Build Your Own Ardruino 6DOF Motion Platform

Here you can show and share your design ideas and ask questions about them

Build Your Own Ardruino 6DOF Motion Platform

Postby futuresims » Fri 24. May 2013, 05:19

Hi,
The guys at FullMotionDynamics really did a superb job.


How to build an Arduino-powered 6DOF motion platform

Here are the instructions and parts lists for,

How to build an Arduino-powered 6DOF motion platform

This instructable will show you how to create your own six degree of freedom motion plat-
form using an Arduino microcontroller and some standard servo motors for ~$100. The
math/programming is somewhat complicated and will be covered in another instructable.

Here's a video of some basic movements just by moving a few arms (no math involved yet):
http://youtu.be/cfnBnx8Cvcg

Here is a list of the items (and potential sources) needed to complete this project:

1 Arduino Uno microcontroller (Amazon)
6 standard servos (Parallax)
12 4-40 rod ends (ServoCity)
12 conical spacers (New Era Models)
2 ft 4-40 threaded rod (McMaster-Carr)
16 4-40 11/16" at head machine screws (McMaster-Carr)
12 4-40 nylok nuts (McMaster-Carr)
4 4-40 3/16" pan head machine screws (McMaster-Carr)
4 4-40 threaded aluminum spacers (McMaster-Carr)
1 mini breadboard (Amazon)
2 sq. ft. 1/4" thick acrylic (TAP plastics)

The only hand tools you will need are a small phillips-head screwdriver, a 1/4" wrench, and a
1/8" drill bit/drill, but you will need access to a laser cutter to cut the acrylic. I used a laser
cutter at TechShop in Menlo Park. TechShop is a DIY workshop, if you are interested check
out their website, http://www.techshop.ws.


Cut the acrylic

The rst step is to cut the acrylic. I have attached the les I used, which you can also modify
if you want. Make sure to check tment on the holes for the servo mounting, etc. to make
sure the tment will be right before cutting everything out only to nd the holes are too
loose.

I created these les using Autodesk's AutoCAD Mechanical 2012, which is also available at
TechShop if you don't have a copy of your own.
There are 3 les to be cut out of 1/4" acrylic: base_bottom.eps, base_top,eps, and plat-
form.eps

And 1 le to be cut out of 1/8" acrylic: servo_arms.eps

Assemble the connecting links

The next step is to cut the rods to length. I used 2x 1 ft. sections, which I cut into 6x 4"
pieces. Make sure that the ends are cleaned up nicely because they will be threading into
plastic which can be easily damaged by the metal if there is a burr.

Once the rods are cut to length, simply thread a rod end onto each end of each rod, making
sure that all 6 rods are exaclty the same length from end to end when you are done.

Assemble the connecting links
Assemble the connecting links


Glue and install the servo arms

The next step is to glue and install the servo arms onto the servos. I used a liquid acrylic
solvent from TAP plastics, but you can use any glue you like. With the liquid solvent
approach, I found it helps to lightly sand the surfaces being glued to ensure they stay
together.

Glue and install the servo arms
Glue and install the servo arms


Glue the circular piece to the arm as shown in the picture, making sure that the splined piece
still ts onto the servo arm (the laser creates a slightly tapered cut, so the splined pattern will
t on the servo shaft in one orientation better than the other)

Assemble the platform

Start by threading the servo connectors through the base_top piece from the bottom up,
then push the servo into place and thread the connector back down through the other hole.
Do this for all 6 servos.

