Robotic Hand Using Servos

by kleung2131 in Circuits > Gadgets

21 Views, 0 Favorites, 0 Comments

Robotic Hand Using Servos

original-AEF399C8-56B3-4C2B-9767-37701BB55005.jpeg

The project proposed by my exploring technology teacher, consists of building a robotic hand, I was tasked with finding the volume and waste for each finger by coding with python, so I was not involved with making the hand.

Supplies

original-D989EA66-C3DF-4710-A94C-676EC133CB62.jpeg

The materials needed for this project includes: Arduino Uno, 2 servos, 1 foot^2 of foam, box cutter, sanding block, pliers, fishing line, marker, bag of elastic bands, paper clips, blank piece of paper, and a ruler.

Measurements

original-47FD2485-90DC-4BEB-AB7C-EB266602A007.jpeg

Firstly, you would trace out your hand on a blank peice of paper and measure each section as demonstrated in the picture. Lastly trace the measurements onto the foam for the next steo. (Be sure to make the length and width the same for simplicity)

Cutting

original-B7C54F8A-031F-48C2-91CC-14AE1E08B82F.jpeg

After measuring each section of the fingers, cut them out with the box cutter. If done correctly it should look similar to the pictures above.

Measure Height 2

unnamed.gif

After each section of each finger is cut out, make a 45 degree cut on the ends on the top and base of the finger, while making 2 cuts on the middle. The end result should be a hollow joint where the sections should connect. If bent each section should align to create an arc. Lastly measure height 2 of each section (From the cut to the bottom of the finger).

Sanding

sanded hand.png

After all is done, round out all the harsh edges, making it more aesthetic or more hand like.

Connect the Hand

original-027223E3-8A19-4D1F-A258-04EC374DDF57.jpeg
original-78CC52E9-571A-4528-8D18-1221EC0BEE31.jpeg
original-AADB5B8E-24F5-4D42-BEC9-B883E410DECE.jpeg

After all is said and done, use hot glue to connect the base of each finger to the palm.

Connect each finger using hot glue, but instead using a elastic band form a joint, and hot glue that into place. At the end all the sections should be connected.

Thread Fishing Line

original-9E543300-2FD3-4713-A1F8-102DA35FB322.jpeg
original-4FAF4826-EAC2-4177-9DED-A25172DFBABB.jpeg

Cut paperclips in half to create the pathway for the fishing lines, make a lane for each fishing line to connect with the corresponding finger.

After that, use a needle and make a hole in the middle of the finger, and hot glue the fishing line at the end of each finger.

Adding the Servos

processed-76B0BEF8-4B8B-46E9-A0A2-0EA4B4F68532.jpeg

Once the fishing line are all connected, add the servos in a "V" formation on the forearm, then wrap the fishing lines to the ends of the servos. (Make sure the lines are tight)

Coding

There are 3 parts to the coding, first you have to create a code to find the volume of the sections of each finger, then you have to code for the waste created by the cutting and sanding, lastly you would code for the motion of the servos (in C++).

In the first 2 codes, you have to find the volume of a cylinder, hemisphere, and rectangle. As well as, the waste produced by subtracting the cylinder from the rectangle.

Personally I combined code 1 and 2, to create one code to find the volume and waste for the entire hand.


*This is an example of my code*

#PYTHON CODE FOR MATH

import math

#INDEX FINGER

sec1F1H = float(input("Enter height of section 1 of finger 1: "))
sec1F1L = float(input("Enter length of section 1 of finger 1: "))
sec1F1W = float(input("Enter width of section 1 of finger 1: "))
sec1F1R = float(input("Enter radius of section 1 of finger 1: "))

sec2F1H = float(input("Enter height of section 2 of finger 1: "))
sec2F1L = float(input("Enter length of section 2 of finger 1: "))
sec2F1W = float(input("Enter width of section 2 of finger 1: "))
sec2F1R = float(input("Enter radius of section 2 of finger 1: "))

sec3F1H = float(input("Enter height of section 3 of finger 1: "))
sec3F1L = float(input("Enter length of section 3 of finger 1: "))
sec3F1W = float(input("Enter width of section 3 of finger 1: "))
sec3F1R = float(input("Enter radius of section 3 of finger 1: "))

#MIDDLE FINGER

sec1F2H = float(input("Enter height of section 1 of finger 2: "))
sec1F2L = float(input("Enter length of section 1 of finger 2: "))
sec1F2W = float(input("Enter width of section 1 of finger 2: "))
sec1F2R = float(input("Enter radius of section 1 of finger 2: "))

sec2F2H = float(input("Enter height of section 2 of finger 2: "))
sec2F2L = float(input("Enter length of section 2 of finger 2: "))
sec2F2W = float(input("Enter width of section 2 of finger 2: "))
sec2F2R = float(input("Enter radius of section 2 of finger 2: "))

sec3F2H = float(input("Enter height of section 3 of finger 2: "))
sec3F2L = float(input("Enter length of section 3 of finger 2: "))
sec3F2W = float(input("Enter width of section 3 of finger 2: "))
sec3F2R = float(input("Enter radius of section 3 of finger 2: "))

#RING FINGER

sec1F3H = float(input("Enter height of section 1 of finger 3: "))
sec1F3L = float(input("Enter length of section 1 of finger 3: "))
sec1F3W = float(input("Enter width of section 1 of finger 3: "))
sec1F3R = float(input("Enter radius of section 1 of finger 3: "))

sec2F3H = float(input("Enter height of section 2 of finger 3: "))
sec2F3L = float(input("Enter length of section 2 of finger 3: "))
sec2F3W = float(input("Enter width of section 2 of finger 3: "))
sec2F3R = float(input("Enter radius of section 2 of finger 3: "))

sec3F3H = float(input("Enter height of section 3 of finger 3: "))
sec3F3L = float(input("Enter length of section 3 of finger 3: "))
sec3F3W = float(input("Enter width of section 3 of finger 3: "))
sec3F3R = float(input("Enter radius of section 3 of finger 3: "))

#PINKY FINGER

sec1F4H = float(input("Enter height of section 1 of finger 4: "))0
sec1F4L = float(input("Enter length of section 1 of finger 4: "))
sec1F4W = float(input("Enter width of section 1 of finger 4: "))
sec1F4R = float(input("Enter radius of section 1 of finger 4: "))

sec2F4H = float(input("Enter height of section 2 of finger 4: "))
sec2F4L = float(input("Enter length of section 2 of finger 4: "))
sec2F4W = float(input("Enter width of section 2 of finger 4: "))
sec2F4R = float(input("Enter radius of section 2 of finger 4: "))

sec3F4H = float(input("Enter height of section 3 of finger 4: "))
sec3F4L = float(input("Enter length of section 3 of finger 4: "))
sec3F4W = float(input("Enter width of section 3 of finger 4: "))
sec3F4R = float(input("Enter radius of section 3 of finger 4: "))

#Thumb

sec1F5H = float(input("Enter the height of section 1 of finger 5: "))
sec1F5L = float(input("Enter the length of section 1 of finger 5: "))
sec1F5W = float(input("Enter the width of section 1 of finger 5: "))
sec1F5R = float(input("Enter the radius of section 1 of finger 5: "))

sec2F5H = float(input("Enter the height of section 2 of finger 5: "))
sec2F5L = float(input("Enter the length of section 2 of finger 5: "))
sec2F5W = float(input("Enter the width of section 2 of finger 5: "))
sec2F5R = float(input("Enter the radius of section 2 of finger 5: "))

#3d rectangle of finger parts

RVs1F1 = sec1F1H * sec1F1L * sec1F1W
RVs2F1 = sec2F1H * sec2F1L * sec2F1W
RVs3F1 = sec3F1H * sec3F1L * sec3F1W

RVs1F2 = sec1F2H * sec1F2L * sec1F2W
RVs2F2 = sec2F2H * sec2F2L * sec2F2W
RVs3F2 = sec3F2H * sec3F2L * sec3F2W

RVs1F3 = sec1F3H * sec1F3L * sec1F3W
RVs2F3 = sec2F3H * sec2F3L * sec2F3W
RVs3F3 = sec3F3H * sec3F3L * sec3F3W

RVs1F4 = sec1F4H * sec1F4L * sec1F4W
RVs2F4 = sec2F4H * sec2F4L * sec2F4W
RVs3F4 = sec3F4H * sec3F4L * sec3F4W

RVs1F5 = sec1F5H * sec1F5L * sec1F5W
RVs2F5 = sec2F5H * sec2F5L * sec2F5W

