Introduction: Arduino Controlled Rotary Stewart Platform

Picture of Arduino Controlled Rotary Stewart Platform

This instructable is about building a Rotary Stewart Platform. It allows to position its moving platform in six degrees of freedom. This specific platform is designed to be able to position a DSLR or any other digital camera.

This version of Stewart Platform uses instead of linear actuators just ordinary hobbyist servos for motion. Whole platform is controlled by an Arduino Uno, it computes all necessary equations to get the platform into right position and also controls servos.

Video of movement of completed platform can be seen here. Quality is not very good, but camera with better picture was at the time of capture on the platform. It was set-up for random position every 4 seconds.

Some informations about platform:

  • weight of load can be up to 2Kg (platform tested with 1.5Kg with no observable problems during moves in whole range of movements), theoretically platform should be able to cope with even higher loads, but it wasn't tested with such load
  • low power consumption - with load of 1kg was consumption of around 5W.
  • very good fineness of moves - smallest possible move is around 1mm
  • perfect ability to repeatedly achieve the same positions.
  • good stability of platform even with big loads.

All source files for platform (templates, Arduino source code, code for communication library can be found here.

Price of platform mostly depends on the price of servos and of the Arduino board. Cutting of parts, all other needed parts cost at most 50$. Total price can be around 150$.

IrDA and LCD with I2C interface were bought from ebay, they are very cheap (together around 10$)

Parts of platform are cutted from acrylic, i used 4mm acrylic.

Needed tools:

  • drill
  • screwdriver
  • tools needed for soldering and creation of PCB for connecting external power supply
  • measuring tools
  • double sided tape

In case of any questions, feel free to contact me.

Step 1: Building Moving Platform

Picture of Building Moving Platform

We start by cutting parts from acrylic, here we will use templates from files platform_bot and platform_top. This platform is divided into two parts for better universality, just by changing top part of platform you can adapt it for various purposes. They are put together using screws placed in holes A1-A3.

Dimensions are chosen with respect to size of ordinary DSLR. Platform can be changed to be smaller or bigger.

At denoted places B1-B3 in bottom part of platform it is needed to drill holes which are used for anchoring of connecting rods. On third picture you can see proper way of doing that. These weird deformations in acrylic were caused by using CA glue to fix screws in acrylic.

On top of the moving platform it is necessary to place a piece of rubber or foam and fix it there with double sided tape. It will prevent unwanted rotations and movements of camera on the platform.

Length of connecting rods should be around 12cm and they should be bended as can be seen on picture of completed platform. This bend greatly improves range of movements. Length of rods should be chosen so that the angle between servo arms in horizontal position and the rod is around 70°.

Step 2: Building Base of the Platform

Picture of Building Base of the Platform

To build base of the platform we will at first need to build PCB for connecting external power supply for the servos. Basic idea behind it and whole schematic of all connections can be seen on the schematic. Layout of the PCB is in the power_board_layout.svg. To all connection points in blue rectangle will go pins for connecting servos. In green area should be sockets for providing power to other accessories such as LCD and IrDA. In purple is shown connection point of power switch. By letter C are denoted positions of capacitors. Last signal cable is connected to ground, this one will be connected to GND socket on the Arduino. Without this connection, servos would run very badly.

Next you should cut main base parts from acrylic based on templates base_bot and base_top. At first, fix the PCB on the bottom part with screws through holes C, and fix three connecting legs (from file servo_arm.dxf) to holes B1-B3. Next place servos on top part, servos should be mounted in holes A0-A5, their signal cables should be led through holes S and W, the right way can be seen on a provided picture, connect all servo connectors to the board, also get all signal cables supposed to go into the Arduino to the top side through holes W. Now fix the connecting leg on top side of base, now it should hold together tightly, if servos can move, fix them with a bit of glue from hot melt glue gun.

Screw spacer screws into holes AD, fix Arduino on them, connect all the cables. Fix the power switch in hole SW. IrDA receiver board is easily fixed with screws through holes I. To fix LCD it is necessary to fix it through helper post - it is fixed on top of the base, LCD is fixed to it from front side. Also connect all cables for LCD and IrDA.

Step 3: Putting It All Together

Picture of Putting It All Together

Cut 6 pieces of servo arms from file servo_arm.dxf. Drill hole on far side with right dimension to be able to screw there nut bolt for ball joint. On the other side drill hole through the arm, place there nut bolt used for fixing it on the servo. This can be seen on a provided picture.

Place all servos into zero position (pulse length of 1500us), then place the arms in horizontal position, tighten the screw. Now is the platform complete and ready to be used.

In source codes, there is file platform.ino, this is main program for the Arduino. Here you have to change few variables with respect to built platform. Many variables are shown on a picture.

MIN and MAX defines - min and max values of servo pulse length

zero[] - pulse lengths in which arms are in completely horizontal position

beta[] - angle between x axis and servo arm

servo_min, servo_max - angle of servo arm in min and max position

servo_mult - values are from technical documentation of the servo, it's pulse length and the resulting angle of rotation corresponding to this pulse length

L1 - servo arm length (from servo rotation point - middle of axis to the center of attachment point - ball joint). In inches

L2 - connecting leg length, in inches

z_home - height of moving platform above base, distance between servo arm and platform.

RD, PD, theta_p, theta_r values - they can be seen on pictures in previous and in this step.

equations for x and y position of servo rotation points on base and platform attachment points, they have to be calculated specificall with respect to desired orientation of x axis. It is just basic goniometry, provided picture can help understand these equations.

Step 4: How Does It Work?

Controlling platform uses inverse kinematics. We know position of base, desired position of platform, then calculate necessary rotation of servos, send them right pulses and its done.

First it is important to define basic position of base rotation points and attachment points of platform, this is bit explained in previous step.

After obtaining values of desired moves, program calculates corresponding position of moving platform attachment points. This is separated into two parts, getting translational vector - vector of movement in x y z axis, rotational matrix - matrix representing values of movement in pitch, roll, yaw, next it is combined in function getrxp, result is new position of platform. From this program finds necessary rotation of each servo, converts this angle into corresponding pulse length and sends it to the servos.

Platform with provided source code listens on serial interface, it accepts at first controlling char which denotes action, then it either executes the action or obtains/sends some data. For easier control of the platform, in src_comm_lib is C++ library for easier interfacing with Arduino, in header file there is explained its usage.


ddaytona1 (author)2017-02-22

Hi. Just viewed this design. How would you incorporate a accelerometer board to make the design into a self leveling platform?

锋吉 (author)2016-04-15

can you help with the design of stewart platform , can tell me the relationship between the platfrom radius ,base radius and height.

ThomasKNR (author)锋吉2016-04-15

Hi, ratio between size of base and platform is variable - it will affect range of movements, stability, precision (if platform is significantly smaller than base, range increases, stability and precision is decreases and vice versa), i would say size ratio of platform can be around 50-100% of size of base. Height is also variable, it can be shorter, or higher, depends on needs. If legs are very short, it will be harder to construct and range of movements will be limited by joints. If legs are long the upper platform will not be stable, precision will be bad. I would recommend to choose leg length so that in platform zeroposition their angle from base would be somewhere between 45-60°.

锋吉 (author)ThomasKNR2016-04-15

one of the document i read today , it states that In order to avoid singularities, a security margin of 15º between the platform and the links is taken. i dont fully understand what it means. it also gives an example, platform radius is 3cm, then he calculated the base radius and height accordingly .(Base R=7.6cm,H=26cm).

I just start learing stewart platform, a lot things dont understand.
Thank you for explaning my  previous  question.

SAndeepS155 (author)锋吉2016-10-11

can i knw the link of this document pls?

ThomasKNR (author)锋吉2016-04-15

The security margin should prevent legs going straight up, if they are perpendicular to base, it would be unstable and with poor performance in these extreme positions. therefore platform should always by at least bit smaller and the length of legs chosen so they would not reach these extreme positions.

lgiusti1 (author)2016-10-19

Hello, i've built the hexapod and loaded the code, after some tries got problem with power, i've burned one servo, and have to repair another, using a power supply 5volt, 1A, that goes directly in a breadboard, lcd connected on arduino, which supply did you use? Think 1A will be enough? Thx you

ThomasKNR (author)lgiusti12016-10-19

Hi, if you burned servo then you probably had severe problem with voltage or maybe put too much stress on the servo. However servos in general are tolerant and can work on various voltages, usually 4.8V-6.0V. Bigger voltage -> faster and more powerful -> in continuous stress bigger voltage will result in shorter lifespan or in extreme cases burn it faster than 5V. Check datasheet of your servos, voltage range is surely there.
Current is other question, you have 6 servos which can take a LOT of power. When i tried using servos without enough power (small cheap micro servos) they behaved purely randomly, i had no control of them at all, or with more power (but still not enough) just some of them started behave randomly when they were under load. In the end, i used cheap 3A switching power supply and big reservoir capacitor to improve behavior in current spikes. In power consumption test my servos (standard 75g cheap servos) drew around 1.2A (if i remember correctly) in platform movements, platform had load of around 1Kg.

lgiusti1 (author)2016-08-17

Hi, i'm starting with your project, i, got the cutted pieces from template, how did you drill plexiglass especially in top part, 'Cause i'm worried to damage the parts, thanks in advance for any suggestion!

ThomasKNR (author)lgiusti12016-08-17

Drilling plexi is hard indeed. Be very carefull and drill at very low speeds, it won't melt so much. It is soft so even at low drilling speeds it won't take much time to make needed holes. Often take brakes when drilling a hole if it melts too much, try to avoid any serious melting of the plexi because it can deform hole or even whole part.

lgiusti1 (author)ThomasKNR2016-08-18

Thx you so much!, did you use a press drill, a dremel? Longitudinal holes are pointing towards center of platform bot, or are just parallel?

ThomasKNR (author)lgiusti12016-08-18

I only had dremel so i used it, press drill would be much better. I think i drilled them to point to the center, although it might not be strictly necessary.

ErchaoX (author)2016-08-08

hello ,i would like to know how big the stall toque of each servo is so that it can match 2kg loads. And what is the theroretical basis ? thanks very much! thanks again!

KeyserS5 (author)2016-07-31

Is that platform having 6 dof?. Correct me if i am wrong, that connecting rod should have one universal joint and one spherical joint right?

RyanE50 (author)2016-06-25

Where did you get those connecting rods? I have looked all over the internet for something like that and have had no luck

Sasa_D (author)RyanE502016-07-21

I used bicycle spokes and fitted them with laser cut perspecx at ends. worked perfectly.

Sasa_D made it! (author)2016-07-21

I went a step further with this. I was able to make a mobile stabilization platform with active suspension. Thanks a lot for the tutorial. It helped a lot. I'll post my instructable soon

PiotrekTom2 (author)2016-04-18

Hello, can you graphically show is how the program works?

I would like to control via the serial port, what do I need to send?

Can you describe how you looks control by IR?

Can you put videos from the platform?

I do not understand this part of the program: "static float arr [6] = {0,0.0,0, radians (0), radians (0), radians (0)};" X, Y, Z, three times rotation but what is the fourth 0 ??

锋吉 (author)2016-04-15


what is the range of theta p , will it affect the stability of stewart platform?

NeoB0b (author)2016-01-17

Hi ThomasKNR,

First I would like to thank you for sharing your job.

Got the same problem than PauloA25 (POINTER_REGS).

I'm actually working with the 1.6.7.

I found some infomartions on that problem.

It may come from the incapacity of the compiler to solve the equation. The recurent answer I read was to simplify the equation to help the compiler to solve the function.

In my case it happens with the 'getrpx'

void getrxp(float pe[])
for(int i=0;i<6;i++){
rxp[0][i] = T[0]+(M[0][0]*(re[0][i]))+(M[0][1]*(re[1][i]))+(M[0][2]*(re[2][i]));
rxp[1][i] = T[1]+(M[1][0]*(re[0][i]))+(M[1][1]*(re[1][i]))+(M[1][2]*(re[2][i]));
rxp[2][i] = T[2]+(M[2][0]*(re[0][i]))+(M[2][1]*(re[1][i]))+(M[2][2]*(re[2][i]));

When I delete one of the terms of the addition, the compiler manages to do all of its task.

So I would like to split the 'getrpx' terms in 2 steps in order to help the compiler.

But I'm a beginner in literal programming and not even better in matrix calculation.

Can someone please help us on that problem?

liu_sn_hit (author)NeoB0b2016-02-29

hi, nice to meet you have design the platform yet?

Curfew (author)NeoB0b2016-01-27

I had this exact same issue; googling reveals that it's most likely a "behind the scenes" bug in the 1.6.x compiler. I downgraded to Arduino 1.0.5, and the script compiled and uploaded. Very bizarre!

PauloA25 (author)2015-12-16

I’m having difficulties compiling the source code with Arduino IDE 1.6.6

"exit status 1

unable to find a register to spill in
class 'POINTER_REGS' "

Any ideas?

Robitor (author)2015-11-14

Hi, could you give information about weight of your Stewart Platform? Thanks, i wish you continued success.

Pablo CesarM (author)2015-11-07

Hi, could you send me some pictues from different angles of the completed platform, especifically the part of the connections. Thanks!

MatthewK30 (author)2015-10-29

Hi, may i ask for the platform, the angle of where the 2 nails are drilled in plays a difference? If so, where can i find the difference in the code.

In detail about step 1, the building of an Platform.

ThomasKNR (author)MatthewK302015-11-03

Hi, in the picture in step 3, these points are REx, therefore the angle is theta_r. Base attachment points are Px.

ggrimlock (author)2015-11-03

Could you better explain:
static float arr[6]={0,0.0,0, radians(0),radians(0),radians(0)};

It is clear that the last 3 are the rotation angles in radians, are the other 3 in mm or inchs?

I want to use your arduino source modified so that I can send 6 values straight via serial port. In which case I'm using a variation of your SETPOSITIONS case.

which are the value ranges that I can send in order to get the rest of the functions working as expected?


ThomasKNR (author)ggrimlock2015-11-03

Hi, the positions array expects to use inches as unit. However, in my communication protocol through serial i expect mm. Ranges of units can be anything, it will calculate something. However, if you use bigger numbers, then the platform can reach its mechanical limits, after that the precision is lost, eg. if you use big numbers, platform will most likely move all the way up. Therefore you are limited by mechanical properties of your platform, if you need to know precisely, i suggest you can make a program which will move platform in all directions, and in all their combinations, and log whether there was any clipping of values (position is beyond reach) or not. To do that, i suggest just simulating it, it will be way faster than with platform moving.

AleksanderH (author)2015-09-29


I am curently looking at your code as i am developing a platform of my own, altough i will run it from a rpi, and coding in python. when testing your code the void getrxp(float pe[]) fails, i assume it is because you have used re inside function not pe, yet when i change it i get the compile error

platform.ino: In function 'void getrxp(float*)':
platform:220: error: invalid types 'float[int]' for array subscript

any help would be greate, thanks

ThomasKNR (author)AleksanderH2015-10-01

in getrxp the argument is not used, i probably forgot to delete it. In getT you calculate vector for move in x,y,z direction. In getmatrix is calculated just rotation matrix. In getrxp you apply this vector and rotation matrix to get the desired position of attachment points of moving platform. So you don't need pe[] here.

raul91 (author)2015-09-30

Hey awesome project!

I just have a quick question, you bend the rods to improve mobility to the platform but would it be possible to design the base smaller than the bottom platform (platform_bot), that way bending the rods wouldn't be necessary?

It's difficult to tell from the photo what angle the rods are bent, so I may be wrong.

ThomasKNR (author)raul912015-10-01

Hi, of course you can adjust size and shape of the top plane of the base (as long as you can still mount servos firmly on the base). It can help (and it will), but even the servo itself can get into way of the rod. The angle and distance of the bend from servo arm are not very important. Just bend it slightly and later you will see, only thing that is necessary is to make all rods with the same bend.

bobbytaylor7 (author)2015-09-04

This is great

MatthewK30 (author)2015-09-02

How did you code the platform? ( Explain the code )

Is there a difference if you change the distance between the servo and push rod

Thanks, any help will be appreciated.

ThomasKNR (author)MatthewK302015-09-02

Of course if you change sizes or lengths, you also need to change appropriate variables in the code. You shouldnt need to change code calculating inverse kinematic, only input variables.

MatthewK30 (author)ThomasKNR2015-09-02

Is there any steps or videos to show how to code, as im new to Arduino and i cant understand the code. However, I do know the values of the servos would change accordingly to output values of flight simulator


kanna (author)2015-08-15

awesome project. I need some advice on cutting acrylic sheet, particularly,
the rectangular holes to hold the servos. How did you do it and what tools
did you use? Thank you.

ThomasKNR (author)kanna2015-08-17

Hi, i didn't cut it by hand at all. At local advertising company they have laser cutter, they provided me with the plastic and also cutted it precisely with laser for reasonable price. Yet, if i had to cut it myself, i would definitely use dremel drill by drilling few holes and then connecting them.

MohamadM (author)2015-06-06

Hi, Great Project

I've one question do i need swivel ball links or ordinary links at end of each rod?

ThomasKNR (author)MohamadM2015-06-07

Hi, you will definitely need ball links, with ordinary links there would be a lot of tension in the joints.

rmboy86 (author)2015-04-27

Hi Mate, great work! :-)

One question how do I download the dxf filed from git hub? It wont let me :-(

felix.ros.7 (author)2015-04-06

Hi Thomas,

I'm an Industrial design student form the Netherlands and building my own stewart platform. I'm stuck at the proportions of the platform. Could you clarify how to determine the size of the base, top and legs?

I would like the top to be small enough to fit in my hand. The image shows the platform I have now, unfortunatly it runs into mechanical erros...



ThomasKNR (author)felix.ros.72015-04-06

Hi, unfortunately i cant help you very much - there is really no specific ratio. But i don't see any big problem (only that the angle of legs is at limit of ball joints), but during movement there can be some other problems, the upper platforms is way smaller than bottom platform. Have you considered inverse positioning of servos? I mean rotate them by 180°. Like this...
I think otherwise you will have to make upper platform bigger.

felix.ros.7 (author)ThomasKNR2015-04-08

Thank you for your fast response!

I kinda figured it out. There is a relation between the size of the top and bottom platform as well for the length of the legs. The more the platform looks like two triangles on top of each other the better the stability, the length of the legs do determine the degree of movement. Mine seem to be too long and the platform gets tangled up because the joints can't keep up with the rotations (like you said).

I'm going to make a new one that sticks to the triangular shape, similar to your setup.


JyB2 (author)2015-03-25

Hi Thomas,

First, congratulations for your work.

I was looking at your DXFs files and was wondering what should be the actual length of the servo_arms, as it shows 175 mm (6,88 inch.), which seems far too much in comparison with the plates?


ThomasKNR (author)JyB22015-04-01

That is definitely some kind of error. In program i used (QCad) it is 2cm from the middle of servo axis to the leg joint.

pallogarciiaa (author)2015-02-16

hi Thomas, i'm from Brazil.

I have a doubt about the servos:

Can I use servos with lower torque?

ThomasKNR (author)pallogarciiaa2015-02-16

hi, that depends on weight of load, with these servos the platform was strong and could handle the load for extended periods of time (hours). Therefore you can definitely use weaker servos if you won't put a lot of weight on it, also with shorter arms power of servos will be bigger.

About This Instructable



More by ThomasKNR:Arduino controlled Rotary Stewart Platform
Add instructable to: