Loading

OpenScad Micro Servo Robot Arm

by holgero, published

OpenScad Micro Servo Robot Arm by holgero Mar 23, 2013

Description

This design is a re-write of thingiverse.com/thing:34829 in OpenScad.

Also some of the parts were too hard to print for me, so I made them easier to print.

Recent Comments

view all
The code to control the robotic arm with 5 potentiometers:

#include

Servo ServoWally1; //Declaramos que queremos controlar un Servo, al cual le vamos a poner un nombre cualquiera
Servo ServoWally2; //Declaramos que queremos controlar un Servo, al cual le vamos a poner un nombre cualquiera
Servo ServoWally3; //Declaramos que queremos controlar un Servo, al cual le vamos a poner un nombre cualquiera
Servo ServoWally4; //Declaramos que queremos controlar un Servo, al cual le vamos a poner un nombre cualquiera
Servo ServoWally5; //Declaramos que queremos controlar un Servo, al cual le vamos a poner un nombre cualquiera


int pot1 = 0; //El pin análogo donde va conectado el Potenciómetro
int pot2 = 1; //El pin análogo donde va conectado el Potenciómetro
int pot3 = 2; //El pin análogo donde va conectado el Potenciómetro
int pot4 = 3; //El pin análogo donde va conectado el Potenciómetro
int pot5 = 4; //El pin análogo donde va conectado el Potenciómetro

int val1; //El valor a leer por el puerto análogo
int val2; //El valor a leer por el puerto análogo
int val3; //El valor a leer por el puerto análogo
int val4; //El valor a leer por el puerto análogo
int val5; //El valor a leer por el puerto análogo

void setup()
{
ServoWally1.attach(12); //El pin al cual conectaremos nuestro Servo
ServoWally2.attach(11); //El pin al cual conectaremos nuestro Servo
ServoWally3.attach(10); //El pin al cual conectaremos nuestro Servo
ServoWally4.attach(9); //El pin al cual conectaremos nuestro Servo
ServoWally5.attach(8); //El pin al cual conectaremos nuestro Servo

}

void loop()
{
val1 = analogRead(pot1); //Aquí le decimos que lea el valor del potenciómetro, valor el cual oscila entre 0 y 1023
val1 = map(val1, 0 ,1023, 0, 180); //Traduce la lectura análga (0, 1023) a grados (0°, 180°)
ServoWally1.write(val1); //Mueve el Servo según la lectura análoga

val2 = analogRead(pot2); //Aquí le decimos que lea el valor del potenciómetro, valor el cual oscila entre 0 y 1023
val2 = map(val2, 0 ,1023, 0, 180); //Traduce la lectura análga (0, 1023) a grados (0°, 180°)
ServoWally2.write(val2); //Mueve el Servo según la lectura análoga

val3 = analogRead(pot3); //Aquí le decimos que lea el valor del potenciómetro, valor el cual oscila entre 0 y 1023
val3 = map(val3, 0 ,1023, 0, 180); //Traduce la lectura análga (0, 1023) a grados (0°, 180°)
ServoWally3.write(val3); //Mueve el Servo según la lectura análoga

val4 = analogRead(pot4); //Aquí le decimos que lea el valor del potenciómetro, valor el cual oscila entre 0 y 1023
val4 = map(val4, 0 ,1023, 0, 180); //Traduce la lectura análga (0, 1023) a grados (0°, 180°)
ServoWally4.write(val4); //Mueve el Servo según la lectura análoga

val5 = analogRead(pot5); //Aquí le decimos que lea el valor del potenciómetro, valor el cual oscila entre 0 y 1023
val5 = map(val5, 0 ,1023, 0, 180); //Traduce la lectura análga (0, 1023) a grados (0°, 180°)
ServoWally5.write(val5); //Mueve el Servo según la lectura análoga

}
Looks cool, definitely going to make one.

One question about the motors. Does it matter if I use 9g Continuous Rotation Micro Servo or non-Continuous?
Anyone have the code for arduino?

