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: allow steering to Motors beyond -1 to +1 range #8600

Merged
merged 4 commits into from
Jun 12, 2018

Conversation

rmackay9
Copy link
Contributor

@rmackay9 rmackay9 commented Jun 8, 2018

This PR attempts to resolve and issue with loss of steering control for vehicles traveling at high speeds. This issue was caused by this earlier PR which moved the speed-scaling from the attitude controller to the motors library. The potential issue was recognised and sadly now it's been confirmed during beta testing. Comments from the PR are copied below:

the potential downside of the change is that at very high speeds the steering control may become so limited that it cannot counteract a physical misalignment in the steering linkage. For example at 20m/s (70km/h) only 5% of the total steering range is available. A potential solution to this though is to allow steering inputs > 1.

This PR resolved the problem by allowing the high-level steering request sent to the motors to be outside the -1 to +1 range.

Below are images before and after showing the simulated vehicle is better able to achieve the desired turn rate. In this test an Ackermann style rover (i.e. separate throttle and steering controls) was driven slowly (2m/s) but with full left steering. In master, because the speed scaling, the steering output was scaled back too far to achieve the desired turn rate. With this PR the vehicle comes much closer.

master-turnrate
new-turnrate

Somewhat separately this PR also adds a new parameter MOT_SPD_SCA_BASE (i.e. "Motor Speed Scaling Base") which is equivalent to the similar "Vector Thrust Scaling Base" parameter. It allows the user to specify the lowest speed that the scaling is applied. I don't expect many people to change this but it could be useful especially for very slow vehicles because it will give them better steering control below 1m/s. Very fast vehicles that spend very little time below 1m/s.

This issue is discussed here in the Rover-3.4.0-rc1 beta testing thread.

each motor output handler (regular, skid, omni) becomes responsible for constraining the steering input (if required) and setting the limits flags
it is possible to reduce duplicate code but I think it might be more important to keep it clear which level is responsible for the limiting and constraining of steering
This replaces the hardcoded 1m/s start point for speed scaling with a configurable value
Copy link
Contributor

@khancyr khancyr left a comment

Choose a reason for hiding this comment

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

OK, this looks good.
But I wonder if we don't miss something ... the AR library should already been adapting that according to the current speed, lateral acc and desired rate

@rmackay9
Copy link
Contributor Author

@khancyr, txs for the review. In earlier versions we had the speed-scaling-of-steering done in the attitude control but now it's down in the motor library... not sure if that answers your question or not..

@rmackay9 rmackay9 merged commit 5e7b37f into ArduPilot:master Jun 12, 2018
@rmackay9
Copy link
Contributor Author

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants