Spring is Here!

It’s been a while since I’ve posted, but that doesn’t mean I haven’t been busy. The back yard is starting to really green up and I think the worst of the cold is finally behind us here in Kansas.

The backyard on this fine spring morning. Winter is finally over!

I purchased a replacement relay board for the one that went bad several of weeks ago. Unfortunately, I didn’t read the fine print and the new relay board requires you to ground the appropriate pin instead of applying 5V to it in order to trigger the relay.

Since I’m now using a high current relay to switch the Sabertooth, I decided to resolder the damaged terminals on the relay board and put it back in the enclosure to switch the high current relay. I’ve taken the wheel chair robot out and tested it, and it is working quite well.

The RTK GPS system is working great, but unfortunately my backyard is still a very challenging environment to work in. Maintaining an RTK fix for 50% of the time is about all I can do. Because of this, I am exploring two different improvements to the wheel chair robot.

Optical Flow

For the uninitiated, optical flow is the concept that modern computer mice use to measure the motion of the mouse. An integrated circuit with a built in “camera” takes rapid (500Hz-ish) pictures. The pictures are very low resolution, 16 bit grayscale or thereabouts, and really small, like 32 pixels square. Using math, the vector difference between each frame is computed, and if you know how far above the surface you are you can then estimate your translation.

The same concept can be applied to our robot wheelchair. Take a camera, point it at the ground, measure how far the camera is above the ground and voilà! With some creative coding, you can estimate your robot’s translation. Optical flow is great because it measures your vehicle’s absolution translation, not some intermediate measure like wheel turns or integrating accelerations to back into your position.

What’s really cool is the Ardupilot code already features optical flow! There’s only one catch… it’s currently only implemented for copter. So for the time being, I’m going to have to either bribe a genius on the internet to port the code to Ardurover, or I’ll have to do it myself. I’ve started playing with the Ardupilot code, but let’s be real. I have no clue what I’m doing.

Wheel Encoders

This is a feature that is already implemented in the Ardurover code. I’m thinking about buying some rotary optical encoders to leverage this feature. For ~$140 I can get two encoders and pretty much plug and play them into my motors.

encoder on motor
The wheel encoders mounted where the brake used to be on the motor. Fits like a mitten!

To properly implement them, I need to figure out the gear ratio on the gear box. I measured it by counting turns of the back shaft on the motor per one wheel rotation and came up with a ratio of  32:1. I thought this was an odd ratio (I was expecting 30:1 or 60:1) so I did some digging and it turns out there’s a little bit more going on in that box than I initially suspected.

To measure the gear ratio, I could just use the encoders and hook them up to an Arduino, measure several wheel rotations and then see how many pulses I get out of the encoder, so I’m not going to bust open the gearbox and start counting teeth. In theory though, this would be the correct way to determine the exact gear ratio.

Some things I’m not sure about:

  1. How much wheel slip is acceptable before the encoders actually start degrading position estimation instead of improving it? Wet grass isn’t nearly as friendly as concrete.
  2. How many pulses per revolution (PPR) do I realistically need? Not much is my guess, but if the Pixhawk can read them, the more the merrier. Where’s the sweet spot?
  3. The wheel encoders help if you can continue to get good absolute positioning information from the RTK GPS. But they’re only as good as your initial position, and you’ll quickly start experiencing drift once you lose your RTK fix. How long can the wheel encoders tide you over between RTK fixes?

For ~$140, I think I’ll take the risk and see how well they work.

Concept #5 Refined

The autonomous lawn mower as of this evening.

The autonomous lawn mower design is coming along nicely. It turns out that the batteries fit nicely below the robot frame. I only had to raise it by 1.5in to give adequate clearance for the battery terminals. This keeps the center of gravity low, and makes for an all around good looking robot in my opinion.

I have an RTK GPS module arriving in December (more on that later), and I want to get the lawn mower design as mature as I can before I need to start investing my time testing that module with the wheel chair.

