Category: HAL
I was having a fun discussion with google AI about trying to build a 4WD 4WS gps guided lawnmower. The idea is to build a chassis with 4 "slew drive units" (SDUs), one on each corner. The SDU would consist of a drive wheel and a vertical rotation axis capable of +- 180 degrees. I currently have a very basic RC lawnmower I built. The only thing I don't like is doing 180s with it, it is only 2WD, but if you're not careful with it, it does dig into the lawn. It's "skid steer", no turing steering, just casters.
So my new concept with the 4 SDUs would have 2 distinct drive modes:
1. conventional curve follow mode. this would pretty much act like a 4WD platform and it would use front and rear steering to gently follow medium size curves up to straight lines. The "body" of the platform would align with the direction of motion following the curve. Say during a mild left curve the front 2 SDUs would turn a bit left and the rear 2 SDUs would turn a bit right to allow a nice following of the curve and keep the platform aligned with the direction of motion.
2. transition to next "parallel" row. this would be kind of like a zig pattern in machining. The idea is to transition at the end of one row to the beginning of the next row without any tight turns or reversing wheels spinning on the grass. If the machine is moving say, directly East and it arrives at the end of it's row, the main platform is pointed East and will maintain that Eastward direction as the 4 SDUs "slew" each steering unit through a 180 degree rotation that drives it to the next row, say to the South, all 4 SDUs would turn say 30 degrees to the right and keep driving "forward". During this transition, "forward" eventually become directly to the West (after each SDU has completed a 180 degree arc), but the platform body is still facing East. Each SDU will follow a "perfect" 180 degree equi-radius path bringing the still-facing-East-platform to the next row. The exact opposite of this would happen at the end of the West running row (and untangling the SDUs wires) to bring everything back to normal at the beginning of the next East facing row.
So Ardupilot is a system used for RC airplanes and drones and such that allows GPS guided "missions". By using RTK GPS you can get cm level accuracy. The software already has a "rover" version that can do conventional mowing patterns but it can't do the kind of motion I'd like to try.
So I asked AI if Linuxcnc could help with this. Of course it said, "That is some next level genius engineering solution, just let HAL take care of it for you." And I said "can you just make that happen for me?"
At this point it's just a thought exercise, but if you understand what I'm trying to do, could you give me advice as to how I should learn how HAL works? I run Linuxcnc on my DIY 3 Axis router, so I'm familiar with that, but not HAL.
I'm imagining loading a lawnmower path g-code into LinuxCNC and it would use 8 Axii (4 drive motors and four rotational axii for steering). Maybe it could use custom M-codes to specify which mode it's running in (curve follow or slew mode row transition). Somehow we would need to get GPS feedback into LinuxCNC to correct for slip. There would actually be two GPSs on the platform to provide a heading instead of the unreliable magnetic compass. I think I would just use the Ardupilot Mission Planner to read the GPSs and somehow that needs to get to LinuxCNC for feedback.
I'm imagining the code would all be G1 moves and for the tight turns at the end, simply allow the path look ahead to decelerate the drives and accelerate the steering as setup on each axis physical limits.
I'll try to draw up some diagrams if the turning strategy is confusing as I'm not sure I explained it right.