Hex displayed some alarming over-roll events tonight, when "snap" rolling - ie jab the sticks. Mainly because I'm still tweaking the PID's the last few percent.
However, it's only when "snapping" left. Add left stick progessively - even to full travel - and it's completely normal. But snap it, and it has a massive overreation. It did it as well when switching to loiter. However, a second later, it's flying rock solid again, and the loiter one had a perfect loiter afterwards.
All the motors are solid (a couple have slightly vibey bearings), and it flies rock solid if youre smooth on the sticks.
Any ideas why there's an over reaction rolling left? Logs are attached.
Replies
You haven't responded to the CG and the wind conditions, those can really change the overall system. Are you following a specific methodology for tuning these values?
I'm sure other people will chime in, but my guess looking at the graph is that your integrator is set too high and you rely on the integrator to do half of the work of the P-term. I'm basing that on the curve that I see right after the overshoot occurs and the specific shape of how it returns to the setpoint. That resembles the response of an integrator on a step input. Let's see what others think.
The CoG is 1cm forward, due to a gimbal. On roll it is within a few mm, as far as I can tell, balancing it with my fingers. The problem appeared when on multiple headings, and wind was only 2-3kph, so not sure it's that. And pitch was not (visibly) affected. But I didn't check in the logs, admittedly...
Re: P and I - aren't these supposed to matched? I read on here a few times they were supposed to be matched. (In the old days, I used to tune P and D only, and left I at zero, but apparently I'm not supposed to do that).
Re: method:
P (and I) incremented 0.01 at a time, until (subjective) satifactory response achieved.
D incremented 0.02 at a time from 0.04, until "the worbles", then tuned back by 0.02. Rolling right, seems "tight" to the eye.
Even if I was overtuned, would that explain the "doubled output" we're seeing when rolling left?
Well, I don't know what's causing this overshoot to the left, could be that one of the motors is less efficient or there are slight differences in prop momentums or your motors may be slightly angled, creating a yaw issue and uneven load over motors. Range of possibilities there.
It's safe to say it's not related to the PID tuning itself, but more of an issue with the mechanics, basically the response of the system as a whole you're trying to control. So motors, motor angles, CG or other things.
The requirement that P and I should be incremented in step is wrong from a theory perspective, but it's possible that doing this for multirotors is "usually correct". My preference is always that I and D terms should be as low as possible.
My method: make I and D zero. Only tune P until oscillation. Then tune D until you get faster little oscillations. Tune D back a bit, then tune P up again until you get the same "system" oscillations again. Tune P back a bit. Fly around for a bit longer, watching for anomalies.
Then tune I until satisfied. What you should expect if I is too high is a system where it seems you have a very small delay for the MR to react to stick input and also some 'difficulty' stopping or going the other way.
Is your CG slightly to the left or did you test this in windy conditions facing one direction only?
In snap rolls it gains rotational velocity that needs to be compensated quickly. You should also verify the differential term if it's the right sign. Consider doing the test again with D set to 0.00 at first. Another thing could be that the I term is set too high, but it doesn't look like it has enough time to accumulate.
Can you post your PID settings for roll for people to verify?
STAB rates:
PARM, RATE_RLL_P, 0.090000
PARM, RATE_RLL_I, 0.090000
PARM, RATE_RLL_D, 0.010000
PARM, RATE_RLL_IMAX, 500.0000
PARM, RATE_PIT_P, 0.090000
PARM, RATE_PIT_I, 0.090000
PARM, RATE_PIT_D, 0.010000
PARM, RATE_PIT_IMAX, 500.0000
PARM, RATE_YAW_P, 0.200000
PARM, RATE_YAW_I, 0.020000
PARM, RATE_YAW_D, 0.000000
PARM, RATE_YAW_IMAX, 800.0000
These work perfectly for snapping right...it's snapping left that's the problem. Pitch is also ok. As is Yaw.