Thrust Bearings

We discovered in testing that the main gear of the robot was being pushed away from the motor bevel gear far enough that it was causing the gears to slip under high load (e.g. turning the robot quickly on carpet).  This was causing our heading-hold code trouble too, which would affect our accuracy in the autonomous events.  Here’s a video demonstrating the problem – listen for the clicking noise at start and stop:

The usual solution to this problem is a thrust bearing – normal bearings are good for taking load in a radial direction (like supporting the weight of the robot through an axle).  A Thrust Bearing is good for loads along the axle.

A quick google showed that suitable bearings would cost 9 pounds each.  And we’d have to modify the track frame and drive cog to use it.  At that point Shaun asked “Why don’t you just print one?”.  Why not?  A quick browse of thingiverse turned up a couple of examples of them – suggesting airsoft BBs as ball bearings.  A quick play in Onshape later and I had modified the track frame and drive cog to have a channel for the BBs and a cover to prevent too much dirt getting in.  And a couple of 4 hour prints later, we had a pair of these:

They go together like this:And spin beautifully freely:

Onshape

This years robot is a milestone for us in terms of the amount of 3D printing that has gone into it.

It started last year with the discovery that you could design really complicated things (that worked!) when we made custom mecanum wheels.

So this year we designed tracks, brackets, nerf dart shooter and even thrust bearings!  And all of this has been done in Onshape.

Onshape is a web based parametric CAD package.  It seems that the hobbyist community mostly uses Fusion 360, but for us that was a non-starter because it is Windows only, and I no longer have *any* Windows machines.

Onshape works completely in your web browser and stores its data in the cloud, so I can drop into it for a quick design session from work or at home without having to install anything.  And with their android app, also while commuting on the train.

They have a plugin system too for people to write custom tools when the existing ones are insufficient.  This year we used Nut Pocket (which generates pockets for nuts, so that you can use standard fasteners in your 3D prints) and Bevel Gear Generator (which generated our main drive gears).  

Assembly!

 

Its always amazing how much you learn when you actually attempt to assemble the robot.  There’s always something you forgot, no matter how careful you were in design…

Fixed missing pull up resistors on one of the I2C lines.
We got lucky and this cable was exactly the right length! All the others needed work though.
Not enough clearance for the screen connector
Voltage/Current monitors too close together
Lower profile capacitors so that it actually fits in the case!

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.

Tracks!

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…

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!

 

More Peripherals

Following the posts on servos and distance sensors, I thought I’d talk about the other peripherals we’re adding to Tigerbot.

A screen is an under-rated part of a PiWars robot.  Its really handy not to have to cart a laptop around with you between events and have a way to check that the robot is in the mode you think it is (ask me how we know!).  We found this little 128×64 pixel screen on ebay based on the SSD1306. And Adafruit has a lovely tutorial on how to use it.

It can be controlled over either I2C or SPI (just set the pattern of resistors on the back).  With this, you can write your code to have a menu of “modes” (one for each event) switch between them using buttons on your controller and display the mode the robot thinks you’re in on the screen.  No more laptop on the day!

  • Another handy peripheral is an IMU.  This is a combination Gyro, Accelerometer, Barometer and Thermometer all in one.  Of most interest to us is the Gyro.  This is a rate gyro – it tells you how fast the rate of rotation is changing (and NOT the absolute rate of rotation).  This is a 3-axis device – it tells you about rotation around the X, Y, Z axes.  To use it you generally have to calibrate it first – with the robot still and stationary, you take readings from each of the gyros for a while and record the output.  These are your zero readings.  All future readings from the gyro need to subtract the zero readings.  The zero reading can vary with battery voltage and temperature, so be sure to re-calibrate it just before you use it!  Now you can turn the rate into absolute rotation by taking lots of readings and integrating them.What use is a gyro?  There are a couple of obvious events that could use a gyro:
  • Straight line speed test
    • here you’re trying to keep the robot pointed in the same direction all the way to the end
  • Minimal maze
    • for checking that your turns are exactly 90 degrees (if you’re using wheel rotations for this, how do you know if the wheel has slipped on the surface?)

