Introduction: Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype)
Most open source robotic hands are limited by the fact they have servos in the forearm, which is the logical place to put them, given the vast space in the arm. However this restricts the wrist motion as the strings attaching the fingers to the servos run through the wrist and if the wrist rotates the strings will pull on the fingers, moving the fingers when they should otherwise be stationary.
Instead by hacking apart and redesigning several sg90 servos I was able to fit all the required servos inside the palm of the hand which allowed me to create a wrist that rolls in a similar motion to that of a humans. Whether or not you decide to build this arm the steps about the servos and how to make them compact and continuously rotate might be of interest.
Counter-intuitively to what Instructables is meant for I do NOT encourage anyone to build this arm. This prototype has several flaws as outlined in the link below. Rather this is documentation of my experience in the hopes it can help others who wish to design a robotic arm avoid the same pitfalls.
If you wish to build this arm by all means do, but just be prepared to troubleshoot and problem solve as you go. I have made all the code and .f3d files available online. If you just want to build a robotic arm that works without problems I would suggest either the InMoov hand or the Flexy Hand (although you will need to redesign the forearm to work with servos).
What are the issues?
Here is a list of issues that need resolving, and are best to keep in mind when building either this project or your own.
Being my first Instructable there may be some sections that are incoherent/ glossed over, if any of the sections don't make sense let me know in the comments below and I will try to clarify and edit them.
Step 1: Required Parts and Tools
- 3D filament (I used black and white PLA but ABS would work too)
- At least 8 SG90 servos (I say at least because we will hack them and it possible to destroy them in the process, rendering them useless)
- Fishing line
- Thin elastic cord
- 4 springs
- Heat shrink tube
- Spare wire
- Braided nylon sleeve (this is optional, can be hard to find in small quantities, you can probably find an alternative or just use zip ties)
- Arduino Uno
- Battery (I used a 9v but a rechargeable lipo would be ideal)
- 3D printer (or at least access to one)
- Soldering iron
- Screw driver and other basic workshop tools
- Super glue &/or epoxy
- Drill and pliers for clean support structure
- Wire strippers/cutters
Step 2: Printing
Fusion 360 files can be found here: http://a360.co/2ufYJJV
(To 3D print the hand you will need to download the .f3d file in the above link, open it in Fusion 360 and export the individual pieces as .stl files to your chosen 3D printing software)
A few comments on printing:
- The finger tips are designed to be printed on a dual extrusion 3D printer, as the black tips are too thin to print on their own. (If you use a single extrusion printer you won't have the black trim on the finger tips as they are too thin to print individually and glue on, alternatively you could redesign the black finger tip to be thicker), all the other pieces will print the same on both a dual or single extrusion printer
- I personally used PLA but ABS plastic would work too
- Print with support structure
- I was impatient and to reduce print time I printed the larger pieces like the palm and forearm at 0.3mm layer height while some other pieces, like the fingers, I did at 0.1mm. It is up to you what resolution you print at
- I found that white plastic shows up dirt very easily (since it can easily get caught in the grooves between print layers), keep this in mind when choosing your colour of plastic
Step 3: Hacking the Servos (part 1): Continuous Rotation Servo
The rotation of servos is limited by the fact that the potentiometers (a device that has a variable resistance and as it is rotated the change in rotation can be read and from it an angle of rotation calculated) cannot rotate more than 180 degrees.
To overcome this restriction, open up the servo and cut of the plastic stopper on the top most gear. Then drill a hole down its axis, this stops allows the gear to freely spin where as before it would bite onto the D-pin mount of the potentiometer (see 4th picture above). Now the gear can continuously rotate while the potentiometer does not move at all. Reassemble the servo as it was before and test it with the code below, making sure it continuously rotates in both directions. Make 2 of these servos.
Important: When modifying the servo make sure you rotate the potentiometer to the middle position. This is because the code will tell the servo to rotate to either 180 degrees or 0 degrees (depending on the direction of rotation) and since the top gear no longer bites onto the potentiometer, the potentiometer will never move, thus the motor will keep spinning in the same direction trying to reach 0 or 180 degrees forever. If however your potentiometer is rotated to either of the ends it will read an angle of 180 or 0, and the code will not work, hence ensure the potentiometer is rotated to about the middle position. (I don't know if I have articulated myself in a way that makes sense, let me know in the comments below if I should come back and rewrite this)
Step 4: Hacking the Servos (part 2): 2-in-1 Compact DC Motors
I wanted to keep this hand aesthetic and realistic, as such there is limited space in the palm of the hand for servos.
The following steps will go over how to make 2 servos fit in less space, while keeping the servo essentially (in terms of circuitry) the exact same. In essence the only change I have made is increasing the length of the wires connecting the motor, potentiometer and chip.
- Open up the servo
- Cut off both the potentiometer and chip (place them aside for later)
- Of the 3 blue plastic case components cut the lower 2 of them as shown in the pictures/video. It is important to make sure the indent where the axle rests is not cut off (picture 4)
- Cut off the plastic stopper on the top most gear (this will allow the servo to continuously rotate)
- Reassemble the case as shown in the pictures
- Because we have removed the potentiometer 2 of the gears have no axle to spin on. I initially tried replacing the axle by cutting one of the screws from the plastic case to a length of 8.5mm but found it caused too large a vibration. Instead I later found some scrap rod of better diameter.
- Repeat the above steps on a second servo
- Using epoxy glue the servos together in the orientation shown above (be very careful not to get any epoxy on the gears)
- Solder on extension wires to the wires from DC motors
- To test the motors work still I used a 3.7v lipo connected to one of the motors, check it continuously rotates in both directions (achieved by reversing the battery) and then test the second motor.
In later steps the potentiometers we saved will be put into the knuckles to get a reading of how much the finger has rotated (between 0 and 90 degrees). By wiring the potentiometer and the motor back to the chip it can used as a servo in the same way any other servo would be when connected to the Arduino.
Another design I had considered using for the thumb motion is shown above (picture 8) and in the video. I ultimately decided against it because I couldn't find a way to get readings from the pots while keeping the design compact and aesthetic. But the steps to make it are the exact same as above, with the exception of step 8, where you should first rotate the 2 motor cases before gluing. Let me know if you end up using this type of design in any other projects you make, I would be interested to know!
Step 5: Hacking the Servos (part 3): the Remaining Servos
3 of the servos can be left as is, unaltered:
- One of the servos will be used as the thumb rotation servo.
- Two of the servos will be used as the left/right and up/down motion of the wrist
- Note: In reality the sg90 servos have insufficient torque to rotate the wrist. In later versions I will make the forearm larger to accommodate a more powerful servo such as two Kuman MG996 servos.
From the forth servo the only thing we need is the black potentiometer, the rest can be set aside as spare parts. (it is possible you might have broken the plastic cases/ gears in the previous two steps, thus making them useless, instead of wasting another servo just use the potentiometer from those). Alternatively you could try finding the same pots online (I haven't looked).
Step 6: Assemble the Fingers
Note: Not all the black pieces fit into the white pieces and not all the finger joints roll smoothly, both of these problems can be fixed by altering the Fusion 360 files if you wish.
- Clean out support structure with a drill, ensure you can feed string through each hole before continuing (it is harder to rectify problems when the fingers are glued)
- Lay out the finger segments as shown in the video and glue (superglue or epoxy) them together, being careful not to glue the joints, or the holes that the string goes through
- Feed elastic through the holes on the topside, and optionally if you want to test the finger feed fishing line through the holes on the underside. When the fishing line is pulled the finger should contract and when released the elastic should pull it back. If you chose to test them, remove the fishing line now.
- Repeat for the main 4 fingers (the thumb is done later as to not get in the way while assembling the hand)
- With the 3 potentiometers saved from earlier, solder extension wires to them. I would suggest putting heat shrink tube on the ends of the extension wires and developing some sort of colour code to differentiate each of the wires (including the wires from the servos, there will be a total of 22 wires coming out of the hand and it will be impossible to differentiate them if you don't have some sort of coded system).
- Rotate all the pots to 90 degrees (ie halfway between the two ends blocking rotation) then push each pot into the index, middle and ring fingers. The pinky doesn't need one because both it and the ring finger are connected to the same servo, I have however left space if you wish to give the pinky its own pot.
- Place the fingers in the holes of the 3D printed palm (topside) and feed the elastic through the hole in the palm. While keeping the elastic tight add superglue or epoxy to the hole. You could try tying a knot instead of gluing but you may lose tension in the elastic in the process, if the elastic is not tight the finger will not snap back into position.
- Feed the wires through the palm and out the hole near the wrist.
Step 7: Build the Hand
Screw 4 black pulleys onto the 4 modified servos.
Above you can find a picture of where all the servos in the hand go and to what finger the fishing line connects. To make wiring simple I would suggest assembling it in the following order:
- The continuous rotation servo for the thumb contraction (note: this one will need to be glued in place as there aren't enough walls to keep it in place, you could use epoxy but I opted for hot glue so that I can salvage it later should I need to).
- The normal, unaltered servo for the thumb rotation, feed the wiring through the palm as shown in the video.
- The 2-in-1 compact DC motor (note: the pulley that the pinky and thumb are tied is larger than the other 3 pulleys)
- The continuous rotation servo for middle finger contraction.
Before continuing I would suggest just double checking all servos still work (easier to fix problems before the hand is assembled).
All the wires for the pots and motors should be coming out of the hole in the side of the palm. As mentioned in the previous step make sure you have some system of telling different wires apart. I suggest using coloured heat shrink tube. To keep everything neat I slid a braided nylon sleeve over the wires, the sleeve is ideal because of its flexibility, you could also use tape or zip ties.
On each of the pulleys tie a piece of fishing line. I used a clove hitch with a touch of superglue to make sure the fishing line doesn't slip. Feed the fishing line through the holes in the other half of the palm and out towards the fingers.
Screw the 2 halves of the palm together. Feed the fishing line through the 4 fingers and tie them in a knot at the end of each finger
Step 8: Make the Wrist
I salvaged several springs from an old printer, as such I don't have a part number or name for them unfortunately. Thread in 8 screws (one at each end of the 4 springs), it is important to use screws that have a head wide enough they don't slip through the end of the spring, alternatively add a washer to the screw.
Screw in both sides of the spring, one into the palm, one to the forearm. This can be tricky, it requires bending the springs and using a thin screwdriver (be careful not to over bend/stretch the springs resulting in permanent deformation).
Once all 4 springs connect the forearm to palm, pop the 3D printed sphere in between the springs. It might be possible to use a pingpong ball instead, in fact being smoother than a 0.1mm print layer a pingpong ball may be ideal for reducing friction (I have not tested this idea and it is possible that after a period of time the pingpong ball could crack under the pressure).
Attach the armatures to the 2 SG90 servos and move both of them to 90 degrees before continuing. The code for this can be found here.
Once at 90 degrees, tie 2 pieces of fishing line to each servo, one at each end of the armature. Mount the servos in the forearm.
Several design flaws:
- Of the 4 screw holes used for mounting the servos only one can be reached with a screwdriver (an oversight on my part), instead use glue to secure them
- The servo responsible for left/right motion (ie waving) could easily be torn out of its mount, instead I should have put a wall on the other side of the servo to prevent it from pulling itself out under its own rotation.
- The sg90 servos are too weak to actually rotate the wrist (at least for the springs I used), so this step is actually kinda redundant, since the wrist won't move.
After mounting the servos feed the fishing line through each of their respective holes and out of the forearm (being careful to not get them twisted), tie a knot around a small screw (with a larger head or washer to ensure the fishing line won't slip off) and then screw them in place. Again I added a touch of superglue to be safe.
Step 9: Forearm and Wiring
Feed the wires through the tube in the side of the first forearm piece.
Screw the second forearm piece onto the first. Note that in the video and pictures, the second piece of my forearm failed mid-print so I had to glue the two halves of the failed print together, this shouldn't be an issue for you though.
Put a 9volt battery into the slot of the second forearm piece and solder on a female DC plug, with +ve in the centre.
In the 4th picture you can see what the chip looks like that was saved from the 2-in-1 modified servo made in earlier steps. While the 2 motors in the '2-in-1 modified servo' no longer "look" like servos we can wire them back up the same way to "operate" in the same way as servos. In the 5th picture there is a diagram of how to do this, simply solder the motor and corresponding potentiometer (which is either located in the index and ring finger knuckles), and solder them as in the diagram to the chip. The servo is now "functionally" the same as any other servo.
In the 6th picture there is a diagram of how to wire everything to the Arduino Uno board. Note that the red servos are regular servos, and the purple ones are servos that have no position reading from their potentiometer. More specifically the 2 purple servos are the servos that were modified into continuous rotation servos in previous steps.
With the potentiometer placed in the middle finger knuckle we can get a position reading and use this to control the corresponding purple, continuous rotation servo.
The other purple, continuous rotation servo, used for the thumb contraction has no position reading. This is a serious design flaw and must be fixed in later versions. At the moment it can only be operated by sight (ie a person watching the thumb move and telling the Arduino when to stop), if left to its own devices it would just continuously rotate until either the servo or the thumb breaks. I added a momentary switch connected to pin 6, that can be used to tell the Arduino when to stop contracting the finger.
Mount the Arduino uno in its frame and plug in the power plug from the battery. Glue the black final plastic piece of the forearm on.
Step 10: Adding the Thumb
Assemble the first few segments of the thumb in the same way as the other fingers. However instead of feeding the elastic into the hand glue it in the last segment (see 2nd and 3rd pictures above).
Screw the thumb axle mount onto the servo protruding from the hand. As in the 4th picture glue both sides of the thumb around the axle (this design is structurally weak but will suffice for this prototype, feel free to adapt it as you wish).
Feed the fishing line through the holes in the underside of the thumb and a knot at the end of the thumb.
Step 11: Code
The code can be found here
A few things to keep in mind while working with the code:
- In the code I only have 3 basic hand movements: wave, fist and key hold. Feel free to customize it and add your own.
- Because of how the potentiometers are orientated in the knuckle the servo has a range of motion of [90, 180] degrees. For example 90 degrees corresponds to the finger being at rest, fully extended, and at 180 degrees the finger is fully contracted. Values outside the range are invalid, and would correspond to bending the finger backwards.
- The middle finger potentiometer reads values in an analog range of up to 1023, I used the map() function in line 134to convert the range into the same [90, 180] range as the other fingers. The values you map from could be different for different potentiometers, so in setup(), there are several lines dedicated to the calibration of the potentiometer, if you don't wish to recalibrate the pot each time you run the code, you can simply record the calibration values and set the variables MidExtd and MidCont equal to them.
- As mentioned two steps ago in "Forearm and wiring" the servo controlling the thumb contraction has no position feedback and must be manually controlled with a momentary switch, see the moveThumb() function for more info.
- Finally as mentioned in the step about how to make a continuous rotation servo, it is important that modifying the servo make sure you rotate the potentiometer to the middle position (ie not to either of the extremes of 0 nor 180 degrees). This is relevant for the thumb contraction and the middle finger contraction as we will write() to either of the extremes: 0 or 180, depending on which way we want to rotate the servo.
- In the function moveThumb() you my need to change the range of rotAngle from [60, 140] to something different depending on what position the servo was rotated to when attaching the thumb, just play around with the range until you find a suitable one for you.
Since last testing it (and having several servos break) I made a few alterations to the code. Everything should still work fine but comment down below if I am wrong and I'll go and fix it.
Step 12: The End
If you found this instructable interesting &/or interesting please consider voting for it in a contest by clicking the vote button on the top right of this page.
While I didn't achieve the outcome I had hoped for, I have learnt a lot, and that knowledge will be built into future versions. I am particularly happy I was able to contain all the servos within the palm, despite there being a few issues still in need of resolving.
Although the sg90 servos had sufficient torque to move the wrist, when tested with larger servos, the wrist moved as predicted. Next time I will make the forearm wider to accommodate these superior servos. My only concern is the wrist may begin to break after repeated use with weight in the hand.
I have already gone over the flaws earlier so I won't dwell on them much here other than to say I encourage you to read through them and keep them in mind when designing your own robotic arm. By all means feel free to use and alter the fusion files I have shared, but I believe it may be a better allocation of time to start a ground up redesign, keeping previous knowledge in mind.
- Instead of using an Arduino Uno with wires connecting it to servos in the palm, it would be ideal to use an Arduino Nano inside the palm itself. This of course would require a battery inside the palm and probably smaller, high torque motors too.
- Perhaps getting a little too sci-fi for a diy project, but instead of using potentiometers in the knuckles it would be interesting to use multiple IMU's in the fingers and pressure sensors in the finger tips, giving feedback.
- The ball and socket wrist motion allows for rolling of the wrist left & right and up & down, however in its current design it does not allow for wrist rotation, adding in this extra degree of freedom would be good.
- I would like to try using mechanical fingers such like this or this instead of fishing line
- In terms of aesthetics, since most of the control is done inside the hand and the forearm will be nearly completely empty, it would be cool to make a transparent forearm like in the movie Ex Machina
Second Prize in the
Invention Challenge 2017