Category Archives: Robotics

Testing new motor mounts

I needed to re-design the motor mounts on the robot base, they didn’t hold the motors securely enough and tended to shift around.

The new mounts are better fitting and include a small wedge that fits between one of the gearbox plates where there are no cogs.

Testing new motor mounts Testing new motor mounts

One of the great things about 3d printing is being able to pull out part of a design and iterate over in isolation, then when you’re done incorporate it back into your main design.

Tagged ,

Raspberry Pi camera mount + lens holder

I printed out the front half of my Raspberry Pi camera module mount. It serves two purposes, providing a way of mounting the camera on my robot, and giving me a place to attach the wide-angle lens I’d bought earlier.

Raspberry pi camera holderRaspberry pi camera holder

Tagged ,


The Raspberry Pi camera doesn’t have a field of view that is wide enough for my robot, I’d have to mount it really far from my robot to see enough context to make it drivable so I’ve bought some wide angle iPhone lenses to try out.

Wide-angle and fish-eye lenses

Here’s a photo taken using the fish-eye lens held up to my iPhone:


Tagged ,

Batteries and battery charge circuits

I’m currently powering my robot via cable and mains adaptor. This works fine but. I need to power it by battery so it can roam around a room. I’ve looked at which batteries to get, and I guess I’m going to get something like a NiMH battery. LiPo sound like a good idea, except for the whole exploding/setting on fire thing, the robot will be left alone while charging and if I burn down the office no-one is going to be pleased. So I’m thinking of buying something like this NiMH battery for my robot.

The problem I have is how to charge the battery. The robot needs to “dock” and charge unattended, rather than have someone change it’s batteries manually so standard consumer battery chargers are out. I also need to get charging status somehow so I can get remote status / prevent the robot from moving off until the battery is charged so some sort of SPI/I2C interface will be needed (the docking station will be a Raspberry Pi).

It looks like there are chips out there to do this sort of thing, like the LTC1759 (from here) and more.

Unfortunately I have 0 surface mount skills, or confidence that I could make a circuit out of that that would work so I need some help:

  • Does anyone have any suggestions for boards that already exist that use a chip like this…
  • …or suggestions as to how I could handle the charging?

Shutting down your Raspberry Pi cleanly with the MotorPiTX

The MotorPiTX I’m using for my robot comes with a power switch that can either hard power-off the Raspberry Pi, or signal software running on the Pi to do a clean shutdown:

Purely to control the ATTiny chip, to turn on the Pi, but also to shutdown as well. With the Pi off, pressing it once will turn the Raspberry Pi and MotorPiTX board on. With the Pi active, pressing it again will set GPIO 8 high, signalling that the button has been pressed and should be used to shutdown the OS. See Installation for more details.

Holding the button for 3 seconds will cut all power, useful if something goes wrong, such as the Raspberry Pi crashes and refuses to respond.

I’d never bothered to write any software to listen for GPIO8 going high before, I’d always relied on being able to SSH in to shut the machine down. Recently however I’ve been playing with the Pi camera, this was causing the Pi to pull too much power and it would shut down the USB ports cutting off my (wireless) SSH access and my USB keyboard both at the same time leaving me with no alternative but to hard power off. It was time to do something with that GPIO8 pin signal, and so I wrote motorpitx_power_control.

motorpitx_power_control is simple, from the README:

A program to listen for MotorPiTX power button presses and cleanly shutdown your Raspberry Pi.

It’s a really small program written in Go that checks the status of GPIO8 every half a second and initiates a shutdown sequence if the pin goes high. I’ve included instructions for building and installing on Arch linux, but it will work on other distros too.

Why Go?

I think Go is a great language for the Raspberry Pi. Go creates small, efficient, statically compiled binaries that easily fit within the resource limits of the Raspberry Pi. motorpitx_power_control is a relatively small 2.5MB binary that uses almost no CPU at all.

Getting it

The project requires a working Go install to compile, this is simple enough to get on Linux and OS X, check your package manager or homebrew. If you have Go installed head over  to the motorpitx_power_control Github page and clone the repo. Follow the build instructions, copy the binary file to your Pi and run it. That’s it!

Check the Contributing  & TODO sections of the README if you want to contribute back to the project.

Tagged ,

Prototype robot base #1

The robot base design from my previous post printed OK. Here it is printing:

Robot base printing

The finished print. The two small separate objects are the motor covers:

Completed robot base print

The assembled robot, including Raspberry Pi and MotorPiTX:

Assembled robot base

The underside of the robot:

Assembled robot base base

Tagged ,

OpenSCAD robot base design

I’ve re-designed a prototype robot mount in OpenSCAD as Sketchup wasn’t up to the job. It took a while, you have to program the model in a text editor so there’s lots of trial and error. Will have to wait to print it to see if this design will work.

Prototype robot base designed in OpenSCAD

I’ve made some improvements over the original design, most notably thicker side walls and motor mounts, more accurate measurements and added the cross-pieces with a Raspberry Pi mount.

Here’s the original Sketchup design for comparison:

Robot base designed in Sketchup

Sketchup was great, really easy to use, the only problem was that it seemed to create invalid model files.

Tagged ,

Trying out the prototype caterpillar track mount

It works, but it needs more refinement.

Testing the new motor mount

Tagged ,

Designing a track mount

Designing a track mount for my pololu caterpillar tracks. Sketchup is trying  very hard to prevent me.

Pololu track mount

Tagged ,