The Frame

The last couple of weekends, I’ve been working on the least sexy part of the robot – the mounting frame.  As has been mentioned, the space inside the robot is VERY tight this year, so making everything fit is a real challenge.

We need to fit in:

  • The Pi and its (not quite) Hat
  • 2 x Motor controllers
  • Servo controller board
  • IMU
  • Screen
  • 2 x Battery monitors
  • 2 x PSUs
  • Amplifier
  • Speaker

All in a space 94 x 83 x 89mm.  And we need to think about thermal management.  Looks like we’ll have to mount the batteries externally!

Our solution is this 3D printed frame.  It holds the circuit boards vertically (for good convection cooling), puts the Pi and its connections at the back (the back is removable for easy access).

All the other little boards are mounted on the reverse of the Pi mounting plate (hidden in the photo).  The whole thing lifts out of the robot if we need access to one of the boards buried near the bottom.

Tour of the main PCB

As mentioned in my previous post, this year we needed (an excuse) to learn KiCad and build a custom PCB.  Thankfully, we did succeed in soldering it up , despite the tiny pitch on some of the components.

Picture of the board

The PCB dives into a few parts.  I expect you’ll all recognise the Pi header in the top left.  Above that, in yellow on the annotated image, we have the SPI peripherals: the screen and the IMU (which we use mainly for the gyroscope).

Annotated board
Yellow: peripheral connectors; Pink: Parallax Propeller; Green: Time-of-flight sensor connectors; Red: Isolation chips

Below the header, in pink, we have the Parallax propeller chip, a fast microcontroller that we use to decode the signals from the motors.   Each motor can put out 200k pulses per second, which isn’t really possible to handle from the GPIO pins because Linux can’t really handle that many interrupts per second.

To the right, in yellow, we have connectors for the “noisy” off-board components.  These sit over their own ground plane, so that, if we want to, we can drive them from a completely isolated power supply. From top to bottom:

  • “noisy” 5v power
  • motor driver control 1
  • motor encoder 1
  • motor driver control 2
  • motor encoder 2
  • servo controller
  • 2 x power monitors

To bridge the gap between the microcontroller and the noisy world of the motors, (in red) we have a pair of ISO7742 chips.  These provide two input and two output signals, which are level shifted from 3.3v to 5v and are  isolated through an internal capacitor.  Unlike an optoisolator, they were super-simple to use, requiring 3.3v and 5v power and grounds, a couple of decoupling capacitors and some pull-ups on their enable pins.

