Wednesday, 21 October 2015

ElMo's Cannon Takes Shape

This weekend we put the electronics mostly to one side and concentrated on some mechanical engineering.  It was time to construct our cannon.  We already have a tris10 kickball kit and they provided a CAD file to 3D print a mount that it can sit in.  We spoke to the family design engineer (aka the lovely Uncle Tone) and he got in touch with his ever so helpful friend Tim - who just happens to own a 3D printer.  A massive, massive thank you to Tim from Team ElMo for helping us out.  He even provided an action shot of the mount being printed
We spent the afternoon cutting and drilling the perspex that the mount would be attached to
The kitchen table got a little bit messy - but we did tidy up afterwards
 We eventually came up with something that ought to do the trick quite nicely
Alas, a tiny miscalculation means that the upper piece does not caress the bowling ball as snugly as we were hoping (ok - its miles off) - we might add some foam pieces to bulk that out if it helps.  And the casters we ordered did not arrive in time to fix to the base - they finally arrived yesterday.  So we don't have a moving cannon - yet.  BUT - we did test it using a raspberry pi GPIO pin to control the discharge - and that doesn't appear to have any adverse effect on ElMo (huge sigh of relief there) - so hopefully we'll soon be able to attach our shiny green and purple appendage to ElMo and try it out in anger!

We're nearly done with the construction of ElMo now - we'd still like to try adding an OLED menu screen and some select buttons.  And  then there is quite a bit of coding to do.  But we're getting there - and having fun doing it :)


Tuesday, 13 October 2015

ElMo goes ultrasonic

This weekend we managed to add ultrasonic sensors to ElMo.  We bought an UltraBorg from the PiBorg people, which made this very straightforward - although we did seek out some warm words of encouragement on their forum before starting.  Piborg also sell a mounting kit to hold an SR04 ultrasonic sensor, so we grabbed some of those as well.  Fitting the screws was a job for small fingers

We brilliantly designed the metalwork we added last time so the spacing was exactly the same width as the mounting holes on the ultraborg - or was that just a very satisfying fluke?!
Communication with the board is using I2C - the same 6 pin set up as the picoborg reverse, so we were able to just daisy chain this board in between the picoborg and the raspberry pi - simple.  The ultraborg would apparently need an extra power supply if we were to add servos, but this is not required for ultrasonic sensors, they can just draw power from the pi.  We fitted two sensors to the front (they are connected with the white/lilac/purple/blue wires in the picture above.  We may add two more on the side later, to help with steering in the straight line speed test.  Looking good :)
We also swapped the crazy breadboard connection to the line following sensor for some female/female wires in fetching rainbow colours - these came from robotshop.

We seem to be getting relatively reliable readings from the sensors, which is pleasing - I thought we might end up using an IR distance sensor instead, but actually these seem OK.  We wrote a little program that approaches a wall at full speed, drops to quarter speed when the distance is less than 300mm and stops when the distance is less that 30mm.  It might need some fine tuning and we may not get as close to the wall as some (apparently they needed calipers last year), but I think this is a great start.  Here's the video of take two - take one didn't go quite so well ;)

Next time we'll hopefully be harnessing the power of the cannon...

Thursday, 8 October 2015

ElMo - now we're moving

On Friday we took full advantage of a school inset day and cracked on with building ElMo - now the motors were soldered into place, the rest was pretty straightforward.
We powered up... and then wrestled with the PS3 controller for quite a while - it just wouldn't connect first time, but after randomly connecting via a cable and disconnecting again, we finally got the two paired and were able to run the example script that we downloaded from the piborg website.  Behold, a moving robot :)


After playing with our new toy for a while it was time to add some more hardware.  We were planning to incorporate a number of individual IR sensors for line following, but a recent MagPi article mentioned a 3 way sensor from Ryanteck, so we sent for one of those.  We cut some Vex aluminium to mount it
The line follower has 5 pins (Vin, 3 sensor outputs and Gnd).  At this point we realised we had no female/female jumper wires (some arrived today from robotshop), but we cobbled something together via a breadboard.  

The way the pi gpio pins are laid out we can attach 3.3v from pin 17, use pins  19, 21 and 23 for sensor inputs and pin 25 for ground - all in a neat row.  Note those are the physical pin numbers - the sensors are actually connected to GPIO10, GPIO09 and GPIO11

Once we power up, there are 3 leds on the top of the line follower board that go out to show when a line is detected, which is very useful.  There is also a variable resistor that can be used to adjust the sensitivity - keep turning until a black surface turns off the LED.  One of the sensors seems to be a bit more sensitive than the others - it might be a tiny bit too close to the ground?  So we may eventually swap this unit out for 3 separate detectors which each have their own variable resistor to adjust the sensitivity - definitely more testing required.  I'll post (and maybe talk through) the code another time, but we did get it working - like I say, it feels like we need to tweak things a bit, but overall we made good progress :)


Next time we will be adding some ultrasonic sensors to the front and thinking about attaching the cannon