Deciding where to start
For the recent LVBots line following competition, my first instinct was to try to come up with some unique alternative design for a robot that would be competitive with the traditional differential drive robots. However, I knew the winning robot from the last LVBots line following competition (Mostly Red Racer) would be returning, and it had an impressive time to beat. I also remembered spending so much time designing and assembling the hardware for my last line following robot, that I ended up not having enough time to tune the PID coefficients and get the performance I was hoping for. After brainstorming a few ideas, I ended up deciding to keep it simple and make sure I had enough time to get a robot I was happy with, which I ultimately named “The Chariot” because of its shape. The Chariot ended up winning second place in the competition, which I was very happy with. Instead of focusing this blog post on how you can make your own version of The Chariot, I will try to explain my thought process throughout the design and build process. In other words, my hope is that after reading through this post, it will be clear why I chose the parts that I did.
The first thing I decided was how I was going to power The Chariot. When designing a line following robot, one thing to keep in mind is that the performance can change significantly when your battery voltage changes (e.g. when the batteries are recharged or drained). A great way to prevent this inconsistency is to use a voltage regulator. I chose to use a regulator from the D24V25Fx family of step-down regulators, which allow for output current of around 2.5 A and come in a variety of output voltages from 3.3 V to 9 V. I ended up choosing the 7.5 V D24V25F7 regulator because it fit well with the rest of my system. I also had an extra 3S LiPo battery that I decided to use as my main power source.
I used a pair of our 35:1 Metal Gearmotors 15.5Dx30L mm and compatible mounting brackets. These motors have a free-run speed of about 575 RPM at 7.5V and plenty of torque for my lightweight robot. Also, the 3mm-diameter D-shaped output shaft is compatible with our Pololu Wheels. I also used a lightweight 3/8″ plastic ball caster as a third contact point. After some quick calculations, I determined the 70 mm wheels should give my robot a theoretical maximum free-run speed of around 2 m/s. I used the speed of a 3pi robot, which is roughly 1m/s, as a base-line goal to beat.
Next, I looked for a motor driver. I wanted a small dual motor driver that did not use a lot of I/O pins to drive from a microcontroller. The Qik 2s9v1 Dual Serial Motor Controller fit these criteria and worked great with the motors I chose. Since the Qik accepts serial commands and has an Arduino library, it was easy to integrate into my system. For my main microcontroller, I used the A-Star 32U4 Mini LV. This Arduino-compatible programmable controller is based on the ATmega32U4 from Atmel and has an onboard switching step-up/step-down regulator that allows it to be powered efficiently from 2.7 V to 11.8 V. It is also small and uses a Micro-B USB connection for programming. The only part left to pick was the line sensors. For that, I used a QTR-8RC Reflectance Sensor Array, but since I did not need all 8 sensors in the array, I broke the board into two parts, leaving me with a 6 sensor array for The Chariot and an extra 2 sensor board for a later project.
Designing a chassis
I designed the chassis for my robot using SolidWorks. Using 1/8″ thick acrylic from our Custom Laser Cutting Service allowed The Chariot to be sturdy but lightweight (about 210 g including components and hardware). I knew from past experience that having too much weight extended in front of the robot makes it difficult to control during turns, so I kept my battery located under the motors. To allow easy access to the battery, I used a few t-slots intended for #2-56 screws and nuts to hold it all together. If you are designing something like this in acrylic, I recommend reading this How to make snug joints in acrylic guide, which has some useful tips. I also remembered robots using IR sensors having problems with interference from the lighting in the competition room during a few of the previous competitions. To help prevent this problem, I designed a shield around where the QTR sensor array was mounted. The pictures below show the rendered model I designed in SolidWorks.
Following a line
Unlike the previous line following competition, I had enough time to tune my robot to a performance I was comfortable with (not too fast that it was unreliable, but fast enough to be competitive). I even had time to add a second button on the day of the competition to program in an “aggressive mode” and a “conservative mode”. This allowed me to have a faster (but less reliable) setting for The Chariot, just in case I felt like it needed a small boost during the competition. While it was a nice feature to have, it was a little too unreliable. After losing an early race because The Chariot missed a turn and lost the line, I stuck with the conservative option.
The competition was a bracket-style, double elimination, line following race. Two robots would face-off for 3 laps around mirrored courses, clock their times, then switch courses. The one with the single fastest time won the heat. That format allowed a more exciting structure since there were head-to-head races, while also letting us directly compare robots with others we might not have raced against. For more information about the rules, see the LVBots line following rules. The Chariot ended up in the final race against last year’s champion, Ben’s Mostly Red Racer. Coming into the final race from the loser’s bracket meant that the Chariot had to win twice to be declared the winner, but the Mostly Red Racer was too fast, with three laps clocking in 24.4 seconds and an average speed of 1.20 m/s. The Chariot was close behind, getting second place with a time of 25.1 seconds and an average speed of 1.17 m/s. Overall, I am very happy with the second place result, and while I did not beat the defending champion, I did beat my personal best.