Shepherds Pi Update

Earlier in the month I said we were dropping Shepherds Pi in favour of the other autonomous games.  Things have moved on since then…

To start with, we finished videos of the other two autonomous games that could be submitted.  I think we will probably attempt new videos of both; we can certainly get them slicker, but I’m happy for now.  This made Shepherds Pi the new priority.

Secondly, I re-tuned the robot motor control PIDs and dead reckoning system.  I think the tuning required for tracks is not the same as the tuning that was carried through from last year’s (wheeled) robot.  The robot now moves about the arena more accurately.

I added several coloured discs around the arena to provide additional localisation opportunities during the game, see below.

This image has an empty alt attribute; its file name is targets1.png

The “sky” on the sheep decorations was removed; this had been the original localisation target for the robot but was rather error prone.  A yellow band was added which is a more robust target. 

Originally, the pen was made from Lego train track pieces connected to 3D printed supports. However, these were about 10mm longer than required which made the entrance to the pen about 20mm too narrow. That 20mm was proving to be important, but I couldn’t bring myself to cut the tracks down. Instead I designed and printed some new pen walls; they were made to look suitably aged to fit with the “Old McDoofus” theme. Actually, they are derived from the trough planks I made for “Feed the Cattle”.

The original Lego pen fence.
The new 3D printed, regulation-length fence.

We now have a video of Shepherd’s Pi being performed autonomously, although we are not even close to being able to perform the target three rounds.

The next step is to re-film the challenge with the whistle detector installed.

Evolution of an Apple Picker

Four candles

Our apple picker uses fork like prongs protruding to the front of the robot. The robot drives up to the tree, guided by the camera looking for the apple on the middle branch. The prongs dislodge the apples which (hopefully) drop into the chutes below.

However, this wasn’t all that reliable to start with; sometimes the apples were knocked in front of the robot, or they were not dislodged from the branch. So, the design of the forks went through several iterations in an effort to improve the performance of the system.

The final design (in the right of the picture) doesn’t make direct contact with the apple. Instead, a piece of insulation tape is attached across the prongs. The more compliant nature of the tape seems to be just the job to knock the apples without bouncing them forwards.

Today must be my lucky day….

Last year’s Feed the Fish Controller and a microphone preamp circuit

It turns out the last year’s feed the fish controller (on the right in the picture), combined with a little microphone preamp board (on the left) that someone bought for my birthday years ago, should work as a whistle detector!

I reckon my stars must be aligned or something.

I’m off to buy a lottery ticket…

Sheep-pen-ator Version 2.

In early May it became clear that our attachment for Shepherds Pi wouldn’t work because the combined length of the robot and attachment was too much to permit a turn within the delivery pen.  So, here is the new version:

Perhaps Doofus should have a hard hat?

As you can see, this version can lift the sheep completely above the body of the robot; thereby not increasing the overall length of the machine.  In this configuration the robot is (just) able to turn within the pen.

This version has the added advantages that it can place a sheep over the fence of the pen, and it lifts the sheep out of the view of the camera.  However, it can only lift a sheep from the side (version 1 could lift from the side or from end on).

We did some experiments with the new lift, and it works well.

There’s a lot to do to get this game working though:

  • For now, the video guidance system aligns on the “sky” around the sheep.  However, there’s more blue around the head end of the sheep graphic and this pulls the centroid of the colour away from the cuboid centre.  Sometimes this causes a rather “lop-sided” lift of a sheep, although the lift still doesn’t usually drop the sheep.
  • The bigger problem is that the arena is too crowded for our control system.  In most games the rather vague nature of our dead reckoning system can be countered by the camera and ToF sensor.  But in Shepherds Pi there is need for more manoeuvres between visual guidance opportunities and this usually results in the robot displacing play pieces inadvertently.

We’ve decided to stop further work on this game for the time being.  We will prioritise the other games and videos, then use what time we have left to have another go later.

Nature’s Bounty Update

There’s been some progress this week on Nature’s Bounty. The Apple picker has been printed and assembled, and the game play code has been written.

After some (read “a lot of”) adjustments we managed to get a video of the robot picking 24 (of a possible 36) apples within the allowed 5 minutes.

There’s still work to do though:

  • Sometimes the apple picker knocks some of the apples to the floor, other times an apple remains on the tree. We are going to try further adjustment  to the design of the “fork” to make things more reliable. 
  • The number of apples picked isn’t all that clear on the video. I think we will unload the apples into a container so that they can easily be seen and counted by the judges on future videos. 
  • Finally we will create a second set of apples (i.e. glue washers to ping-pong balls). As with Feed the Cattle, the manual preparation of the game is a big proportion of the entire length of the video. You need the mindset of an F1 pit crew for PiWars 2022!

Arena Props

As you know (hopefully), we have made a big effort with the aesthetic aspects of our robot this year.  However, we have also tried to make our arena and game pieces look the part too.  Here are some details…

The Arena

There’s a slightly cartoon look to PJD, so we have carried that through into the arena decorations.  We downloaded some cartoon tree images then created landscape images for the back two walls of the arena.  Exeter FabLab has a large format printer that was able to print the images 300mm high and 1,500mm long.

