I’m trying really hard not to turn the height adjustment mechanism into a science project. All it needs to do is (1) support the mower deck and (2) allow the height of the deck above the ground to be easily adjusted.
You can find some exciting mechanisms out there to adjust the height of a mower deck. Google Scag Tiger Cat Height Adjustment if you want to see one of the more interesting ones.
A lot of mowers have a mechanism that lets you adjust the mower deck with one single lever. While I like these mechanisms I don’t think they’re necessary for the robot mower. How often do you typically adjust your lawn mower’s height? I do it once a year, if that.
For this project, having to adjust the height in four places versus one is a small price to pay compared to the time it would take to both engineer a mechanism that would work for our robot mower. Not to mention the cost to make it. Springs and linkages get expensive quickly, and the risk it won’t work right goes up fast when you start adding lots of moving parts.
I like simple. I’m not that bright, so I figure if I can envision something working, chances are it will probably work okay in real life. To adjust the height of the deck, pull the quick release pin, rotate the lever to the appropriate height, and put the pin back in. Do that in four places and your done. Simple!
The nice thing about CAD software is you can see how different ideas play out before you spend a fortune to discover they don’t work. The past month or so I’ve been drawing up robot mower designs with little luck. The model above is the only one I feel even moderately good about.
Most of the concepts I’ve put together so far feature a sheet metal chassis shaped around my batteries and motors. The upside with these previous designs is that it allows for the smallest vehicle footprint. The downside is that they involve a lot of welding and waterjet parts, and it’s difficult to come up with a simple mechanism to adjust the deck height because the motors mount directly to the chassis.
This new concept has the mower deck hanging beneath the robot frame. Separating the deck from the robot frame allows both to be simplified greatly. To adjust the deck height I plan on putting a few turnbuckles between the robot frame and the mower deck. An added bonus is that I can disassemble it and throw the robot in the trunk of my small Hyundai sedan for field testing.
One potential downside I anticipate with the design above is that it will be top heavy. The four batteries have to sit on top of the robot frame. We can box them in and secure the to the frame, but I’m not sure what the vehicle center of gravity will look. Guess we’ll have to do some more modeling to find out.
The XLR charger came in the mail today. I was a little worried because it was advertised as 24V output and after I bought it I realized that you really need something like 28V to charge a 24V lead acid battery. The 12V float charger I have is actually 15V at 150mA.
The charger was advertised as being used to charge electric wheelchair batteries though, so I didn’t worry too much. I checked the output voltage and it came it at 27.3V. Not too bad.
The connection between the panel mount XLR and the charger was a little disappointing though. It’s tight. Really tight. I’ve been trying to break it in, but I may have to take the panel mount apart and grind down the poka-yoke feature. Just enough to let it slide on though, not enough to remove it completely. It’s there for a reason.
If you think a good design is expensive, you should look at the cost of a bad design.
-Ralf Speth, CEO of Jaguar Land Rover
I know from experience that Mr. Speth is correct. So with a good functional understanding of my electrical components and a wiring diagram in hand, I set out to create a detailed CAD model of the wheelchair.
I do a lot of CAD modeling at my day job, and it’s something I really enjoy. But you don’t have to get anywhere near the level of detail shown below to start seeing real benefit from a CAD model.
CAD modeling is difficult and tedious if you’re doing it right. That’s because you will run into questions like these:
How does that enclosure mount to the chassis?
Where will I position that switch?
Do those components fit in that small area?
Can I route those wires through there?
Is that plate rigid enough to hold that enclosure in place?
In a nutshell, CAD modeling forces you to plan. The more detailed your model, the more detailed your plan. You can choose to do your planning in the garage when you’re scotch taping your Pixhawk and GPS to a chunk of cardboard, or you can do your planning in a CAD program from your air conditioned kitchen while you sip an iced tea. I prefer iced tea.
CAD pro-tip: most stuff is already modeled up somewhere. You just need to know where to look. A good place to start is the manufacturer’s website. Search for the term “CAD model” or “STP file” with the part number after it. Almost everything on McMaster’s website has a CAD model you can download, too. Do some digging. You’ll be surprised what you find!
Before I started drawing up the modifications I was going to make to the wheelchair, I spent a lot of time reverse engineering the existing structure. Would you buy new cabinets for your kitchen remodel before measuring your kitchen? Of course not, and modifying the wheelchair is no different. You’d measure things out to understand your constraints.
It’s important to know what you’re working with so you don’t accidentally put components that interfere with stuff on the wheelchair. But beyond constraints, having a good reverse engineered model also reveals possibilities. Unexpected places to bolt stuff suddenly pop out at you. Places to run wires begin look obvious.
If you don’t have a good set of calipers you need to get some, this will make reverse engineering your existing structure alot easier. The more accurate your CAD model, the more value it will have. Measuring the ID of a hole with a tape measure just doesn’t work that well.
Another cool side effect of reverse engineering something is the learning aspect. Some engineers out at Pride Mobility probably spent a few months hashing this wheelchair design out. I know they put a lot of thought into it. I can learn a thing or two from how it’s built and why it has the parts and features on it that are there.
Hopefully I’ve sold you on the importance of laying things out. Spend several hours thinking about your robot and drawing things out, even if it’s on a dirty paper towel. The alternative is ugly.
A More Robust Robot
No more cardboard. I found these pretty inexpensive enclosures that were the right size for this project. You’ll have to purchase a separate mounting panel if you want something to attach your parts to, which I did. As an added bonus, Polycase provides CAD files of their products on their website.
I mentioned previously that I suspected there was a lot of magnetic interference coming from my motors that was affecting my compass. To try and mitigate that, I decided to segregate all of my power electronics from my control electronics.
The control enclosure is intentionally oversized for the components it houses. Eventually I may insert some kind of companion computer and RTK GPS unit. Or maybe a camera. Who knows? But at least with extra space, I’ll have options.
Connecting the Enclosures
Connecting the two enclosures posed some surprising challenges. Power to the Pixhawk and other control electronics comes from the BEC, which is in the power electronics enclosure. But the control signal for the Sabertooth comes from the Pixhawk. All in all I needed to run 9 wires minimum between the two enclosures.
I spent way too much time researching connectors and wire assemblies, trying to find a cost effective solution. I bought 100ft of phone cable at a garage sale for $2 and initially intended to use that, but how do you connect your wires once they’ve been fed back into your enclosure?
I wanted to avoid crimping my own custom cables because it requires some expensive, specialized tools that I would use once, maybe twice. I also wanted a solution that was plug and play, to allow me to modify things on the go or add additional wires down the road. So soldering was out.
I also had to contend with signal loss through the cables. You can only run a 26 gage wire so far before you start getting noticeable losses. You can double up on small wires to mitigate that effect, but that’s not a proper solution in my opinion. So in summary, my constraints were:
No crimping or soldering
Flexibility for changes in the future
No major signal loss through the cable
One cable between the enclosures
Robust and secure construction
During my research I stumbled upon these D sub connector breakout boards made by Winford Engineering. They even had a CAD model on their website. If you pair these connectors with a cable that is made of something bigger than 26 gage wire you’ve got a pretty good solution, I think. Spend $5 on an old DB15 or DB25 cable at the goodwill, and another $20 for a pair of those D sub connector breakout boards and you’ve satisfied all of those constraints.
The male DB15 breakout board. The jack screws clamp the breakout board to the adapter plate, and the adapter plate screws into the enclosure wall.
There were a few drawbacks to this solution though. I had to make a custom adapter plate to mount the D sub connectors to the enclosure. And the smallest DB15 cable I could find was still 2ft long. Not great, but they don’t make them in 10in lengths off the shelf. And as I mentioned, I’m not too excited to get into the custom cable making business.
I initially intended to make the adapter plate out of aluminum, but looking around it might be just as cheap to 3D print it. The numbers I get back from some quotes I have out will determine what I decide. That interior profile with a +/- 0.020in tolerance is going to be expensive to machine.
Mounting the Enclosures
To mount the power enclosure, I had a small aluminum plate cut. The enclosure is attached to the plate and the plate is attached to the wheelchair base.
I’m trying use something other than steel for material wherever I can to prevent further compass issues. Even absent the compass problems though, steel is difficult to cut through. Unless the rigidity is required it’s probably worth it to use aluminum if you can.
The Sabertooth 2X60 comes with a cooling fan and a nice heat sink. I’ve set up the power enclosure to take advantage of this feature by drilling holes in the enclosure to allow the fan to pull air through it. I also selected the grey colored enclosure instead of the black to try and keep heat retention to a minimum. If you’ve ever owned a black car in the summer time, you’ll know why.
To mount the control enclosure, I made a small pedestal weldment that functions like the seat did before I removed it. This allows me to adjust the height of the enclosure if I need to move it further away from the motors. The enclosure bolts to the weldment the same way the power enclosure does.
Connecting the Motors and Batteries
To connect the batteries and motors to the power enclosure, I found these interesting connectors called Posi-Locks. They allow you to both electrically and mechanically connect your wires. Strip the wires, cram them, and cinch them down. They aren’t cheap, but they are reusable.
We’ll see how well they work once I start putting things together. I’m using six 10 gage Posi-Locks for connecting the two motors and B+ and B- battery terminals to the Sabertooth 2X60.
Someday I hope to actually build a robot lawn mower. I’ve tried to design everything here in a modular fashion so I can take this equipment over to the new robot without too much hassle when that day comes.
I previously discussed a lot of issues I experienced with my first robot build that stemmed from a lack of planning. To avoid those pitfalls this time around, I decided that a good place to restart things would be a detailed wiring diagram for the robot.
Between 2014 and several months ago, I managed to fry the Sabertooth 2X32. I’m not entirely sure how it happened, but the excellent support folks at Dimension Engineering informed me that moving the robot manually can generate enough back current to fry it.
On my previous build I had a switch between one of the positive battery terminals and the Sabertooth B+ contact. The Sabertooth is a regenerative motor controller, meaning any current that enters from the motor leads get fed back into the batteries as I understand it.
Well when that switch is off, current generated by the motors has nowhere to go. Wheeling the robot by hand into the garage generates current (it’s basically a DC generator at that point) and that could have created enough current to blow the Sabertooth I guess.
Alternatively, the geared motors on the robot have a lever that can be used to put the gearbox in “neutral” so that it’s easier to push and so that wheel rotation doesn’t rotate the armature of the motor. If I were smart I would have just flipped the lever.
Dimension Engineering kindly offered to replace my blown Sabertooth 2X32, but I decided to upgrade to the Sabertooth 2X60 instead. For an extra $65 you get a cooling fan (more on that later) and twice the current carrying capacity. Definitely overkill, but one the things I learned on my previous build was to not skimp on quality and robustness.
Notice the two 30A fuses on the M1A and M2A motor leads. If you do get large back current, the fuses should blow before you damage the Sabertooth motor controller. Spending $5 is cheap insurance to protect a $200 part.
Mauch BEC and Current Sensor
Because the Sabertooth can’t output enough current at 5V to fully power the Pixhawk and it’s accessories, I had to find an alternative way to power them. However, because my power supply is two 12V 35AH SLA batteries, I was hesitant to use the stock BEC that comes with the Pixhawk. And in any case, I couldn’t use it to control my motors with, so I thought it would be worth it to find an alternative solution.
That’s when I found Christian Mauch’s line of BECs and current sensors. The wiring for these guys is a little weird, at least to me, but it makes sense once you examine it.
The BEC is connected to the 24V battery supply, but after the current sensor.
The BEC steps down the 24V supply to 5.30 +/- 0.05V at 3A and feeds itinto the current sensor.
The current sensor has a 10 gage wire that sits between the positive terminal of the 24V battery supply and everything else, so it can measure current consumption.
The current sensor then has a 6 wire output that is fed straight into the power port on the Pixhawk.
Got all of that? Here’s the diagram from Christian’s website.
That 5.30 +/- 0.05V is written intentionally. The Pixhawk decides which power supply to use by selecting the supply with the highest voltage. If the servo rail provided, say, 5.2V and the power port on the Pixhawk was supplied with 4.9V, the Pixhawk would use the supply on the servo rail. Christian designed his BEC to output on the high side to make sure the Pixhawk selected his BEC with a clean output for power.
According to the documentation, the HS-200-HV is capable of measuring up to 200A of current. Yep, that’s 200A. And you thought the Sabertooth 2X60 was overkill.
The reason for this choice isn’t completely unfounded. Down the road I may want to have an electric motor for the cutting blade on the mower. I’m not sure how much current that will draw, but it won’t be chump change, I imagine. Hopefully this will provide flexibility in the future.
New Three Position Switch
To charge the SLA batteries on my first setup, I had to remove the two terminal lug screws and attach a 12V trickle charger to the battery. I had to do this twice, once for each battery. Kind of tedious.
On this new configuration, I intend to have a three position switch: one position for on, a neutral position where nothing is connected to the battery, and a charge position, where the batteries will be connected to an XLR port for a 24V XLR charger.
The idea is that you flip the switch up for operating the robot, and down for charging the batteries. For storage you have the neutral middle position so that the charging port isn’t energized by the batteries.
Hopefully these new features will correct some of the problems I experienced on my first build. This wiring diagram will also prove invaluable for the next step of planning.
I learn best through experience. I learn the most through bad experiences. The picture above was a bad experience. Fortunately though, I did learn a lot.
Shortly after I got the electric wheelchair home I took the seat off, removed the plastic cover from the base, and started slapping on my hastily purchased parts.
In my defense, I hadput some thought into what you see above, just not very much thought. And because I’m a tightwad and unwilling to shell out $200 for some connectors, boxes, and other small but very important accessories, I ended up with this hairball.
This post is a list of things I learned the hard way. Hopefully you can learn from my mistakes.
Secure Your Equipment
You’re seeing that right: scotch tape is what secures the Pixhawk and GPS to that platform. Wondering why you’re getting “Bad AHRS” readings in Mission Planner? The fact that your GPS and compass unit can wiggle +/-5° might have something to do with it. Especially if it’s taped to some cardboard that is then zip tied to your robot.
Even if the Pixhawk and GPS/compass unit had been adequately secured on my first iteration of this robot, a lot of other critical components should have also been more secure. Nothing holds the Sabertooth in place except for the 10 gage wire tied to the batteries. Nothing holds the RC receiver in place except the servo cable.
If you want a robust robot, then you need to secure everything. If it is loose, it will fall off your robot and get damaged. Related to securing your equipment…
Vibration Is No Joke
Vibration? That’s something the copter guys have to worry about, not us rover guys.
Boy was I wrong. It’s tough to see in that picture, but the cardboard is zip tied to a piece of .030 thick aluminum plate. That plate is bolted to a floor mount pipe flange. The pipe flange has a plastic pipe threaded into it that is then crammed into the seat pipe on the wheelchair base.
I don’t think I could have created more vibration problems if I had tried. What I made was basically a giant diving board to mount the Pixhawk to. You could watch the thing bounce up and down every time I started and stopped when driving in manual mode. I’m sure this contributed to the “Bad AHRS” I was getting in Mission Planner. Another reason to secure your equipment.
Wire Management Matters
When your robot is running over the loose wires hanging off the chassis, you have a problem. Wire runs should be as short as possible and zip tied to your frame. When I had to get my multimeter out to test continuity across wire runs that are electrical taped together, I should have stepped back and said “maybe there’s a better way to do this.”
Related to secure your equipment: wires conduct current, not mechanical force. Yes, I knew this before I slapped this monstrosity together, but this experience gave me first hand experience when a servo cable between the Pixhawk and Sabertooth came uncrimped because the robot ran over a wire tied into the Sabertooth.
Be smart with your wires. Even wire nuts are better than what I’ve done here. Rovers are nice because unlike the guys running RC planes or copters, weight isn’t an issue. But it’s no excuse to get sloppy.
An On-Off Switch is Mandatory
Would you turn on your kitchen light by reaching into an exposed outlet box on your wall so you can bend a wire to contact a terminal? Of course not, and just writing that sounds ridiculous.
But that’s how I powered on the robot, by taking a wire and cramming it into one of the battery lugs. It sparked something nasty every time I did it, and always created a nice little smell afterwards. But more importantly, that was pretty dangerous.
One nice improvement you can’t see here is a switch I jury rigged together after I got tired of the inevitable zap that happened when I connected the wire to the battery terminal. I had an old light switch lying around, so I wired it in by clamping the wire under the switch terminals. Did I secure it to the frame? Of course not.
The Pixhawk needs a nice, clean 5V supply. One of my favorite features of the Sabertooth motor controller is the 5V, 1A BEC output. Unfortunately, 1A really isn’t enough to power both the Pixhawk and any useful peripheral devices, like the GPS and especially the telemetry radio.
The 0V was wired into the − rail and the 5V was wired into the + rail of the Pixhawk. Using this configuration, I experienced regular brownouts. I’m not sure how much current my radio, GPS receiver, and PPM encoder were drawing, but it was enough to cause the Pixhawk to reset not infrequently.
You really need a good BEC that can output a few amps of current to make sure the Pixhawk is well supplied. I skimped by thinking the Sabertooth BEC allowed me to not purchase a good BEC.
Another downside, albeit a small one, was that without a good BEC there’s no way to measure current consumption or voltage drop across the batteries. With two 12V, 35AH SLA batteries though it’s really not a big deal, but it would be nice to get some information about battery state.
DC Motors and Magnetic Flux
Brushed DC motors create a lot of magnetic interference. I would liken it to the movie Twister, except with magnetic flux. Your compass is the cow getting sucked into it. This has big implications for your compass reading and ultimately your heading.
When I did try to run the robot in Auto mode, it would weave left and right really bad if I tweaked the skid steer parameters just right, but mostly it would just run in circles, sometimes switching rotation direction. Toiletbowling is the technical term, I think.
I suspect this was because my compass was getting swamped by all of the flux created by the motors. The long cables carrying several amps probably didn’t help either. The ferrous pipe flange could have contributed. But because of all of the other jacked up stuff I mentioned above, I never did figure out the root cause. It was probably a combination of things.
Calibration could also have been an issue. This robot weighed 80+lb, and to rotate it about all axes for calibration was pretty much impossible, especially with the way my equipment was secured. So I was basically rolling with a half-baked compass calibration. So there’s that, too.
The Moral of the Story
I hope that wasn’t too depressing. There is, however, a moral to this story.
Robustness is important. You can’t trouble shoot a “Bad AHRS” error if the Pixhawk is bouncing all over the place. You can’t tune your skid steer parameters if you are experiencing brownouts every 5 minutes. You can’t calibrate your compass if nothing is mounted to your frame. Murphy’s law applies: if it can fail, it is going to. Spend the time and money to do it right. It’s not worth it to do it any other way.
Planning is important. If I had spent even 5 hours laying stuff out and making a wiring diagram, I would have been light years ahead. Where I work we have a saying, “an hour of design saves an hour of rework in the shop”. Basically, you save time and money by planning things out. It’s true where I work, and it’s true with robot building, too.
Go slow and pace yourself. It’s important to do things deliberately and methodically. I was basically just slapping things together trying to get it to work. Sometimes you will get lucky and things will work perfectly. But mostly, you’ll just end up discouraged about the lack of progress. Start with small bits and get them working, and working robustly. Then move on to combining the small bits into larger ones. Rome wasn’t built in a day. A good robot isn’t, either.
Unfortunately, this experience was so discouraging that I stopped working on the mower project altogether for a few years. The wheelchair sat in the garage collecting dust. But it was always in the back of my mind. I cleaned out the garage several months ago and decided it was time to give the mower project another try, but this time with a more deliberate approach. Next time I’ll give some detail about what I’m doing differently this go around.