My Z-turn mower project "Noodle Brain" 54" Gravely, pixhawk 6c, Here4 w/base antenna

Hey guys, my name is Scott and I’ve been lurking around for a while learning a TON of stuff from this forum so I want to say thanks to everyone especially the developers of software for being so active and helping/sharing info!

Here is my little project I’ve been tinkering around with for a few months now, its an old Gravely Prostance 54 Z turn “grandstand” mower. I dabble in a little of everything from racing full size cars/boats, to RC cars, construction equip, subs, heli’s, etc but I havent spent much time in this complicated world of autonomous stuff so Im learning this all the hard way. So please bear with me if I say or do something wrong or dumb! My kids came up with the name Noodle Brain since the “driver” is my kids old clothes stuffed with pool noodles held together with duct tape.

So I started off with a pixhawk6c, here4, and base station antenna. Currently only 1 gps antenna and using the here4 as the compass “I hope its configured that way anyway lol” The conversion and hardware is the easy part for me, I installed big 1/4 scale hitec ultra torque servo’s, removed the centering springs from the hydraulic valves, and rigged up a servo to run throttle and turn the key off as a failsafe. So it is a pretty simple setup, and pretty easy to switch back to manual mowing if this turns out to be a flop. I put 3 big 12v lead acid batteries on board to power electronics and a stand alone battery for the cooling fan. Has a FPV system in hopes that someday in the future I can sit in my shop and watch it mow.

I have about 2.5 acres to mow, around 35 trees to go around, and being amateur at best with programming way points its taken quite some time to get a mission created that doesnt run into something. I wait for RTK fixed, wait a bit longer to gather a bunch of satelittes, and drive around saving way points, then create a polygon around the perimeter and get a bit creative trying to avoid trees and stuff with the polygon. Then I create auto waypoints 1m apart, lately I have been using spiral pattern but I would like to get it working well enough to do a back and forth pattern for nice looking lines.

Only recently have I started using Lua script for autotune, and this seems to have made things much easier and a HUGE time saver. Although I am still fighting this mower never driving in a straight line. It really takes the term S-curves seriously. I have used different diameter circle radius for tuning, and used my own “probably poor” PID values and am still seeing the same issue. I have done the position controller tuning steps as well and I have seen some good success with that, but something still seems a little off. Anyways! on to the pics and stuff.

Share a .bin log for tuning help.

I suspect your use of a magnetometer rather than GPS heading (GPS for yaw) is compounding the issues. I recommend NOT buying a second Here4 to try and rectify that. Moving baseline on the Here4 is a nightmare.

Those extra batteries are probably just taxing your charging system (if they are tied into it). Most of us just run the electronics off the stock electrical system. A good step down converter handles the irregular spikes in the crappy mower charge output. I upgraded the stator and wired a DIY voltage regulator on mine, since a set of bigger servos started overloading the stock (awful) voltage regulator. The stock battery has plenty of capacity.

A servo actuated key is a novel concept. An ignition relay might be a bit more reliable.

Im going to do a little bit of midnight testing here and post a fresh file later or in the AM. The batteries were simply left over from a lithium conversion I did on a ryobi electric mower and figured they would be great ballast and last dam near forever “60ah each” so I run those totally independent of charging system. Given I am still using the hydraulic drive motors the biggest draw is the big servos, and the cooling fan is hooked up to its own separate battery “I might not even need it”. I have only charged them twice in a few months with heavy testing so it might end up being a annual or biannual type thing once this thing is working good.

I might be searching for something that’s not possible with my setup and I need 2 antennas for GPS yaw… but I am certain I can improve what I have.

I am curious, since I do alot of testing at night “when kids are finally asleep” I dont spin the mower blades since the grass is soaking wet from condensation and it stinks up the garage from wet grass and mold. so I have a switch that runs compass calibrate and I calibrate the compass before mowing or testing each time, “blades on or off”, since I read a post you mentioned the blades can change the calibration. Is this a good idea, not worth doing, overkill, maybe throwing calibration off if Im in a hurry or calibrate in a bad spot?? It calibrates so fast its not that big of a deal, but if it leads to inconsistencies I dont like that.

The real answer to compass calibration is here:

https://ardupilot.org/rover/docs/common-magfit.html

Use the web tool. Try it with a few logs and compare results (blades on/off, various conditions). If you get somewhat consistent results, then you might get away with using a compass alone. If you can at least get consistent results with the PTO engaged, use those results and know that spinning blades is a requisite for good navigation.

