instructables
Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype)
         by Will Donaldson
Most open source robotic hands are limited by the               robotic arm avoid the same pitfalls.
fact they have servos in the forearm, which is the
logical place to put them, given the vast space in the          If you wish to build this arm by all means do, but just
arm. However this restricts the wrist motion as the             be prepared to troubleshoot and problem solve as
strings attaching the fingers to the servos run through         you go. I have made all the code and .f3d files
the wrist and if the wrist rotates the strings will pull on     available online. If you just want to build a robotic arm
the fingers, moving the fingers when they should                that works without problems I would suggest either
otherwise be stationary.                                        the InMoov hand or the Flexy Hand (although you will
                                                                need to redesign the forearm to work with servos).
Instead by hacking apart and redesigning several
sg90 servos I was able to fit all the required servos           What are the issues?
inside the palm of the hand which allowed me to
create a wrist that rolls in a similar motion to that of a      Here is a list of issues that need resolving, and are
humans. Whether or not you decide to build this arm             best to keep in mind when building either this project
the steps about the servos and how to make them                 or your own.
compact and continuously rotate might be of interest.
                                                                Being my first Instructable there may be some
Counter-intuitively to what Instructables is meant for I        sections that are incoherent/ glossed over, if any of
do NOT encourage anyone to build this arm. This                 the sections don't make sense let me know in the
prototype has several flaws as outlined in the link             comments below and I will try to clarify and edit them.
below. Rather this is documentation of my experience
in the hopes it can help others who wish to design a
       https://youtu.be/s0LA48Sw62k
                               Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 1
Step 1: Required Parts and Tools
Parts
        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)
Tools
        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
                          Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 2
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
 1. Layer height of 0.3mm is faster to print, but layers show up easily
                                    Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 3
Step 3: Hacking the Servos (part 1): Continuous Rotation Servo
The rotation of servos is limited by the fact that the         Test Code
potentiometers (a device that has a variable
resistance and as it is rotated the change in rotation         Important: When modifying the servo make sure you
can be read and from it an angle of rotation                   rotate the potentiometer to the middle position. This is
calculated) cannot rotate more than 180 degrees.               because the code will tell the servo to rotate to either
                                                               180 degrees or 0 degrees (depending on the direction
To overcome this restriction, open up the servo and            of rotation) and since the top gear no longer bites
cut of the plastic stopper on the top most gear. Then          onto the potentiometer, the potentiometer will never
drill a hole down its axis, this stops allows the gear to      move, thus the motor will keep spinning in the same
freely spin where as before it would bite onto the D-          direction trying to reach 0 or 180 degrees forever. If
pin mount of the potentiometer (see 4th picture                however your potentiometer is rotated to either of the
above). Now the gear can continuously rotate while             ends it will read an angle of 180 or 0, and the code
the potentiometer does not move at all. Reassemble             will not work, hence ensure the potentiometer is
the servo as it was before and test it with the code           rotated to about the middle position. (I don't know if I
below, making sure it continuously rotates in both             have articulated myself in a way that makes sense,
directions. Make 2 of these servos.                            let me know in the comments below if I should come
back and rewrite this)
 1. Top most gear                                               1. This plastic stopper needs to be removed
 1. Cut off plastic stopper                                     1. The D-pin bites onto the gear, drilling a hole in the gear allows it to
                                                                freely spin
                                                                2. The potentiometer
                              Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 4
                                1
1. Drill down the centre
                           Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 5
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.
     1. Open up the servo
     2. Cut off both the potentiometer and chip (place them aside for later)
     3. 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)
     4. Cut off the plastic stopper on the top most gear (this will allow the servo to continuously rotate)
     5. Reassemble the case as shown in the pictures
     6. 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.
     7. Repeat the above steps on a second servo
     8. Using epoxy glue the servos together in the orientation shown above (be very careful not to get any
        epoxy on the gears)
     9. Solder on extension wires to the wires from DC motors
    10. 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.
Side Thought:
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!
                                                        1. Remove the chip and potentiometer
                           Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 6
                             1
                                                                                                      2                    1
1. Cut off the plastic stopper on the topmost gear                   1. This one has been cut in half
                                                                     2. Make sure this indent is still intact
                             2         1                                                                  1
1. This is where the potentiometer and chip use to be                1. You need to find a replacement axle for the 2 gears to spin on
2. Screw back together the case with 2 of the 4 original screws
                                                                                                                1
                                   2
1. Glue the 2 cases together                                         1. Another design for the thumb joint
2. Test everything stll works by connecting a battery to the wires
                                   Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 7
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).
 1. Salvage an extra pot from a servo
                                   Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 8
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.
      1. 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)
      2. 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
      3. 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.
      4. Repeat for the main 4 fingers (the thumb is done later as to not get in the way while assembling the
         hand)
      5. 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).
      6. 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.
      7. 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.
      8. Feed the wires through the palm and out the hole near the wrist.
                                                               1. Superglue black and white pieces together
                            Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 9
                                                                                                                    1
                                                                       1. The holes are a little small, I suggest widening them with a drill
                                           1                                                                 1
