This past Christmas was an Arduino Christmas for me. I got a couple of Arduinos and some accessories and it’s taken off into quite an obsessive hobby, completely taking over my kitchen table (We live in a small apartment). Anybody who gets into electronics through the Arduino will probably decide to build some kind of robot at some point in their adventures. For me the goal was to provide some kind of structure to my electronics/microcontroller tinkering. Similarly, when I’d like to learn a new programming language or framework, I pick a project to implement. To test the waters I picked out the cheapest kit/parts I could find and dove into seeing what I could do with it.
I started with the Tamiya Tracked Vehicle Chassis and the Tamiya Twin Motor Gearbox. Eventually I swapped out the motors for the higher voltage Solarbotics RM3 and picked up a couple of Tamiya Universal Plates to support the electronics and batteries.
A tracked chassis seemed easier to start with due to the differential drive. To learn as much as possible along the way I decided to build my own basic motor controller based on the SN74410. I then added some back-emf sensing after stumbling upon this post. The post explains the details, but basically on each motor there’s a pair of voltage dividers connected to an analog pad on the Arduino. Every 100ms the software stops the motors, pauses for 2ms so things can settle and then samples the voltage on that motor for 2ms more. That average is proportional to the physical speed of the motor and with some calibration we can match speeds of the motors, among other things.
My brother in law is addicted to RC helicopters so I consulted him on some LiPos. He suggested a receiver pack because my current requirements weren’t insane. I went with the Zippy FlightMax 2100mAh 2S which has worked great. For charging I got the Thunder AC6. I wasn’t interested in anything more serious until I was sure I’d get my moneys worth and so far it has worked great. Because I fried one of my voltage regulars due to a polarization mishap I grabbed a set of Anderson Powerpoles and attached those to the batteries and made a few utility cables. I’m very happy with them, though I wish they were a little smaller as they’re kind of big for my needs. Also, I used solid core hookup wire on power system and next time I’d use stranded for the extra flexibility, frequently disconnecting and connecting the battery is annoying with rigid wires. Also, I’m using the Pololu D24V6AHV to step the battery voltage down to 5V to drive the Arduino instead of using the on board linear regulator.
I attempted a simple encoder system using SparkFun’s SEN-09299. I mounted them under the second story of the chassis, hoping the beam would sneak through the tiny holes in the tread allowing me to see them tick by.
Unfortunately, this proof of concept didn’t produce a reliable square wave as the tread moved. I think there’s still merit to the idea though, especially if the photo interrupter could be mounted tighter to the tread so that the IR isn’t leaking around the outside. I opted to just hold off until I could do a proper encoder on the motor’s shaft.
I’m a big fan of Pololu. They’ve got a ton of very useful stuff on their website with great documentation. It’s also nice that they’re nearby (Las Vegas, I’m in Southern California) so everything arrives quickly. I picked up their MinIMU-9 to toy around with, you can see the part mounted on the picture below.
With the help of their sample code I pieced together a feedback loop to maintain a heading. This was very successful as it would do a great good job of turning back to its original heading if bumped off course, for example. It’s a great little board, especially with the DCM library they link to on their site. I’ve since broken the MinIMU-9 and an ATMega328P out onto a separate, configurable board that’s running the DCM algorithm and can speak I2C. I’ll do a post on that later.
Final Product And Thoughts
Here are a few more pictures of the robot. It’s been dismantled now so that I could use the parts, as is the circle of robot life.
You may have noticed the IR detector on the servo in the front for obstacle detection. That’s just a tiny peak into the autonomous behavior I’m getting into now. More on that in a future post.
So yeah, that’s about all I got on this project, hehe. I’ve already bought my next platform, the DFRobot 4WD so there will be more to come on that. I’ve also gotten out of the motor controller business and am using an off the shelf one so that I can focus more on autonomous behavior. Making my own simplified/naive one was great fun though.