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! 




No comments:

Post a Comment