1. finger is contracted by pulling the fishing line                    1. Superglue the end of the elastic
1. Press the pots into the holes at the base of the fingers
                                    Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 10
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:
       1. 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).
       2. The normal, unaltered servo for the thumb rotation, feed the wiring through the palm as shown in the
          video.
       3. The 2-in-1 compact DC motor (note: the pulley that the pinky and thumb are tied is larger than the
          other 3 pulleys)
       4. 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
                                   54
                          2 6
                                    3                                                                               1
                               1
 1. Continuous rotation servo contracts the middle finger             1. This pulley is a tight fit with the wall
 2. Continuous rotation servo contracts the thumb
 3. Normal, unaltered sg90 servo rotates the thumb
 4. Contracts the index finger
 5. Modified 2-in-1 servo
 6. Contracts both the ring and pinky fingers
                                   Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 11
                                                                                                                           1
                                              1
1. Glue the braided nylon sleeve in place                           1. This is channel that the string for thumb contraction runs through
                                                                    1. Feed fishing line through fingers
                                 Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 12
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.
                                                       2
                                                   1
                                                                                                                  1
 1. Ensure the servo is rotated to 90 degrees before attaching the armature   1. There is very limited clearance, as such in the current design higher
                                                                              torque servos are not an option
 2. Add fishing line to each end of the armature
                                   Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 13
                                         1
1. Twist the screw into the spring and ensure it cannot be pulled out
1. Ensure the fishing line is kept under tension when attaching it to the palm
                                  Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 14
Step 9: Forearm and Wiring
Feed the wires through the tube in the side of the first          red servos are regular servos, and the purple ones
forearm piece.                                                    are servos that have no position reading from their
                                                                  potentiometer. More specifically the 2 purple servos
Screw the second forearm piece onto the first. Note               are the servos that were modified into continuous
that in the video and pictures, the second piece of my            rotation servos in previous steps.
forearm failed mid-print so I had to glue the two
halves of the failed print together, this shouldn't be an         With the potentiometer placed in the middle finger
issue for you though.                                             knuckle we can get a position reading and use this to
                                                                  control the corresponding purple, continuous rotation
Put a 9volt battery into the slot of the second forearm           servo.
piece and solder on a female DC plug, with +ve in the
centre.                                                           The other purple, continuous rotation servo, used for
                                                                  the thumb contraction has no position reading. This is
In the 4th picture you can see what the chip looks like           a serious design flaw and must be fixed in later
that was saved from the 2-in-1 modified servo made                versions. At the moment it can only be operated by
in earlier steps. While the 2 motors in the '2-in-1               sight (ie a person watching the thumb move and
modified servo' no longer "look" like servos we can               telling the Arduino when to stop), if left to its own
wire them back up the same way to "operate" in the                devices it would just continuously rotate until either
same way as servos. In the 5th picture there is a                 the servo or the thumb breaks. I added a momentary
diagram of how to do this, simply solder the motor                switch connected to pin 6, that can be used to tell the
and corresponding potentiometer (which is either                  Arduino when to stop contracting the finger.
located in the index and ring finger knuckles), and
solder them as in the diagram to the chip. The servo              Mount the Arduino uno in its frame and plug in the
is now "functionally" the same as any other servo.                power plug from the battery. Glue the black final
                                                                  plastic piece of the forearm on.
In the 6th picture there is a diagram of how to wire
everything to the Arduino Uno board. Note that the
                                                                                                          1
                                       1
 1. These two forearm pieces where meant to be printed as one       1. Feed all the wiring through the side of the forearm
                                 Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 15
                                     1
1. Insert 9v battery
                       1
                                 2
1. Connect the 9v battery with a female DC plug
2. Screw in the Arduino board
                                 Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 16
Step 10: Adding the Thumb
Assemble the first few segments of the thumb in the                is structurally weak but will suffice for this prototype,
same way as the other fingers. However instead of                  feel free to adapt it as you wish).
feeding the elastic into the hand glue it in the last
segment (see 2nd and 3rd pictures above).                          Feed the fishing line through the holes in the
                                                                   underside of the thumb and a knot at the end of the
Screw the thumb axle mount onto the servo                          thumb.
protruding from the hand. As in the 4th picture glue
both sides of the thumb around the axle (this design
                                                                                                      1
                             1
 1. Assemble the same way as the fingers                             1. Glue the elastic here, cut off the excess elastic (sorry about the out of
                                                                     focus pic)
                             2          1
 1. You can see here where the elastic is glued                      1. Glue the two pieces together around the axle
 2. Screw in axle
                                  Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 17
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.
                          Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 18
Step 12: The End
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.
Future Versions
         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
                           Robotic Arm 3D Printed (DIY Initial Prosthetic Prototype): Page 19