Mower strips speed up 180 turns with encoders?

I have a small electric mower bot with wheel encoders/companion computer. All of my mowing patterns start with a few outside perimeter passes and then all internal mowing area is done with back and forth patterns (180 pivot on each end). I am losing a lot of time on my turns which are a simple 180 pivot. I have worked on a lot of turning and have gotten it close, but with this application there doesn’t seem to need a lot of “smart” navigation with the pivot turn (path to next WP navigation still needed). Is there a way to break into the turn using the companion computer and encoders to make these turns quick and not use time which equates to battery life? Running MAVProxy, MAVROS, and some Pymavlink code on the companion right now for various functions. Maybe there is some guided feature that can be tapped into here to make a 180 turn without GPS/Navigation assist.

My thoughts are some kind of setting to reach WP, disable Auto (switch to Acro), use encoders/code to make the 180 pivot, then reenable Auto to proceed to next WP. Which way to turn would need needed based on next waypoint which brings some thought in? *My pattern spacing lines up with a 180 pivot. Not sure how much time Auto would use to pick back up and save time? I know this goes against a lot of the reasons for all the navigation items within Ardupilot, but seems like a controlled pivot turn using encoders for this application would fix a lot of issues for me and speed up turns without a lot of processing.

Any thoughts/suggestions? Please chime in even if it is to say don’t go down this road.

We tried a LUA script to navigate the 180 degree arc. It calculated the arc, then, drove the vehicle around the arc, using a PI loop to vary the sharpness of the turn to stay on the desired arc. It wasn’t perfect, and, it wasn’t much faster than 2 90-degree pivot turns plus a 1.2-meter segment. Turning around the “pivot turn” method requires coming to a stop, making a 90-degree pivot, moving 1.2 meters (distance between our strips) and making another 90 degree pivot turn, and takes about 13-14 seconds. The LUA script was completing the maneuver (when it did) in about 8-9 seconds. Another consideration was that we didn’t want the inside wheel to remain stationary (thus tearing up the grass while the vehicle rotated about it). Which meant actually making a slightly bigger than 1.2 meter diameter half-circle. Another consideration is that the arc sometimes ended up going outside the double-width outside perimeter which we also mow.

In the end we gave up for now - maybe we’ll come back to this.

Do you happen to have a copy of the LUA script you were testing that I can take a look at to see your approach? Any bigger bot and I would have to worry about grass tear, but this new mower build is about 30 pounds with 13" cut. Had a 42" cut gasser going last year, but loving this new smaller/safer bot. My turn with one wheel locked is an overshoot so small scale stuff here to mess with. Just 1 acre property to mow with the small bot, but trying to get the best I can out of my battery capacity. The turn right now in auto is doing the 90 advance 90 method, but is overshooting. It gets stuck thinking sometimes and that kills battery too. I am still working on getting all the steering params worked out, but the majority of my battery usage is the dual blade motors. I may have to try to dump the blades on the turn and fire them back up when on the way. Planning to use dock and recharge once I can get things worked out, but just in my testing getting way less mow time than I calculated. Big learning curve on all parts from Ardupilot/RTK last year to companion computer this year. Thanks for the input.

It sounds poorly tuned. Chris’s script won’t help that, but it might be a good approach overall.

If the pivot turns are just too slow, have a go at increasing these parameters during your next tuning session:
ATC_STR_RAT_MAX
WP_PIVOT_RATE

Thanks for the script Chris. You have done a lot of leg work there and I will start going through it soon.

@Yuri_Rage I went through the params again and the WP_PIVOT_RATE helped, but I am more concerned with pauses in the bot. Do you know what I can check to see why it is sitting for long periods at a way point. I receive Reached Waypoint and Mission shows next waypoint. There is no throttle or steering requests. After an undetermined amount of time, a steering request shows up and the bot turns and takes off to next waypoint. I have tried to set WP Radius etc, but it shows it arrives at way point and then just sits (no delay on WP either set). A lot worse today than yesterday, but not sure why it just sits and thinks. I am on 4.3.0 beta 12 if that helps. Using GPS Yaw with both GPS RTK Fixed. I have my own Base Station as well. PID data looks really good. I turned pivot off all together and get the same result. Not sure what to check to see what it is waiting on to proceed to turn.

Many thanks guys!

After some more weird stuff going on… I reloaded the firmware and reloaded params. Things are looking way way better now. I will still be digging into the 180 encoder solution at some point to see if I can get a Non-GPS type turn added. Not sure what was hung up, but should have thought to go this route early on.

4.3 has nav issues and should be considered unstable.

Unfortunately 4.2.3 requires a different set of nav tuning parameters and will force you to change quite a bit. But that’s my best suggestion for now.