2020 Pi Wars Robot Theme Reveal

We thought it was about time we revealed the theme that we've gone with for our Pi Wars 2020 robot. With the general theme being "Disasters", we've decided to adopt the theme of a zombie outbreak response team.

A team of roboteers have acquired an old van and converted it into a zombie outbreak response vehicle, equipped with all of the tools required to rid the planet of marauding zombies and to generally make the world a better place.  

The body is 3D printed in four sections and took about 32 hours to print. The original 3D model was a copy of the Tamiya RC tuck Vanessa's Lunch Box but we've made quite a lot of changes to that design, for example we've chopped a big section out of the middle to make it fit our wheelbase. Once all of the sections were printed, we bonded them together and filled the seams, before finishing with acrylic spray paint and some themed decals. 

All in all we're quite pleased with the results.

Direction Training - Magnetometers and Gyroscopes

For what seems like far too long, we've been stuck on trying to teach our robot which direction it's facing in and change its direction based on this value, well, that was until now. 

For previous years we've used sensors to measure distance, both ultrasonic and laser-ranging TOF (Time-of-Flight) flavours, and these have proven very useful with challenges such as maze navigation. Last year we managed to achieve quite a good time in the maze but to say we were "winging it" would be a bit of an understatement, not so much with keeping away from the walls, but certainly in terms of which direction to take. Rotation was, for a want of a better word, blind. The robot was simply instructed to spin left or spin right for a period of time, but this is, as you can imagine, fraught with a number of issues. If the battery was a little low it wouldn't rotate enough and if it was freshly charged then it would rotate too much, then you have to take into account the grip of different flooring, how clean the tyres are etc etc. Of course, fully balancing the voltage to the motors would have solved some of that, but nowhere near enough to make it reliable and consistent to a level that we'd be happy with.

So this year we were keen to improve on that by giving the robot the ability to know which direction it was heading in. For us, the obvious first choice was to use what would effectively be a compass, which we'd achieve by using a magnetometer. It's fair to say that we spent quite a lot of time this year trying to get two different magnetometers to work, in fact we'd spent quite a lot of time fighting with them last year too. I have seen others achieve good results with magnetometers (not necessarily Pi Wars people), so I know it's possible, but sometimes you simply have to admit defeat, especially when the Pi Wars date is fast approaching. 

After conceding defeat to the little magnetometers, I reached out to a good friend (you know who you are and thank you once again) and they recommended that I try the BerryIMU v2 - Accelerometer, gyroscope, magnetometer and barometric/altitude sensor from https://ozzmaker.com, which if I'm perfectly honest is a little overkill for what need at this time, but I wasn't messing about now as this is beginning to hold up our progress quite a lot. 

Needless to say it works very well for us, with the key factor being the abandonment of the use of any reference to magnetic north and simply using the BerryIMU's built in Gyroscope. TOF sensors determine if the robot is square to a wall and the Gyroscope determines how much to rotate in relation to its current heading.

Below is a video of us testing 90 degree rotation and despite very little adjustment and tuning, it's proven pretty accurate so far.

We still have quite a lot more testing and coding to do to fully prove this concept, so tomorrow's blog post might be entitled "Direction Training - Back To The Drawing Board", fingers crossed that we've cracked it though, as this will open up quite a lot in our automated challenges.

Finally, the masking tape mounting of said BerryIMU is hopefully just a temporary solution.

Teaching Some Spatial Awareness

Recently we've been focusing a lot on re-writing code and creating our own libraries, with the hope this will smooth out the process of writing the rest of our code. For instance, we have today been creating libraries for sensors and motor control and calling upon those libraries to have the robot navigate autonomously. 

As we are sure you'll appreciate, this process takes a lot of work before you see any results, but when the results do come, they come quite quickly (Hopefully). That's certainly been the case today. 

We've spent the past few days working on the library for the sensors and have had little to show for it in the "real world", but today this has all come together and we've managed to get the robot to be aware of it's surroundings and adjust itself accordingly. 

Below you'll find a little video of the robot being put too close to a wall and it adjusting itself away from the wall and resetting itself to point directly forward.

It's far from perfect, but we're very happy with how this part of the project is progressing.

Trying to make sense of it all

Today we are tackling the installation of the VL53L0X Time-of-Flight (ToF) laser-ranging sensor modules. The plan is to use five in total, with one up front and two on each side. 

These have been incorporated into the front and rear bumpers to try and save space and this seems to put them at just the right height for what we're aiming for. 

We are yet to wire them all up, but that should come soon. We're expecting to need these for all of the autonomous challenges, so they are a vital part of the build.

Laser Pointer - Batteries Included, but not Required

One of the improvements we wanted to make this year, was to the laser pointer we used for our cannon. I had the bright idea of buying one last year that had a cross hair, I thought this would really help with aiming, it didn't. It was next to useless as you could barely see it on the targets (see below).

So, the cross hair one had to go and I've opted for something a little more conventional.
Below you'll see I managed to find one on eBay for just under £2.00. Of course despite it being listed as coming from the UK, it came from China, but to be fair it was here in just over a week, so I'm not too fussed.
 

I wanted to be able to turn the pointer on and off remotely and to have it powered from the robot. So we set about dismantling it and working out which components we needed to keep and which ones we could discard. The following photo was taken after I'd already started soldering the wires on, I remembered half way through that I was supposed to be blogging about this :)

As it happens, we managed to discard most of it, including the white LED, the buttons, key ring and of course, the batteries. Soldering new wires onto the board was quite fiddly and I manged to damage a surface mount resistor in the process, but this was quickly resolved with a through hole resistor used inline. 

We cut the aluminium tube down a little and finished it all off with a little white heat shrink tubing, just to make it look pretty.

All in all, I'm quite pleased with this little modification. Granted I've not done anything ground breaking here, but it's a definite improvement over the aiming method we had last year. Will it help us hit 100% of the targets this year? Who knows, I guess we'll find out.

Build Update - Bumper Edition

We've tried to give our robot a reasonable amount of ground clearance, but this has created a slight issue when it comes to mounting our VL53L0X Time-of-Flight ranging sensors, if we mount them to the body they'll sit too high and might end up looking over the walls in some of the challenges, this is clearly far from ideal. 

Another possible issue that I foresee is damage to the little gearboxes on the micro metal gear motors that we use. These little gearboxes are pretty fragile at the best of times, but we've opted for larger wheels this year, putting even more strain on them. I don't think it would take many bumps into a wall to cause problems. 

So, how do we solve these issues? Well, hopefully we've solved them with a single solution, Bumpers. 

The thought process behind this is we install bumpers to protect the wheels and gearboxes against collision damage and we make end caps for the bumpers which we can then mount the sensors to.  

Will they work as planned? Who knows, but there's only one way to find out. 

New Year Update 2020

And we're back. 

Things have been hectic at Team Currington HQ but we've still managed to get quite a few things done on the robot, we've just not managed to post about it, until now. This was also compounded by the fact that I (Matt) have been kinda taking a break from social media and the like. 

Anyway, over the past few days we've been working on adapting and modifying the cannon. We've managed to mount it on top of the robot for this year, some of you may remember that we made a little trailer for it last year and towed it along when it was needed. 

For this year we are looking to refine the controls and even automate part of the aiming process. We're also looking to replace the laser pointer with one you can actually see. 

We're also looking to re-print most of it and tidy up a few things.

Barrel Lifter and OpenCV Progress

If you follow us on twitter (@teamcurrington) then you will most likely have seen the revised barrel lifter in action, we've used a combination of servos and control arms to clamp and lift a single barrel. Whilst we've not done anything ground breaking here, it seems to be working pretty well, all things considered. We have a few cosmetic things we'd like to improve on, but that can certainly wait for the time being.

In case you've not seen it already, here are the barrel jaws in action.

So, moving on from the hardware stage, it's time to get back to the software and writing some more code. We have the code for our motor and steering control, We have OpenCV setup and working just fine, we have the The Raspberry Pi Camera Module v2 identifying red and green barrels and identifying which one is closest. All we need to do now is make all these aspects work as one.

Fortunately we have an expert on hand to assist.

The plan for the weekend is to get the robot moving towards the locked on barrel. Wish us luck :)

Eco Disaster Automated Barrel Collector

This week we've been putting most of our focus into what we feel is the most challenging of challenges in Pi Wars 2020, the eco-disaster challenge.

A number of coloured drums are scattered inside an arena, red ones are toxic and green ones are clean. The robot has to be sort and deliver each barrel to the correct zone within the arena.

*If we take on the big one first, then the rest will be easy, right?

As mentioned in a previous post, as we're competing in the intermediate class, we don't "have" perform this one autonomously, but there are extra points to be had and we're not ones to shy away from a challenge. Maybe foolish, maybe brave, but in either case, we're going for it.

Despite quite a lot of time and effort having been invested in this one already, we're still very much at the research and development (Trial and Error?) stage and one thing we're really trying very hard to achieve is to keep it as simple as possible, the fewer moving parts and fewer electronic components "should" give for a more reliable operation, well that's the theory anyway.

There is still a lot to do and this section is far from finished, but the objective this week was for the robot to identify when a barrel was inside the jaws, pick it up, hold it and put it back down. So considering that was this week's target and we've got there, albeit in a bit of a clunky way, we're pretty pleased with the result. 

So, without further ado, here are the jaws operating totally autonomously 

*Make no mistake, we don't believe this for one second :D

It wont look like this when it's finished, we promise

Over the past few days, we've been mainly working on the hardware side of the eco-disaster challenge and to be totally honest it's snowballing in to a much bigger task that we anticipated. Despite not having to carry out this challenge in an autonomous way (We are entered as intermediates) we are aiming to score as many points as possible, so Autonomously is what we're aiming for. 

The main issue to overcome at the moment is detecting when the barrel in close enough to the robot to be picked up, the first idea was to use a micro switch, but this might not work on the day as we found that if the barrel was on a smooth surface then there wasn't enough friction to prevent the barrel from being pushed along by the micro switch without actually having enough force to trigger the switch. The level of surface friction is understandably not published on the Pi Wars Website, so it's too much of a risk to rely soley on micro switches in this instance, we're still at the drawing board with this one.

We have managed to print the jaws and work out the geometry of the levers that act upon the jaws, but at the time of writing this we've not worked out exactly how we're going to open and close them or how we're going to lift the barrel once it's loaded in to the jaws. 

Anyway, here's what the Team Currington robot looks like today.

Needless to say, It wont look like this when it's finished.