nobleo / path_tracking_pid

Path Tracking PID offers a tuneable PID control loop, decouling steering and forward velocity
Apache License 2.0
129 stars 37 forks source link

Controller state doesn't need to be reset on reconfigure #121

Open Rayman opened 2 years ago

Rayman commented 2 years ago

The controller can be reconfigured while driving. If the controller is also reset, then the D and I action are reset to 0, and the lowpass starts from scratch. This is unwanted behavior.

https://github.com/nobleo/path_tracking_pid/blob/ff653a6fda8778d8bd287828e2e6be1b975e294b/src/controller.cpp#L978

Timple commented 2 years ago

Should the values also be kept if the D, I or cutoff parameters are changed?

Rayman commented 2 years ago

Yes, the integrator filter contains basically the integrated value of the signal. That won't change if you reconfigure the I parameter

Timple commented 2 years ago

So if I reconfigure the I action to zero. I will keep having the previous value?

Rayman commented 2 years ago

The integrated value stays the same. That value will be multiplied with the I action (which is then 0) so it will add 0 to the PID sum

Timple commented 2 years ago

Great, sorry for asking instead of checking :slightly_smiling_face: I was wondering if the integrated value was pre- or post-multiplied.