More from Robotics

view more

Liked By

view all

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

You will need additionally 5 micro servos 9g with their accessories, 4 small screws and a pic18F13K50 to control the servos via USB from your PC.

Either use the RoboArm.scad file and follow the instructions at the end of the file which modules you need and render them to stl files. You may want to check the diameter of the shaft of your servos and adjust the inner radius of the gripperGear (I used 2.5 mm).

Or use the stl files directly if you don't need to change anything.

Either way, slice the stl files (I used Slic3r, layer height was 0.3 mm for all parts). Don't add support, it is included in the design, but add a brim to all of the Arm-parts (I printed the Gripper without brim, but I think I was just lucky, so you probably want to add a brim to them, too).

Print the Foot, Swing, ArmSpring, Arm, ArmFront, FrontPlate and GripperGear once. Print Gripper and GripperRack twice.

Remove the support: The Swing, ArmSpring and Arm have a small support piece below the mount for the next arm, remove that. Also the holes in the side of the Gripper are not connected, cut the plastic to connect the holes.

Assemble the parts and the servos. Use the quad horn for the servo in the Foot and the small screws to attach it to the Swing. The servos in the Swing, ArmSpring and Arm use the horn with one arm. The servo in the ArmFront needs no horn, but the GripperGear.

Don't forget the FrontPlate when fixing the servo in the ArmFront, it goes between the servo and its cage.

To control the servos I use a pic18F13K50, the software (firmware for the PIC and a java program to control it) is available at github: github.com/holgero/PicUsbServo .
The code to control the robotic arm with 5 potentiometers:

#include

Servo ServoWally1; //Declaramos que queremos controlar un Servo, al cual le vamos a poner un nombre cualquiera
Servo ServoWally2; //Declaramos que queremos controlar un Servo, al cual le vamos a poner un nombre cualquiera
Servo ServoWally3; //Declaramos que queremos controlar un Servo, al cual le vamos a poner un nombre cualquiera
Servo ServoWally4; //Declaramos que queremos controlar un Servo, al cual le vamos a poner un nombre cualquiera
Servo ServoWally5; //Declaramos que queremos controlar un Servo, al cual le vamos a poner un nombre cualquiera


int pot1 = 0; //El pin análogo donde va conectado el Potenciómetro
int pot2 = 1; //El pin análogo donde va conectado el Potenciómetro
int pot3 = 2; //El pin análogo donde va conectado el Potenciómetro
int pot4 = 3; //El pin análogo donde va conectado el Potenciómetro
int pot5 = 4; //El pin análogo donde va conectado el Potenciómetro

int val1; //El valor a leer por el puerto análogo
int val2; //El valor a leer por el puerto análogo
int val3; //El valor a leer por el puerto análogo
int val4; //El valor a leer por el puerto análogo
int val5; //El valor a leer por el puerto análogo

void setup()
{
ServoWally1.attach(12); //El pin al cual conectaremos nuestro Servo
ServoWally2.attach(11); //El pin al cual conectaremos nuestro Servo
ServoWally3.attach(10); //El pin al cual conectaremos nuestro Servo
ServoWally4.attach(9); //El pin al cual conectaremos nuestro Servo
ServoWally5.attach(8); //El pin al cual conectaremos nuestro Servo

}

