I came across an odd behavior that I cannot figure out where the rover continues to drive past the last waypoint before stopping.
In the log below I have a simple waypoint mission with 2 waypoints on my driveway. After switching to Auto I would expect the rover to drive to the first waypoint, turn around, head to second waypoint, and stop. Instead it goes to the second waypoint and then slows down/coasts to a stop about 10’ away from 2nd waypoint.
What do I need to do to get the rover to stop at the last waypoint?
Log here (I repeated the test a couple times)
It seems like it is slowly ramping down throttle after you hit the second waypoint - instead of just telling it to stop right away.
Maybe set mode to hold after the last waypoint?
I tried that before and no change. (WP1, WP2, DO_SET_MODE 4)
It seems like it gets to the last waypoint and then ramps down it’s speed slowly until it comes to a complete stop. Something is preventing it from stopping without decelerating first. This rover is by no means fast with a top speed is 0.5 m/s.
Did you ever find what was causing this? I’m having the same issue. I have MIS_DONE_BEHAVE set to 0 (hold) and most of the time it stops at the last waypoint as expected, but occasionally it stays in auto after reaching the last waypoint and keeps going.
No, I never figured it out and the problem still exists today. As a work around, I just added the last waypoint away from any obstacles so it goes there after the mission. After going to that last waypoint, it continues to drive another 10’ or so and then stops.
That sounds more like a tuning problem than a flight mode one. Look at your throttle tuning and trim values.
I just realised the link to the log file above was broken so below are the bin as well as my config. Look in the log and you will see the rover reach the waypoint but still have a RCOUT signal to the 4 motors that decays until the rover stops. As for tuning, I am not sure which parameter(s) controls the behavior after the rover reaches the last waypoint. Any help is appriciated.
Log: Dropbox - 2020-10-01 09-27-32.bin - Simplify your life
Config: Dropbox - Rover-23 Oct 2021.param - Simplify your life
How does it behave in acro mode?
I am not sure since I only have 3 modes configured. Hold, Manual, and Auto. The rover stops immediately after the throttle is cut from the radio in manual mode.
Then I think we may have discovered your problem. If you haven’t tuned the Rover, that log won’t show anything useful. The documentation leads you to tune in acro mode because a lot of the control loop logic works similarly in acro as in auto. Have you done any tuning of the throttle and steering parameters?
I followed the “First Drive with Rover” documentation when I was first setting it up and yes, tuned the throttle. Maybe it was done poorly but the rover is pretty happy navigating my yard while in Auto and performs as expected in Manual. If it stops raining, I can change the flight modes to Hold, Acro, and Auto but don’t ever remember the rover “carrying on” when it was tuned. Seems to only happen when in Auto at the end of the mission.
And amazingly enough, drives autonomously following a waypoint mission ~12 hours a day without issues.
ArduPilot is a pretty incredible platform and can overcome a lot of user induced issues. But you’ve admitted that it does indeed have at least one issue, and I think we’ve found a possible root cause.
That’s really interesting. My rover also cannot achieve its speed targets, so if that can cause this issue, I think that might explain my case as well. Thanks!
Do you think this is an integral term wind up issue?
It is absolutely an I windup. This is a zoomed in look at the end of your mission, and you can see that I has saturated and slowly comes back to zero after the mission ends.
You’ll want to tune SPEED_MAX, CRUISE_SPEED, and CRUISE_THROTTLE for sure.
The expedient fix is to zero the I term, since it’s doing you no good right now anyway, but you should probably go back to square one with tuning.
The rover parked itself for the day due to lack of sunshine and low battery voltage. The ground is now muddy so I will look at this later this week.
I did change the some of the speed settings in the past (after tuning) because I was getting errant failsafes when the rover thought it was caught on something but was in fact just moving slowly. I remember looking and there was no way to tune around it which was unfortunate because my rover is SLOW. If I just moved up the target speed, I introduced additional error and hence the wind up problem.
I agree with your assessment that I should go back to square one with tuning. Thank you for your help!
Any idea why the controller doesn’t immediately transition to Hold after the mission is completed?
I bet it needs to see ATC_STOP_SPEED or less before making the flight mode switch.
EDIT: see my next post below