Yuri's Mower Updates

Thanks much, Randy! Since you’re here - I just noticed a 4.2.0-dev branch. Will that include SCurves? Should I be gearing more toward 4.2.0, or is it wiser (and/or more useful to you) to continue beta testing 4.1.0 for now?

@Yuri_Rage,

There’s not much new in the 4.2 yet so I’d stick with the betas for now at least. I have a development branch with SCurves in it but it is half baked and not worthy of testing just yet. Once the dust settles a bit more on 4.1 beta testing (especially for Copter) I hope to get back to SCurves for rover.

1 Like

By the way, Kenny’s method is probably most useful for those of us not using ESCs. We’ve briefly discussed it before, but these “big” machines are driving physical hydrostatic actuators via servos (or linear actuators) that take advantage of the fact that the throttle commands from the FC are easy to translate PWM signals. If you’re using an ESC, it likely becomes much easier to get perfectly matched output on multiple drive motors.

1 Like

I’m sorry I haven’t yet replied to you, @Kevin_OBrien. That sounds like a very cool way to control your mower. While I’m not interested in building one myself, I’d love to see a thread detailing your mower and the drive mechanism you describe.

2 Likes

@Kevin_OBrien I completely glossed over your statement that you are automating an electric zero-turn. I didn’t know they made such a thing. Looks interesting and I second Yuri’s motion to see more info on your setup.

1 Like

I made some interesting observations today while chasing the perfect pivot turn. I think I completely ruled out servo PWM values as the method by which to fine tune the little pivot anomaly shown in my last long post. Rather, the INS/GPS position offsets need to be dialed in correctly to achieve perfect pivot behavior.

I did try PWM tuning to reduce the pivot error and achieved a modicum of success that way…at the complete expense of straight line tracking. It doesn’t appear to be a good method and is likely masking one error with another. It’s likely best to tune the servo min/max/trim values for best straight line tracking and tackle pivot tuning separately.

And then I beat my skull against the wall all afternoon messing with the GPS/INS X offset values. After some careful measuring and re-measuring, I found that the GPS antennas are 2.5" aft of the pivot axis, and the Cube is 10.5" forward. So I set GPS_POS*_X=-0.0635 and INS_POS*_X=0.267, expecting the stars to align and the tune to be perfect.

It got worse. Through hours of trial and error, I finally achieved a good looking pivot turn with GPS_POS*_X=0.35 (WAY forward of the actual physical antenna position) and INS_POS*_X=0.26, which made no sense and worsened the nav tuning. It just made pretty pivot turns.

Then I discovered that if I had the GPS and INS X offsets within 0.1m of one another, the turns looked better than the picture above, no matter what the magnitude of the values - they just had to be within 0.1m, and the turns looked pretty good, which is probably why I was getting such good results with absolutely no X offset at all before.

After some more monkeying around with numbers and trying to make sense of it all, I think I discovered that the best result was achieved with the GPS_POS*_X offset exactly 0.0635m less than (aft of) the INS_POS*_X value. Maybe it’s confirmation bias, or maybe there’s something to it. But I’m seeing nearly perfect pivots with INS_POS*_X=0.27 and GPS_POS*_X=0.2065 (I increased the INS offset a little, and it seemed to tame some oscillation, so perhaps my measurement was off…or perhaps there’s another factor at play here).

I guess it’s possible that the FC first biases all GPS positions by the values of the INS_POS* parameters, and then biases them again by the GPS_POS* parameters, which is the only way I can make sense of what I observed. I have not seen documentation to indicate that, nor have I dug into the code to confirm or reject the theory. Perhaps the EKF innovation values in the logs will help in the process of discovery.

I have a LONG video attempting to share my adventure with all of this - I’ll try and edit it down to something reasonable and record some sort of conclusion when I’m happier with the overall tune (messing with the INS position forces a change in many of the rate parameters). I’ll post it later this week.

EDIT:
Possible firmware issue discussion opened here.
And the related YouTube video

3 Likes

A quick weekend update before I walk away from the mower and computer for a bit to actually socialize with people instead of machines (I may prefer the latter… :smiley: )

Since the cheap Amazon hardware worked so well, I sprung for some proper tie rods and oil-impregnated Heim joints (McMaster-Carr and I have a love/hate relationship for sure…).

image0 (2)

With these, I think I’ll be able to really dial in the straight line tracking, adjusting the rod length for trim position and then working out the min/max values with a handheld tachometer - thanks to @ktrussell for that idea!

3 Likes

Looks awesome, and you know I am going to copy as much of what you have done as possible, eventually… :slight_smile:

2 Likes

Very interesting discussion, very helpful and useful, thank you so much for all of you , I am going to try GPS for yaw, but it looks challenge.

1 Like

@lumono, It really is easy now that the firmware is working well. You have to decide how you want to get the RTCM3 corrections from the ground-based Base GPS to the Moving Base GPS on the vehicle. Beyond that it is quite straightforward.

Personally, I would recommend that you NOT use the Ardusimple daughter board for the 2nd GPS. From what I understand, the way it connects the UARTs between the daughter board and the main board is not ideal. If you use two Ardusimple RTK2B boards, you have the flexibility to connect them any way you need. Of course, it takes a little more real estate than one stacked on top of the other. You may be using something completely different, though, such as one of the HERE devices.

I have used both 2 Ardusimple RTK2B boards and also 2 Ublox C099-F9P eval boards. The C099-F9P has a jumper you have to get right, but otherwise works the same as the Ardusimple boards. They are a little bigger. Both work well. The Ardusimple RTK2B works well and has a GH connector that is ready to connect to the flight controller with readily-available cables.