After reviewing the log, it did not record the missions that I wanted to share. I was under the impression every time I armed it, it would start a new log, and when I dis-arm it would end that log. Apparently that is not the case so I need to look into that. I will attach the log anyway, apologies its so large of file, wasnt intended. Hopefully there is something in the log that will throw a redflag to a more knowledgeable person.

So here is what I did last night from 10pm till 1am

Decided to “start fresh” with the steering and throttle gains and let quicktune do its thing did a few different circle radii and reversing the direction so I could record the values and see if they change. Again there is no indication that quicktune was working, no messages, and PID values unchanged. Quicktune worked previously and cleaned up my somewhat botched attempts at tuning in the past so I tried to keep faith, seemed weird but ok…

Now focused on PSC tuning, after beating all those values to death, again, with no real improvement I decided to make a last ditch effort at steering gains. Running low on beer at 1am I took a swing at it, moved P gain way up, I think I added 50% to whatever it was. “left I and D at quicktune values” which generally resulted in crazy oscillations, but to my amazement it responded very well. I ended up with almost triple the P value compared to quicktune’s #. Still needs work, but big improvement. Keep in mind this was all done without the blades on, hopefully in the next day or two I will be able to actually mow with good results. Then, hopefully, I can share that log.

oops sorry, that was my half asleep, half buzzed, explanation video lol Here is the log.

Also keep in mind that since you are tuning the whole drive “system”, engine rpms change the hydro drive characteristics just a bit. I have mine well tuned at full rpm but when I drop the rpm at its last WP for its cool down period, it does have a slight oscillation as it slowly trundles home that is not there when cutting. Nice job!

PS - Like Yuri, I’m just using the small original mower battery and the stock charging system (15 amps)keeps everything topped off easily. Good luck!

1 Like

I am curious how you guys go about programming the mowing path? Currently I am driving the mower around saving waypoints to create the perimeter and locate the obstacles. Then import to Mission planner, create a polygon overlaying the waypoints I saved for the perimeter, auto way point that polygon, then I manually move waypoints and add waypoints to avoid the obstacles. but there is ALOT of trees and obstacles, and its proving to be a time consuming task with the amount of revisions I’m making and waypoints to move. Then heaven forbid I park a trailer or vehicle where its supposed to mow and have to modify it again.

Just trying to find more efficient ways to do this. I was hoping there was a way I could just drive the mower and it would record my entire path that I could import into mission planner, rather than driving, and stopping at every place I want a way point.

Thank!

oh and 1 more question, after a tuning session I have noticed sometimes it behaves differently. I think due to acceleration settings, so Im curious which accel settings effect the way it drives in manual mode? I was under the impression that manual mode should be bypassing the FC, and when switched to acro it would apply the PID gains and acceleration limiting settings. Thanks!

I use Mission Planner similarly to the way you suggest for path planning. I’m working on a standalone path planner that takes fixed obstacles into account for the reasons you are concerned.

If you are worried about pop-up obstacles, you should look at obstacle avoidance with radar or LIDAR. I don’t really like the way BendyRuler behaves for mowing, so I abandoned most of that. But it does technically work, and I should probably make better use of avoidance features for safety’s sake.

Even with fully active obstacle avoidance, I would never park something expensive in a place I routinely mow and then send the mower out on a path that intersects the expensive thing. I’d change the plan or move the thing!

Tuning has no bearing on manual mode.

When adjusting ATC_accel parameters it shouldnt change the way it behaves in manual mode?

On the topic of obstacle avoidance, I was hoping I could tighten up my waypoints to bring the mower closer to the perimeter and tree’s, thinking 1-2ft, and using bendy ruler as a safety to hopefully not run into them. I’ve already ran into instances where RTK was lost, accuracy goes to crap and it starts hitting things. It would be super cool to auto way point the whole yard and use some sort of proximity sensor and bendy ruler to avoid trees and obstacles! but at this point I have a fairly decent mowing pattern figured out as long as GPS and RTK fixed are good.

What would the ideal thing to use in this case, I see there are lidar units, sonar, depth cameras?? Im sure most of you are rolling your eyes at a simple question like that on this forum but like I said Im learning the hard way here and Im not well versed in this sort of thing. Ideally something that is supported and has been used with pixhawk/mission planner.

No. They are not used at all in manual mode. The only tuning parameters I can think of that should affect manual mode’s operation are MOT_SLEW_RATE, MANUAL_STR_EXPO, and the SERVOx parameters for the motor outputs.

I think the best answer to obstacle detection is millimeter wave radar. There is no “right” answer. Every LIDAR I’ve tested gets wonky in bright sunlight. Maybe a super expensive one would work, but I have no faith that the dollars spent would be actual value added.

You might be interested in this Lua script to keep your mower reined in whenever the fix type decreases below RTK Fixed.