Now you can mount the Arduino using the threaded aluminum spacers, 3/16" pan head
screws, and 11/16" at head screws. To make it look nice you can countersink the bottom
side of the holes in the acrylic so the at heads sit ush, but it's entirely necessary. You may
also need to shave o a bit of the aluminum spacers so that the t at against the Arduino
(you'll see what I mean when you try to assemble them).

Once the Arduino is mounted, you can stick the breadboard right underneath it, in between
all the servos. With the breadboard in place, you can wire everything up. The servos all need
+5V on the red wire, ground on the black wire, and signal from the Arduino on the white
wire. Make sure you use the PWM capable pins on the Arduino (I used pins.3, 5, 6, 9, 10, 11).
Route the wires as shown in the picture.

Once everything is wired up, you can install the base_bottom piece. As you can see there is
no mounting hardware for the servos, it's just a "press" t. This is for ease of assembly/disas-
sembly/debugging, so don't worry if you didn't get something wired up correctly.

Now it's time to add the connecting links. Start by attaching the links to the servo arms. Use
a at head screw through the rod end, then a conical spacer, then the arm, and into a nylok
nut on the back. Before attaching the top, you'll need to drill 1/8" holes in the sides of the
platform where the holes for the nuts are. Once you've drilled the holes, the connecting
links attach the same way they did on the bottom: a at head screw through the rod end,
then a conical spacer, then the acrylic and into a nylok nut embedded in the platform. Be
careful not to overtighten these as the plastic can easily crack.

You're done! You can play around with the programming yourself, or you can check out my
other instructable on how to program the platform.

How to program an Arduino-powered 6DOF motion platform

Assemble the platform
Assemble the platform


How to program an Arduino-powered 6DOF motion platform

This is a follow up to my previous instructable about building an Arduino powered 6 degree
of freedom motion platform. In this instructable, I'll talk about programming the platform
using an inverse kinematics approach.

I built the platform using a laser cutter at the TechShop in Menlo Park, CA, and I started
learning about the Arduino microcontroller in TechShop's Arduino class. TechShop is a DIY
workshop, if you're interested check out their website at http://www.TechShop.ws

In robotics, inverse kinematics, as opposed to forward or direct kinematics, is the process of
determing the positions of each actuator necessary to achieve a given position of the end
e ector (in this case the platform), rather than determing the position of the end e ector
given the positions of each actuator.

I won't go into too much detail on the math, but the basic idea is this: The microcontroller
calculates the position of the upper mounting points for the connecting links by taking into
account the desired position and orientation of the platform relative to the base along with
the position of the mounting points relative to the platform itself. It then calculates the
current position of the lower mounting points based on the current position of the servo
arm and it's position relative to the base. The distance between these two points is then
compared to the physical length of the connecting links and the servo arm is moved up or
down accordingly.

How to program an Arduino-powered 6DOF motion platform
How to program an Arduino-powered 6DOF motion platform


Here is my code, I have commented it with descriptions of each variable, and I'll try to
explain as much as I can here about how to use it. I have also attached the .ino le if you
want to load it directly into the Arduino IDE.

Looking down at the platform with the USB port pointing away from you, the positive x axis
is to your right, positive y away from you (in line with the USB port), and positive z is up.
rotation follows the right-hand rule (point your thumb in the direction of the positive axis,
your ngers curl in the positive rotation direction), so positive x rotation will tilt the platform
back, positive y rotation will tilt the platform to the right, and positive z rotation will rotate
the platform counter-clockwise.

The platform will "rest" at a speci c height (z_home)
The array pe[6] contains the information about where the platform should be:

pe[ x position , y position, z position, x rotation , y rotation , z rotation]

changing the x position, y position, and z position variables will move the platform accord-
ingly (in inches). Changing the x roation, y rotation, and z rotation variables will rotate the
platform accordingly (in radians).

So tell the platform where you want it to be by changing the appropriate variables, then
uploading the code. Once uploaded, the platform will initialize to the "home" position and
pause for one second, then move to the desired position.

I'll talk about incorporating some type of realtime position input in another instructable.
ALternatively, you could write a loop to run the platform through a series of movements
such as this: http://youtu.be/cfnBnx8Cvcg

The code:

#include <Servo.h>

const oat pi = 3.14159, theta_r = radians(48.0), theta_p = radians(23.2), theta_s[] = {-pi/3,
2*pi/3, pi, 0, pi/3, -2*pi/3},
RD = 2.395, PD = 3.3, L1 = 1.0, L2 = 4.72, z_home = 4.25, servo_min, servo_max,
servo_mult
p[2][6] = {{PD*cos(pi/6 + theta_p), PD*cos(pi/6 - theta_p), PD*cos(-(pi/2 - theta_p)),
-PD*cos(-(pi/2 - theta_p)), -PD*cos(pi/6 - theta_p), -PD*cos(pi/6 + theta_p)},
{PD*sin(pi/6 + theta_p), PD*sin(pi/6 - theta_p), PD*sin(-(pi/2 - theta_p)),
PD*sin(-(pi/2 - theta_p)), PD*sin(pi/6 - theta_p), PD*sin(pi/6 + theta_p)}},
re[2][6] = {{RD*cos(pi/6 + theta_r), RD*cos(pi/6 - theta_r), RD*cos(-(pi/2 - theta_r)),
-RD*cos(-(pi/2 - theta_r)), -RD*cos(pi/6 - theta_r), -RD*cos(pi/6 + theta_r)},
{RD*sin(pi/6 + theta_r), RD*sin(pi/6 - theta_r), RD*sin(-(pi/2 - theta_r)),
RD*sin(-(pi/2 - theta_r)), RD*sin(pi/6 - theta_r), RD*sin(pi/6 + theta_r)}};

/*
theta_r = angle between attachment points
theta_p = angle between rotation points
theta_s = orientation of the servos
RD = distance to end e ector attachment points
PD = distance to servo rotation points
L1 = servo arm length
L2 = connecting arm length
z_home = default z height with servo arms horizontal
servo_min = lower limit for servo arm angle
servo_max = upper limit for servo arm angle
servo_mult = multiplier to convert to milliseconds
p = location of servo rotation points in base frame [x/y][1-6]
re = location of attachment points in end e ector frame [x/y][1-6]
*/


const int servo_pin[] = {9,3, 5, 11, 6, 10}, servo_zero[6] = {1710, 1280, 1700, 1300, 1680, 1300};
/*
servo_pin = servo pin assignments,
servo_zero = zero angles for each servo (horizontal)
*/
Servo servo[6];
/*
Servos 0, 2, 4: reversed (+ = down, - = up)
Servos 1, 3, 5: normal (+ = up, - = down)
*/
void setup()
{
//Serial.begin(9600);
for(int i = 0; i < 6; i++)
{
servo[i].attach(servo_pin[i]);
servo[i].writeMicroseconds(servo_zero[i]);
}
delay(1000);
}


void loop()
{

static oat pe[6] = {0,0,0,radians(0),radians(0),radians(0)}, theta_a[6], servo_pos[6],
q[3][6], r[3][6], dl[3][6], dl2[6];
/*
pe = location and orientation of end e ector frame relative to the base frame [sway, surge,
heave, pitch, roll, yaw)
theta_a = angle of the servo arm
servo_pos = value written to each servo
q = position of lower mounting point of connecting link [x,y,x][1-6]
r = position of upper mounting point of connecting link
dl = di erence between x,y,z coordinates of q and r
dl2 = distance between q and r
*/

for(int i = 0; i < 6; i++)
{
q[0][i] = L1*cos(-theta_a[i])*cos(theta_s[i]) + p[0][i];
q[1][i] = L1*cos(-theta_a[i])*sin(theta_s[i]) + p[1][i];
q[2][i] = -L1*sin(-theta_a[i]);


r[0][i] = re[0][i]*cos(pe[4])*cos(pe[5]) + re[1][i]*(sin(pe[3])*sin(pe[4])*cos(pe[5]) -
cos(pe[3])*sin(pe[5])) + pe[0];
r[1][i] = re[0][i]*cos(pe[4])*sin(pe[5]) + re[1][i]*(cos(pe[3])*cos(pe[5]) +
sin(pe[3])*sin(pe[4])*sin(pe[5])) + pe[1];
r[2][i] = -re[0][i]*sin(pe[4]) + re[1][i]*sin(pe[3])*cos(pe[4]) + z_home + pe[2];


dl[0][i] = q[0][i] - r[0][i];
dl[1][i] = q[1][i] - r[1][i];
dl[2][i] = q[2][i] - r[2][i];


dl2[i] = sqrt(dl[0][i]*dl[0][i] + dl[1][i]*dl[1][i] + dl[2][i]*dl[2][i]) - L2;


theta_a[i] += dl2[i];


theta_a[i] = constrain(theta_a[i], servo_min, servo_max);


if(i%2 == 1) servo_pos[i] = servo_zero[i] + theta_a[i]*servo_mult;
else servo_pos[i] = servo_zero[i] - theta_a[i]*servo_mult;
}


for(int i = 0; i < 6; i++)
{
servo[i].writeMicroseconds(servo_pos[i]);
}
}

Platform.eps
Platform.eps


Platform Laser Cutting File
Platform.rar
Platform Laser Cutting File
(21.34 KiB) Downloaded 1285 times


Base Bottom.eps
Base Bottom.eps


Base Bottom Laser Cutting File
Base_bottom.rar
Base Bottom Laser Cutting File
(18 KiB) Downloaded 1200 times


Base Top.eps
Base Top.eps


Base Top Laser Cutting File
Base_top.rar
Base Top Laser Cutting File
(24.02 KiB) Downloaded 1185 times


You do not need the code from this file.
You do not need this Arduino Controller.

You can use this controller instead by tronic
Thanos Motion Simulator Electronics Blog
http://motionsim.blogspot.ca/

The X-Sim Software does all the work

You only need to build the model.

I am doing my best to support the X-Sim3 community.

Thanks.
User avatar
futuresims
 
Posts: 33
Joined: Mon 25. Mar 2013, 15:06
Has thanked: 0 time
Been thanked: 7 times

Re: Build Your Own Ardruino 6DOF Motion Platform

Postby fw14b » Fri 24. May 2013, 13:07

Thanks for this information
I'm testing this code this week-end
Best regards
Sorry for my bad english
How do you make the link between X-SIM and arduino?
fw14b
 
Posts: 4
Joined: Tue 18. Dec 2012, 14:20
Has thanked: 4 times
Been thanked: 0 time

Re: Build Your Own Ardruino 6DOF Motion Platform

Postby futuresims » Fri 24. May 2013, 17:09

Hi,
Ask Tronic how to make the link,
Thanos Motion Simulator Electronics Blog
http://motionsim.blogspot.ca/

Thank you.
User avatar
futuresims
 
Posts: 33
Joined: Mon 25. Mar 2013, 15:06
Has thanked: 0 time
Been thanked: 7 times

Re: Build Your Own Ardruino 6DOF Motion Platform

Postby tronicgr » Fri 24. May 2013, 17:35

Yeah, but the problem is that I don't use arduino IDE to program my controllers :lol: ... I prefer using Assembly to have access to REAL registers of the microcontrollers instead of the generic and often slow ones that arduino uses. Its the only way to make a multitasking environment for realtime PID control of 6 actuators and LCD user menu and instant USB communications...

Arduino if fine though if used for less actuators ( one or two) or for non time critical applications like digital tachometer dashboard... ;)

