Progress on Feed the Fish

It was soon clear that our existing Nerf gun design was not well suited to the new shooting game, “Feed the Fish”.  The gun is designed to hit a target using a projectile trajectory which is as flat as possible; but the new game needs the projectiles to drop into the opening in the top of a box.  Also, the game is timed, and it is permitted in the rules to fire five projectiles at once.

We decided that it would be better to start again, this time with a catapult style device that could lob projectiles rather than shoot them like a gun.  Also, it could then fire five rounds at once.

This is a render of the first design, which is designed to be 3D printed:

Render of our Feed the Fish Catapult

We realised that the device should not be powerful, so it uses a rubber band (connecting the arm to the rubber band mount) to store energy.  The actual amount of energy stored can be adjusted by adding more bands or by tightening them.

The amount of travel in the arm can also adjusted with the trajectory adjuster.  The adjuster is mounted between two arced slots; if it is fitted towards the bottom of the slots then the arm moves a small amount, and the projectiles fly mainly upwards with little forward movement.  If the trajectory adjuster is fitted towards the furthest end, then the projectiles fly lower but with greater distance.  After a few test fires we found a good position, roughly halfway round the arcs.

To fire the catapult the servo lifts the trigger momentarily, releasing the arm.  Reloading is then a case of pushing the arm back down to tension the band and replacing the five Nerf “cannon” balls.  When the arm is pushed down the trigger automatically locks it in place, ready to fire.  Reload can be done quickly which was one of our requirements for the new design.

This system works well; once adjusted it frequently achieves five out of five shots into the aquarium.  But it does require that the robot return to the fire position very accurately.

Having the robot return to the same position rapidly might be difficult to achieve.  So, we designed a second version which includes a turntable and camera mount, the idea being to rectify small location inaccuracies by aiming the catapult autonomously with a vision system.

Here is a render of version 2:

Version 2 Catapult. Modified for Autonomous Aiming.

This version has the same catapult mechanism as version 1.  But it is mounted on a turntable which can be turned by the targeting servo.  A raspberry pi camera module is also attached so that the whole system can be rotated (by about +/-10 degrees).  This is a small amount, but we think it is about right for targeting a gun.

Version 2 also fires forward (version 1 fires sideways).  This is useful since it allows the robot to approach the firing position while measuring the distance to the aquarium with its forward-facing ToF sensor.

To begin with we will try to use PiDrogen’s odometry, ToF and inertial measurement systems to align the whole machine on the target.  But if this is too unreliable (i.e. too many shots miss) then we will write code to automatically target the aquarium based on camera feedback to make small turntable adjustments.

We’re pleased with the turntable design.  Assuming it works well we will adjust the Nerf gun to use it too.

Getting ready for PiWars@Home

So, what about all these new challenges then?  The new challenges for PiWars at Home were announced at the start of September 2020. 

As in previous competitions, there are several ways to perform each challenge with differing amounts of points available for each approach.  We will make every effort to gain maximum points for each round so will generally attempt the most challenging method.

Let’s look at each game:

Feed the Fish.

The rules say that the robot can be remote controlled or autonomous, but it is not clear if an autonomous approach yields more points.  However, the game is against the clock and it is possible that an autonomous machine could be quicker: delicate aiming by radio control can be time consuming.  For this reason, we will keep an autonomous design in mind.  To begin with we will try to use PiDrogen’s odometry, inertial measurement and time of flight systems to manoeuvre the robot from the loading to the firing location on the arena.  However, we might also use video guidance if the simpler systems are insufficient.

Since the game is against the clock, we will try to create a design which fires five rounds at once.  The design will also need to be quick to re-load (since we think the re-loading time is part of the game).  Finally, the launching mechanism will be based on a catapult so that projectiles can be lobbed rather than shot with a flat trajectory so that they can drop into the top of the “aquarium”.

Extra “artistic merit” points are available for a nicely decorated aquarium.  Since this is a robotics competition, we’re thinking automaton.  But only if there’s time at the end.

Tidy Up the Toys

Again, we will be seeking the highest scoring approach to the game.  This requires that the robot stacks the boxes using an autonomous control system.

We have a barrel lift mechanism that was built for the Eco-Disaster game in the 2020 games.  This works well for barrels and could easily be adjusted to lift the toy boxes (by changing the jaws).  But it could not lift one barrel and place it on another.  So, a redesign is needed.

The game is against the clock, so we hope to lift the red box, drive to the green, place the red on it, then lift both the red and green box and drive them together to the blue box.  Finally, the robot will lift all three boxes and deliver them; hopefully, this is quicker than delivering the boxes one at a time.

