将CAD的史都华平台转换到Matlab中(Translating a CAD Stewart Platform)

发布时间:2011-12-13 19:07:38

Translating a CAD Stewart Platform

On this page…

Introducing the Stewart Platform

Introducing the Stewart Platform Assembly

Viewing the Stewart Platform Assembly

Exporting the Stewart Platform Assembly

Generating the Stewart Platform Model

Visualizing the Stewart Platform Motion

Introducing the Stewart Platform

The Stewart platform consists of two plates connected by six mobile and extensible legs. The lower or base plate is immobile. The upper or mobile plate has six degrees of freedom, three rotational and three translational. The platform is a six-degree-of-freedom (DoF) mechanical system used for accurate positioning applications. It is highly stable and easy to control.

The platform's six legs each have two parts, an upper and a lower leg, with a piston-like cylindrical DoF between each pair of parts. The legs are connected to the base plate and the top plate by universal joints at each end of each leg. (These universals are not just sets of abstract DoFs. Each also contains a spider-like body, while also having two DoFs.) The upper part of each leg can slide into and out of the lower leg, allowing each leg to be varied in length. The position and orientation of the mobile platform (top plate) varies depending on the lengths to which the six legs are separately adjusted.

Once the top is connected to the legs, the entire Stewart platform assembly has 36 DoFs. Only six DoFs are independent, the same as the top plate would have if it were disconnected. You can think of these independent DoFs as the six adjustable leg lengths or as equivalent to the six DoFs of the mobile plate.

Introducing the Stewart Platform Assembly

The following example uses a complex computer-aided design (CAD) assembly that models the Stewart platform.

Note    The Stewart platform assembly in this example is an advanced example of computer-aided design. You should work through the previous case studies before attempting to work with this assembly.

To learn more about the Stewart platform, see the Motion, Control, and Real-Time Simulation chapter of the SimMechanics User's Guide.

Locating the Stewart Platform Assembly Files

Look for the 45 CAD files of this case study in the SimMechanics Link demos folder. The master assembly file is:

stewart_platform.ASSEMBLYFILETYPE

Viewing the Stewart Platform Assembly

Open the master assembly file, stewart_platform.ASSEMBLYFILETYPE. Click the assembly and rotate it to view the top and bottom plates and the legs.

Stewart Platform CAD Assembly

The CAD hierarchy for the Stewart platform contains assemblies for the top and base plates, as well as assemblies for the six legs. All the constraints on the assembly parts are grouped into one group, containing 30 constraints. There are 448 component parts and 38 subassemblies, which you can open individually to examine the separate parts.

The base plate is about 24 centimeters (cm) in diameter; the top plate about 16.5 cm. When centered and oriented flat, the top plate is about 20 cm above the base. The assembly models the platform material as aluminum (about 2.7 grams per cubic cm).

Exporting the Stewart Platform Assembly

Apply any changes you want to the assembly configuration or settings. If you change the assembly or any subassemblies, you need to rebuild the assembly before exporting it to XML.

Using the SimMechanics Link interface to your CAD platform, export the assembly into Physical Modeling XML. Because the assembly is so complex, the export process takes longer than it does for simpler assemblies. As the export proceeds, various parts and subassemblies are highlighted. When the highlighting stops, the export is finished.

The exported model appears as stewart_platform.xml in your working CAD folder.

Generating the Stewart Platform Model

Move or copy the stewart_platform.xml file into your working MATLAB folder.

To generate a new Simulink model, enter mech_import('stewart_platform') at the MATLAB command line, and wait for the model generation stewart_platform to finish.

Inspecting the Generated Model and Counting Its DoFs

The complete Stewart platform model contains seven subsystems.

Stewart Platform Model: Base, Legs, and Top Plate

The subsystems correspond to the subassemblies of the original CAD assembly — the base plate and the six platform legs.

The base plate subassembly BaseRingAssembly-1 contains six subassemblies, modeling a base swivel bearing for each leg.

