-
Notifications
You must be signed in to change notification settings - Fork 13
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
rover position control: fix stuttering (speed fluctuation) motion patern #517
Conversation
b08631c
to
8757382
Compare
@@ -330,6 +330,17 @@ RoverPositionControl::control_position(const matrix::Vector2d ¤t_position, | |||
return setpoint; | |||
} | |||
|
|||
float RoverPositionControl::lowpass_filter(const float sample_rate, const float cutoff_req, float input) |
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.
There are ready made lowpass filters in px4, e.g. a second order one in mathlib: src/lib/mathlib/math/filter/LowPassFilter2p.hpp
Why not use one of those?
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.
sure, I am gonna switch to one of the ready made one when this is confirmed a solution. I was just experimenting with this LPF idea if it would help with the stuttering motion.
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.
LPF is actually not a solution
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.
LPF is actually not a solution
8757382
to
acd287c
Compare
acd287c
to
9588089
Compare
…trol rover linear speed
9588089
to
00d3dce
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!
Sorry, we just tested further today and this PR is no longer relevant. I will not merged it and will create another PR for a much simplier solution |
The reason for the stuttering was that in the speed control function, the output of the throttle PID controller is forwarded to set rover linear speed. This gives raise to the fluctuation effect of the throttle value getting smaller as the target speed is being reached, hence reduce the speed which prompts the PID controller to increase the throttle again. This results in the stuttering motion pattern.
The solution is to subtract the throttle norm from the desired speed and output the result as the linear speed that will be forwarded to the chassis.
The D component is also disabled.
Tested on UGV2 with 1 and 2m/s in PMK
Bug ticket:
https://ssrc.atlassian.net/browse/DP-6914