Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

haitomatic
Copy link

@haitomatic haitomatic commented Oct 6, 2023

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

@haitomatic haitomatic force-pushed the rover_control_stuttering_fix branch from b08631c to 8757382 Compare October 6, 2023 10:11
@@ -330,6 +330,17 @@ RoverPositionControl::control_position(const matrix::Vector2d &current_position,
return setpoint;
}

float RoverPositionControl::lowpass_filter(const float sample_rate, const float cutoff_req, float input)
Copy link

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?

Copy link
Author

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.

Copy link
Author

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

Copy link
Author

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

@haitomatic haitomatic force-pushed the rover_control_stuttering_fix branch from 8757382 to acd287c Compare October 12, 2023 13:20
@haitomatic haitomatic changed the title rover position control: add lowpass filter for rover velocity control… rover position control: fix stuttering (speed fluctuation) motion patern Oct 12, 2023
@haitomatic haitomatic force-pushed the rover_control_stuttering_fix branch from acd287c to 9588089 Compare October 12, 2023 14:35
@haitomatic haitomatic requested a review from jlaitine October 12, 2023 14:38
@haitomatic haitomatic force-pushed the rover_control_stuttering_fix branch from 9588089 to 00d3dce Compare October 13, 2023 08:32
Copy link

@jlaitine jlaitine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@haitomatic
Copy link
Author

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

@haitomatic haitomatic closed this Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants