Saturday 13 February 2016

Robot hand...

As with all projects I got slightly sidetracked. I was watching You Tube for general robot building ideas, then I came across a robot hand. Mmm this looks interesting and perfect for the 10 micro servos I had ordered from Amazon when I was drunk. We ended up watching bird-strike tests on Rolls Royce Trent Aeroengines - funny old You Tube.

A special trip to B&Q was undertaken specially to buy robot-hand materials, what we ended up with was a meter of reinforced hose, perfect for fingers.

Anyway I think this picture will be the best way to describe a few hours of fiddling....


The hosepipe fingers were cut at the joints to allow them to bend then stuck to a CD case 'palm' with blue stretchy tape. The tendons are wires from an old network cable. I'm not quite sure if it will actually have opposing thumbs, thus differentiating it from an ape. Next job is to make a wrist from wood to mount the servos on/in.


Another picture of general awesomeness.... 

Friday 12 February 2016

The code

The PIC microprocessor, programmed with the PICAXE system is fairly straight forward and is used to produce the desired behavior of the servos mentioned in the previous section.


Subroutines are used for the 3 types of movement needed - forward, turn clockwise 180° and turn counter-clockwise 180°.

The above will make the robot do this:

...forever.

Note the pause values, the forward movement is arbitrary, but the pause values after the turn is initiated is crucial to making the correct number of degrees.

Driving the servos

Normal servos are usually only able to operate between two extremes, e.g. 275 deg and 70 deg, this is fine as servos are normally used to move things back and forth, for example flaps on a remote control aeroplane wing.

Another type of servo is the, rather catchy named "Continuous Rotation DC Servo", which basically rotates continuously!

The servo needs a signal applied to it to operate and this signal is a 50Hz pulse with a width of 0.75 to 2.25ms, this pulse width will determine which direction and speed the servo will rotate at.

Soooo, with 2 servos (of the Continuous rotation type) mounted end to end we need to drive them in opposite directions at the same speed to produce forward (or backward) motion. We need to drive them in the same direction to produce a turn, the time of this rotation will dictate how many degrees the robot turns by....simples.

To illustrate this the following signals were recorded with my oscilloscope:

This is applying a pulse of 0.75ms and 2.25ms to each of the motors - this results in a forward movement - remember that the servos are mounted end to end.
The following shows an equal pulse of 2.25ms being applied to each servo, driving them in the same direction, but as they are mounted end-to-end the wheels rotate in the opposite direction and turn it.

The following shows the servos being driven to turn them in the opposite direction:


Wednesday 10 February 2016

Robot requirements

This blog is about the creation (birth) of a new robot friend for Joseph, my son who is very lonely.

The main requirement is that it doesn't bump it's head on walls, so when it gets near a wall, it must turn around and go the other way.

It's brain will be a PIC microprocessor and to simplify the programming a PICAXE will be used. This was chosen so that Joseph can lean to program his new 'brother' using the simplified IDE that comes with it. Other than that, along with much larger programs, it's the same PIC microprocessor.

The little lad will have new legs in the form of wheels, these will be powered by continuous servo motors or stepper motors. The reason for this is because if normal DC electric motors are used they will have to be geared down which would be a bit of a pain and require lots of extra hardware. The servos can just be told to rotate in a certain direction at a certain speed and that's it. Once they are mounted they are good to go.

The little fellas eyes will be ultrasound sensors, these will alert him to the proximity of objects and allow him to take evasive action.

His body will be made of metal Meccano which used to belong to grandpa (my dad).

So far we have the 2 servos held in place by some Meccano, a PICAXE prototype board (on the right), two battery packs - one for the PICAXE and one to power the servos and a small bread-board to make the various connections.

 The PICAXE prototype board came with a Darlington array to drive motors etc. but this was not needed to control the servos, in fact it made it impossible to drive the servos from this board. In order to get it to work I replaced the Darlington chip with a 330 ohm resistor array that connects to all the the port B outputs from the PIC.