Tuesday, 16 July 2019

Competition Day


A bit of a delayed blog post this - but with the plans for next year's Pi Wars going ahead, I thought it was a good time to go back to it. I actually wrote the blog a few weeks after the competition, but didn't have the photos and videos to hand, so never posted it.



Well - we did it. We designed and built a robot for Pi Wars - and, as it turned out - did rather well.

In the beginner's category, we won the Canyons of Mars challenge, got the fastest time on a single run in the Blast Off challenge - and came 3rd overall, which exceeded all our expectations. In fact, bar a couple of operational issues, we had a robot capable of winning the beginner's category - which we were very proud of for our first attempt.


The Morning

We drove up to Cambridge the day before the event and booked into the Premier Inn. It takes just over an hour to get to Cambridge from our home in Berkhamsted, and we didn't fancy doing that on the Sunday morning. 

The boys struggled to wake up in the morning due to the clocks going forward, and after a short Mother's day card and present giving, we headed down to breakfast. I think we must have missed the other competitors - it was a bit late by the time we went down. 

Getting to the venue we were allocated a small room. Although this was apart from other competitors, this was good for the boys to just chill in between events when we weren't looking at other robots. The Diddybot team were next door so we did manage to have a quick chat with them. And - with our team T-Shirts on - we were recognised by a couple of teams we had chatted with on Twitter and the Discord channels.  

The Challenges

Space Invaders

Space invaders was our first challenge - and probably the one we were most worried about - our attachment for aiming was a little hit and miss (quite literally!) and we had mixed results in testing.
Anton - our 8 year old driver - was very nervous - he was a bit worried about driving the robot with people watching. I said that we could take turns if he felt uncomfortable, but in the end he had a great time. He was using the wrong joystick though for the 1st couple of rounds (we had one joystick for full speed movement and the other restricted to 60% power for more control) so a couple of the balls got knocked forward - but when we did get a ball aligned - it generally went in a straight line, following the laser sight and hit the targets. We think we got at least 2 targets in each round and finished in 9th place in the beginner's - which was as good as we could have expected really. 


Apollo 13 Obstacle Course

Again - another nervous wait for Anton. He was worried about the treadmill. But on every run he timed it perfectly - waiting for it to slow down just enough that Sputnik could make progress. Not once did we end up in the pit. Our fastest run was about 1m 37s with no rescues which gave us 3rd place in that event. We were very happy with this and were starting to believe we had a decent robot on our hands.



Pi Noon 

We were given a bye in the 1st round of Pi-Noon - so went straight into the 2nd round where we faced 'CodeBreaker' another beginner - so 5 balloons each.

Another bit of great driving by Anton and towards the end we had 2 balloons to their 1 with not much time to go. I'm ashamed to say I advised Anton to run away and let the clock go down for the win. However, to his credit, he ignored my advice and went for the knockdown. Unfortunately we lost first one balloon to make it one all - and then the final balloon near the end. 

We were out - but I'm proud of the way Anton drove and how he really went for the victory. It's an event where luck counts for quite a lot - and we had no preconceptions of how well we would do in this event.


Blast Off - the Straightish Line Speed Test

Next up - the first automated test. We were using ultrasonic sensors only for this challenge. The ones on the side were used to keep us centred within the 2 walls and the front ones mounted at 45 degrees were used to see the approaching bend and do a quick turn at the right place. 

Max - our 5 year old - was the official starter on this one. He started the run and it went round the bends perfectly getting towards the end and then - it stopped! The judges were suggesting giving it a push to get it over the line - but I managed to get Max to press the start button again and it carried on over the line. We realised that when practising at home the runs were a lot shorter - and once it got past any bends we had set up, we stopped it. On this run, Max saw it had got to the end, so he pressed the stop button, not realising it hadn't crossed the finish line. At least we knew the reason so I told him to just let it crash the next time and not to try and stop it at all. 

The next run was our fastest - at just under 10 seconds. The final run was similar, but had a bit of a wobble towards the end as it did a couple of extra turns - so was a little slower. 

Our second run was actually the fastest of all the beginners, so we were very happy with that. We came 2nd overall in the beginners at this event. Another great result.



Judging

With an hour before our next event, it was time to meet the judges. There was a bit of a queue, so had to wait some time. When it was our turn the judges had some appreciative comments about the looks and the build quality. 

We weren't expecting too much here to be honest - we really went for simplicity - and although we had cut out a nice shape for the top and sprayed it with metallic paint (a lot of people were surprised to find it was actually made of wood, not metal) - it was really just 3 pieces of wood with the motors and components screwed on. 

With joint 18th in technical merit and joint 7th in artistic merit, we couldn't complain about that. 

We also found out later we came joint 3rd place in the blogging competition - so that's another good result. I think it really pays to put in the time with the blogging - and its a great reference point looking back. 

Spirit of Curiosity 

This was the big unknown. But we had put big wheels on Sputnik specifically for this event and, with the powerful motors we were quite quick over the course. 

A bit of suspension may have helped us, but again, some great driving by Anton and we safely got 7 little stones to the other side - getting us joint 2nd in this event. Another great result.



Hubble Nebula Challenge

We were really looking forward to this event having done a lot of testing up to the day before the competition and had got some really good times. 

I went to the room about 30 minutes before the event to calibrate the Pixy2 camera on the calibration course. It was a bit harder than I thought to differentiate between the colours but by the time I had finished it was able to distinguish between them. 

So - on the first run we were very pleased to see Sputnik look around at the colours and then head straight for red. It went back to the centre and turned again - but then disaster - it went to the green instead of the blue. After that it couldn't find the next colour. 

We tried to recalibrate the camera using the button on the top - but after that it couldn't find any colour it was all a bit of a failure. 

The run to the 1st red was enough to get us on the scoresheet in 8th - but we had expected so much more from this event. 

In hindsight - I should have taken the laptop with us and calibrated it properly after the 1st attempt - but I thought I could fix it with just the camera itself. A lesson learned. 


Canyons Of Mars

Feeling a little despondent we went back to the pits to change the batteries and get ready for the Canyon's of Mars event. Svetlana suggested we do a quick test in the corridor. Personally I didn't see the point as we had done a fair bit of testing, but there's no harm in an additional test, so we ran it up against the door towards the wall where we expected it to turn left and carry on along the wall. 

It didn't - it turned right - then right again and came back the way it had started. 

This would have been a disaster. Our method of solving this challenge is very simple. When going forward we use the same code as per the straight line speed challenge to stay centred between the walls. Then when we sense the wall with the front sensor, we stop, look left and right to see which is the shortest distance, and then use a timed turn to turn approximately 90 degrees in the direction of the longest distance and keep going. As long as the 90 degree turn is there or thereabouts, the straight line centring code will put it back on track. That's it - repeat until the maze solved. We have some basic logging enabled in the software so we were able to see what the sensors were showing. It was giving us a reading of zero on the left sensor when we got to the wall. Generally this means that the distance is larger than the maximum so we should take it as the largest reading. However, whilst I had taken this into account on the right sensor, I hadn't taken it into account on the left. Our test courses at home were so small we never encountered this issue. A quick change to the code and it was working properly. 

Going down to the event, it worked a treat - the 1st run did touch the wall briefly as the robot turned, but the 2nd and 3rd runs were very clean and we won this event with a time of just over 15 seconds. 


Summary 

At the prize giving ceremony we were given 3rd place overall in the beginners which we were very happy about. Had the Hubble challenge gone smoothly, we could have done even better - but that's what competition is about - getting everything right at the time. 

Certainly the robot and the software we had were capable of winning the beginner's category - so we can be really proud of what we've achieved. 

We had no preconceptions about Pi Wars having never attended an event. When we saw the challenges we went for a functional design - to try and make a good all-rounder for each event. Knowing there was going to be some uneven ground we went for large wheels. This cost us the most anguish in the design - as we had to get new motors and motor controller to cope with the grip - but as it turned out this was a good decision and certainly helped in the obstacle course and spirit of curiosity challenges. Everything else we kept simple. Although there was a little complication in that we were using an Arduino for the ultrasonic sensor inputs -  this actually made things a bit easier as we could use cheap HC-SR04 ultrasonic sensors rated at 5v and plug them straight into the Arduino. 

The robot was pretty much built by January and the majority of the code written, so when we got the call in February to come off the reserves bench and enter the competition proper, we were well prepared - just fine tuning the software in the weeks before the event. 

Barring a couple of loose screws on the sensor mounts, and the aforementioned change to the Maze code, we had no real work to do in the pits. Most of the 2 crates of tools and spares we had brought were never used. 

What would we do differently? For our first attempt, very little I think. We had a robot that we think looked good and had the potential to perform well in all the challenges. I think just taking a bit more time before the start of each challenge to prepare properly would have helped. 

Overall we're extremely happy with 3rd place in the beginners. 

Next Time

After doing so well in the beginner's category I think that if we apply for another Pi Wars - in whatever form that may be - it'll have to be in the intermediate category. 

Watching the CNM Hackspace team from the US blast down the straight line speed track in just over 6 seconds means that the first thing to change is to put in faster motors.

I've also got some interesting ideas involving Servo motors - but we'll have to see if they're in any way practical. 

Watch this space ....

And Finally

During the development of Sputnik we kept a google sites website to keep track of setting things up. There may be some useful information on here - it's at http://www.sputnikrobot.co.uk.

Many thanks to Mike and Tim for organising the event and everyone who helped to make it a great day. 




1 comment: