Hi, does anyone know if ArduPilot uses Anti-Windup algorithms in their PID loops? The Motor signals in my vehicle are switching off and on shortly after the motors hit their limits. Here is a link that discusses the phenomena and typical Anti-Windup solutions:
Does anyone know if PX4 works any better? Thanks. For more details on my problem see:
Can you explain why my motor signals are switching off an on shortly after the motors hit their limits? This is usually due to Windup behavior of the PID loops, and should be fixed with proper Anti-Windup algorithms. Reference the end of the above project discussion link to see the motor signals switching off and on after they hit their limits.
Your avoiding the question. Motors can hit their max limit in extreme maneuvers in any drone and this behavior I am observing would cause a done to crash. It is not desirable behavior in a PID loop. If it is the PID loop algorithm then it needs to be fixed.
Transport type drones typically hover at 70% throttle, which is what mine is hovering at. This is acceptable if the drone just uses VTOL to take off and land and then quickly transition to forward flight. Ref following VTOL expert discussion 11.33min into following video:
Here is the front motor signal. When the Motor hits its limits at the end, the Integrator winds up and then the motor signal starts turning off and on uncontrollably causing the vehicle to crash.
The vehicle is going through a radical maneuver when the motor rails here, which will normally not be the case when the vehicle is properly operated, but unfortunately cant be avoided during the learning phase. My concern is that the PID loop should not be behaving this way with proper Aiti-Windup algorithms implemented. My question if this behavior is due to the PID loop or something else. If so, can this behavior be fixed? Perhaps I could try PX4 instead of Ardupilot and see if the PID loops behave differently.
@William_Walker I saw the link to your other thread and looked through it. I currently can review your logs as I am away from home. So I can’t see what your parameters are. To answer your question regarding how ardupilot manages the integrator, it is done through integrator limits and motor limit flags that stop integrator windup when the motor reaches a limit or max control request. In your case I am not sure why it is not limiting the integrator as it reaches the motor limit. It may be that it limits integrator for a max control request. It would take a little digging into your logs and looking at parameters. However seeing the values that your integrator is achieving tells me that you have a very large value for ATC_RAT_PIT_IMAX. I think I read in your other thread that this vehicle has a pretty big CG offset which I am assuming is driving the large integrator values.
I will close by saying that I am a helicopter guy and have a descent knowledge of the flight control code but don’t play with tuning multicopters or Quadplanes. Good luck with your issue.
Hi Bill, Thanks for the interesting suggestion. The Pitch I_Max parameter is set 1.0, and both I and P are 1.0 in our setup. Based on what you see in the above motor signal plot what should I_Max be set to?
By the way, here are our parameters: IeqP.param (22.2 KB)
and here is a link to our log file of the test posted above:
Something is not right. It is showing the integrator (PIDP.I) exceeding ATC_RAT_PIT_IMAX. @Leonardthall why is the integrator being allowed to exceed the IMAX value
The other thing I noticed is that you have the time to 63% steady state attitude (ATC_INPUT_TC) as 0.2 and the max accels set for vehicles that are more nimble than what I expect your vehicle to be given its size. So you have a rate P gain that is really large and a rate D gain that is disproportionately small. From looking at your set up, IMHO I believe you are over driving the response. The shaping of the desired response is done through the input_tc and max accels and max rates. The input_tc is probably the most important as it adjusts the requested rates and accelerations according to the requested attitude. I would make this more like 0.3 seconds. So the only other thing I would think could be an issue is that you don’t have enough control power which also can cause high rate P values.
These are my thoughts based on only looking at your parameters and the size of your vehicle. Hopefully Leonard can chime in as to why the integrator is not being limited per the IMAX value.
Overdriving the response is just saying that the control feed back in response to the rate error is very large. Mainly due to the high rate P gain. The aircraft cant respond quick enough and you will get this behavior where the motor alternates between max and min.
At a minimum, accel P max should be specified based on your aircraft design. You need to estimate what max acceleration is possible based on your aircraft inertia and moment the thrusting motors can produce. You can estimate it from flight by looking at the actual angular rate versus the target angular rate. If the actual change in angular rate (angular acceleration) can’t keep up with the target then you will want to lower the max accel. Max rates are harder to judge. You really need to do full control input roll or pitch rates to see what is the max attainable rate.