2 Likes

@lumono, I’ll second Kenny’s advice. Just get two of the SimpleRTK2B basic starter kits (or 3 if you want to use your own fixed base), and you’ll have more flexibility with a little more ease of configuration. Right now, it’s actually cheaper to get two the basic starter kits than one of the RTK+heading kits anyway.

2 Likes

very appreciated @Yuri_Rage and @ktrussell for your advice.

2 Likes

On the subject of my own project, I’ve made some pretty good progress.

I managed to get a few mowing specific features added to the Mission Planner master code branch, and they are now available in the latest beta update.

I’ve also begun a quest to move some of my Lua scripting automation over to the transmitter side rather than gobbling up flight controller RAM. Presently, I use Lua scripts to accomplish the following:

  • Automatically set the parking brake when disarmed or in hold mode

  • Automatically engage the mower blades when a waypoint mission is active and keep the blades engaged when switching between manual control and auto control during the mission (with a switched failsafe).

  • Overload a single channel for arming and ignition, then use that channel state to determine the function of the only momentary switch on my transmitter, alternating between choke on/off, starter engage/disengage (with automatic choke outfeed if it was engaged when the ignition was switched on), and waypoint save.

  • Sometimes just for grins, calculate the sun elevation based on GPS coordinates and date/time, and if it gets a little below the horizon, turn the headlights on (I don’t usually run this one).

  • (and as of today) Pausing auto mode when GPS fix status is worse than RTK Fixed.

I wrote most of these scripts to avoid using up all of the RC channels on a Spektrum 9 channel transmitter. However, I’ve been using a FrSky 16+ channel transmitter for about a year now, and I haven’t fully taken advantage of OpenTX’s flexibility. So far, I’ve managed to move much of this logic over to the transmitter, and I think I even got an automatic choke outfeed function to work.

I’ve also learned a TON about open and closed loop process control as it relates to flight controller tuning. I know some of you follow my YouTube channel, and I truly appreciate the support. I have an even longer backlog of video ideas after all of this, and I’ll try hard to get some of them filmed, edited, and uploaded.

You’d think after a year and a half of this that I’d tire of this project or call it “good enough,” but I find the entire platform fascinating, and it keeps bringing me back to find ways to improve performance. Apparently I’m “that guy with the robot lawnmower” to my neighbors, and I even had a county policeman stop his cruiser, turn around, and start asking me about the project (I was apprehensive that he’d actually been called to inspect the safety of my “operation,” but he was genuinely curious, and we had a great chat!).

6 Likes

Keep blazing the trail ahead of us (me at least) so the grass isn’t too high for us to follow! Pun intended.

2 Likes

@ktrussell & Yuri …I have been watching the forum on the discussion between you &Yuri (great work guys)and I am building a complete new mower to test with.Similar design as my old model from 2017. I wanted all the new technology .I have a question about the GH connector between the Cube and the SimpleRTK2B, you had mention to me a few weeks ago. I bought a new Orange Cube and have two SimpleRTK2B.configured as a rover and fixed base on top of my shop . BUT I don’t see the GH cable you mentioned. The only cable that fits the SimpleRTK2B is going to the Power splitter from the Cube.

Forgive me if I’m a bit confused by the question. There is one 6-pin GH connector on the SimpleRTK2B board that needs to be connected to a serial port on the cube. You can connect it to one of the 6-pin serial ports labeled GPS2, Telem1, or Telem2. Or, if you’re comfortable repinning a connector, you can use an 8 pin connector on the Cube side and connect it to GPS1 (keep the power, TX, and RX lines on pins 1-3, and use pin 8 for ground).

If you’re looking for a specific connector in the Cube’s wiring kit, it may not exist. They do a good job of packing some frequently used parts, but they don’t include a connector for every possible hardware configuration. You can order more connectors from Amazon, Mouser, DigiKey, etc.

Thanks Yuri, That’s is what I thought but Kenny and I were discussing a cable and I was hoping it was in the Orange Cube set, I ordered a Pre-Crimped Cables and GH1.25 Connectors for Pixhawk2 Pixhack Pixracer PXFmini Silicone 15cm Wire from the AMAZON .and I will make one,Thanks again for all your help on the subject matter You and Kenny are the “MEN”

@dwright361, I would have sworn that the Cube Orange kit ( AmazonSmile: The Cube Orange Standard Set (ADS-B Carrier Board) : Electronics) included the right cable, but I have a brand new one I have never opened (for a drone like Yuri’s, of course!) and it does not. It seems to have the GH connectors for the cube, but the other end of each has the older DF13 connectors. I guess I built my own from this kit AmazonSmile: Pre-Crimped Cables and GH1.25 Connectors for Pixhawk2 Pixhack Pixracer PXFmini Silicone 15cm Wire : Toys & Games.

Looking forward to seeing your new mower build!

Kenny: thanks for the reply. Yep. I ordered that kit this am

I will just swap the plug out on the cable. Thanks again for all your input. Doug

I think we all have at least one of those kits on hand!

Here are some 20cm GH style pre-made harnesses:
https://www.amazon.com/gp/product/B07PLPT2Z6

And if you ever need the older style DF connectors, here’s a link to those, also:
https://www.amazon.com/gp/product/B07S18D3RN

Between a copy or two of each of these and a little patience, I’ve been successful at connecting any peripheral hardware I’ve ever tried.

1 Like