I broke Phoebe’s legs in so many ways on Wednesday that rummaging through the wreckage today I found I had enough fixable pieces to put together a leg / ankle / foot combo suitable for flying again. And the weather today is once more on my side.
First test was a sanity check on the autonomous take-off again; checking the stats yesterday showed a bug in the PID gains plus a need for some tuning that hopefully would allow for safer (read less destructive) landings.
That went fine, so onwards (and upwards) with the drift tuning. This time, I had the gentle head-wind I needed for testing, and she held her ground this time. Sadly, landing broke her repaired leg again to the extent it’s now irreparable – at least the new ones are on their way from Poland.
I had hoped at this point to declare now that PHASE 1 OF PHOEBE’S DEVELOPMENT IS COMPLETE! And after a fashion it is, but…
The test today did still show some drift, but not due to wind, but instead due to non-horizontal take-off platform (I’d been sloppy setting it up). If she takes off at a slight lean, she’s bound to drift because she’s not pointing straight up. I think the solution here is for me to split the sensor calibration; the gyros can be calibrated on any stable surface since they just measure the speed Phoebe is pitching, rolling and yawing – if she’s sat still, they can all be safely calibrated to read 0. But the accelerometer is measuring force, including gravity; it needs to be calibrated so that the X and Y axes read 0g on as perfect a horizontal surface as possible; that then ensures that when in flight with the X and Y axes reading 0g force, that absolutely does represent no horizontal drift. Any tilt in the calibration surface will cause the X and Y axes to read 0g when in fact there is a tilt and therefore drift.
The calibration values are already written to / read from file anyway, so the changes are simple – split them into two, and add a specific command line option to only do accelerometer calibration on as near perfect a surface as possible.
P.S. Once she has a compass / magnetometer then this will cease to be an issue. – unfortunately that might be on hold for a while until Invensense ship the MPU9250 and Flyduino produce the corresponding breakout for it.
P.P.S. Actually, I don’t think I need to split the calibration code, at least not for initial testing; I can do the calibration of both gyro and accelerometer indoors – that saves the results to file anyway, and then just carry her outside to test the theory.