Images for the back two walls of the arena.

Nature’s Bounty

Simon, who is more artistic than the other members of the team, painted the Nature’s Bounty tree for us:

The Apple Tree

Shepherd’s Pi

We decided to make a “net” to make the decorate the sheep cuboids.  To achieve this, we created a 3D model of a cartoon sheep in Fusion 360 then took an image from each direction.  These were stitched together with some sky and grass and printed. The sheep cuboids are 3D printed in white PLA, then the paper nets were glued on with PVA.

The wolves were just a straight download from the internet.  Again, the standee structures were printed in PLA and the image attached with PVA.

3D Model of a Sheep
Side and top elevations projected from the model
Do you think the sheep looks nervous?

Feed the Cattle

The trough parts rendered by Fusion 360

Some aged, cartoonish planks were modelled in Fusion 360 then constructed into a face of the correct dimensions for the troughs.  The same face was printed in blue PLA for each face of the trough.  A red band was printed in PLA for the half-full line, then the whole lot glued together.

A finished trough

Hopefully we’ve made the game pieces look nice, now all we need to do is get the games working properly!

Ro-Bovinator Mk3

If you follow this blog, then you’ll know that there have been two designs for the Feed the Cattle mechanism; a hopper with doors and one based on an Archimedes’ screw.

Well, now there’s a third (and can I say final?) version, which has been inspired by the work of a couple of other teams from the competition.


Mk3 uses a rotating drum containing three individual hoppers as used by the East Devon PiRates ( The flow of rice is controlled by a sliding mechanism which is how I think M0o+ ( do theirs.  My design is a mixture of the two; the hopper rotates so that the bottom of the hopper aligns with a hole leading to the pipes.  So, one servo presents a new hopper and in doing so opens the flow of rice.

I decided on a re-design for two reasons:

  • The Archimedes system was a little slow, taking more than 10 seconds to make a delivery.

    Mk3 makes a delivery in around 3 seconds.
  • But more importantly, I didn’t have confidence in the amount of rice being delivered.  It appeared that I would have to time the delivery differently for the three different troughs.  I could imagine having to make lots of videos to get nine perfect deliveries in a row.  And if I lacked confidence then so might the judges.

    With Mk3 it is easy to be sure how much rice has been delivered.  So long as all (or at least most) of the rice goes in the trough then the perfect amount has been delivered because each hopper holds the right amount of rice plus 20%.

The design uses two down pipes to direct the flow of rice to the trough.  This is so that PJD’s radiator grille mounted camera can still get a clear view of the trough (although the last bit of the drive is blinded by the bottom chutes).

In operation PJD deliberately crashes into the troughs so that two front mounted prongs can align the trough with the robot before the delivery takes place; this means that diagonal approaches to the troughs still work.  As delivery takes place the robot turns the hopper back and forth through about 10o to make sure the rice doesn’t stop flowing.

During the design process I wanted to measure the volume of rice held in each hopper.  But I couldn’t see how to get Fusion 360 to tell me the volume of a void.  Two minutes on the internet provided the answer; create a solid then use the hopper as a cutting tool to shape the new solid to the shape of the void (and hence the rice it could contain).  Fusion will then tell you the volume of this new body.  I could then extrude the top of the design until the volume was exactly 300,000mm3 (this being 20% more than the volume required to half fill a trough).  The picture below shows the shape of the rice held within each of the three hoppers.

The shape and volume of the rice held in each hopper.

This system works well and an initial video is “in the bag”. All we need to do now is make a new video where the human elements of the team don’t dilly-dally quite so much!

Good and Really Bad News

It’s been a mixed weekend.

First the good news…

The good news is that my test on an Archimedes’ screw-based cattle feed delivery system went well.  I’m now printing the remaining parts (a hopper and a chute) to complete the build.  (Actually, that would be half a build; I plan to use two of them.)

Furthermore, it seems that it should be possible to deliver a measured quantity of feed based on the motor run time. It may not be as quick as some of the other systems I’ve seen, but I like the idea of an Archimedes’ screw.

Now the not good news…

Hmm. Can’t make that turn.

The bad news is that the Sheep-pen-ator is not fit for purpose.  My plan had been to drive into the pen then have the robot make a right-angle turn in order to tuck the sheep into the corners of the pen.  However, the picture shows that it will not be possible to make the turn as the robot will still be in the gateway.

It feels late in the competition for such a fundamental problem.

Sheep-pen-ator Fails

Version 1. These gears jump under pressure.

This is the sheep lift I built for Shepherds Pi.

Unfortunately, it doesn’t work.  The right-angle drive shown in the highlighted circle (which is made of Lego parts) is used to grip the top of the sheep.  However, the shaft that carries the drive from the servo flexes when too much torque is applied.  This results in the gears jumping and the mechanism loses synchronisation.  The system is unable to apply enough grip to lift the sheep.

I have reworked the design so that the shaft is supported between the servo drive gear and the right-angle drive.  While I was at it, I added a mid-support for the shaft that holds the jaws of the grip too.

Version 2. More support for the cross shaft.