First indoor flight

I was at last able to have the first successful indoor flight! Hover seems to be very stable, with only a slight drift. Small corrections are still needed to keep the quad in one spot, however much less input was needed to hover compared to a helicopter (I am flying a TRex 450).

Development took a bit more effort than I originally anticipated, due to the effect of vibration on the accelerometers. Having four (unbalanced) motors does produce quite a bit of vibration. I had to spend some time trying to understand the vibration and its effect on the accels. Given the constrains I have on the Propeller, I opted for a moving average filter on the accelerometer channels and I noticed a big improvement on the IMU response. The vibration would basically make the roll and pitch output of the Kalman filter drift by up to 15 degrees. With the filters I was able to keep any error below 3-4 degrees. Some more tuning on the filter length and Kalman parameters is possible, however I am quite satisfied with the performance of the IMU stabilizer so far. The results can be seen in the video above, during the flight some small corrections were needed but nothing major.

I would not declare victory just yet, there is still some room for improvement and more testing is needed on outdoor flights (for example the effect of centripetal force during a turn). However I am quite satisfied with the performance of the controller, considering that low cost gyros and accelerometers are used.

As soon as the weather improves I will also try it on my EasyStar. I will post the source code and design files on this blog soon, stay tuned!

4 Responses to “First indoor flight”

  1. Great to see you quadrotor flying!!!

    I had n issue. I wonder f you could help.

    We sample gyroscope data coming from the IMU using a 10-bit ADC. Now, the first few readings (100) are used to find out the bias in the sensor. The rounded off average of the first 100 readings is taken as the Value the sensor would return when the IMU is stationary.

    Equation used to convert gyro data to gyro rate.

    (Sensor_Reading – zero_value)/1024 * 5V * (1 deg/s)/.002V * (Pi radians)/(180 deg)

    Sensor_Reading is the quantized value.
    Here, zero_value might be something like 310. 5V is the ADC Voltage. .002V/deg/s is the sensitivity. (Pi radians)/(180 deg) is for angle conversion.

    I round off the average of the first 100 sensor readings and that becomes my zero_value. I am not sure if this is the right thing to do. I could figure out if it would be better to do a floor or ceil and then do the appropriate but the problem would still not go away.

    Now, there is bound to be some jitter in the IMU. So, even when the IMU is stationary it would return values 311 or 312 or maybe 310 and 311 (better case). If I figure out whether it is better to floor or ceil then hopefully we will always get the better case. But, even with this, since, we integrate gyro data. This error starts adding up. So, even if it is 0.02 at each reading. It will get to 2 in 100 samples which will just be in a second since our sampling rate is ~100 Hz. It will actually alternate between 0 and 0.02 in the better case or something like that.

    I could low pass the gyro data but the problem would still be present to a certain degree. Is this the gyro drift people talk about. I believe the sensor values themselves drift due to various factora such as temperature. And that is the gyro drift.

  2. Vassilis says:

    What you are describing is normal to some degree for all gyros and it is called gyro drift. Some gyros are better than others but they all drift. This is why you need the accelerometers, to provide the absolute, drift free angle. When you combine the accelerometer with the gyro readings with a Kalman filter, you basically use the accels to calculate the gyro bias and subtract it. Do some reading on Kalman filters and have a look at my code.

    Vassilis

  3. Mitch says:

    Fabulous blog! Keep up the good work, I am very impressed.

  4. [...] 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 [...]

Leave a Reply