4 ms·
PID controls do exactly what you are objecting to.
by amluto 8y ago
PID controls do exactly what you are objecting to.
- AWildC182 8y agoIt's more nuanced than that. My ramp functions technically have a += 1 somewhere in them. You just don't want to += a motor value directly or otherwise add to state out of a feedback loop. You can verify the PID function in simulation/unit test. It's much harder to unit test the motor/driver/controller on a stand.
- jschwartzi 8y agoIt seems like what you're really getting at is that when you have a control like this where there's a non-linearity in response for a linear change in input quantity, what you really want to do is instead have a non-linear change in input quantity so that there is a linear response. In that case, you would characterize the effect of the control on the response variable and arrive at a table of acceptable values. Then your +=1 becomes an increment of an index which returns the next-highest acceptable value and you no longer produce a non-linear change in the response.
- kortilla 8y agoNo, you’re missing the point a bit. It’s not about the magnitude of the response, it’s about the propensity for a feedback loop. =+1 is shorthand for “ignore everything going on in the world and increase your value”. This is almost never what anyone actually wants so they try to spend a bunch of time guarding against calling that when it’s already at a maximum. Instead, the safe thing to do is only assign to it from a function with a ceiling. val = min(CEIL, val+1) It’s way to easy to get runaways with =+1 even in serious systems like this one. Every time I see that in code I review where the value is some long-lived thing, I just confirm with the author that they don’t care if it overflows, because it’s probably gonna happen.
- Gibbon1 8y agoAll practical PID controls have anti-windup features.
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]