-
Notifications
You must be signed in to change notification settings - Fork 16.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PID object PD limit #24567
Add PID object PD limit #24567
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constrain is "invisible" because the pid_info
object is not updated, this will make log review very difficult.
Its a little hard to say the best way to over come this. We could work out the ratio and decrease both P and D as logged. EG:
if (is_positive(_kpdmax)) {
const float PD_scale = _kpdmax / MAX(fabsf(P_out + D_out), _kpdmax);
P_out *= PD_scale;
D_out *= PD_scale;
}
However doing it that way may still not make it clear as P and D will not "flat line" individually.
I think we would need that and a new limit flag. We can do a limit bitmask and in the existing uint8_t
limit field so the log message size will not actually get bigger, although the pid_info
struct will.
@lthall |
That sounds like the best option to me.......
@xianglunkai this is not something that the majority of vehicles will use however it is useful for very particular problems. One of these problems is caused by slew limited actuators. Slew limited actuators have a small delay for small output changes and much larger delays for larger changes. Basically the frequency response changes with the magnitude of the signal. By adding a PD limit you can ensure the system doesn't move to the lower latency and unstable region. |
e0b3f0e
to
76646ad
Compare
76646ad
to
ed8bf9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ed8bf9a
to
ed4192d
Compare
@lthall I've force pushed the change we discussed to remove the constructor changes |
ed4192d
to
ab75101
Compare
ab75101
to
a2ba404
Compare
a2ba404
to
e7364a0
Compare
Thanks Pete!!! I like it. |
0085087
to
42fab87
Compare
Mark as advanced |
…and D terms are correct
756edc9
to
0f6cf69
Compare
This feature lets the user limit the maximum PD output of the PID object. This is useful in large aircraft or systems where the actuators are slew limited.