#Cylinder of finger parts

CVs1F1 = math.pi * (sec1F1R**2) * sec1F1H
CVs2F1 = math.pi * (sec2F1R**2) * sec2F1H
CVs3F1 = math.pi * (sec3F1R**2) * sec3F1H

CVs1F2 = math.pi * (sec1F2R**2) * sec1F2H
CVs2F2 = math.pi * (sec2F2R**2) * sec2F2H
CVs3F2 = math.pi * (sec3F2R**2) * sec3F2H

CVs1F3 = math.pi * (sec1F3R**2) * sec1F3H
CVs2F3 = math.pi * (sec2F3R**2) * sec2F3H
CVs3F3 = math.pi * (sec3F3R**2) * sec3F3H

CVs1F4 = math.pi * (sec1F4R**2) * sec1F4H
CVs2F4 = math.pi * (sec2F4R**2) * sec2F4H
CVs3F4 = math.pi * (sec3F4R**2) * sec3F4H

CVs1F5 = math.pi * (sec1F5R**2) * sec1F5H
CVs2F5 = math.pi * (sec2F5R**2) * sec2F5H

#SemiSPHERE VOLUME

SemiSphVF1 = (math.pi * (4/3) * (sec1F1R**3)) / 2
SemiSphVF2 = (math.pi * (4/3) * (sec1F2R**3)) / 2
SemiSphVF3 = (math.pi * (4/3) * (sec1F3R**3)) / 2 
SemiSphVF4 = (math.pi * (4/3) * (sec1F4R**3)) / 2 
SemiSphVF5 = (math.pi * (4/3) * (sec1F5R**3)) / 2

SemiSphVTTF1 = CVs1F1 + SemiSphVF1 
SemiSphVTTF2 = CVs1F2 + SemiSphVF2
SemiSphVTTF3 = CVs1F3 + SemiSphVF3
SemiSphVTTF4 = CVs1F4 + SemiSphVF4
SemiSphVTTF5 = CVs1F5 + SemiSphVF5

sec1F1H2 = float(input("Enter height 2 for section 1 finger 1: "))
sec2F1H2 = float(input("Enter height 2 for section 2 finger 1: "))
sec3F1H2 = float(input("Enter height 2 for section 3 finger 1: "))

sec1F2H2 = float(input("Enter height 2 for section 1 finger 2: ")) 
sec2F2H2 = float(input("Enter height 2 for section 2 finger 2: "))
sec3F2H2 = float(input("Enter height 2 for section 3 finger 2: "))

sec1F3H2 = float(input("Enter height 2 for section 1 finger 3: "))
sec2F3H2 = float(input("Enter height 2 for section 2 finger 3: "))
sec3F3H2 = float(input("Enter height 2 for section 3 finger 3: "))

sec1F4H2 = float(input("Enter height 2 for section 1 finger 4: "))
sec2F4H2 = float(input("Enter height 2 for section 2 finger 4: "))
sec3F4H2 = float(input("Enter height 2 for section 3 finger 4: "))

sec1F5H2 = float(input("Enter height 2 for section 1 finger 5: "))
sec2F5H2 = float(input("Enter height 2 for section 2 finger 5: "))

TruncatedCVs1F1 = ((sec1F1R**2) * math.pi * (sec1F1H + sec1F1H2)) / 2
TruncatedCVs2F1 = ((sec2F1R**2) * math.pi * (sec2F1H + sec2F1H2)) / 2 
TruncatedCVs3F1 = ((sec3F1R**2) * math.pi * (sec3F1H + sec3F1H2)) / 2
TTruncatedCVs2F1 = TruncatedCVs2F1 - (CVs2F1 - TruncatedCVs2F1) #TOTAL CODE FOR SEC2 DOUBLE TRUNCATE

TruncatedCVs1F2 = ((sec1F2R**2) * math.pi * (sec1F2H + sec1F2H2)) / 2
TruncatedCVs2F2 = ((sec2F2R**2) * math.pi * (sec2F2H + sec2F2H2)) / 2 
TruncatedCVs3F2 = ((sec3F2R**2) * math.pi * (sec3F2H + sec3F2H2)) / 2
TTruncatedCVs2F2 = TruncatedCVs2F2 - (CVs2F2 - TruncatedCVs2F2)

