Zoe the Zero – Appendix – Testing and Tuning

I did very little testing before I let Zoe loose – just two pieces:

With the LiPo not plugged in, I ran a flight; this checks that the sensors are working and  tuning data sampling rate to ensure all samples are caught.  Simply run

cd ~/Quadcopter
sudo ./qc.py -f fp.csv

As a result you should see a 20s countdown, a 1.5 second warm-up, ascent (2s), hover (2s), and descent (2s).  Then the length of the flight is shown on screen.  The key here is that the internal timing for the steps through the flight plan is based only on the number of samples captured, and the data ready interrupt frequency; the total time printed at the end is the difference between calls time.time() before and after the flight.  It should read 7.5s with accuracy of 1% or less based upon the above flight plan.  If it is significantly more, then samples are being missed and you need to reduce the dri_frequency.  If it is significantly less, then the data ready interrupt is not working – have you installed the customized GPIO code?

With that passed, the other step is to check the PWM is working, and that the props, motors and ESCs are installed correctly:  the front left and back right props should spin anti-clockwise to match the code’s expectation.  Run

sudo python ./qc.py --tc 1 -h 150

Each prop should spin in turn (front left, front right, back left, back right) for 10s.  Feel the down draft underneath each.  If the props are not turning the right way, swap any two wires on the ESC.  -h specified the PWM pulse size minus 1000 i.e. 150 is 1150us pulse.  This should be enough to get the props spinning but well below the takeoff speed of around 400+.

With those two tests done, she’s ready for a trial flight.  With the motors still powered up run

sudo python ./qc.py -f fp.csv

Be ready with control-C to kill the flight, and I’d strongly recommend running this flight outside on a soft surface (grass).  It should all be fine, but it’s very demoralising to trash your quad in a violent crash on the first flight!

4 thoughts on “Zoe the Zero – Appendix – Testing and Tuning

    • Because the pre-configured flight plan specifies velocities in 3 dimension. A line in the flight plan like

      # x, y, z, time
      0.0, 0.0, 0.3, 3

      gives a 3 second vertical (Z axis) climb at 0.3m/s with zero horizontal movement (X and Y axes).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.