Similarly, below that, we have an isolated i2c line for driving the servo board (which runs from the “noisy” 5v power supply.

In the bottom left (in green) we have 6 connectors for optical time-of-flight sensors.

The time of flight sensors, Propeller, servo controller and voltage monitors are all i2c controlled, which poses a couple of problems:

  • i2c busses tend to become unstable with more than a handful of devices (because each device adds capacitance to the bus, making it harder for any device to drive the bus)
  • we have no control over the addresses of many of the devices; for example, all the time-of-flight sensors use the same address.

To address those problems, we included an i2c multiplexer in the design (to the left of the Propeller), allowing us to switch any combination of devices on and off the bus.

Multiplexer schematic
Multiplexer schematic
Picture of the multiplexer

Despite having very little space to play with, we were able to squeeze in a bit of prototyping area, which we’ve used to address errata.  For example, I found that I’d missed a couple of pull-ups on the i2c port that the propeller was attached to.  A bit of thin kynar wire to the rescue:


Having seen various tracked robots on Thingiverse and especially this amazing one, I thought we should try and implement Wall-E’s tracks ourselves.

We could have gone with a simple rubber band or timing belt (and in retrospect that would have been MUCH easier), but I really fancied seeing how far I could push 3D printed parts.

So I had a long browse through thingiverse looking at lots of track designs and started to draw up my own.  The FPV rover design had an interesting idea for fine adjustment – they used 2 different sizes of 3D printed pins to join the tracks together to make the whole thing slightly tighter or looser as needed.

In the end I settled on a design which had sprocket wheels mounted on either side of a supporting frame (to avoid nasty torques on the frame).  Obviously the layout of the sprocket wheels on the frame had to match the ‘real’ Wall-E, but I decided to make the sprocket teeth larger (and therefore stronger).

Then the track elements needed designing.  I went with a design which used the links between the tracks as the raised sections and the sprocket teeth sat in a deep well, but did not protrude from the other side.  Like this:

A matching pin is shown too.  After a few trail and error prints to fine tune the pin diameter, well depth, we got something that worked.  And then we needed to print about 36 of them per set of tracks (3 x 4 hour sessions of printing).

The final problem was how to connect these to the motor.  We wanted a fair bit of speed, so I’d ended up buying pololu motors with a 4:1 gearbox.  Having seen these run, I was a bit worried about the high speed, so wanted to gear them down a touch.  I found a bevel gear generator plugin in Onshape and ended up with this:

And that worked!

In fact running these is slightly terrifying – fairly sure if you got your finger in there it’d get a nasty nip…

Mad not-quite-HATting

With space at a premium in this year’s bot (it amounts to a squared-off Pi):

Pi overlaid with a square, showing the size of the enclosure

and because I fancied having a go at it, and, Lance had his hands full with the CAD work, we decided to design a custom PCB. It’s now on its way to us from Shenzen 🙂

Picture of our boards in bubble wrap
The board house sent us a photo when they finished production, which was a nice touch

The custom PCB needed to combine several functions that were separate boards and breakouts last year:

  • I2C mulitiplexer
  • propeller microcontroller for interfacing with the motor drivers/encoders
  • connectors for all the peripherals (IMU, motors and distance sensors)

along with some new functions that we wanted to squeeze in (screen and voltage sensors to monitor the batteries, for example).  I also thought it’d be a good idea to add some isolation and level shifting chips to the design so that we could better isolate the motors and support having noisy and clean power supplies.  Previously, we’d had gremlins that we thought might be down to noise and brownouts caused by the motors.

Since it’s pretty much the only game in town for open source PCB design (and Lance and I had used it before), we used Kicad to draw the schematic and then design the board itself.

We’ll cover a  bit more detail on the design in the next few posts but, if you are interested in making your own board, my number one tip is to punch “Kicad” into Youtube’s search box.  There are great how-to videos on there that guide you through the whole process.  My second tip is to search for “Kicad push and shove”; which will show you how to use the automatic layout tools.

Note about the title: while it fits on the Pi, our board isn’t a HAT because there are rules about what makes a HAT 😛  also, we’re mad to try soldering some of the chips we plan to put on there; they’re tiny :-O





PiWars 2019!

It was awesome to hear the launch of PiWars 2019 and we loved the space theme.  That led to a week of lunchtime brainstorming – what famous space exploration robots are there?  We ended up discounting most those as being a bit too spindly to 3D print.  So what else could we do with the theme?  What robots are there in space films?  And Wall-E was the obvious winner:

  • tracked – so uneven ground would not be a problem
  • boxy – so shape should be printable

But: The PiWars rules limit the width of robots and Wall-E has a fairly square footprint.  And a big chunk of the width is taken up by the tracks.  So were we going to be able to fit all the electronics into the body?

That has turned into an interesting challenge.  We were fairly sure we were going to use similar electronics to last year, but we were also sure that we would have to reduce the size of them.  Which means designing a custom PCB…

So the challenges we’re going to face:

  • making it look like Wall-E – arguably the most important thing!
  • mechanical design – 3D printing tracks to look like Wall-E’s is going to be hard
  • making the electronics fit into the tiny body – ideally with extra servos to animate Wall-E  🙂
  • Finding places to mount sensors at the right height for the challenges
  • Figuring out how to mount the attachment hardware
  • Plus all the unexpected stuff we haven’t spotted yet!