That was it - thanks. Now, do you know how it works (outside of the autotune LUA script) - does it circle around the current location - or circle around a particular waypoint?
Circle mode circles around the location it was at when it entered the mode. LOITER_TURNS (within a mission) can do either… so if lat,lon are specified it will circle around that location, if not it will circle around the current location.
Thanks very much for giving 4.5.0 a try! you are actually the first person to provide feedback so it’s very much appreciated!
@Yuri_Rage@rmackay9 what is the latest status on the straight line tracking issue in the S-curve controller? Is there anything I can do to have the rover more aggressively minimize X-track error? With the old L1 controller I knew how to tune to aggressively stay on the straight line between 2 waypoints. I seem to remember that there isn’t a similar construct in S-curves.
This mission the x-track averaged 5-10cm which is higher than I am used to seeing.
The steering and throttle controller tuning looks pretty good to me and it’s moving around the square pretty well with no weaving.
To improve accuracy further the errors need to be really small in both the estimation and control areas.
It looks like there are two RTK GPSs and the 2nd one is 1.05m ahead of the first?
For control, I wonder if you could try turning off pivots at the corners by setting WP_PIVOT_ANGLE = 0 and remove any delays from the waypoint (I think WP3 has one)? Pivot turns are quite different from driving along a straight track because of the additional friction and the exit angle (which can be off due to yaw errors) so temporarily turning them off separates the problem into two.
Re tuning the navigation controller, the PSC_VEL_P, PSC_VEL_I and maybe PSC_VEL_D are the main parameters that can be adjusted. In particular adding a bit of PSC_VEL_I (e.g. 0.2) might help reduce the cross track error a bit.
@rmackay9@Yuri_Rage Could you suggest where to look/try next?? My problem is that I still don’t see my rover make a nice rounded corner. It passes the waypoint then starts turning.
I turned off pivot turns - then followed the tuning instructions. Navigating at a nice slow 0.5 m/sec - with wp_radius of 2 meters -
Key params:
ATC_ACCEL_MAX 2.0 (so, this shouldn’t be limiting it)
ATC_DECEL_MAX 0
ATC_TURN_MAX_G 2
WP_RADIUS 2.0
WP_SPEED 0.5
Reading through this page Tuning Navigation — Rover documentation, is is true that " * The vehicle will cut the corners more if the maximum accelerations are reduced (e.g. the lowest of ATC_ACCEL_MAX, ATC_DECEL_MAX and TURN_MAX_G * 9.81)"?
I can never remember which one the “moving base” is. I have 2 ardusimple boards. The board connected to TELEM1 on my Pixhawx 6C is the one with the antenna at the center of the vehicle, between the wheels. Is that the moving base? The other board is connected to TELEM2 and is connected to the GPS antenna that’s basically between the front (caster) wheels, about 1.1 meters in front of the other antenna. The vehicle’s position on MissionPlanner does not move (at least, doesn’t move very much) during a pivot turn. So, I think I have the antennas/boards/UARTS sorted out.
That pic above was with wp_radius set at 2 meters (4 seconds before arrival at a waypoint)… so, no, behavior didn’t change with increased wp_radius.
The moving base is probably the one on Telem1 (the lower numbered port).
Its position is where your vehicle “thinks” that it is, so it will not begin turning until that antenna is over the intended turn point (waypoint minus WP_RADIUS, plus accounting for any GPS_POS* offsets).
Should the orange line (Direct to current WP) change from the current waypoint to the next waypoint when i’m <4.0 meters from the current waypoint? i’m driving in a N/S/E/W square 10 meters on a side. Should wp_dist (mission planner tuning window) decrease all the way down to 0, then jump back to 10 upon crossing a corner waypoint, or, should it start displaying the distance to the next waypoint once i’m within WP_RADIUS of the current waypoint?
I don’t think you’re doing anything wrong, per se, and I’m wondering if we’ve discovered a possible bug since the significant improvements to Rover pivot turns and waypoint timing were introduced.
As a bit of a hail Mary before I defer to @rmackay9, let’s try increasing TURN_RADIUS to 2m.
I’ll admit that I have noticed some S-Curve path overshoots on my own mower, but they have been minor, since I almost always pivot my turns, so I only ever get S-Curve behavior on very shallow angles.
@Yuri_Rage I’m curious: When, after completing a pivot turn, your mower is positioned left or right of the new track (which inevitably happens), does it center itself back on the track pretty well within a meter or so? Do you monitor xtrack_error? Do you know whether xtrack_error represents the cross-track error to the line-between-the-waypoints, or does it represent the cross-track error to the s-curve-generated-curve trajectory?
Crosstrack error during normal navigation is the difference between vehicle position and the line drawn between waypoints (desired course). I don’t know how (or if) that differs during S-Curve nav on the curved paths. Mine is usually less than 10cm, though sometimes rough patches or hills can increase it a little.
It always corrects back nicely (and quickly - though I couldn’t tell you the exact distance), and since I mow in spirals, the turns from one pass to the next tend to behave similarly, so I end up with decently overlapping passes that generally avoid skips in the mowing.