TruncatedCVs1F3 = ((sec1F3R**2) * math.pi * (sec1F3H + sec1F3H2)) / 2
TruncatedCVs2F3 = ((sec2F3R**2) * math.pi * (sec2F3H + sec2F3H2)) / 2 
TruncatedCVs3F3 = ((sec3F3R**2) * math.pi * (sec3F3H + sec3F3H2)) / 2
TTruncatedCVs2F3 = TruncatedCVs2F3 - (CVs2F3 - TruncatedCVs2F3)

TruncatedCVs1F4 = ((sec1F4R**2) * math.pi * (sec1F4H + sec1F4H2)) / 2
TruncatedCVs2F4 = ((sec2F4R**2) * math.pi * (sec2F4H + sec2F4H2)) / 2 
TruncatedCVs3F4 = ((sec3F4R**2) * math.pi * (sec3F4H + sec3F4H2)) / 2
TTruncatedCVs2F4 = TruncatedCVs2F4 - (CVs2F4 - TruncatedCVs2F4)

TruncatedCVs1F5 = ((sec1F5R**2) * math.pi * (sec1F5H + sec1F5H2)) / 2
TruncatedCVs2F5 = ((sec2F5R**2) * math.pi * (sec2F5H + sec2F5H2)) / 2

#(WASTE)

Ws1F1 = RVs1F1 - CVs1F1
Ws2F1 = RVs2F1 - CVs2F1
Ws3F1 = RVs3F1 - CVs3F1

Ws1F2 = RVs1F2 - CVs1F2
Ws2F2 = RVs2F2 - CVs2F2
Ws3F2 = RVs3F2 - CVs3F2

Ws1F3 = RVs1F3 - CVs1F3
Ws2F3 = RVs2F3 - CVs2F3
Ws3F3 = RVs3F3 - CVs3F3

Ws1F4 = RVs1F4 - CVs1F4
Ws2F4 = RVs2F4 - CVs2F4
Ws3F4 = RVs3F4 - CVs3F4

Ws1F5 = RVs1F5 - CVs1F5
Ws2F5 = RVs2F5 - CVs2F5

WTs1F1 = CVs1F1 - TruncatedCVs1F1
WTs2F1 = CVs2F1 - TTruncatedCVs2F1
WTs3F1 = CVs3F1 - TruncatedCVs3F1

WTs1F2 = CVs1F2 - TruncatedCVs1F2
WTs2F2 = CVs2F2 - TTruncatedCVs2F2
WTs3F2 = CVs3F2 - TruncatedCVs3F2

WTs1F3 = CVs1F3 - TruncatedCVs1F3
WTs2F3 = CVs2F3 - TTruncatedCVs2F3
WTs3F3 = CVs3F3 - TruncatedCVs3F3

WTs1F4 = CVs1F4 - TruncatedCVs1F4
WTs2F4 = CVs2F4 - TTruncatedCVs2F4
WTs3F4 = CVs3F4 - TruncatedCVs3F4

WTs1F5 = CVs1F5 - TruncatedCVs1F5
WTs2F5 = CVs2F5 - TruncatedCVs2F5

#total formulas 

FINGER1RV = RVs1F1 + RVs2F1 + RVs3F1
FINGER2RV = RVs1F2 + RVs2F2 + RVs3F2
FINGER3RV = RVs1F3 + RVs2F3 + RVs3F3
FINGER4RV = RVs1F4 + RVs2F4 + RVs3F4
FINGER5RV = RVs1F5 + RVs2F5

FINGER1CV = CVs1F1 + CVs2F1 + CVs3F1
FINGER2CV = CVs1F2 + CVs2F2 + CVs3F2
FINGER3CV = CVs1F3 + CVs2F3 + CVs3F3
FINGER4CV = CVs1F4 + CVs2F4 + CVs3F4
FINGER5CV = CVs1F5 + CVs2F5

FINGER1V = TruncatedCVs1F1 + TTruncatedCVs2F1 + TruncatedCVs3F1
FINGER2V = TruncatedCVs1F2 + TTruncatedCVs2F2 + TruncatedCVs3F2
FINGER3V = TruncatedCVs1F3 + TTruncatedCVs2F3 + TruncatedCVs3F3
FINGER4V = TruncatedCVs1F4 + TTruncatedCVs2F4 + TruncatedCVs3F4
FINGER5V = TruncatedCVs1F5 + TruncatedCVs2F5 


