Every time I threaten to retire Phoebe, she throws a spanner in the works.
I took her out for some horizontal velocity PID tuning this morning. It’s below freezing point outside and my expectations weren’t high, but her thermostat code still brought her sensors up to the 40° calibrated temperature. Probably 5 flights consisting of 3 seconds take-off at 0.5m/s, 5 seconds hover, and 3 seconds descent at 0.5m/s.
Of those 5 flights, one was, well, there’s no other word for it, perfect. A perfect pass of the Ronseal test. Don’t get me wrong, the other did well wrt drift management and getting to approximate hover over the take-off point but this particular flight just worked: take-off from a sloping ground stabilized up to 1.5m, completely static hover for 5s, and then an elegant descent back to the original take-off point.
The cause: gravity calibration in the Z axis. Every flight starts with Phoebe peacefully sitting on the ground, measuring gravity in her X, Y, and Z axis. That then produces a set of Euler angles used to rotate gravity back to earth axes where gravity should read 0, 0, 1 in the X, Y and Z axes respectively. X and Y always measure zero to 8 decimal places. Z seems to have a variability of 0.2% still though despite the thermostat – gravity could read between 0.998 and 1.002g and it seems entirely random.
But this particular flight, the sensors said earth gravity was 0, 0, 1.000009g! That’s 0.001% error in the Z-axis or 0.1mms-2 acceleration error. That correspond to a maximum drift velocity over the course of the 11s flight of 0.55mms-1!
That has multiple effects, the key two being angles and velocity calculation: with 0.001% error in the Z axes, then all angles and velocities were essentially right for the duration of the flight, hence the fact she rose to the right height and hovered over her takeoff position.
I’d love to know the cause of the random variance of accelerometer values from the Z axis – is it sensor tolerance, or ground vibrations or something else I’ve missed (the motors aren’t running at this stage of initialized before you ask)?
A barometer / altimeter + magnetometer / compass may fix it entirely:
- the barometer / altimeter will provide an alternate measure of vertical velocity @ ±10cm resolution
- the magnetometer with provide orientation, and critically pitch, roll and yaw compared to the earth magnetic core.
A fusion of these sensor readings with their current accelerometer source could well improve matters – “fusion” just being the merging of the sources through a complementary or Kalman filter.
So why don’t I just get on with it? Because still I cannot find a sensor that meets critical physical properties – none of them provide a double row of pins with 0.1″ pitch in both directions to allow connection to a breadboard or prototype PCB.
I think I need to put my politest head on and see whether DroTek have fixed their pin pitch spacing for their 10 DOF IMU yet. Wish me luck!