keithellis74 / Tiny4WD-robot

Tiny4WD robot using approxeng.input joypad library and Picon Zero motor controller

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tiny4WD-robot

Introduction

This Tiny4WD robot is based on the robot designed by Brian Corteil, this robot was featured in The Mag Pi issue 51 which contrains build instructions. Brian has also released the files for the chassis on his GitHub site. If you would prefer not to source each individual part, the Tiny4WD is now available at Pimoroni

I am using the Rock Candy PS3 controller which connected to the Raspberry Pi with a dedicated 2.4MHz dongle, the Pi thinks this is a wired controller, all the pairing is done directly between the dongle and the joypad, so we don't have to worry about this at all.

To interface the Rock Candy Controller I used the input library by Tom Oinn called approxeng.input This is a really neat librarry and currently supports a number of controllers includng the Rock Candy. When I started using this library it was designed for Python2, however I prefer to use Python3. I contacted Tom and he very kindly updated the library and it is now python2 and python3 compatable.

The motor controller I am using is the 4Tronix Picon Zero motor controller 4Tronix provided some sample library code, but I wrote my own library class with Motor and Robot instances. This is documented in my GitHub repo

The build

So I downloaded the laser cut files and got them cut at Ipswich Makerspace, bolted on the 4 micro metal gear motors (I used 50:1 ratio) to the base plate. Bolted the Raspberry Pi Zero to the top plate, connected the jumper wires to the motors and then bolted the top and bottom plates together using 4 No. 50mm stand-offs.

To power the robot I used a 2000mAh lipo battery along with an Adafruit Power Boost 500C. This is an expensive but clever device. It takes the input from a 3.7v lipo and boosts it up to 5v, I use this 5v to power the Raspberry Pi. The Power Boost also has a micro USB socket which can be used to charge the battery. The Power Boost has a number of break out pins, one of which allows a switch to be connected to power down the output of the Power Boost.

The Picon Zero motor controller board has a number of power options.

  • To power the board itself, it needs 5v, this can be supplied directly from the Raspberry Pi or from the on board micro USB socket
  • The motors can be feed from the boards 5v supply, (which is either from the Pi or the seperate USB socket) or from a seperate terminal block.

I chose to power the PiCon Zero board from the Pi, which is fed from the Power Boost 500C. The motors will are fed from the terminal blocks which I wired up directly to the 3.7v of the lipo battery.

For a demo of the Tiny4WD robot see my Introduction YouTube video

Dependencies

pip install approxeng.input pip install RPi.gpio pip install gpiozero pip install smbus-cffi

About

Tiny4WD robot using approxeng.input joypad library and Picon Zero motor controller

License:GNU General Public License v3.0


Languages

Language:Python 93.7%Language:Shell 6.3%