-
Notifications
You must be signed in to change notification settings - Fork 59
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
Mower correts path too agressively at low speeds. #144
Comments
@greymfm i saw this as well - but didn't noticed that this is related to the stanley stuff. |
Thanks. Well, I think I have a better solution: we all like fast control corrections (and for a GPS FIX they are here quite good now). However if the "GPS jumps behind or beside the robot" (e.g. due to FLOAT) while driving, fast control corrections are not what we want :) Actually, we don't want any corrections at all if something like that happens. So, my suggestion is that the robot stops driving and turns in place if the angle error to the target is more than e.g. 90 degree... |
Oh yeah, we need something different for float, as it is right now I would rather have the mower stop when the gps flaots. Right now while going in and out of waypoints sunray doesnt seem to use the slow stanley values, so we get crazy heading corrections even with fixed gps, this could be fixed using the slow stanley variables for waypoints, in my opinion a larger stanley softening value is more elegant though 😊. Ill try those changes and see how it feels. |
I modified it (b92b11f) and now I'm testing this modification... |
So, if the heading varies by more than 45 degress, rotate intead of stanley tracking? Ive tried adding a larger softening value, the mower runs smoothly at low speeds now. Previous settings:
Current settings:
In literature Ksoft is set to 1m/s apparently. |
Changing the Stanley controller will require to do all tests again (low speed and high speed) with a specific robot as this controller is very robot dependent (mass, motors etc.). Are you testing with Alfred, Ardumower stock motors or something else? :-) |
Im using standard ardumower from this year. Seems like its not only to avoid dividing by zero:
Maybe I notice it more because I need a bigger K to stay on track at 0.4 m/s, so at low speeds it becomes more unstable. |
Ok, feels pretty good without the speed factor, with a P of 2 and a K of arund 3-4 works well fo both low and high speeds. The code then becomes: |
I still saw situations where the mower takes far too long to correct the path especially for a mow point 10m away - i would expect that the mower tries to get to the mowline in 1-2m of driving |
With the above code? |
No with original Code and for Alfred those values are very low (see: https://github.com/Ardumower/Sunray/blob/master/alfred/config.h#L381) because otherwise it starts to swing left to right. |
Is there an additional planned change? I've still the problem that the mower sometimes turns very fast at a waypoint. Mostly it turns smooth and then it speeds up. After that it often has a deviation to the target direction and has to correct it within the path tracking. At waypoints with only a small needed angle correction, the mower does not slow down any more. Here the new path direction is often not exact enough and it has to correct it while path tracking. I have this new behavior since I changed from Sunray v.1.0.306 to v.1.0.314 (commit b44caf) and I believe it is a result of the removal of steering restrictions, too. This happens with standard ArduMower + standard brushless drives and mowing speed =0.4m/s. I think, not to speed up the turning speed in these situations and slow down at all waypoints as it was before would be preferable behavior. |
You can try the suggested code replacing this line linetrackere.cpp @greymfm are you interested in merging this? |
Since the steering restrictions were removed I noticed that the mower turns quite aggressively at low speeds.
This is noticeable right after turning after reaching a waypoint and when the gps is on float, Ive seen the mower do a 180 in a fraction of a second.
This happens because the stanley correction is inversely proportional to speed.
Possible solution:
Make the stanley softening variable user adjustable, having a larger softening variable means that the heading correction is less correlated with speed, this should also remove the need to have two different sets of stanley values for normal and low speeds.
The text was updated successfully, but these errors were encountered: