Mission planner usually says that the motors are drawing approximately 5A to 7A so I generally assumed the motors weren’t under that much load. I am now questioning those readings given the damage to the board, shown below.
I remember checking the relay board after one of the motors stopped working, but I was relying on the LEDs to confirm the relay was triggering properly. This was the wrong way to check the board, because the LEDs light up when 5V is applied to the header pins, not when the relay actually closes.
I also seem to recall hearing the relay “click” when triggered, but because the wire trace in the board was burnt up, no current could flow through the board, whether the relay was engaged or not. Because the back of the board was hidden and I couldn’t see the burnt up wire trace, I assumed the relays were good and moved on. I’ll check the module later, but the relays probably still work fine.
My Mission Planner current readings are probably wrong.
I don’t think I have the current sensor calibrated or configured properly. Either that, or mission planner does some kind of smoothing of current measurements that doesn’t reveal maximum current flow, only the average over the measurement period. The Mission planner output is total current consumed by the robot, meaning 7A is used for everything. This shouldn’t have caused a problem, in theory. Obviously, there is a disconnect between reality and theory somewhere.
You get what you pay for.
This relay board was $3 plus shipping. The header pins were a nice setup, and the fact that the relays could be triggered with 5V is the main reason I bought them. I had a convenient 5V source to switch them with, so I tried to keep things simple. Unfortunately the board was undersized for the task, as you can even see heat damage to the conductor that isn’t completely split. I should have known there was a problem when I couldn’t fit 12ga wire into the screw terminals on the board and had to use 16ga wire instead. Not good.
Fuses are critical for protecting components and preventing fire.
I’ve been skeptical of going to the trouble of putting fuses in my robot, partly from a cost perspective but mostly from an “ain’t nobody got time fo dat” mentality. This failure could have been a more critical component. If the relay board hadn’t failed, I could have fried the Sabertooth, or worse, started a fire in the enclosure. While I’ve focused my safety efforts on the spinning blades, this is an equally important area to get right.
Remember Occam’s Razor when troubleshooting.
When one motor spins but the other one doesn’t, which is more likely:
The Sabertooth motor controller is fried, but only halfway fried.
There’s a connectivity problem to the motor that doesn’t turn.
Taking a step back to asses the problem can save a lot of useless troubleshooting, like tearing the Sabertooth out and testing it. Use common sense. Start checking the simplest failure modes first, moving to more complicated failure modes until the root cause is found.
To switch current to the motor controller I am going to add a much larger 50A relay to this system. I’ll then use one of these smaller boards to switch the 50A relay. The coil current consumed by the 50A relay should be much lower than the current consumed by the drive motors on the robot.
Running the wheelchair robot in autonomous mode has been a lot of fun. Seeing it come back to waypoints pretty much dead nuts to the same spot is very satisfying. So I’ve become a little complacent with keeping my hand on the “manual mode” button in mission planner in case the robot veers off toward something it shouldn’t.
And boy did I pay for it today. Remember that sprinkler well in my backyard? Well the robot seemed to remember it too, and I may be buying a new power switch for it this spring. I took my eyes off the robot for just a few seconds and boom, collision.
Normally this wouldn’t be too frustrating except for the fact that now the left motor doesn’t rotate at all. The right motor though still runs perfectly.
So I start to troubleshoot the problem using the following process:
I made sure the motor still works. I connected the motor wires to the battery terminals and it spooled up just fine. No problem.
I checked continuity across the motor wires to the relays and Sabertooth motor controller. Everything is connected. No problem.
I checked the relays to make sure they weren’t broken, they function as desired. No problem.
I checked the fuses on the motors. Not blown. No problem.
I swap the S1 and S2 wires on the Sabertooth, thinking this would eliminate the Sabertooth as the issue if the left motor suddenly worked and the right motor didn’t. No change, the right motor still responds to RC input, although in a funky way because S1 and S2 are switched. The left motor is still unresponsive. Might be the Sabertooth.
I removed the Pixhawk from the equation by hooking the Sabertooth up to RC input from the receiver directly. Same results, left motor still unresponsive, right motor works.
I also checked continuity across the DB15 cable between enclosures. Everything seems to be connected. No problem.
So from my cursory testing, the Sabertooth seems to have been bricked, at least on the left motor side. So I pull it from the enclosure and take it inside for bench testing.
But after some simple testing, both left and right motor outputs work when hooked up! So what could the issue be?
I’m thinking something got knocked loose during the collision. Nothing else makes sense. I’ll take everything apart and rebuild it just to make sure, but the lack of a smoking gun is somewhat worrisome.
Get the rover tuned properly, and see if there is any strange autonomous behavior like weaving, jerking, etc.
Familiarize myself with planning autonomous missions in Mission Planner. I was specifically interested in seeing how to autogenerate waypoints.
See how well the GPS blending reports position. I was interested in both absolute and relative accuracy, but really just wanted to get a feel for things at this point.
To start, I took the rover V2 out in my backyard and got it to run autonomously, but my backyard isn’t very big. I have lots of tall trees in my neighborhood, too, so GPS signal reception wasn’t great either.
I would estimate position accuracy relative to the satellite map data was +/-3m. Not horrible, but not great, either. Throughout the afternoon position would drift slightly, I would estimate +/-1m.
I had the rover run an autonomous mission of 20 waypoints positioned in a circle several times to test repeatability. I did this close to 10 times over the course of an hour, and each time the rover took a slightly different path, as evidenced by the track marks in the grass. Sometimes the rover would go on the left side of my sprinkler well, other times to the right. Not very repeatable, but this was a somewhat challenging GPS environment.
So knowing that things were at least configured somewhat correctly I decided to take the rover V2 out to a large parking lot with a good view of the sky. In Kansas, those aren’t too hard to find. I chose a parking lot way out of town, with newly painted stripes that showed up on the satellite imagery so that I could have a good measure of relative accuracy.
The rover weighs something close to 100lb, so I had to take the batteries off of the chassis and remove both of the control boxes. I brought my tool box with me to help reassemble the rover and I also made sure my laptop was charged, but I forgot to bring a few things. If you’re ever out field testing, a checklist is a really good idea. Here’s mine for the next time I go out:
Cell phone with cellular data
AA batteries for the RC transmitter
Make sure rover batteries are sufficiently charged
The toolbox with hex wrenches, adjustable wrench, and screwdrivers
Laptop with a good battery charge
Telemetry radio for the laptop
SD card, installed in the Pixhawk
I asked my very supportive wife to go with me, thinking she would bring her phone and that I could use it as a wireless hotspot to download Mission Planner map data. I forgot to explicitly ask her to bring it, which was a huge mistake because this was the one time she decided to leave her phone at home. And I’m too cheap to have a data plan, so I was depending on her. We had a good laugh about it when we realized she’d left it at home.
So while I was able to do some autonomous missions, I was unable to compare the position data to the parking stripes on the satellite map. I could zoom in, but the ~300 car parking lot was reduced to 6 pixels in Mission Planner.
So without any good imagery, I took the rover manually around the parking lot perimeter to demarcate the edges and then planned some missions. The first ones were circular, and then I did some square ones, and some random ones.
Overall, I felt like the rover was tuned perfectly. I had a few odd shimmies here and there, but I didn’t spend too much time trying to find the cause. They weren’t debilitating, just noticeable. Seeing the rover run autonomously without toilet bowling was very satisfying given my rover V1 experience.
So field testing was only a partial success. I felt like the rover was tuned really well with just the default settings, so that was a win. But I wasn’t able to get a good feel for GPS positioning accuracy or repeatability. I did get to spend some time familiarizing myself with Mission Planner.
An observation about field testing that may be specific to Kansas: Wind stinks. The laptop almost blew off the hood of my car while I was in the parking lot. I set up shop in the trunk of my car where I was sheltered from the wind a little, but I noticed this affected my radio range somewhat. I had the rover more than 500ft from my car at some points, and much past that things got spotty. In the future I’ll choose a calmer day for field testing.
Another observation: Kansas is flat. Very flat. When the rover got more than 200ft or so away from me distance to obstacles becomes very difficult to judge (especially with no satellite map). I hopped a few curbs in manual mode, but the rover V2 handled it like a champ.
Overall I’d say it was a 1.5 out of 3. We’ll bring a good cell phone and choose a calmer day next time.
One of the painful experiences I had on rover V1 was getting the motors to turn the correct way. It sounds simple enough, but there are several different variables that control motor rotation direction and behavior:
Motor wiring polarity. How you connect the two wire leads on the motor into the Sabertooth motor controller affects rotation direction.
DIP switches on the Sabertooth motor controller. There are 6 on-off switches on the Sabertooth that determines how it interprets RC input from the Pixhawk.
Servo output from the Pixhawk. There are 8 servo outputs on the Pixhawk. These must be assigned to the correct output function.
PPM encoder wiring. My RC receiver has 6 RC outputs, but there is only one RC input on the Pixhawk. I use a PPM encoder to mix the six channels into one. Depending on the wiring configuration into the PPM encoder affects which RC channel gets associated with yaw, roll, pitch, etc.
Mission Planner servo reversing. You can reverse the RC input in Mission Planner.
Skid Steer settings. This rover turns by varying the rotation speed of the left and right motors relative to each other. There are a settings related to this behavior.
RC mapping. Which stick on the RC transmitter should control throttle or steering? There’s settings for that, too.
Pretty straightforward, right? This post is for my own personal recollection of this process in case I lose my settings or have to rebuild the rover for some reason. But hopefully I can also shed some light on how to wade through this mess of options and get your rover behaving as desired.
Step 1: Put your rover up on chocks
Seriously, get those wheels off the ground. We’re doing this exercise because the wheels don’t turn the right way. In the wise words of Robby, “your shins will thank you“.
Step 2: Preliminary Wiring
You gotta start somewhere, so don’t worry too much about getting all the wires set up correctly on the first try. Something is going to be backwards or configured incorrectly in Mission Planner. Here’s my checklist for preliminary wiring:
RC receiver is plugged into the RC slot of the Pixhawk servo rail.
Channels 1 and 3 of the Pixhawk output have servo wire running to the RC input terminal block on the Sabertooth (these are the defaults in Mission Planner).
Motors are wired into the motor output terminals on the Sabertooth.
Batteries and BEC are all wired appropriately.
Double check your wiring to make sure your battery or BEC is wired properly and with the rover on chocks, turn on the power.
Step 3: Sabertooth DIP switches
Dimension Engineering has an excellent wizard to help you get your DIP switches configured properly. You’ll obviously need to select what’s appropriate for your situation, but for mine I selected the following:
Lead acid battery chemistry
Simulated RC signal
Regarding (4), you could probably do linear control too, this is a preferential thing I think. The rest of these settings are mandatory as far as I can tell.
The bottom line here is that we want the Pixhawk to mix the steering and throttle signals for skid steering, not the Sabertooth. I’m pretty sure this is why (3) above is set to independent mode. If it wasn’t, you’d have the Pixhawk mixing the signals, and then the Sabertooth mixing them again. Quite the mess, I’d imagine. Probably one of the many things that went wrong on rover V1.
This should result in the following DIP switch configuration:
Step 4: Ensure Your Motors Are Responsive
Flip on the RC transmitter, arm the Pixhawk with the push button switch, and move the sticks around. The motors should at least respond to RC input on the transmitter, even if it seems completely jacked up. If not, go back to step 2 and check your wiring. Motors kicking straight into high gear with the sticks in the neutral position shouldn’t be unexpected at this point. This is also why step 1 is very important.
SERVO1_FUNCTION = 73 (This sets servo 1 output to left motor throttle)
SERVO3_FUNCTION = 74 (This sets servo 3 output to right motor throttle)
In recent versions of Ardurover I think this is all you need to do to enable skid steering. As always, refer to the most recent documentation.
Step 6: Get your RC transmitter mapped correctly
Decide how you want your RC transmitter to control your rover. I have an airplane style transmitter and so I wanted steering and throttle both on the right hand stick. There were a few reasons for this:
When you release the stick it returns to the center neutral position, which will stop the rover.
You can go forward and reverse on this stick. The left stick zero position is all the way down as it’s supposed to be throttle for an airplane, so there’s no way to go in reverse if you assign throttle to this stick.
I can control the rover with one hand and use my left hand for something else.
You’ll want to assign throttle and steering to your desired stick motions in Mission Planner using the RC mapping parameters. In my case you’d go with the Ardurover default:
RCMAP_ROLL = 1
RCMAP_PITCH = 3
This sets your roll and pitch transmitter signals to your the appropriate Pixhawk output.
Step 7: For PPM Encoder Users…
So you cheaped out when buying your RC transmitter? You’re among good company. Your setup will probably look something like this:
PPM encoder users have another layer where they can improperly assign RC channels. Roll might be channel 1 on the transmitter and properly assigned on the servo output of the Pixhawk, but PPM encoder users will need to make sure that Mission Planner shows the Pixhawk as interpreting roll as channel 1.
Pull up the radio RC transmitter configuration page under Initial Setup in Mission Planner and verify that the RC mapping is correct. If it isn’t, you’ll need to fiddle with the way the PPM encoder is wired so that the channels map across.
Step 8: Play With Settings
Now you’ll want to watch the motors as you move the RC transmitter sticks. Forward should obviously cause both motors to rotate in the same direction. Right should cause the motors to counter rotate; same thing with moving the stick to the left. Make sure you check all stick positions so that there’s no funky-ness with the full range of motion.
Are the motors still doing something strange? Now is when you can adjust the motor wire lead polarity. Hopefully you can identify one motor that is behaving opposite how it should. If this is the case, flip the motor wires on that motor and see how this affects things.
Step 9: Document Everything
Did you get it working? Save those parameters. And take pictures of everything, the Sabertooth DIP switch settings, the wire runs, the PPM wiring. Everything. Better yet, take a video of it while you explain verbally what you did to get it to work. You’ll thank yourself later.
Still having trouble? Did you reverse any servos? I thought that servo reversing would be a good idea to get things to work, but I really advise against it. You might get things configured to where your rover does run correctly in manual mode, but when it comes time to throw it in auto, that servo reversing can make things very weird. best to switch wires around instead in my opinion. Get everything configured in the hardware and leave the software at the default settings.
One last word about Mission Planner settings: don’t push buttons. Normally I like to push buttons until something works, but Ardupilot is one of those situations where it really doesn’t help and usually makes things worse.
There are literally hundreds of parameters to play with, and even if all of the settings I’ve described here are correct, there could be a phantom parameter somewhere you tweaked that is messing with your setup. If you didn’t heed this advice you may be better off resetting the parameters to their default.