My list of open items on the design as of this evening:

  1. Latches for the battery compartments. Maybe I don’t need them, but it would be nice to have some way to hold the doors closed. Maybe just some screws would work.
  2. Control enclosure location. It needs to be far enough away from the deck motors to avoid the flux storm. But mounted in such a way that it doesn’t adversely affect vehicle performance or look goofy.
  3. Deck height adjustment mechanism. The robot needs to have a way to simply and quickly adjust the deck height as you would on a typical lawn mower.
  4. Safety shutoff and control system for deck motors. I think these should be powered by a separate set of relays so they can be independently turned off from the rest of the rover. They will still be wired into the master safety shutoff switch.
  5. RTK GPS antenna mount location. Wherever the control enclosure box gets placed, it will need to have enough real estate on it for the GPS antenna.
  6. General wiring. All the motors, the enclosures, everything. This will take a lot of time but as we saw earlier was very much worth it.
  7. Mower deck discharge chute. The mower needs a plastic chute where the grass clippings discharge. It’ll also need the hardware that attaches it to the deck.


The autonomous lawn mower versus our wheel chair robot.

The autonomous lawn mower measures 37.5in long X 36in wide X 17.5in tall currently. Not bad considering our grass cutting width is 35.5in!

Machinists: I’m Sorry

I have a confession to make. I’ve been making the machinists I work with drill some large hole diameters through some pretty thick steel. I didn’t think it was a big deal at the time, but I now know better. It’s kind of painful. Literally.

For mounting the power electronics box to the wheel chair chassis, I had to drill two 0.25in diameter holes through a piece of 1.5in X 1.5in steel tube. No big deal, I’ll just start out with a 0.125in drill bit and go from there.

Generally that wouldn’t be too bad of an idea, if it was actually a steel tube. The ends were plugged with some kind of threaded stud to mount the foot rest for the wheel chair. As I started drilling through the tube I quickly realized that this was actually a solid piece of bar stock.

The first 0.125in diameter pilot hole. It only took 30 minutes!

To make matters worse, I really didn’t have any sharp drill bits, just some old ones I bought at a garage sale years ago. It helps to have sharp bits if you’re going to drill through 1.5in thick steel.

I clamped the mounting plate to the chassis and started my first pilot hole using the plate as a template. Once I had a nice dimple in the frame I removed the plate and kept drilling.

About 5 minutes in my arms were killing me. The wheelchair is pretty heavy, but I still had to brace it with my left arm to keep it from rolling off the blocks that raised it to where I could get the drill on it. And my right arm started aching from pushing the drill into the wheel chair.

I knew I should drill slowly: too many RPMs and you will heat up the drill bit and dull the cutting edge. But even going slowly I wasn’t making much progress. I tried not to apply too much pressure to the drill either, but without it, it wouldn’t make any chips at all.

I did some reading and discovered that using some cutting fluid can allow you to drill at higher RPMs, so I borrowed some non-stick vegetable oil spray from the pantry and sprayed the bit and the hole with it. That seemed to help, but not much.

In the end it took about an hour for each of the two holes, starting with a 0.125in bit, moving to a 0.1875in bit and finishing with a 0.25in bit. I can’t tell you how satisfying it felt when the drill lurched forward as it broke through the back side of the bar stock.

So machinists everywhere: I’m sorry for all the holes I’ve made you drill in steel plate. I will at least have a very good reason the next time I ask you to do it. I understand (in a small way) your pain.

Thanks Rod!

The Pride Mobility Jazzy 1103 Electric Wheelchair.

The Mower Project began after a brief meeting with a kind gentleman named Rod. We met through Craigslist; he was selling his electric wheelchair, and I was very excited to purchase it from him.

Rod had been injured in an auto accident several months prior to our meeting, but he was quite ambulatory when we met. After some minor haggling, he agreed to sell his Jazzy 1103 wheelchair to me for $220.

“Just curious, who is it for?” he asked as we took the wheelchair apart to load in the trunk of my car.

“Well, it’s actually for a project I’m working on,” I said.

“Oh? What kind of project?” he asked.

“Well, I have this idea for a robot, and this wheelchair has a lot of components I need to build it.”

Rod nodded slowly, giving me a strange look. He reached into his pocket and gave me his business card. “Let me know how it turns out,” he said. I told him I would, thanked him for the wheelchair, and was on my way.

That was back in April, 2014. I have long since lost that business card, but in a small way, I hope this blog fulfils that promise I made to Rod four years ago. If you’re out there Rod, here’s how it turned out.