void loop()
{
val1 = analogRead(pot1); //Aquí le decimos que lea el valor del potenciómetro, valor el cual oscila entre 0 y 1023
val1 = map(val1, 0 ,1023, 0, 180); //Traduce la lectura análga (0, 1023) a grados (0°, 180°)
ServoWally1.write(val1); //Mueve el Servo según la lectura análoga

val2 = analogRead(pot2); //Aquí le decimos que lea el valor del potenciómetro, valor el cual oscila entre 0 y 1023
val2 = map(val2, 0 ,1023, 0, 180); //Traduce la lectura análga (0, 1023) a grados (0°, 180°)
ServoWally2.write(val2); //Mueve el Servo según la lectura análoga

val3 = analogRead(pot3); //Aquí le decimos que lea el valor del potenciómetro, valor el cual oscila entre 0 y 1023
val3 = map(val3, 0 ,1023, 0, 180); //Traduce la lectura análga (0, 1023) a grados (0°, 180°)
ServoWally3.write(val3); //Mueve el Servo según la lectura análoga

val4 = analogRead(pot4); //Aquí le decimos que lea el valor del potenciómetro, valor el cual oscila entre 0 y 1023
val4 = map(val4, 0 ,1023, 0, 180); //Traduce la lectura análga (0, 1023) a grados (0°, 180°)
ServoWally4.write(val4); //Mueve el Servo según la lectura análoga

val5 = analogRead(pot5); //Aquí le decimos que lea el valor del potenciómetro, valor el cual oscila entre 0 y 1023
val5 = map(val5, 0 ,1023, 0, 180); //Traduce la lectura análga (0, 1023) a grados (0°, 180°)
ServoWally5.write(val5); //Mueve el Servo según la lectura análoga

}
Looks cool, definitely going to make one.

One question about the motors. Does it matter if I use 9g Continuous Rotation Micro Servo or non-Continuous?
Anyone have the code for arduino?
Great update of original!
I have printed, assembled and programmed. It records and replays but not correctly. When you lock in the servo into the arm segment would the best position be having the arm straight up and servo at about middle of overall range?
Just printed and assembled this, the one problem I had is that the servo cage on the base piece and the front plate don't make allowances for the servo cable, so I had to shave off a few cm on those parts to get around the servo cable.

Really nice though, I'll upload a "made" as soon as I get it attached to a controller!
I've built the parts and will assemble it when I get the proper servos.
Thanks for sharing this great design.
The hole in the gripper gear is much larger than the spline on the micro servo I have.
I ordered different servos to see if that is the difference.
How do you attach the servo horn to the bottom of the swing?
It printed smooth. Thought there would be screw holes.
Just curious- how much would this be in material costs, if all the pieces were printed? Unfortunately I do all of my printing through Shapeways, so everything gets a little spendy. THANKS!
I am sorry, I have no idea. Printed it on my own printer, so I don't know what Shapeways would charge for it. Don't they tell you the price when you try to order?
Of course. I calculated out the Shapeways cost, and it comes out to be $60.45 + Shipping and tax - and that's for a smoothed out plastic, that is similar to a commercial grade quality. Since I don't have my own PLA printer, I was just trying to get a ballpark for the cost (seeing if it was better for me to buy my own printer for the long-term).
Ah now I get it you mean the material cost if printed on your own printer? If you do not have too many failed attempts, it is quite cheap. I pay about 25 Euros, thats about $ 33 per kg for the filament. I never tried to weigh the parts separately, but most of the 1 kg spool I bought is still here. I would say it is perhaps about $ 2 for the ABS. In any case it is negligible in comparison to the servos.
YOWZAH! THAT'S CHEAP!!!! I ended up hiring on guy on Fiverr.Com to print the parts for me, so I'll see what kind of quality he's able to make. He's charging me something like $25 (and that includes shipping).

Thanks for uploading the models BTW. Much appreciated! Can't wait to try out the arm!
I should perhaps mention that the quality I can achieve on my printer does not come close to what you get from Shapeways, though. If it has really fine structure or if you want to do something like jewelry, you might still want to let them do the job. But this thing prints well on my reprap.
I ordered these: dx.com/p/mystery-9g-mini-servo-with-accessories-1-3kg-torque-20023 . They were quite cheap and if they haven't change anything they should fit perfectly. (OK, the arms are a bit to tight, so the fit is not really perfect, but it was good enough...).
Where did you get your servos from? all the ones that i see dont have the right horns with them.
Unlike the original design of bentommye this one is really printable for me. Printed with brim, but I think it wouldn't be needed. Thanks for sharing!
Top