Archive for January, 2009

Update on IMU controller progress

Wednesday, January 7th, 2009

The IMU development is coming along but a number of modifications had to be made to get it to work more reliably:

  • The original design was updating both IMU and PID loops every 20 ms. I found that this was not fast enough to react to the fast attitude changes of the Quad. To achieve a faster update rate I had to re-write the IMU code and Kalman filters from scratch to allow them to run at a 5 ms update rate.
  • The gyro conversion from the raw ADC sample to rad/sec (or deg/sec) was wrong by a factor of two resulting in an error in the short term estimate of the pitch and roll angles (the accels did eventually correct the angle). Fixing the conversion factor considerably improved the the angle response and allowed to tune the Kalman filter to rely on the gyro more than the accels. That results in a much faster IMU response to attitude changes. That can also be seen in the video below. Keep in mind that the artificial horizon is only updated every 100ms through the debug port so there is a noticeable lag in the UI.
  • The PID loops now run at a 10 ms rate, the motor ESCs are updated at the same rate however I am not sure how often the input is actually read by the ESC. In any case an improvement was seen with the faster update rate.
  • Some more progress was also done on the Windows application that is used to record and display data from the IMU controller in real-time. The update rate is a bit slow (100 ms) due to the large number of channels that are transmitted through the debug port.
  • Preliminary flight tests show that a large amount of derivative control is needed in the PID loops to minimize the oscillation. The PID loops were also modified to use the un-biased rates that are calculated by the Kalman filters as the input to the derivative part of the PID loops (rate of change). That allows the loops to quickly react to changes in attitude before the Quad starts oscillating out of control.
  • The GY401 Heli gyro works pretty well, in heading hold mode it keeps the Quad steady in the yaw axis. There is a slow drift but this is expected since there is no sensor to measure the absolute yaw. A magnetic compass could be added in the future for that purpose.

More work is needed on the tuning of the PID loops and Kalman filters and this is the next step. Preliminary tests show that stable flight is possible with the current setup!

Quadcopter assembly completed

Wednesday, January 7th, 2009

The Quadcopter assembly has been finally completed. The design is based on the Kquad design as described in the RCGroups thread. There are many different frame designs mentioned in the thread but I went for Rusty’s Rev 7 fiberglass frame. It is a bit heavier than the other options but it can take a lot of punishment (which will be needed while testing the IMU based controller!). Of course I am not using the controller that most use in the Kquad since the IMU I am developing will do all of the work. Assembly was very easy, wiring was a bit tricky but it worked out great. The video camera, transmitter, OSD and eLogger will be installed after IMU stabilized flight is achieved.

img_1

A number of lessons were learned during assembly and initial flight tests:

  • Motor spacing plays a big role on stability and yaw control. I found that when the spacing was about 800mm (shaft to shaft) the yaw was nearly impossible to control, also the Quad was impossible to control because any slight change in the motor speed will result in a large change in attitude. The solution was to move the motors in as much as possible for a spacing of 460mm. With that spacing the yaw authority was much better, however yaw became more sensitive to motor alignment so it took a few tries to get the yaw to be stable.
  • To my surprise, even at the reduced motor spacing it is nearly impossible to control the quad without active IMU stabilization. Especially when the yaw gyro is in heading-hold mode, the changes in motor speed tend to also affect pitch and roll. This is likely due to slight differences in the motor performance and position. My reflexes are not fast enough to manually compensate in time so I was not able to hover more than a foot from the ground.
  • The tennis balls are too heavy but I will temporary use them until I find something better.
  • Total weight is 1082 grams (38.2 oz) including the tennis balls (200 grams) but not the battery.

img_2

The next step is to work on the controller, tune the PID loops and Kalman filters for IMU stabilized flight. More details in the next post.