Archive for December, 2009

Quad-rotor demo with CHR-6D IMU and DCM algorithm

Wednesday, December 30th, 2009

After implementing the DCM algorithm on the CHR-6D IMU it was time to flight test it on my quad-copter. I used the same controller I developed last year but instead of using the onboard 5DOF IMU, I connected a serial port to the CHR-6D IMU. The filters and DCM algorithm was executed on the STM32 of the CHR-6D, the direction matrix was sent to the control board through the serial port. Only a few minor modifications were made on the control software to use the angles from the direction matrix, the rest remained the same.

I spent a few hours tuning the PID gains, filter cut-off frequencies and DCM parameters and the results look very promising. Occasionally, small corrections are still needed to keep the quad-rotor in one spot but that was expected. With a GPS and altimeter it should be possible to control the position and altitude fairly accurately.

The main reasons for the improved performance are:

  • Encapsulating the IMU sensors in gel to reduce vibration
  • High speed sampling and extensive filtering of raw sensor data
  • Direction Cosine Matrix using a 6DOF IMU (3 accels and 3 gyros) – although a Kalman filter should also have worked

The ESCs are still controlled using PWM, stability should improve by using a I2C ESCs and a higher update rate (>100Hz). Stability is not as good as in some more high-end setups but I can comfortably fly the quad-rotor outdoors, in fact it is easier than flying a heli. I still need to test the effect of large acceleration on the stabilization e.g. fast ascent, descent or turns (can be easily corrected by calculating and subtracting the centripetal acceleration).

Direction Cosine Matrix implementation for the CHR-6d IMU

Sunday, December 20th, 2009

I recently got the CHR-6d IMU from CH Robotics, I needed a 6DOF (3 gyros and 3 accelerometers) for my quad-rotor. In my last attempt I used a 5DOF IMU and did all processing in the control board. Although I was able to get it to hover fairly well with only minor manual corrections I had two main limitations. Processing power and sensitivity to vibration from the frame. The CHR-6d has a powerful ARM Cortex processor with plenty of processing power available for filtering and additional signal processing. I was able to drastically reduce the effect of vibration by complete potting the IMU in dielectric gel.

The board comes with open source software the implements the digital filters and serial communication. I needed to extend this functionality to calculate the actual Euler angles (or equivalent) that would be used to stabilize the quad-rotor. I have tried a Kalman filter in my last attempt so I wanted to try out something different. I found an excellent paper from William Premerlani that very clearly explains the theory behind the Direction Cosine Matrix. I prototyped the implementation in Matlab and tested it using data from the actual IMU, I also did a few vibration tests by mounting it on my quad-rotor and powering up the motors while holding it fixed on the ground. With the dielectric gel I was able to reduce the effect of vibration to about 1-2 degrees of error when the motors are running at 65% throttle (typical hover is 55%). The ultimate test will of course be a flight test.

The following video is a ground test of the complete setup. The implementation is not yet completed, I have a 3-axis  magnetometer break-out board for the HMC5843 from SparkFun. It will be connected through the I2C bus to the CHR-6d IMU and will be used to correct the drift of the yaw gyro.

You can download the latest version of the DCM implementation and Matlab scripts from the DCM page.