Uncategorized

How to calculate the length of Stewart Platform actuators

Patrice wrote in to ask “If I know the pitch, roll, yaw, heave, sway, and surge of a stewart platform… how do I then calculate the length of each actuator?”  Great question, Patrice!

I’ve never tried explaining this before in detail, so bear with me. We’re going to use math you probably learned late in high school, so get out your graph paper and erasers and come along for the ride.

Art time!

On the graph paper and draw the top half of the stewart platform, called the End Effector (EE):

A photo posted by Dan Royer (@imakerobots) on

On a separate piece of paper draw the bottom half, called the base. the base should be large than the EE.

A photo posted by Dan Royer (@imakerobots) on

Now when you hold the EE over the base you can imagine 6 lines going from the EE to the base, forming a stable structure.

A photo posted by Dan Royer (@imakerobots) on

Relative and Absolute Coordinate Systems

On the EE paper, point P is always (x=0,y=0). On the Base paper, Base P is also (0,0). If you move the EE paper then the difference between EE P and Base P will change. If you roll, pitch, or yaw the paper then the EEX, EEY, and EEZ will change compared to BaseX, BaseY, and BaseZ.

Now let’s look at paper EE more closely. If you’ve drawn your EE on graph paper it will be very easy to measure from P to, say, A. On my paper it’s (4,1). Even when the paper is moving in space over the table, EEA = EEP + EEX*4 + EEY*1. If we can explain to the computer the difference between EEP, EEX, and EEY and the equivalent values in the Base, then we will know EEA and BaseA, and the length of actuator A = EEA – BaseA.

So how do we explain the difference?

When I turn on the machine I “home” to a location where I know every measurement. At this spot EEX=BaseX, EEY=BaseY, EEZ=BaseZ, and EEP is directly above EEBase. Put another way, EEP(x,y,z) = EEBase(x,y,z+a known value).

When the robot is commanded to pitch, heave, or sway EE it changes EEP. When he robot is commanded to make the EE roll, pitch, or yaw it uses a rotation matrix to calculate the new EEX, EEY, and EEZ. In both cases after any kind of move it uses the new EEP, EEX, EEY, and EEZ values to find EE points A-F. Then it finds the length of actuators A-F and commands each actuator to move until the real actuator length matches the calculated length.

If you get this far, I salute your persistence!

There are now only two little problems that you still need to face.

The first is each actuator will probably be moving at different speeds. You can’t let any of the actuators move faster than the speed limit, and they all have to reach their destination at the same time. That means you have to look ahead and figure out which actuator is moving the fastest, then scale everybody’s speed down if necessary.

The second is a bit harder to describe. hold the EE paper over the Base, a little to one side. Move it across the center, maintaining the same height and angle. As the EE gets closer to the center most of the actuators are retracting and getting shorter. Once past the center those same actuators are getting longer. Trickier still, those actuators are constantly changing speeds. So where’s the problem? In a bad program the computer calculates the start length of the actuators, the end length of the actuators, and then tries to take the easiest route from start to end… but that would mean the actuators would move only one direction, at constant speeds! It wouldn’t look like a straight line to us, watching the platform wiggle all over the place. Most ways a stewart platform can move has this kind of problem. My solution is to break every kind of move into lots of really tiny segments. Each segment is small enough that there’s no problem, and when they’re all added up the movement looks correct.

Code

All the code for Marginally Clever’s stewart platform is available on Github, open source.

Results

This is our stewart platform v2 in action. Although it uses actuators with an elbow like a delta robot, the principle is exactly the same. I have the added fun of figuring out where the the elbow of each arm needs to go in order to get the right actuator length. I only use rotating movement because I don’t have good linear actuators yet. Maybe one day, right?