Best Regards,
Thanos
User avatar
tronicgr
 
Posts: 624
Images: 11
Joined: Tue 20. Mar 2012, 22:10
Location: San Diego, CA
Has thanked: 130 times
Been thanked: 50 times

Re: Build Your Own Ardruino 6DOF Motion Platform

Postby sirnoname » Fri 24. May 2013, 17:55

How do you make the link between X-SIM and arduino?

Goto the project gallery, goto the interface overview, select opensource arduino project. Expand as you like ...
If a answer is correct or did help you for a solution, please use the solve button.
User avatar
sirnoname
Site Admin
 
Posts: 1829
Images: 45
Joined: Thu 1. Sep 2011, 22:02
Location: Munich, Germany
Has thanked: 35 times
Been thanked: 128 times

Re: Build Your Own Ardruino 6DOF Motion Platform

Postby V8Griff » Tue 25. Jun 2013, 11:38

Hi first post on here and I'm probably being thick but I can't see the link to download the .eps for the servo arms or is the image in the PDF the correct size?

Thanks in advance.
V8Griff
 
Posts: 1
Joined: Tue 25. Jun 2013, 11:17
Has thanked: 0 time
Been thanked: 0 time

Re: Build Your Own Ardruino 6DOF Motion Platform

Postby tronicgr » Fri 28. Jun 2013, 23:05