We’re thinking that we might take another look at the motor interface software; it will be useful for this challenge if the robot can be made to make smooth movements, i.e. where acceleration and deceleration rates are controlled.  This will be a nice addition to the robot in any case.

Up the Garden Path

This game is a variation of previous line follow games.  PiDrogen can already use video guidance to follow a line, although it has no code to resolve routes at junctions.  It would be fun to add this functionality, but video guidance is not the highest scoring approach to the game.

Instead we will attempt to provide PiDrogen with a speech recognition system; this being the highest scoring method.

Analysis of the route suggests that we could use a fairly minimal repertoire of commands; we propose to use directions based on the numbers of a clock face.  To follow the route the driver should say “three”, “two”, “three” to get to the start of the first curve.  Then the driver should say “anti” meaning drive around the semi-circular part of the curve.  The full set of words that should be resolved will be: two, three, nine, ten, anti and clock.  The robot can stop at the end of the course based on the front facing time of flight sensor.

We have a pair of Blue Tooth headphones with excellent sound quality.  We hope to be able to connect these to PiDrogen’s Raspberry Pi brain and have it resolve verbal commands since this is explicitly allowed in the rules.  We think this will be more reliable than mounting a microphone on the chassis where ambient noise is likely to be a problem.

PiDrogen is quick at following a line with the camera.  It is even quicker making moves based on odometry and the IMU.  We may have to choose between a fast time recorded using odometry / video guidance or a slower time using voice guidance.

DIY Obstacle Course

At the moment we don’t have much of a plan for the obstacle course.  But there are a couple of thoughts at this time:

  • We think PiDrogen is pretty good at moving over obstacles.  P19 did quite well in the obstacle-based challenges in 2019 and P20 has had many updates that should make it better still, such as improved ground clearance, a smooth underside etc.  We want to demonstrate how well our machine can traverse obstacles, so we need to develop a challenging course.
  • In this game we will not go for the maximum points approach (which is an autonomous machine).  Instead we will use radio control so that our chief driver can demonstrate his skills.

That’s all for now.  Next time we will get into detail about one of the new game implements.

Hello Again

Hmm.  Keeping this blog up to date is one of the trickier aspects of PiWars.  A lot has happened since the last entry, both with our robot build and in the world.  This year has rather taken the wind out of our sails (and everyone else’s I think). Throughout lockdown, and now lockdown 2.0, we’ve been very slowly working on our robot and now we are working towards PiWars @ Home. 

So, let’s start with where we had got to in March, the time PiWars 2020 was postponed.  PiDrogen2020 (P20) was looking pretty impressive sporting the re-designed Nerf gun for Zombie Apocalypse.

P20 armed and ready for the Zombie Apocalypse

P20 was ready to take on many of the challenges:

  • P20 is quicker and has better ground clearance than PiDrogen 2019 (P19) so we were confident it was going to perform well on the obstacle course.
  • We can now fit mecanum wheels.  Nathan had been practicing driving with them, which is pretty tricky to do well, ready for PiNoon.
  • We were excited to show our upgraded Nerf gun to the world for Zombie Apocalypse.  The new design is more accurate and powerful.  It is also easier to align as the laser sight can be adjusted with thumb screws (machine screws actually).
  • Everything was also ready for Lava Palava which was to be performed using video camera guidance; this was a straight lift from P19.
  • We were also fully prepared for Escape Route.  P20 has three time-of-flight sensors mounted in its face plate; one facing forward, one left, one right (as can be seen in the photo above).  These allow P20 to follow a wall and detect when the wall comes to an end.  The maze route was pre-programmed.
  • Eco-Disaster was a little behind the curve.  An arm was developed that mounts under the robot chassis and this worked well; it can easily pick up a barrel.  But the code was easy to defeat. A barrel could easily be knocked over if it were between another barrel and the delivery zone – more work was needed (or kind/lucky barrel placement on the day!)
  • We also needed to do more work for Mine Sweeper.  The plan was to mount a mirror ball above an upward facing camera.  Experiments showed that it should work and that the robot should be able to see the entire arena. The code was set up for mecanum wheels and looked ready to test.  However we never built the mirror ball mount or the test arena.

We were pleased with P20. It was on target to be a strong competitor for PiWars 2020.  But we can do better…P21 is coming soon.

To be the first to see it in all its glory, follow @PiDrogen on Twitter or subscribe to our blog.

Hardware Almost Finished.

The finish line is in sight for the hardware now.


We have hopefully gone through the last major redesign (number 7!) for this year’s robot.  The new design incorporates all the lessons from the test chassis and last year’s robot.  All that remains is to settle on mounting holes in the lid for the Nerf gun.

Printing has started.  Here’s the back controller module…


This allows us to select the game and provides start and stop buttons.  The bottom line reports the battery voltage and goes red when the battery is getting close to minimum voltage.  Connection to the Pi is via a USB port.

The face plate is also printed.  Assembly of the front module, which contains a lot of components (3 time-of-flight sensors, 4 LEDs with their drivers and a micro controller) can start soon.

Pi Noon Practice


Last year we didn’t do very well in Pi Noon as we were knocked out in the second round.  We decided to try to improve that this year.

To that end we have developed a “Pi Noon Simulator”.  The cylinder at the top bends when pressed and makes a connection.  This lights an LED via a pulse stretcher which counts as a “POP”.

We’ve got one unit mounted on last year’s PiDrogen and another mounted on our new mecanum test chassis.  We can now have unlimited games of Pi Noon without going through a shed load of balloons.

This really is a lot of fun!

Mecanum Wheel Trial

Since our last blog there’s been lots of progress.

IMG_0976We have drilled out the centres of the mecanum wheels and printed some new hubs.  This allows the gap between the motor and the wheel rim to be reduced so that the robot remains within the maximum width specification.  It also allows a common attachment method between the “balloon tyre” wheels and the mecanum wheels so that a wheel swap between games is viable.

We’ve all, but particularly chief driver Nathan, been driving the test chassis with the mecanum wheels installed.  We’ve been trying to imagine that we are in a PiNoon battle.  We try to always face the opposition then lunge at the appropriate moment.  Quite honestly it’s tricky.  Last year’s machine is easier to drive although it is not as versatile.  This is going to need some practice.

There’s good news though.  The 3D printed chassis is definitely robust enough.  This leaves us free to go through (hopefully) one last design pass and then to print the final version.

Hmm. One step forward, two back.


We built some electronics.  This is an Arduino Beetle driving four Pololu motor drivers (which are based on MAX14870 chips).  The lower board (which you can’t really see) holds a couple of DC-DC converters which convert our 4S LiPo voltage down to a nice smooth 5.2v for the Pi and the other electronic bits.  The Pi can talk to the motor driver board via the USB port and direct the speed and direction of the motors.  Well it should do anyway.

Unfortunately it doesn’t work.  The motor drivers (which are rated at 2.5A peak) report an error (which I think means “too much current”) so the motors just buzz rather than move.  On paper this should all work; the motors have a stall current of 1.4A.  But unless we limit the motor current to about 800mA the drivers refuse to play ball.

I’ve heard it said that you have to massively over-specify motor drivers.  Now I see that’s true.

We are not amused.  This is a setback.

Test chassis takes shape

Since our last blog post our test chassis has transitioned from the CAD world into the real world.  This chassis incorporates loads of experimental features:

  • It is all 3D printed.  Last year’s robot (“P19”) was mainly laser cut acrylic which turns out to be quite brittle.  So we’ll see if PLA can stand Nathan (who is an enthusiastic driver) at the helm any better than acrylic.
  • The chassis uses four independent motor drivers so that we can use the big balloon tyres for the obstacle course and mecanum wheels for PiNoon.  There might even be a third set of wheels that permit rapid and accurate skid-steer turns for the autonomous challenges.
  • Actually the motor drivers are also experimental.  At the moment P20 is equipped with (rather old fashioned) L298N drivers.  But we are going to try some MosFET replacements soon which shouldn’t need such large heat sinks.
  • We bought new motors.  These are about 50% quicker than last year’s and they’re quieter too because there’s less gearbox.
  • We’re also playing with a Teensy 4.0 to replace P19’s (much larger) Arduino Due peripheral controller.  This provides a USB interface which the Pi will use to control the motors and to get measurements from three time-of-flight sensors.  At the moment it is also interfacing to the radio receiver so that we can drive it around.

So the plan now is to drive it around a lot to see what breaks.  And we need to print some hubs so that we can try out the mecanum wheels.

Finally it feels like we have some progress!

That’s better…

Version 2 of the barrel lifter has now been printed and tested. The (horribly vague) cable connection between the jaws and servo of the first attempt has been replaced by a bevel gear mounted on the servo output shaft. The drive also incorporates a 2:1 reduction so that a half turn of the servo output equates to a quarter turn on each jaw.

I’m delighted to say that it works a whole lot better than it’s predecessor.