Z turn mower, skid steering question, sanity check

Hey guys, I have completed a Zturn mower project, and have a quick question just as a sanity check. Being 1 servo is named “throttle” and the other “steering” in the outputs section. I just want to make sure when Im doing my PID tuning that the steering and throttle PID’s are actually tuning that function? If that makes sense? as in, do I need to keep the steering the throttle PID values the same to make the servo act “symmetrical”? Thank you in advance. and I do plan on making a thread with my Z turn build to share with others, its been quite the adventure for an amateur like myself.

Hi @scottyk,

I guess the physical controls on the mower take separate throttle and steering inputs? Normally with skid-steering vehicles the inputs would be separate left and right throttle values.

I took some time yesterday, about 4hrs worth, to start over with my PID tuning and I think the current gains are pretty decent… It is apparent that the PID tuning is working as intended “throttle PID values are controlling forward and backwards movements not just the left side drive, and same for steering”. I have spent probably 20-40hrs on this mower tuning PID values only to find myself starting over again multiple times. So the purpose of this post was to make sure Im not taking the wrong approach all together. Apparently I am just bad at tuning, and/or adjusting the wrong parameters.

Maybe. But it appears you have the vehicle misconfigured as well, as Randy suggests.

It is a somewhat older Gravely 54" standup Z turn mower. So it has separate controls for each hydraulic motor. I have removed the centering springs from the stock controls and used large 1/5 scale hitec servos connected directly to the hydraulic valve to control them. I have it setup according to skid steer type vehicles with servo output 1 throttle controlling left servo and servo output 3 steering on right servo.

I have adjusted the output range to where the wheels spin very close to the same speed without hitting any physical stops. They do spin faster in forward than in reverse tho, even after I adjusted the reverse stop on the mower to the max amount. With that being said I noticed when it makes pivot turns, it almost always pivots around the inside tire. For instance a left hand 90 degree pivot, the left side wheel will not turn “would expect reverse?” and the right side will rotate forward.

With that being said. I am a newbie to say the least and learning the hard way as I go. I have had some guidance from a good friend who competes in the sparkfun AVC racing category but he is unfamiliar with mission planner.

Anyway, it is a pixhawk 6x with here 4 gps, here 4 base station, so I have RTK fixed positioning pretty much all the time. and I do have it operating as I have mowed my property with it multiple times but its had some stripes un-mowed, and I love to tinker so I keep playing with it trying to make it behave the way I want and expect it to.

I have tried to click on a link that explains how to export the log files everyone posts on here but the link was dead? Any updated links or instructions on how to do that and I will post one. Thanks for taking the time to reply! much appreciated

Host logs on a file sharing site like Dropbox or Google Drive.

See here for a script that may help your tuning efforts:

I was able to download the script for autotune, and I used it while in circle mode although I did not see anything in the messages tab I did not think it was working but I noticed the rover trying different things while going in a circle so I let it go for about 10 minutes. The PID values changed so it must have worked! anyway, I am trying to view my own logs so I can compare before and after autotune. but it appears my “dataflash logs” tab is not there, given I am not connected to the rover but I figured I should be able to view these logs while not connected to it since you guys can view them. Any insight to that? Thanks! I am dangerously close to having a very well working mower here and Im excited to share it all with you guys.

The logs of interest are stored on the SD card as .bin files. You must either remove the card and retrieve the logs with an SD card reader (which is often fastest) or use Mission Planner while connected to download them (sometimes painfully slow).

Downloading and Analyzing Data Logs in Mission Planner — Rover documentation

1 Like

I was able to find the missing “data flash logs” tab, it was just named something else when you right click on the header…

I am reviewing them right now to make sure I name them correctly to share. The autotune seems to have worked very well! thankfully because that will save me alot of time. I have much more precise navigation, the issue I am seeing now is a consistent, slow oscillation while trying to follow a straight line between waypoints, and even when doing the autotune in circle mode it was oscillating. Probably a good chance the issue is with either Str angle P, PSC vel, or PSC pos if I had to guess. because those were the parameters I was playing with quite a bit and certainly differ from the default value.

You will probably see in the logs I was changing those values around quite a lot while it was running the mission and did not find the correct values to make those oscillations go away.

I was also wondering if I should try tightening up the circle radius in circle mode for the tuning since it seemed to have a tendency to over rotate on pivot turns slightly. Maybe forcing it to tune a tighter radius might closer duplicate a tighter turn? Thanks so much!!

This log should hopefully have all the things…

Yes. A tighter turn can help. You may see warnings about steering rate while running the script at too wide a radius.

I’m curious where you land on turn radius. Mine seems to take a bunch of space to turn around…

So I tried some smaller radius’s “radii?” in circle mode with autotune “this was a failure keep reading to see” and spending a few more hours tuning PCS and a little ATC settings, while mowing, I have not made any progress with the wandering at all. I successfully made it worse and brought it back to as “good” as it was before. I can get the mower to hug the line closer while still constantly oscillating. BUT come to find out when I came back inside to view the logs again, the SD card was NOT in the mower, it was still in the laptop. So the autotune function obviously was not working since the script is on the SD card… doh! Maybe try again later tonight.

Side note when I tried bringing all the settings not automatically adjusted by autotune, back to default settings, I noticed the PSC_POS_P which is something I noticed makes a big difference on how closely the line is followed between WP’s, the default value is listed as .200 but the range given is .500-2.000 so when I try to go back to default value I get a error saying it is out of range. not sure what to believe on that one.

I have noticed my way point radius is automatically configured now when using PSC “S-curves” I manually set my turn radius to .1 which I think it should be zero being a skid steer, but I guess my thinking was that this would allow for a little bit of error in GPS positions when its trying to make a zero radius turn and see’s a radius?? I dunno, Im probably over thinking that like everything else.

Turn radius only affects non-pivoted turns.

Don’t sweat the out of range warnings. They won’t stop you from setting whatever you want (within reason). The warning may be due to an outdated version of Mission Planner. It’s often best to use the latest beta version (help page, beta updates), despite the conventional thought that betas are unstable. Firmware development often outpaces “stable” releases of MP.

After running a autotune script “with the SD card inserted this time LOL” with a small radius circle, 2m I believe. the mower is driving MUCH better now! Still has a bit of wondering but I should have much fewer unmowed stripes in the yard now.

1 Like

I am just curious if one of you who is much smarter than I could take a look at my parameters to make sure I am using the Here4 compass correctly? As the pixhawk is mounted on a thick chunk of aluminum and in front of it is a large thick piece of steel, so I tried to set it up so only the here4 compass is used. I also have the ch7 switch now setup to compass learn so I can relearn the compass before I mow, hopefully that is the best way to do it?

Another thing I have been curious about, if I add wheel encoders to the rear drive wheels, can I use that feedback to help with more accurate turns? more specifically pivot turns?

Thanks so much guys, this forum is a HUGE help, specially when doing this project with minimal prior knowledge.