I'm making a 6DOF mini model. It will be using the same algorithms for PID and sensors like the real platform. The mini servo motors will only provide speed and direction and the actual positioning will be determined by position sensors. It will be fairly more complicated than the simple RC driven mini platforms and will allow to experiment with coding having it right next to me on my desk:















PS. Don't mind the appearance, I like using recycled material laying around :lol:

Thanos
User avatar
tronicgr
 
Posts: 624
Images: 11
Joined: Tue 20. Mar 2012, 22:10
Location: San Diego, CA
Has thanked: 130 times
Been thanked: 50 times

Re: Build Your Own Ardruino 6DOF Motion Platform

Postby viawave77 » Sat 13. Jul 2013, 20:00

Hi Thanos, Hi every one here.

I did the way you say, Thanos , my 6DOF mini servo function perfectly with x-sim and with bff software, here is my 3rd test :

http://youtu.be/WsTzc7H_MG4

But there is a bug that I spend 3 weeks and I can not resolve, if you norest all pair of servos have the arms to the same side, so the plataform move do not exactly behave like 3d model, how can I reverse, and change the side of one arm from one pair of servos?

regards to all sim enthusiast
Italo
viawave77
 
Posts: 5
Joined: Sun 19. May 2013, 22:06
Has thanked: 0 time
Been thanked: 0 time

