When the system is commanded a transition from any mode to STABILIZE then immediately to GUIDED, the Copter descends at maximum rate until the desired altitude hits zero. Then is commanded to climb again at the initial altitude
on the logs you posted ch3 is always at the same position. Please place CH3 (RCIN) at max value and see the behaviour. There is always a jump in altitude when transitioning from a throttle controlled mode to a user controlled throttle mode. There might be a bug, but nevertheless…In any case just open an issue on Github.
I believe you might be seeing a side effect of the transition between a Throttle controlled mode by the flight controller (like RTL and Guided) and a Throttle controlled by the user.
I can see a similar effect on a racer if I flick the switch between guided/RTL and stab and have the throttle stick too far from the middle position, if the throttle stick is high you an see a copter shooting to the sky or drop if the throttle stick is low.
I know is real because we almost lost a vehicle and I can simulate with the SITL easily. It’s very rare that someone did that rapid switch, but if happens… It’s bad. I will open the issue, but I wanted to make people aware of that
I’ve created an alternative fix in this PR and tested it and it seems to resolve the problem. If there are no objections I hope to push forward with this fix because I think it more directly fixes the underlying cause of the problem which was that we were resetting the position controller target to zero … but what we really wanted was to report the altitude target (in the dataflash logs) as zero in manual modes.
No, I don’t think so. I had a peek at the log files you provided and it looks like the EKF isn’t happy with the position estimate. So I think it’s quite different.