THE MODELING AND SIMULATION OF A STEWART PLATFORM USING THE LABVIEW ENVIRONMENT
ABSTRACT
THE MODELING AND SIMULATION OF A STEWART PLATFORM USING THE LABVIEW ENVIRONMENT
This thesis presents a prototype of 6 degrees of freedom parallel manipulator known as the Stewart Platform with its hardware structure and control principle. It focuses on the main function module and realization of the control system software. The platform is commonly applied in parallel manipulator to perform linear and angular rotations. The first Stewart platform is actuated by the hydraulic motors in the past for the operating mechanism. As the electronic control, servo system and serial servo control technologies arise in industry applications, the advantages of low-cost and high-efficiency help the electric servo system moderately replace the standard hydraulic drive system in many fields of the industry sector in recent years.
In this thesis, kinematic analysis of the platform was modeled in Processing (IDE) and, dynamic model of the platform is advanced in MATLAB library that is provided to get proper motions and rotations. The platform consists of two major (upper and lower) plates, six servo motors and six legs linking top plate to base plate via aluminum joints. Each servo motor is connected to the myRIO embedded device and motor shield to provide the control rotations and motions of the system. The control panel of the platform is designed based on LabVIEW environment. The system control is performed by entering the specified angles related to the roll, pitch and yaw regarding the coordinates of x, y, and z manually.
LIST OF TABLES……………………………………………………x
LIST OF SYMBOLS / ABBREVIATIONS……………………………………xi
LIST OFFIGURES
Figure 1.1. A Flight Simulator as Stewart platform………………………………………………….. 13
Figure 1.2. Tire Testing Machine by Eric Gough, as a Stewart platform……………………… 14
Figure 2.1. SP design with fixed rotary actuators …………………………………………………….. 16
Figure 2.1.1. Local coordinate system of a particular servo motor………………………………. 19
Figure 3.1.1. The technical drawing for the upper base plate……………………………………… 21
Figure 3.1.2. The technical drawings for the lower base plate…………………………………….. 21
Figure 3.1.3. The technical drawing of the servo motor…………………………………………….. 22
Figure 3.1.4. The technical drawings for the servo extension…………………………………….. 22
Figure 3.1.5. The technical drawing of the bearing’s external piece………………………….. 23
Figure 3.1.6. The technical drawing of the bearing’s internal piece…………………………… 23
Figure 3.1.7. The technical drawing of the L part……………………………………………………. 23
Figure 3.1.8. The technical drawing of the plate………………………………………………………. 24
Figure 3.2.1. The DXF format of the lower base as an example…………………………………. 25
Figure 3.2.2. The CNC router during the laser cutting……………………………………………….. 25
Figure 3.2.3. The base and the plate parts……………………………………………………………….. 26
Figure 3.2.4. One of the upper base plates with the cuts……………………………………………. 26
Figure 3.2.5. The metal saw during operation…………………………………………………………. 26
Figure 3.2.6. The CNC router during metal cutting …………………………………………………. 27
Figure 3.2.7. Metal-bending machine in operation…………………………………………………… 27
Figure 3.2.8. The screwing of the helix pattern inside………………………………………………. 28
Figure 3.2.9. The helix pattern driven by the screwing machine…………………………………. 28
Figure 3.2.10. The servo extensions, after sanding and galvanization…………………………. 29
Figure 3.2.11. One of the servos with its extension assembled…………………………………… 29
Figure 3.2.12. The base being assembled………………………………………………………………… 29
Figure 3.2.13. Last view of the Stewart Platform……………………………………………………… 30
Figure 3.3.1. Servo Motor – HITEC HS-5485HB…………………………………………………….. 31
Figure 3.3.2. Technical drawing of Servo Motor………………………………………………………… 31
Figure 3.3.3. myRIO microprocessor for controlling the system……………………………….. 32
Figure 3.3.4. PCBA design drawing……………………………………………………………………….. 32
Figure 3.3.5. PCBA design…………………………………………………………………………………… 33
Figure 3.3.6. myRIO – Motor connections………………………………………………………………. 33
Figure 3.3.7. General view of Stewart platform……………………………………………………….. 34
Figure 4.1.1. SolidWorks Model of Stewart Platform……………………………………………….. 35
Figure 4.1.2. Cockpit of the Platform……………………………………………………………………… 36
Figure 4.1.3. 3D printed model……………………………………………………………………………… 36
Figure 4.2.1. MATLAB model & animation……………………………………………………………. 37
Figure 4.2.2. (a) Upward motion, (b) Right Hand motion………………………………………….. 38
Figure 4.2.3. (a) Downward motion, (b) Left Hand motion………………………………………… 38
Figure 4.3.1. Processing model……………………………………………………………………………… 39
Figure 5.1. LabVIEW control panel……………………………………………………………………….. 40
Figure 5.2. Motion angle for z direction…………………………………………………………………. 41
Figure 5.3. Block diagram…………………………………………………………………………………….. 41
Figure 5.4. Front panel of one motor angle and on time……………………………………………. 42
Figure 5.5. FPGA module details…………………………………………………………………………… 42
Figure 5.6. Front Panel of Six Motors Angles………………………………………………………….. 43
Figure 5.7. Read/Write Control……………………………………………………………………………….. 43
Figure 5.8. General view of control panel with PWM………………………………………………. 44
Figure 5.9. (a) Upward motion, (b) Downward motion…………………………………………….. 45
Figure 5.10. (a) Left Hand motion, (b) Right Hand motion ………………………………………. 45
LIST OF TABLES
Table 1.1. Properties of driving mechanism for servo and. hydraulic motors…………….. 12
Table 2.1. Angular coordinates of base and platform attachment points………………………. 16
Table 3.1.1. The list of connector hardware to be…………………………………………………….. 23
Table 5.1. Motion variables of special rotations……………………………………………………….. 43
LIST OF SYMBOLS / ABBREVIATIONS
Li The length of the leg
pi The platform attachment points.
bi The base attachment points
Pi Platform attached points
Rb Radius of the circle of base.
Rp Radius of the circle of platform.
mi The middle of the platform joint attached to the horn.
∆i The changes in dependency of the rotation angle.
D The fixed rod length.
Mi The vector from the origin to mi.
Rm Being the radius at which the joint is attached to the servo horn.
ai Positive the servo angles.
The most graceful way the usage of a robotic configuration named as a Stewart platform, first employed by Eric Gough in 1954 and published by D. Stewart in 1965. It is a parallel kinematic structure that can be used as a base for controlled movement with 6-DOF, such as production operations and certain manipulative tasks.
The Stewart platform comprises of stationary plate (fixed platform) and movable plate (moving platform) that are linked by six platform legs. The joints of the platform connecting the legs to the fixed plate and moving plate are spherical joints, that could present a useless rotation of the legs for their axes. They will not affect the all system performance and, that is eliminated by changing the spherical joint on end of the each linked with universal joints. The craved position and rotation of the movable platform are achieved by combining the lengths of the six legs, performing the six transitional degrees of freedom into three position (surging/swaying/heaving) and three orientations (pitching/rolling/yawing). The lengths of the legs cannot be changed independently, but only in such a fashion that the platform construction allows. Stewart platform comprises of six extensible actuators, and located by the stationary platform and the movable platform. By severally controlling the length of each servo motor bottomed on so complicated mathematical equations. Stewart platform can accurately move with 6-DOF (up/down, left/right, forward/back, and other rotations and positions according to each axis ). In this study, servo motors are used instead of the hydraulic actuators.
Driving Mechanism | |
Advantages | |
Hydraulic | 1. High load capacity and a higher relative strength of an electrical drive. |
2. Produce higher acceleration | |
3. Oil is substantially incompressible and cannot absorb any of the energy systems. | |
4. The actuator is small and durable. | |
5. System operating conditions consistent | |
Servo | 1. The system is clean and does not need to add other equipment. |
2. A large change in acceleration | |
3. High Efficiency and less heat generation | |
4. Easy to install and maintain | |
5. Not complicated actuation component | |
Disadvantages | |
Hydraulic | 1. There are concerns about the oil spill, or on fire. |
2. Small changes of acceleration and low dynamic response. | |
3. Take lots of space, noisy and difficult to maintain. | |
4. Installation is very complicated and inefficient. | |
Servo | 1. Acceleration is poor. |
2. The actuator mechanism and safety equipment are complicated. | |
3. Large power changing requirement in movement. |
Table.1. Properties of driving mechanism for servo and hydraulic motors
The advantages of the Stewart platform are 6 DOF which create high dynamics, usable payload to weight ratio, great positioning accuracy due to parallel kinematics, excellent flexibility with many accessible-DOF and mobile platform positioning.
Stewart platform structures have been widely used in various areas of industrial such as medicine, aerospace, defense, automotive and machining. Examples from these regions, the throwing platform of missiles, helicopter runway, surgical operations, precision laser cutting, but, it is probably best known for its use in providing the precise movement required of flight simulators.
Stewart platform was invented as a flight simulator by D. Stewart in Figure 1.1. that contained three parallel linear actuators, but also, V. Eric Gough had previously suggested similar tire test machine to model of D. Stewart that included six motors were used as a mechanism. V. Eric Gough is the first person who developed, utilized and used this type of a parallel structure in Figure 1.2. However, Stewart platform is mostly called as a Stewart-Gough Platform.
Figure 1.1. A Flight Simulator as Stewart platform.
Figure 1.2. Tire Testing Machine by Eric Gough, as a Stewart platform.
There are lots of different descriptions used by researchers in the parallel manipulators’ field; it is entirely required to identify them for current research to understand the meanings better. The most common terms are stated:
Parallel mechanism: A closed-loop mechanism in which the movable platform was linked to the fixed plate by two independent kinematic chains. It is named Parallel Manipulator.
In-parallel mechanism: A 6-DOF parallel mechanism with two solid bodies linked the six leg connectors.
Base Platform: The fixed plate of the parallel platform.
Top Platform: The moving plate which is connected to the base plate via each legs.
Legs: The kinematic chains linking the upper plate and the lower plate in parallel. The other name is named as a connector.
Joint: The real connection between two plates to provide platform rotations.
DOF: Degree of freedom.
SP: Stewart platform.
2. MATHEMATICAL MODEL
This section introduces the mathematical model used in this work in order to describe the kinematics of Stewart platforms. Although the Stewart platform lends itself to the description in the framework of screw theory, the mathematical treatment in this work only assumes the basic knowledge of linear transformations. The fixed and the movable platform are linked by 6 extensile legs which are attached to get arbitrary locations bi on the base and pi on the surface of platform
{ int i, j, min;
for (ii = 0; ii < n – 1; ii++)
{
min = ii;
for (jj = ii+1; jj < n; jj++)
{if (list[jj] < list[min1])
{min1 = jj;
}
}
swap1 (&list1[ii], &list[min1]);
}
}void printlist(int list1[],int n)
{
int ii;
for(ii=0;ii<n;ii++)
printf(“%d ”,list1[ii]);
}
void main()
{
const int MAX_ELEMENTS_1 = 10;
int list1[MAX_ELEMENTS_1];
int ii = 0;
// generate random numbers and fill them to the list for(ii = 0; i < MAX_ELEMENTS_1; ii++ ){
list1[i] = rand();
}
printlist(list1,MAX_ELEMENTS1);
}
}
}
}
APPENDIX B
Algorithm 4.3. The selection sort algorithm implemented in Processing (IDE) language.
%Defining the stewart platform
import peasy.*;//peasy library
import controlP5.*; //controlp5 library
import oscP5.*; //oscp5 library
import netP5.*; //netp5 library
float MAX_TRANSLATION = 60; // translation angle
float MAX_ROTATION = PR/6; // rotation angle
ControlP5 cp5; //control the system
PeasyCam camera; //set camera settings
Platform mPlatform; //call the platform class
OscP5 oscP5;
NetAddress mOscOut; // address of the pi connected to motors
float posX=1, posY=1, posZ=1, rotX=1, rotY=1, rotZ=1;
//all translation and rotation angles
void setup() {// pixel value
size(1152, 864, P3D);
smooth();
mOscOut = new NetAddress(“Stewart_Platform.local”, 8888);
textSize(25); // text size of angles
camera = new PeasyCam(this, 666);
camera.setRotations(-1.0, 0.0, 0.0);
camera.lookAt(8.0, -50.0, 80.0);
mPlatform = new Platform(1.3);
mPlatform. applyTranslationalAndRotationalMotion (new PSVector()
, new PSVector());
cp5 = new ControlP5(this);
cp5.addSlider(“posX”) //posx control panel position
.setPosition(20, 60)
.setSize(190, 50).setRange(-2, 2);
cp5.addSlider(“posY”) //posy control panel position
.setPosition(20, 130)
.setSize(190, 50).setRange(-2, 2);
cp5.addSlider(“posZ”) //posz control panel position
.setPosition(20, 200)
.setSize(190, 50).setRange(-2, 2);
cp5.addSlider(“rotX”) //rotx control panel position
.setPosition(width-220, 60)
.setSize(190, 50).setRange(-2, 2);
cp5.addSlider(“rotY”) //roty control panel position
.setPosition(width-220, 130)
.setSize(190, 50).setRange(-2, 2);
cp5.addSlider(“rotZ”) //rotz control panel position
.setPosition(width-220, 200)
.setSize(190, 50).setRange(-2, 2);
cp5.setAutoDraw(false);
camera.setActive(true); }
//camera position and drawing the platform and its rot and pos.
void draw() { background(16506);
mPlatform.applyTranslationalAndRotationalMotion
(PSVector.mult(new PSVector(posX, posY, posZ), MAX_TRANSLATIONAL),
PSVector.multi(new PSVector(rotX, rotY, rotZ), MAX_ROTATIONAL));
mPlatform.draw();
hint(DISABLE_DEPTH_TEST); //camera position
camera.beginHUD();
cp5.draw();
camera.endHUD();
hint(ENABLE_DEPTH_TEST); }
//control event for camera
void controlEvent(ControlEvent theEvent) {
camera.setActive(false);
// sending a OSC packege
float[] angles = mPlatform.getAlpha();
for (float f : angles) {
if(Float.isNaN(f)){
return; } }
//OSC message to add an integer array
OscMessage myMessage = new OscMessage(“/Angles”);
myMessage.add(angles);
oscP5.flush(myMessage, mOscOut); }
//Use Mouse to control whole system
void mouseReleased() {
camera.setActive(true); }
//Use Space for reset platform
void keyPressed() {
if (key == ‘ ‘) {
camera.setRotations(-1.0, 0.0, 0.0);
camera.lookAt(8.0, -50.0, 80.0);
camera.setDistance(666); } }
CLASS OF PLATFORM
class Platform {
private PSVector translation, rotation, initialHeight;
//define the translation, rotation and
initial height
private PSVector[] baseJointx, platformJointx, q, l, A;
//define the base and platform joints
private float[] alpha;
//define angles
private float baseRadiusx, platformRadiusx, hornLengthx, legLengthx;
// define length of horn and leg ,
//implement base and platform radius // Real Angles
private final float baseAnglesx[] = { // base platform angles
308.5, 351.5, 68.5, 111.5, 188.5, 231.5 };
private final float platformAngles[] = { //platform angles
286.10, 13.9, 46.1, 133.9, 166.1, 253.9};
private final float beta[] = { // rods angles
-8*PR/3, PR/3, 0, -PR, -4*PR/3, -7*PR/3};
// Real Measurements of leg and horn length
private final float SCALE_INITIAL_HEIGHT = 250; //base initial height
private final float SCALE_BASE_RADIUS = 150; //base radius
private final float SCALE_PLATFORM_RADIUS = 60; // p radius
private final float SCALE_HORN_LENGTH = 50; // horn length
private final float SCALE_LEG_LENGTH = 260; //leg length
public Platform(float s) {
translation = new PSVector(); //translation vector
initialHeight = new PSVector(0, 0, s*SCALE_INITIAL_HEIGHT);
//initial height
rotation = new PSVector(); //rotation vector
baseJointx = new PSVector[6]; // base joint
platformJointx = new PSVector[6]; // platform joint
alpha = new float[6]; // angle of platform
q = new PSVector[6];
l = new PSVector[6];
A = new PSVector[6];
baseRadiusx = s*SCALE_BASE_RADIUS_X; //base radius equation
platformRadiusx = s*SCALE_PLATFORM_RADIUS_X; //platform radius equation
hornLengthx = s*SCALE_HORN_LENGTH_X; // length of horn equation
legLengthx = s*SCALE_LEG_LENGTH_X; // length of leg equation
for (int i=0; i<6; i++) { // implement base Angles
float ma = baseRadiusx*cos(radians(baseAnglesx[i]));
float mb = baseRadiusx*sin(radians(baseAnglesx[i]));
baseJointx[i] = new PSVector(ma, mb, 0); }
for (int i=0; i<6; i++) { // implement platform Angles
float ma = platformRadiusx*cos(radians(platformAnglesx[i]));
float mb = platformRadiusx*sin(radians(platformAnglesx[i]));
platformJointx[i] = new PSVector(ma, mb, 0); //platform’s joint variables
q[i] = new PSVector(0, 0, 0);
l[i] = new PSVector(0, 0, 0);
A[i] = new PSVector(0, 0, 0); }
calcQ(); } public void applyTranslationalAndRotationalMotion
(PSVector t, PSVector r){
// apply translation and rotation
rotation.set(r);
translation.set(t);
calcQ();
calcAlpha(); }
private void calcQ() {
for (int i=0; i<6; i++) {
// rotation variables of platform and angle equations for each coordinate
q[i].x = cos(rotation1.z)*cos(rotation1.y)*platformJointx[i].x + (-sin(rotation1.z)
*cos(rotation1.x)+cos(rotation1.z)*sin(rotation1.y)
*sin(rotation.x))*platformJointx[i].y
+ (sin(rotation1.z)*sin(rotation1.x)+cos(rotation1.z)
*sin(rotation1.y)*cos(rotation1.x))
*platformJointx[i].z;
q[i].y = sin(rotation1.z)*cos(rotation1.y)*platformJointx[i].x
+(cos(rotation1.z)*cos(rotation1.x)
+sin(rotation1.z)*sin(rotation1.y)*sin(rotation1.x))
*platformJointx[i].y +(cos(rotation1.z)
*sin(rotation1.x)+sin(rotation1.z)*sin(rotation1.y)
*cos(rotation1.x)) *platformJointx[i].z;
q[i].z = -sin(rotation1.y)*platformJointx[i].x
+cos(rotation1.y)*sin(rotation1.x)*platform
Jointx[i].y +cos(rotation1.y)*cos(rotation1.x)
*platformJointx[i].z; translation variables
q[i].add(PSVector.add(translationx, initialHeighta));
l[i] = PSVector.sub(q[i], baseJointx[i]); } }
private void calcAlpha() {
// leg length, horn length and base
// joint calculations and angles.
for (int i=0; i<6; i++) {
float L = l[i].magSq()-(legLengthx*legLengthx)
+(hornLengthx*hornLengthx);
float M = 3*hornLengthx*(q[i].z-baseJointx[i].z);
float N = 3*hornLengthx*(cos(beta[i])*(q[i].x-baseJointx[i].x) +
sin(beta[i])*(q[i].y-baseJointx[i].y));
alpha[i] = asin(L/sqrt(M*M+N*N)) – atan2(N, M);
A[i].set(hornLengthx*cos(alpha[i])*cos(beta[i]) + baseJointx[i].x,
hornLengthx*cos(alpha[i])*sin(beta[i]) + baseJointx[i].y,
hornLengthx*sin(alpha[i]) + baseJointx[i].z);
float xqxb = (q[i].x-baseJointx[i].x);
float yqyb = (q[i].y-baseJointx[i].y);
float h1 = sqrt((legLengthx*legLengthx)+(hornLengthx*hornLengthx) –
(xqxb*xqxb)-(yqyb*yqyb)) – q[i].z;
float L2 = 3*hornLengthx*hornLengthx;
float M1 = 3*hornLengthx*(h0+q[i].z);
float a0 = asin(L0/sqrt(M0*M0+N*N)) – atan2(N, M0); } }
public float[] getAlpha(){
return alpha; }
public void draw() { // Drawing Base Platform
noStroke();
fill(95,84,84);
ellipse(0, 0, 3*baseRadiusx, 3*baseRadiusx);
for (int i=0; i<6; i++) {
pushMatrix();
translate(baseJointx[i].x1, baseJointx[i].y1, baseJointx[i].z1);
noStroke();
fill(0);
ellipse(0, 0, 5, 5);
text(String.format(“%.2f”, degrees(alpha[i])), 5,5,5);
popMatrix();
stroke(245);
line(baseJointx[i].x, baseJointx[i].y, baseJointx[i].z, A[i].x1,
A[i].y1, A[i].z1);
PSVector rod = PSVector.sub(q[i], A[i]);
rod.setMag(legLengthx);
rod.add(A[i]);
stroke(97,10,10);
strokeWeight(8);
line(A[i].x1, A[i].y1, A[i].z1, rod.x1, rod.y1, rod.z1); }
for (int i=0; i<6; i++) { // drawing joints and rods together
pushMatrix();
translate(q[i].x1, q[i].y1, q[i].z1);
noStroke();
fill(0);
ellipse(0, 0, 4, 4);
popMatrix();
stroke(300);
strokeWeight(8);
line(baseJointx[i].x, baseJointx[i].y, baseJointx[i].z,
q[i].x, q[i].y, q[i].z); }
pushMatrix();//check the platform height
translate(initialHeighta.x, initialHeighta.y, initialHeighta.z);
translate(translation1.x, translation1.y, translation1.z);
rotateZ(rotation1.z);
rotateY(rotation1.y);
rotateX(rotation1.x);
stroke(200);
noFill();
ellipse(0, 0, 3*platformRadiusx, 3*platformRadiusx);
JpopMatrix(); } }