For those of you into robotics, and especially robotic arms, many of you have seen the cheap but impressive robotic arm that is currently on the market for less then $30 (£30 in the UK) These arms have 5 motors, and some models come equipped with a built in USB interface allowing the PC to control the Arm.
Whilst good value for money, these Robotic Arms do have certain limitations, and the biggest by far, is the lack of feed back, not that there is anything to feed back from!
These robotic arms dont actually have servo's as such, but a simple motor and worm drive gearbox with 4 cogs inside it. Anyone interested in Inverse Kinetics, wouldnt be impressed with the way this arm performs, and the supplied software for the USB version just simply relies on a timer, hoping to get the arm in a very near position to where it was programmed to go.
After reading a few very interesting topics on here, where people have interfaced these arms with an Arduino, the lack of positional feedback was very obvious, especially if you wanted any degree of accuracy, ie better then 2" resolution.
After playing around with small variable resistors to give feedback, I decided to strip down one of the "servo's" to see what room i had to play with. The following Tutorial, explains how these "servo's" can be simply and easily modified using 1 part, and a little time to give that much needed feedback, with surprising accuracy.
Parts needed:- 4 infra red slotted opto's.
3 or 4 core flat cable.
Tools needed:- Soldering iron and solder.
Endless supply of coffee!
Please note, the servo shown below is a finished one, hence the extra cable.
Step 1: Surgery
.The chances are, if you have one of these arms, you will have built it yourself and know how it goes together, so in which case, i will skip the obvious and get right down to the basics. There are 4 cogs or gear wheels inside the gearbox, driven by a worm drive. Take all of the parts out leaving the bare shell. Just to the right of the motor mount, and almost opposite the brown gear wheel, we need to cut some of the plastic away from the divide wall, this isnt critical, but a piece about 3mm X 10mm should be suffiicent, this is where the slotted opto will be glued.
Next modify the slotted opto, the mounting lug on the end opposite the chamfered LED needs to be cut off, next cut off about 1mm from the other lug. Next with care, cut off about 1mm of the chamfered housing for the LED, this is best done with the craft knife, be careful with your fingers, and make sure you dont crack the housing, as it is fragile, we have to remove enough plastic to expose the face of the LED, you may need to apply a drop of super glue afterwards, to hold the infra red LED in place. There is nothing special about these slotted opto's, i just happened to have a few in my junk box, practically any type will do.
Once the Slotted opto is cut and modified to fit, its time to prepare the connections, looking at the rear of the opto, and the LED with the chamfered edge nearest to you, cut the top left and bottom right connection short, to use as a terminal post. Next bend the bottom left diagonally to the top right and solder the two together, this forms the common connection or 0 volts.
Step 2: Mounting the Opto Coupler
Now its time to mount the opto coupler in position, note that the pictures show the wire already connected, but i would leave this off until last, its a lot easier! And appologies for the couple of blurred pictures, but they are clear enough to get the idea. This step has got to be the fiddliest of the whole operation, the opto has got to be mounted in eacactly the right position, if its too high or too low, then the opto will touch the cog, if it too far to the left, the motor wont fit, too far to the right, and the other half of the case wont fit. This is the way i did mine.
The next step would be easier, if the bottom half of the case was held in a mini vise. Temporarily fit the motor, and hold it in place with a rubber band, then fit the two gear wheels,one grey/black the other brown to its shaft, and fit that in place.
At this stage, it would be useful to try a couple of dummy runs, getting the opto into place, BEFORE you apply the glue.
Apply super glue to the lower mounting lug of the opto, and carefully fit that into position (you may have to move the 2 gear wheels to one side to allow access. Once in postion, press the opto into place, making sure that the faces of the opto dont touch the faces of the gear wheel, and also making sure the opto is snug against the motor. Holding it in place with a small screw driver wedged between the opto and the plastic helps, you will see how when its in position.
Once the opto is in place, and you are happy that it IS in the right place, carefully remove the two gear wheels, and place the gearbox shell to one side to allow the glue to set.
Now comes the next fiddly bit.
Step 3: Modifying the Encoder Gear.
Now we have to modify one of the gear wheels, the brown one in fact, to turn it into the encoder wheel.
The very nice people who made this gear wheel, left 6 small circular markings on the underside of the gear wheel, these are in a perfect position for the holes that we want. Basically the more holes we have, the better the final resolution. I certainly wouldnt advise going for more then 6 holes, as it would leave the wheel too weak. The first picture shows the 6 markings, highlighted with a pen.
Great care needs to be taken with the next step, as the wheel can be easily damaged, Please DONT be tempted to drill each hole out in one go, The finished hole size is 4mm. I first took a piece of wood, and drilled a hole big enough to take the smaller half of the gear wheel, to allow the larger face to sit on a flat surface. The first hole i drilled was 1.5mm, this was my pilot hole, the next size up was 2.5mm, and for the last drilling, i did this by hand holding the drill bit with a cloth wrapped around it. The hole being so close to the edge, i didnt want the risk of the drill bit grabbing, and wrecking the gear wheel.
With the gear wheel drilled, we can now move onto the next step.
Step 4: Wiring Up and Re-assembly
Now we can solder the wires into the opto coupler. I used flat cable, because i didnt have to make any further mods to the casing of the motor gearbox. In my case, all i could find was 3 core from an old computer modem lead. Thats the reason why i had to join the -ve's of the LED's, if you have 4 core, you could connect the two diodes in the opto coupler seperately, but it doesnt make any difference.
With the wires connected, they can now be moved clear of where the motor sits, and then with a spot of super glue, glue the cable into position, it needs to be glued to one side, to avoid catching the motor.
Step 5: Re-assembly
With the connections made, and the cable secured in place we can now replace all of the gear wheels, making sure that nothing catches or obstructs the gears, once satisfied, carefully thread the motor cable through the space next to the opto cable, and press the motor into place. Tidy up any wires which may catch on the lid, and then replace the top cover, and screw in the 3 case screws. Clip the motor wires into their lugs to hold them in place.
And thats it, the motor/gearbox has now been converted to provide accurate optical feedback.
Step 6: And.....Finally!!
The outer gear wheel/drive mount can now be added, and the whole assembly fitted back onto the robot arm.
One down, three to go!! Once I was up to speed, i could convert one of these motors in about 45 mins.
The ratio bewteen the gear wheel and the motor is 32 to 1, calculating the ratio of the other gear wheels, shows that for a 180 degree turn of the output shaft, you will get 1024 pulses out of the gearbox, and looking at the output waveform on a scope, the opto was producing nice and clean square waves.
Early playing around has proved that i can get the arm to any position along the horizontal axis to within 3 to 4 mm, this i feel sure can be bettered if the backlash or slack in the gears is allowed for within the software, im pretty new to writing Scripts in the Arduino world, having come from the world of PICS.
The gripper or the jaws were not modified in this way for two reasons, the first reason was, there wasnt really enough room to get an opto inside the gearbox without a lot of fabrication, but the main reason, was, i wanted better feedback from the gripper. I wanted to sense the actual grip pressure, and i did this using a sensitive current sensing module like this:-
Once fitted, i get an accurate feedback of the pressure applied to the jaws of the robot arm, and i can therefore program the Arduino to switch off the motor when a preset pressure is reached.
A similar sensor could be fitted to possibly the elbow joint, and the arm calibrated to give weight readings as well.
I hope you found this instructable of interest, and i welcome any questions or comments.
ewankoster made it!