In order to meet the challenges for Pi Wars 2018 we took a modular approach to the build so that we could add / remove various attachments for each of the challenges. This meant that we wouldn’t have to worry about carrying superfluous hardware that wasn’t being used for a particular challenge.

As soon as the list of challenges was released we set about making the various attachments required. The first of these to be finished was the attachment for slightly deranged golf. This consisted of a servo being attached to a pivot-able arm to allow capture and release of the golf ball and to follow the undulations of the course.

This was a lesson learned from the previous competition as we had used a fixed position servo mounted on the front of the bot the severe slope at the start of the course allowed the golf ball to escape under it and roll away down the course!

After the golf attachment we turned our attention to one of the new challenges for 2018, the duck shoot.

For this we decided on deploying a Nerf gun. There were many models to choose from but we tried to find the smallest one that had a cartridge of ammunition. This decision was led by the rules of the challenge that stated that during each run the clock didn’t stop if you had to reload. This meant that having to reload between each of the 5 shots was going to add considerable time to each run and therefore would mean that we were uncompetitive on time.

With the hardware identified and acquired we took a Dremel to it to try and take some of the weight out of the gun by taking off bits but leaving anything that had a functional purpose intact. For simplicity we left the motors, barrel, ammo magazine, battery compartment and firing mechanism in the gun.

In order to fire the form darts we attached a servo to the firing mechanism to replace the manual trigger that the gun came with and mounted a relay on the gun to enable us to control the motors spinning up and down from the Pi and soldered a red dot laser diode into the loop so that we could see where we were aiming. Unfortunately we didn’t get this right first time as it was a 5V diode being powered by 6V. Initially this worked OK but it stopped working after a while, whoops. When we had bought a new one we added a resistor to ensure that we wouldn’t be overpowering it again.

The gun was then mounted on a pan / tilt bracket that would be controlled by the Pi top allow for aiming of the gun at the targets.

The other challenges that required attachments were minimal maze, over the rainbow and straight line speed test. For these we decided to use three IR distance sensors and a Pi Camera V2. To mount these on the robot we built a box section that could fit in place of the omni wheel on the bot and we would run the bot in reverse so that these sensors we on what would now be the front of the robot.

To reduce the processing on the Pi we hooked the IR distant sensors up to an Arduino so that this could be constantly measuring the distance from the front, left and right of the bot. The Arduino would then send these measurements over USB to the Pi and the Pi would use the latest readings when required in the code. The IR distance sensors were chosen for their operating range of 4cm to 30cm and were the Sharp GP2Y0A41SK0F. The Arduino used was an Arduino M0 Pro that was picked up at Pi Wars 2017 from the bargain bin on the Rapid Electronics stall for the princely sum of £5. At the time we didn’t know what we were going to use it for but at that price we couldn’t say no.

The camera was mounted on the box section as well as that was going to be used in combination with the distance sensors for the over the rainbow challenge. Under the box section was a ball bearing to allow the robot to still retain its manoeuvrability. With the attachments built our attention turned to producing the code for the robot.