Re: Build Your Own Ardruino 6DOF Motion Platform

Postby tronicgr » Sat 13. Jul 2013, 21:51

Hi Italo,

I'm not ignoring your emails, don't feel bad. I just got too busy last month moving to a new place and now got a new job (Qualcomm)!! I'm trying to keep up on my correspondence that now reached up to 3 weeks backlog!!

Since I don't have much time to make a video at the moment, I'll give you hint. I see on your video that the potentiometers axles are not connected on the miniservos arms (aligned against the servo axle). Without direction reference from the potentiometers the servos always turn to same direction...
I kind of explaining this here (other application but the principle is the same): http://www.youtube.com/watch?v=tRpw_L4h0Gg

Thanos
User avatar
tronicgr
 
Posts: 624
Images: 11
Joined: Tue 20. Mar 2012, 22:10
Location: San Diego, CA
Has thanked: 130 times
Been thanked: 50 times

Re: Build Your Own Ardruino 6DOF Motion Platform

Postby telfel » Sun 14. Jul 2013, 08:20

Hi viawave77

from my old RC days, you can reverse a servo by dismantling the servo and swapping the motor connections and the two outside connections on the feedback pot.

Or not sure if you can still buy servo reversing leads, which I assume swaps the signal timing to reverse the servo, All new Rc transmitter have menu systems to reverse servo's.

Or could you change the output timing from you system for those servo's you want to reverse?

regards Terry
User avatar
telfel
 
Posts: 108
Images: 54
Joined: Thu 22. Mar 2012, 19:05
Location: Borders Scotland UK
Has thanked: 2 times
Been thanked: 9 times

Next

Return to Motion simulator designs

Who is online

Users browsing this forum: No registered users and 1 guest

cron