Chassis V2

After some testing (read repeatedly trying to make it do the minimal maze!) we’ve realised that the chassis is very stiff. This means that usually only 3 wheels are touching the ground, which means our turns (and, ahem, straight lines – Shaun) are more variable than they should be.

Solution is to saw the chassis in half 🙂 We’ve separated front and back into separate sections and joined them with a hinge so that the front and back can twist slightly compared to the other end. We’ve added limiters to ensure that it only twists up to 10 degrees of movement so that the obstacle course doesn’t break the robot!

Here’s the print in progress:

And with the rest of the robot installed into it:

Initial testing indicates that the new twisty chassis works better, so that makes me feel much better about totally rebuilding the robot just 2 weeks before the event!

 

3d printing

This year I’m lucky enough to have access to a 3D printer.  These things are amazing.  It is incredible to be able to design something in CAD and then have it in your hand the next day.

Our process has been design the whole robot in a web-based CAD package (like Fusion 360).  As an aside: OMG – web based CAD!  I can’t believe it exists and is free!  Hat tip to Tom Oinn (@approxeng) for introducing me to the idea of it.

CAD allows you to see how the whole thing is going to fit together before you’ve spent a single penny on anything ‘real’.  Once you’re happy with the design, you can download an STL file (the 3D model of the part) and load it into your slicer software.  The slicer’s job is to turn the 3D model of the part into a list of movements of the print head (aka g-code).  It is here that you decide what the infill of the part will be and if you need any support material, etc, etc.

You then send the g-code file to the printer – in our case by copying it onto an SD card, though I’ve recently set up Octoprint on a spare Pi, which gives me a web server to control the printer (i.e. upload g-code files, start prints, etc) and a webcam so I can watch it work while I’m at work.  Prints take HOURS.  Our V2 chassis took 12 hours to print – which is why being able to monitor prints from work is awesome.

Nothing beats being able to discuss and modify the design of a robot part at lunchtime with your team-mates, then kick off a print and be able to bring in the finished part the next morning to hand over and have them try it out on the robot that evening.

3D printer prices have dropped massively recently – my machine is a slightly more expensive one (a genuine Prusa i3 Mk2S kit for those who care) but clones of this machine can be bought for £100 now!  Note that the cheaper kits often take more time to get “dialled in” than the more expesive kits – you need to decide if you are time-poor or cash-poor…

As for running costs, printer filament (usually PLA) costs about 25GBP per kilogram reel.  My slicer (slic3r) tells me how much filament will be used to print a part, and our biggest part (the chassis) used about 7GBP worth of filament.  I think we’ll end up using most of a reel for Tigerbot and 25GBP is cheap compared with all the electronic parts, and is MUCH cheaper than if you buy ready made parts (wheels, etc).  Speciality filaments like the rubbery TPU can be more expensive (we’re using TPU for the tyres).

Peripherals – Servos

So two of the PiWars 2018 events suggest using servos to operate something: duck-shoot and golf.

Servos have been around for a long time and have a very simple interface.  About every 20ms, you need to send them a pulse.  That pulse needs to be between 1ms and 2ms long.  A pulse length of 1.5ms will cause the servo to move to the centre position, 1ms and 2ms correspond to the two ends of travel.  Note that some servos can move beyond these limits, and some can be damaged if you drive them beyond these limits!  If you fail to send a pulse every 20ms, the servo will power down (stop actively driving the motor to a particular position).

See https://www.raspberrypi.org/forums/viewtopic.php?t=46771 for more details and Pi driven solutions.

In Tigerbot, our servos are driven by the Propeller Hat.  This is a microcontroller with 8 cores.  It takes some of the load off the Pi and because it isn’t running an operating system, it is possible to *guarantee* pulse timings.  Our controlling Pi then sends desired servo positions over to the Propeller using I2C, then the Propeller sends servo pulses.  Here’s a demo: