Wednesday, 14 April 2021

Nanny McPi Mark II

 After a bit of a slow March, we're back on to building, and have now completely rebuilt the main chassis. The obvious difference is the eyes and the new hairstyle.

She's starting to look almost human.  

The eyes have probably taken the longest time to plan and get right and we're still working on them. 

Originally we were going to use a single servo with a linkage to move both eyes left and right, and then possibly another servo to move them up and down. 

However there isn't that much space inside the robot, so in the end we decided to use 2 servos - one for each eye - and just have left and right movement. This will also allow us to move them independently for some different expressions. 

The eyes are mounted directly onto the servo arms - currently with a bit of blue-tac, but we're working on a more permanent fitting - probably involving some epoxy resin. 

The eyes themselves are just plastic, semi spherical, toy eyes. They came in a box of 8, so we had 4 different colours to choose from - dark blue, light blue, brown or green. Currently we've gone for green as they'll complement our final colour scheme. 

In order to get the eyes to light up, we cut a couple of WS2812b LEDs from a strip and stuck them to a bit of reflective plastic cut to size and glued to the back of the eyes. 

In remote control mode the eyes can be moved, and the colour changed, using the joystick on the controller. But they'll also serve a useful function. As we cycle through the different automated challenge modes, the eyes will change to a different colour so we know what mode has been chosen. 

Also - in the "Up the Garden Path" mode, the eyes will move to follow the line, and change colour if the robot gets stuck and needs some vocal encouragement. 

In the Tidy The Toys mode, the eyes will again move towards the target block, and maybe change colour to indicate which block we're looking for - as long as this doesn't affect the camera image at all - in which case we'll keep them white during the block location. 

Here are the eyes in operation:  

We've managed to make the eye movement quite smooth by running the servo movement code in a separate thread. The joystick sensor code sets the target servo angle based on the joystick position, and the background thread will smoothly move the servos slowly towards that target angle. This prevents the movement being too jerky.  

Now - we really must get back to the actual Pi Wars challenges! 

Monday, 22 March 2021

I Can 'C' Clearly Now ...

I was intending to move on from the Tidy The Toys challenge. However, after the announcement that this year's competition has been delayed I decided to revisit it. 

Wednesday, 20 January 2021

Time, time, time ....

So today it was announced that both Pi Wars 2021 dates have been moved from March to July due to problems of teams collaborating during the current lockdown.

Saturday, 2 January 2021

HC-SR04 - Every Microsecond Counts

In Pi Wars 2019 we had a lot of success with using HC-SR04 sonar distance sensors on our Sputnik robot. 

Thursday, 31 December 2020

Those Toys Won't Tidy Themselves!

Blogs are like buses - you wait all month to post one, and then three come along at the same time.

But what else are the Christmas holidays for if not working on Pi Wars and catching up on the blog. 

Moving in a Straight Line

In Pi Wars 2019 there were 2 tasks that involved moving in a straight line between two walls. To achieve this, we had sonar distance sensors on each side of the robot, and code that determined the angle we were travelling at and tried to correct it to keep within the centre of the two walls. 

Where Are The Toys?

For the "Tidy the Toys" challenge we need to be able to locate the different coloured blocks so we can move towards them, pick them up and take them to the target zone. Actually we're also planning to use another colour to identify the target zone. The only practical way of doing this is to use a camera and process the image to find the coloured blocks.