Shop OBEX P1 Docs P2 Docs Learn Events
Will sensors do the job? — Parallax Forums

Will sensors do the job?

Hello, I am working on a propeller spin flight controller.
I have been making test flights, but the quadcopter is not balancing quickly enough. I am wondering if my sensors are not accurate enough. I get yaw, pitch , and roll angles from -180 - 180 degrees (integers, no decimals). I am using the L3G4200D gyro, and mma7455L accelerometer. Do these sensors provide a quick enough response that is accurate enough to be used in a flight controller? I am fusing the data with a kalman filter, but am not using quaternions or euler angles, just yaw, pitch, and roll.

When I run up the motors, vibrations shake the accelerometer, trashing its data. I put the data through a low pass filter, but it still has some anomalies. When the motors run, both the z axis (up) and the y axis have their values increase. If this was due to tilt, the z would decrease as the other axis increased. Here are images of data before and after a low pass filter was applied. The bottom graph is the generated angles after the data was put through the kalman filter. The sensors work wonderfully when the motors are off
pdf.pdf

pdf2.pdf

To sum up, I am not sure these sensors make the cut, and if they do, how would I go about removing the vibration issue.

Comments

  • PublisonPublison Posts: 12,366
    edited 2017-07-18 14:55
    You didn't say what platform you are working with.

    Do you have isolation between the board and the craft, as in:

    https://www.parallax.com/product/700-00098

    This would reduce the vibration to the sensors.


  • I have a custom board, that mates with a propeller mini. It is a micro quadcopter, with brushed coreless motors. the controller sits on hot glue mounts, but other than that there is no vibration damping.
  • It is highly suggested to have Isolation mounts. Most IMU's will not work correctly without them.

    You can look at the assembly for the ELEV-8 to see how it is used.

    http://learn.parallax.com/tutorials/robot/elev-8/elev-8-v3-quadcopter-assembly-guide

  • Aside from vibration, are these sensors capable of providing accurate enough data for stable flight? How precise do sensors need to be?
  • Here is a link to the Parallax controller.

    https://www.parallax.com/product/80204

    I does not use the particular items that you list, but the software is open source.

  • Thanks! I will take a look. My quadcopter uses brushed motors, which as far as I know should react no differently than larger motors. When I attempt to get it to balance in a test rig, it quickly will oscillate, overreacting one direction after another until it throws itself completely over. Is the balance issue due to the motors not getting up to speed in time? Or would it be more because of the sensors? It could be either vibration or slow sensors.
  • The sensors should be fine - The gyro in particular will output at up to 800Hz, which is more than enough. Gyro noise tends not to be too bad, but accelerometer noise can be very high and will cause the drift you're seeing. The Elev8-FC uses a median filter on the most recent 9 accelerometer readings to help reject spikes and outliers, and those values are then passed to the custom complimentary filter in the IMU.

    Do as much as you can to reduce mechanical noise - balance your props, and use dampers to mount the flight controller if you can. That said, I have two quads that use the Elev8-FC hard-mounted to the frame, and they fly fine. Micros tend to be significantly more forgiving because the vibrations are much higher frequency, and typically out of the range that they interfere with sensors, however you may be hitting a resonant frequency, which would give you trouble.

    Also, heading / pitch / roll *are* Euler angles. You'll likely have problems with just angles - they're order dependent / non-commutative, you have to deal with seams (like where heading goes from 359 to 0 degrees), and they don't interpolate in a straight line between two given orientations. It's possible to produce a flight controller that only uses Eulers, but it's fussy, and it'll be harder to handle weird cases like inversion or pitch / roll close to 90 degrees.
  • Thanks! My quad cannot handle inversion, but can handle cases near 90 degrees. Because the accelerometer doesn't ever drift, I have no issues with the commutative problem (the gyro rate is only used in the kalman filter) If I shake the quadcopter, hold it upside down, and then set it back on the table, it will read zero degrees on pitch and roll (yaw is a different story, still working on that. I will try some vibration damping. It is difficult to see in the graphs I posted, but the average acceleration goes up while the motors are running, not an oscillation around a stationary value. I think that would not be fixable in software.
  • michaellangford99michaellangford99 Posts: 19
    edited 2017-07-21 02:10
    Also, I apologize for keeping two threads running at the same time! They seem to be converging onto similar topics.
  • I had code that exhibited the same problem before adding noise filtering to the accelerometer readings. Didn't make much sense to me either. If you hit a resonant frequency with the props it'll do bizarre things too.
  • Thanks! I will work on testing that.
Sign In or Register to comment.