In the Simulink model, we select the Mechanical Environment Settings under the Simulation menu. This will display the mechanical parameters that we set for our model. By changing the Analysis Mode, SimMechanics can compute the motion that results from applying forces to a mechanical system or the forces required to produce a specified motion in a mechanical system. Here, the Kinematic Analysis Mode is selected because the Stewart Platform is a closed-loop system, and we want to compute the forces applied without the system moving. Once this is selected, we simulate the model and use the output from the Sensor blocks to obtain the force that will be applied to the Actuator blocks for each of the legs when the platform is at rest. To do this at the MATLAB command prompt, we can use: sim(‘StewartPlatformEquilibrium’); u =
Forces’; Now, we are ready to extract linear models. To linearize the model near the equilibrium point, we can use the linmod command on just the plant model: [A,B,C,D] =
linmod(‘StewartPlatformPlant’,[],u); This will generate an LTI state-space model from a SimMechanics model to use as an input to the Control Systems Toolbox and the µ-Analysis and Synthesis Toolbox commands that generate controller models. The linearization command returns an LTI system with the same number of states as the number of states in the tree of the mechanical system (52 in this case). Since this model is closed, the number of independent states is smaller (12 in this case). We use the minreal function to get at the minimal realization of the plant with 12 states: [A,B,C,D] = minreal(A,B,C,D); These are the state-space matrices that we will use to design the controller for the Stewart Platform model. Designing the Multivariable Controller
Simulate and Visualize the Model Now that we have modeled our system with Simulink and SimMechanics, we can validate the design by simulating the system. We start the simulation by selecting Simulink and Start in the model window menu bar. During the simulation, we can view signals with the Scope block. The first plot in our scope shows the x, y, and z values of the position of the Body block representing the top plate moving over time as the model simulates. The second plot shows the difference between the desired value of the leg lengths calculated in the Leg Trajectory subsystem and the actual value of the leg lengths changing over time. The third plot shows the force on each leg during the simulation.
It is also possible to create or import a VRML scene of the Stewart Platform and hook it up to our Simulink and SimMechanics model using the Virtual Reality Toolbox blocks. Future Directions This article investigated the Stewart Platform, and how to create a model of the controller and mechanical components using SimMechanics. SimMechanics made it easy to build a hierarchical model of the mechanical plant and to modify the settings of the model. The model was trimmed and linearized using command-line functionality, demonstrating that it is easy to link the model with MATLAB advanced control design products. Most importantly, this example demonstrated how plant modeling, controller synthesis, and closed-loop simulation can all be performed within one environment. There are other components of the Stewart Platform not explored in this example, such as linear motors, limit switches, and safety critical logic. These tasks could easily be performed using Simulink, Stateflow, SimMechanics, and SimPowerSystems. Files required to run this demonstration can be downloaded
at: To find out more about products mentioned in this article, visit: MATLAB | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| News &
Notes I Using MathWorks
Products For... I MATLAB Based
Books I Third-Party
Products | ||