Thursday, 14 March 2019

PiWars: Driving Wall-E

Every robot competing in PiWars needs to have a Raspberry Pi as its brain. These days there's a whole range to choose from, ranging from the small and compact PiZero, all the way up to the most powerful 3B+. As some of the autonomous challenges require performing some simple image processing I wanted a Raspberry Pi model with a decent amount of CPU, which rules out the PiZero, but at the same time there's limited space inside the Wall-E chassis so I'd benefit from the smaller form factors.
Happily an updated version of the Raspberry Pi A+ was released at the end of 2018. This has the newer CPU, WiFi and Bluetooth of the Raspberry Pi 3 B+, but in a smaller package. Of course this does come with some sacrifices, only half the memory, a slightly lower top CPU speed and no Ethernet port. But the pros definitely out way the cons.

With the brain sorted the next item to think about is driving the motors, as every challenge in PiWars requires the robot to move. I've collected a number of motor drivers over the years, but one I've yet to get around to trying is the PiBorg Thunderborg. This motor controller can easily drive two motors, can be powered from a wide range of voltages and also produces a 5V output to power the Raspberry Pi itself. This helps keep down number of other components I need to fit into the case.

With these two components selected I placed them in Wall-E's chassis in a variety of positions, trying to determine where they should go. I wanted to minimise the impact they may have on other items I would add later, but not place them in some strange positions that they would be complicated to mount. So after a few attempts it looked like the best place for the Raspberry Pi is where the original PCB was, with the motor controller fitting between it and the motors.

Squeezing components into Wall-E's chassis

Unsurprisingly the original screw holes aren't in the correct position for the new components, so a couple of mounting plates are needed. In theory I could just use a piece of wood or thick cardboard, but, as I have access to a 3D printer, I was able to design and print out custom mounting plates for very little cost.

Initial Raspberry Pi and motor mounts designs

The final component to add to the mix is a portable power source, AKA a battery. Once more I'll be going with a LiPo battery for its energy density, providing a lot of power for very little space. The choice for the battery itself was rather simple, I measured the space I had left inside the chassis and looked for a battery to fit it.

It fits!

Putting all this together, slapping on a little bit of python, and I was able to take Wall-E out for a spin. As one of the new challenges involves 'uneven terrain' I wanted to see how he handled over a non-smooth surface. Turns out he's a little top heavy, but already he's reached the point where he could tackle the manually controlled challenges. (Not necessarily do well, but at least enter), and we can always make improvements.