[With thanks to Dave for getting me rethinking an area I thought I’d already solved.]
I’d had problems in the past when the velocity PID target is changed (e.g. Hover @ 0.0ms-1 to Ascent @ 0.3ms-1) – I was trying to reduce noise at the time, and I speculated that one cause could be that the target changed immediately and the fix was to change the target incrementally over a short period of time. Normally this “soft” transition between targets for the outer velocity PIDs would be provided by the human being operating their sticks, but Phoebe has to do this herself because she doesn’t have the human feedback.
Revisiting that yesterday, I recognised that for significant transitions, there would be a significant power surge, and this could be what’s causing Phoebe’s flipping. The transition from hover to ascending could require such a current surge that the voltage of the LiPo drop to under 10v temporarily, causing the Raspberry Pi to reboot – 10v is the lower limit of the DC-DC converter I use to get the 5v to power the Raspberry Pi.
So I changed the transition time from the fixed 0.5s I was using to a dynamic period depending on how large the change in vertical velocity PID target was. Horizontal velocity target changes don’t need the power sapping current surges (their PID gains are a factor of 600 smaller as they don’t have gravity to fight), so they stay at the default 0.5s transition time.
A quick test flight just now shows it’s working – no more flipping – so I can go back to the equally frustrating drift control again.