TTWASTE = Ws1F1 + Ws2F1 + Ws3F1 + Ws1F2 + Ws2F2 + Ws3F2 + Ws1F3 + Ws2F3 + Ws3F3 + Ws1F4 + Ws2F4 + Ws3F4 + Ws1F5 + Ws2F5 + WTs1F1 + WTs2F1 + WTs3F1 + WTs1F2 + WTs2F2 + WTs3F2 + WTs1F3 + WTs2F3 + WTs3F3 + WTs1F4 + WTs2F4 + WTs3F4 + WTs1F5 + WTs2F5 

#display the answers

#finger 1
print(" ")
print(" ")
print("The total volume of finger 1 with truncated cylinder is: {0:.3f}".format(FINGER1V))
print(" ")
print("The total volume of finger 1 rectangle is: {0:.3f}".format(FINGER1RV))
print("The total volume of section 1 finger 1 rectangle: {0:.3f}".format(RVs1F1))
print("The total volume of section 2 finger 1 rectangle: {0:.3f}".format(RVs2F1))
print("The total volume of section 3 finger 1 rectangle: {0:.3f}".format(RVs3F1))
print(" ")
print("The total volume of finger 1 cylinder is: {0:.3f}".format(FINGER1CV))
print(" ")
print("The total volume of section 1 finger 1 cylinder: {0:.3f}".format(CVs1F1))
print("The total volume of section 2 finger 1 cylinder: {0:.3f}".format(CVs2F1))
print("The total volume of section 3 finger 1 cylinder: {0:.3f}".format(CVs3F1))
print(" ")

#finger 2
print("The total volume of finger 2 with truncated cylinder is: {0:.3f}".format(FINGER2V))
print(" ")
print("The total volume of finger 2 rectangle is: {0:.3f}".format(FINGER2RV))
print("The total volume of section 1 finger 2 rectangle: {0:.3f}".format(RVs1F2))
print("The total volume of section 2 finger 2 rectangle: {0:.3f}".format(RVs2F2))
print("The total volume of section 3 finger 2 rectangle: {0:.3f}".format(RVs3F2))
print(" ")
print("The total volume of finger 2 cylinder is: {0:.3f}".format(FINGER2CV))
print(" ")
print("The total volume of section 1 finger 2 cylinder: {0:.3f}".format(CVs1F2))
print("The total volume of section 2 finger 2 cylinder: {0:.3f}".format(CVs2F2))
print("The total volume of section 3 finger 2 cylinder: {0:.3f}".format(CVs3F2))
print(" ")
#finger 3
print("The total volume of finger 3 with truncated cylinder is: {0:.3f}".format(FINGER3V))
print(" ")
print("The total volume of finger 3 rectangle is: {0:.3f}".format(FINGER3RV))
print("The total volume of section 1 finger 3 rectangle: {0:.3f}".format(RVs1F3))
print("The total volume of section 2 finger 3 rectangle: {0:.3f}".format(RVs2F3))
print("The total volume of section 3 finger 3 rectangle: {0:.3f}".format(RVs3F3))
print(" ")
print("The total volume of finger 3 cylinder is: {0:.3f}".format(FINGER3CV))
print(" ")
print("The total volume of section 1 finger 3 cylinder: {0:.3f}".format(CVs1F3))
print("The total volume of section 2 finger 3 cylinder: {0:.3f}".format(CVs2F3))
print("The total volume of section 3 finger 3 cylinder: {0:.3f}".format(CVs3F3))
print(" ")

#finger 4
print("The total volume of finger 4 with truncated cylinder is: {0:.3f}".format(FINGER4V))
print(" ")
print("The total volume of finger 4 rectangle is: {0:.3f}".format(FINGER4RV))
print("The total volume of section 1 finger 4 rectangle: {0:.3f}".format(RVs1F4))
print("The total volume of section 2 finger 4 rectangle: {0:.3f}".format(RVs2F4))
print("The total volume of section 3 finger 4 rectangle: {0:.3f}".format(RVs3F4))
print(" ")
print("The total volume of finger 4 cylinder is: {0:.3f}".format(FINGER1CV))
print(" ")
print("The total volume of section 1 finger 4 cylinder: {0:.3f}".format(CVs1F4))
print("The total volume of section 2 finger 4 cylinder: {0:.3f}".format(CVs2F4))
print("The total volume of section 3 finger 4 cylinder: {0:.3f}".format(CVs3F4))
print(" ")

#finger 5
print("The total volume of finger 5 with truncated cylinder is: {0:.3f}".format(FINGER5V))
print(" ")
print("The total volume of finger 5 rectangle is: {0:.3f}".format(FINGER5RV))
print("The total volume of section 1 finger 5 rectangle: {0:.3f}".format(RVs1F5))
print("The total volume of section 2 finger 5 rectangle: {0:.3f}".format(RVs2F5))
print(" ")
print("The total volume of finger 5 cylinder is: {0:.3f}".format(FINGER5CV))
print(" ")
print("The total volume of section 1 finger 5 cylinder: {0:.3f}".format(CVs1F5))
print("The total volume of section 2 finger 5 cylinder: {0:.3f}".format(CVs2F5))
print(" ")

#waste volume
print("The waste produced by section 1 finger 1 is: {0:.3f}".format(Ws1F1))
print("The waste produced by section 2 finger 1 is: {0:.3f}".format(Ws2F1))
print("The waste produced by section 3 finger 1 is: {0:.3f}".format(Ws3F1))
print(" ")
print("The waste produced by section 1 finger 2 is: {0:.3f}".format(Ws1F2))
print("The waste produced by section 2 finger 2 is: {0:.3f}".format(Ws2F2))
print("The waste produced by section 3 finger 2 is: {0:.3f}".format(Ws3F2))
print(" ")
print("The waste produced by section 1 finger 3 is: {0:.3f}".format(Ws1F3))
print("The waste produced by section 2 finger 3 is: {0:.3f}".format(Ws2F3))
print("The waste produced by section 3 finger 3 is: {0:.3f}".format(Ws3F3))
print(" ")
print("The waste produced by section 1 finger 4 is: {0:.3f}".format(Ws1F4))
print("The waste produced by section 2 finger 4 is: {0:.3f}".format(Ws2F4))
print("The waste produced by section 3 finger 4 is: {0:.3f}".format(Ws3F4))
print(" ")
print("The waste produced by section 1 finger 5 is: {0:.3f}".format(Ws1F5))
print("The waste produced by section 2 finger 5 is: {0:.3f}".format(Ws2F5))

#The truncated cylinder waste

print("The waste produced by section 1 finger 1 of the truncated cylinder is: {0:.3f}".format(WTs1F1))
print("The waste produced by section 2 finger 1 of the truncated cylinder is: {0:.3f}".format(WTs2F1))
print("The waste produced by section 3 finger 1 of the truncated cylinder is: {0:.3f}".format(WTs3F1))
print(" ")
print("The waste produced by section 1 finger 2 of the truncated cylinder is: {0:.3f}".format(WTs1F2))
print("The waste produced by section 2 finger 2 of the truncated cylinder is: {0:.3f}".format(WTs2F2))
print("The waste produced by section 3 finger 2 of the truncated cylinder is: {0:.3f}".format(WTs3F2))
print(" ")
print("The waste produced by section 1 finger 3 of the truncated cylinder is: {0:.3f}".format(WTs1F3))
print("The waste produced by section 2 finger 3 of the truncated cylinder is: {0:.3f}".format(WTs2F3))
print("The waste produced by section 3 finger 3 of the truncated cylinder is: {0:.3f}".format(WTs3F3))
print(" ")
print("The waste produced by section 1 finger 4 of the truncated cylinder is: {0:.3f}".format(WTs1F4))
print("The waste produced by section 2 finger 4 of the truncated cylinder is: {0:.3f}".format(WTs2F4))
print("The waste produced by section 3 finger 4 of the truncated cylinder is: {0:.3f}".format(WTs3F4))
print(" ")
print("The waste produced by section 1 finger 5 of the truncated cylinder is: {0:.3f}".format(WTs1F5))
print("The waste produced by section 2 finger 5 of the truncated cylinder is: {0:.3f}".format(WTs2F5))
print(" ")
print("The total volume of waste produced is: {0:.3f}".format(TTWASTE))

The End

After a few days of work, you will be the proud father of a robotic hand and 3 codes.