Closed LorenzMeier closed 8 years ago
This code only reduces roll/pitch of the copter in POSCTL in case if at full thrust copter can't hold altitude. Not related to this issue.
I've looked this log and see the following effects:
My opinion what is wrong here:
One of the reasons why the thrust setpoint went down that far was because the attitude setpoint more or less jumped to a new setpoint. So now the desired and the actual thrust vector were subject to a large angle offset. I also had this problem a lot when writing the vtol controller for the tailsitter. In that case the effect was even worse because a low throttle setting lead to a complete loss of pitch control. I solved the problem by limiting the attitude error.
Green is SP glube is actual. The time difference between those two snapshots is just 0.03 s
@DrTon yes, yaw still needs tuning. I'll take a look at that. I'd tried with lower pitch/roll gains already and pushed them up as hard as I could hoping it would help recover faster. In manual it flies very well so it's certainly capable. MPC_Z_VEL_P we increased to improve it's altitude recovery which improved significantly then, but I can reduce it again to see if it plays a role here.
@tumbili that seems to reflect what I saw (obviously:) and that the attempts to correct are so sudden that it is floundering in the air...could there be a kind of prop stall in this situation? That's how it looks.
@SimonWilks I think we all agree that with this low thrust setpoint the copter would have never been able to recover. I'll look into this and see what we can do.
This boils down to the correct vs. robust argument. We want to be correct, but we also need to be robust. Tuning the gains to the right values will make us correct, but not robust to either disturbances (we have seen enough corner cases in logs) or suboptimal tuning.
Summarising some comments from @SimonWilks here:
Logs: http://dash.oznet.ch/view/SHgcgQZ7wcLX9DQV6B7pMU http://dash.oznet.ch/view/n6psxmgeH3EXg4JntrPH6M
The trigger is the combined low-then-high throttle event, which leaves the system for some time without effective attitude control: http://dash.oznet.ch/view/SHgcgQZ7wcLX9DQV6B7pMU#Thrust_PLOT
I suspect this code path could play a role in this, as its defeating the new safety built into the mixer. We probably should completely remote it, as it can lead to a loss of attitude control. https://github.com/PX4/Firmware/blob/master/src/modules/mc_pos_control/mc_pos_control_main.cpp#L1204-L1212