The six leg subassemblies, ActuatorAssm, model the upper and lower halves of each leg and represent part of their DoFs.

For each leg, there are six DoFs. Two pairs of revolutes associated with each leg represent the two universal joints connecting each leg to the top and base plates, respectively. Each of these universals has two DoFs.

At the top level, there are two revolutes, one attached to either end of a leg subassembly, connecting each leg to the base and top plates, respectively.

Within each leg subassembly, there are two other revolutes, each one connecting the leg to the top and base plates, respectively.

One of the revolutes inside the leg subassembly pairs with one of the revolutes outside the leg assembly to make up a two-DoF universal. These pairs occur twice on each leg, one connecting the leg to the top plate, the other connecting the leg to the base plate.

Within each leg subassembly, there is one prismatic, representing the leg's freedom to expand or contract along its shaft.

Within each swivel bearing subassembly, itself located within the base ring assembly, is another revolute representing each leg's freedom to rotate about its shaft.

Each leg has six DoFs. However, the constraints imposed by attaching each leg to fixed points on the base and top plates, respectively, reduce these to one independent DoF for each leg — the freedom to expand or contract along its shaft.

The rotational DoFs associated with the universals at the attachment points are completely dependent on the leg's prismatic DoF.

The rotational DoFs associated with the cylindricals in each leg are completely dependent on the universals at the top and bottom of each leg.

Deleting Unnecessary Bodies and Joints

The generated model contains a large number of redundant Root Weld and zero-mass Root Part blocks. You can delete these and not affect the model's dynamics, as long as you take care to reconnect the remaining bodies properly after deleting each Weld.

Adding Actuators and Sensors

If you want the motion of the platform to be controlled by something other than gravity, you need to add the appropriate Actuators to the model. To quantify the model's motion, you need to make precise measurements with Sensors. You can drive the actuators with external control signals to model an open-loop controller for the Stewart platform. If you introduce feedback from the sensors to the actuators, you can model a closed-loop controller.

Visualizing the Stewart Platform Motion

Note   You can find more information about SimMechanics visualization in the SimMechanics Visualization and Import Guide.

Without any external forces acting, apart from gravity, the platform collapses under its own weight. You can verify this by running and visualizing your Stewart platform model.

From the Simulation menu, select Configuration Parameters. The Configuration Parameters dialog opens. Choose the SimMechanics node.

Select Display machines after updating diagram and Show animation during simulation. Click Apply or OK.

From the Edit menu, select Update Diagram. The SimMechanics visualization window opens with the SimMechanics controls. The window displays the Stewart platform in its initial position.

Start the simulation by clicking the Start button in the toolbar of either the visualization window or the model window.

The mobile plate falls under its own weight and reaches the base plate in about 0.2 seconds. Because there is nothing to stop the legs or the top plate, the platform continues to collapse: the mobile plate falls below the base plate, and the upper and lower parts of each leg come apart.

This visualization of the Stewart platform uses custom body visualization with the STL body geometry files exported from the original CAD assembly.

SimMechanics Visualization of the CAD-Based Stewart Platform (Custom Body Geometries)

Viewing a Stewart Platform Animation

If you are connected to the Internet, have an AVI-compatible media streaming application installed on your system, and want to play a recorded animation of this system:

Click the following link. When the download dialog opens, choose Save to file and specify a file name and location on your system.

Click OK to save the AVI file to your system.

Once the downloading is complete, start the AVI animation on your system.

If you do not have an AVI-compatible application, consider using the MATLAB VideoReader class and its read method instead.

This is a compressed AVI recording, which requires that you have the Indeo 5 video codec installed to decompress and play.

Download animation

The animation shows the Stewart platform moving through a predefined trajectory, as simulated by the mech_stewart_trajectory demo. For clarity, the animation displays the convex hulls, a surface for the top plate, and lines for the legs. The animation steps through the predefined SimMechanics viewpoints to show different perspectives on the moving platform.

将CAD的史都华平台转换到Matlab中(Translating a CAD Stewart Platform)

相关推荐