This is a prelude to a more adventurous robot with 8 fully controllable legs.
I had never worked with servos ,ultrasonics or wireless before so I thought a little test bed robot was in order.
Starting with the servos.
I am still not sure which ones I will be using. 3.7g or 9g . The 3.7g ones here were the cheapest I could find on ebay . £6.99 for four . The gearing mechanism leaves a bit to be desired . On one of the servers the motor wobbles a bit and slips on the gearing. You can hear it whirling away for a while until it catches. These servos will do 180 degrees but the servo pulse has to be 0.6 ms to 2.4 ms . Below 0.5ms the servo will spin. At first I thought I might have damaged the servo but it still works fine although the centre datum point moves each time you spin it .
I first saw a bug like this on the Internet and this is basically a variation on that theme.
The purpose of this prototype is to answer the following questions.
1. How to control a servo.
2. How strong will it be.
3. How fast will it be.
4. Get the best cost to functionality ratio.
5. To see how accurate the ultra sonic sensor is.
6. To see if I can get an analogue signal from the sensor.
7. To workout how to transmit and receive data via radio.
8. To transmit the ultrasonic analogue signal via the radio back to a pc to create a 2D image of what is in front of and to the sides of the robot.
9. How to measure and control collisions of the legs with objects by measuring the current used.
A 3.7gram servo. Supposedly 700g/cm torque.
£1.75ea from Hong Kong !
The legs are made from 3mm stainless steel welding rod. Very tough and springy.
Four of the legs. Each straight bit is about 30mm long . So that’s 120mm length of wire bent 3 times.
These are the four legs that will move back and forth.
This is the middle two legs. These rock from side to side to lift the above legs off the floor .
The legs “hot glued” to the servo arms being careful to leave enough gap for the mounting screws that hold the arms onto the servo drive spigot.
The four servos “hot glued” together. The 3 at the front are for the legs . The one at the back is for the ultrasonic sensor.
The 3 leg frames fitted . I put a dab of hot glue on the ends of the legs for feet so that they would grip and also not scratch as the cut was a bit sharp and the wire very hard.
A HC-SR04 ultrasonic transmitter/receiver . 5V to Vcc 0V to Gnd. Send a 10us pulse to the Trig input and a short while later a pulse will immerge from the Echo pin that is proportional in length to the distance of the echo.
The length of the pulse in us divided by 58 equals distance in centimetres.
The maximum pulse length is 38 ms
I bent the pins back and “Hot glued” them to the forth servos 4 way arm leaving space between them for the screw.
The brains. This is a Microchip pic24f16ka102 SOIC.
The servos and ultrasonic detector plug into this. There is a 6 pin programming port at one end.
There is a 5V and 3.3V regulator on board . The LED is a heart beat monitor to check the processor is running.
This is only a preliminary board without the current monitoring or serial wireless link. I was also testing to see how small I could do photo etch board. I think I can go a bit finer thus allowing me to add the extra circuitry with out making the board much bigger.
A 7.4V lithium polymer battery. This needs a special charger that I already have for my model railway. I have yet to add voltage monitoring but seeing as when the battery gets down to the minimum 3V per cell the serves are already struggling I dont’ think I need it.
The brains “Hot glued “ on the battery and the battery hot glued to the servo pack. Alas I didn’t leave enough room to get the screw in to the middle leg servo arm. Luckily the PCB gets in the way and stops it falling off.
The processor is programmed to send a 1.5ms pulse to the servos for 5 seconds when started up to centre the servo thus allowing the correct alignment before screwing into place.
A quick wiring job. I nearly let the magic blue smoke out . I forgot the ultrasonic board was running on 5 volts and the pic chip on 3.3V. Thus the signal out was at 4V luckily the chip survived. I have temporarily solder in a diode the drop the voltage to 3.35V. That’s below the 3.6V max input voltage.
This is the circuit diagram of the robot. In the bottom right corner is the added circuit needed to reduce the pulse signal down to the correct voltage. I have modified the PCB to add these two resistors feeding pin 20.
The top of the PCB
The bottom of the PCB. This is viewed from the top.
On my board I cut the track feeding +V to the 5V regulator and added a diode in series so that if I connected the supply up back to front I would not damage the board.
To program the pic chip the supply must be disconnected and jumper 10 removed.
1. Programmer socket.
2. Input supply.
3. 5V regulator.
4. 5V smoothing cap.
5. 3.3V regulator.
6. Reset pullup.
7. Reset pullup.
8. Pic Chip.
9. 3.3V smoothing cap.
10. Programming isolator.
11. Ultrasonic sensor supply.
12. Servo O/P.
13. Ultrasonic sensor signals.
14. Servo O/P.
15. Servo O/P.
16. Servo O/P.
17. Heartbeat LED.
18. LED current limit resistor.
19. 5V to 3V converter resistor.
20. 5V to 3V converter resistor.