Sim Mechanics

7
Modeling a Piston 8:57 Model a piston using multibody dynamics. Bodies, joints, and 3D visualization are defined and simulated. SimMechanics Model and simulate multibody mechanical systems SimMechanics™ provides a multibody simulation environment for 3D mechanical systems, such as robots, vehicle suspensions, construction equipment, and aircraft landing gear. You model the multibody system using blocks representing bodies, joints, constraints, and force elements, and then SimMechanics formulates and solves the equations of motion for the complete mechanical system. Models from CAD systems, including mass, inertia, joint, constraint, and 3D geometry, can be imported into SimMechanics. An automatically generated 3D animation lets you visualize the system dynamics. You can parameterize your models using MATLAB ® variables and expressions, and design control systems for your multibody system in Simulink ® . You can add electrical, hydraulic, pneumatic, and other components to your mechanical model using Simscape™ and test them all in a single simulation environment. To deploy your models to other simulation environments, including hardware-in-the-loop (HIL) systems, SimMechanics supports C-code generation (with Simulink Coder™). Learn more about physical modeling. Key Features Blocks and modeling constructs for simulating and analyzing 3D mechanical systems in Simulink Rigid body definition using standard geometry and custom extrusions defined in MATLAB Automatic calculation of mass and inertia tensor Simulation modes for analyzing motion and calculating forces Visualization and animation of multibody system dynamics with 3D geometry SimMechanics Link utility, providing an interface to Pro/ENGINEER ® , SolidWorks ® , and Autodesk ® Inventor ® , and an API for interfacing with other CAD platforms Support for C-code generation (with Simulink Coder) SimMechanics is used to optimize system-level performance and to create plant models for control design. The models you create support your entire development process, including hardware-in-the-loop simulations. 1

description

matlab sim mechanics overview

Transcript of Sim Mechanics

Page 1: Sim Mechanics

Modeling a Piston 8:57Model a piston using multibody dynamics. Bodies, joints, and 3D visualization are definedand simulated.

SimMechanicsModel and simulate multibody mechanical systems

SimMechanics™ provides a multibody simulation environment for 3D mechanical systems, such as robots,vehicle suspensions, construction equipment, and aircraft landing gear. You model the multibody system usingblocks representing bodies, joints, constraints, and force elements, and then SimMechanics formulates and solvesthe equations of motion for the complete mechanical system. Models from CAD systems, including mass, inertia,joint, constraint, and 3D geometry, can be imported into SimMechanics. An automatically generated 3Danimation lets you visualize the system dynamics.

You can parameterize your models using MATLAB® variables and expressions, and design control systems foryour multibody system in Simulink®. You can add electrical, hydraulic, pneumatic, and other components to yourmechanical model using Simscape™ and test them all in a single simulation environment. To deploy your modelsto other simulation environments, including hardware-in-the-loop (HIL) systems, SimMechanics supports C-codegeneration (with Simulink Coder™).

Learn more about physical modeling.

Key Features▪ Blocks and modeling constructs for simulating and analyzing 3D mechanical systems in Simulink

▪ Rigid body definition using standard geometry and custom extrusions defined in MATLAB

▪ Automatic calculation of mass and inertia tensor

▪ Simulation modes for analyzing motion and calculating forces

▪ Visualization and animation of multibody system dynamics with 3D geometry

▪ SimMechanics Link utility, providing an interface to Pro/ENGINEER®, SolidWorks®, and Autodesk®

Inventor®, and an API for interfacing with other CAD platforms

▪ Support for C-code generation (with Simulink Coder)

SimMechanics is used to optimize system-level performance and to create plant models for control design. Themodels you create support your entire development process, including hardware-in-the-loop simulations.

1

Page 2: Sim Mechanics

Parameterizing Bodies 5:42Parameterize bodies with MATLAB® variables. Reuse components and mechanisms to builda scissor lift.

Actuating and Sensing Joints 4:49Actuate joints and send measured values to Simulink® scopes. A hydraulic system modeledin Simscape™ actuates a scissor lift.

SimMechanics model of landing gear. Left: 3D visualization generated automatically from the model. Right: Portion of themodel.

Modeling Multibody Systems

SimMechanics enables you to create libraries of components that can be reused in many different designs. Youdefine bodies in terms of their mass, inertia, and connection points. To create complex shapes, you assemble setsof simple geometries, such as spheres, cylinders, and extrusions defined in MATLAB, and SimMechanicscalculates the resulting mass and inertia automatically. The diagram that defines the body clearly indicates allconnections to the body, making it easy to see your system’s topology. Parameters such as length and mass can becalculated using MATLAB scripts and assigned using MATLAB variables.

You connect bodies using joints and constraints. These define the degrees of freedom permitted between thebodies in your system, which dictate how your system can move. You can define and connect actuators to thesejoints to enable your system to move. Actuating these joints with electrical, hydraulic, pneumatic, or otherphysical systems modeled using Simscape enables you to model your entire multidomain physical system withinthe Simulink environment.

SimMechanics models can be connected to control systems modeled in Simulink and Stateflow®. You canmeasure quantities such as force, torque, and velocity, and pass this information to Simulink blocks. Motion,force, and other results calculated in Simulink can be used to control your mechanical system.

2

Page 3: Sim Mechanics

Importing and Merging CAD Models into SimMechanics 7:14Import models from CAD systems to SimMechanics™ using SimMechanics Link. Separatechanges made in the CAD system and SimMechanics are automatically merged in the finalmodel.

SimMechanics model of four-bar linkage components. Links are composed of connected solids (left) that are defined by apreselected shape (bottom) and MATLAB variables; components are connected by joints with specified state targets (right).

Importing CAD Models

You can import a CAD assembly into SimMechanics using SimMechanics Link. The mass and inertia of each partin the assembly are imported as rigid bodies in SimMechanics. Geometry from the CAD assembly is saved togeometry files and associated with the proper body in SimMechanics. The mate definitions in the CAD assemblyare imported as joints in the SimMechanics model.

For SolidWorks, Pro/ENGINEER, and Autodesk Inventor models, you install a plug-in that lets you save the CADassembly as an XML file that can be imported into SimMechanics. For other CAD systems, SimMechanics Linkprovides an API that you can connect to the API of your CAD system. Download SimMechanics Link.

3

Page 4: Sim Mechanics

Guiding Mechanism Assembly 3:52Specify exact and approximate initial states, including positions and velocities. Reviewassembly results in a model report.

Piston model imported from CAD into SimMechanics. After the CAD model of the piston (top left) is saved as an XML file, andimported into SimMechanics (bottom), the visualization is generated from the STL files automatically exported from the CADsystem (right).

Simulating Models

SimMechanics provides specialized solver technology for simulating multibody mechanical systems. You canperform different types of analyses, including forward dynamics, inverse dynamics, and kinematics. You canapply forces and torques to your machine and see the resulting motion, or specify motions and calculate the forcesand torques required to produce that motion. With these capabilities, you can generate and test requirements foractuation systems, or see how a prosthetic limb would move.

Using state targets, you can guide the assembly of your mechanism, specifying only key information. You canprovide optional target joint positions and velocities and specify whether the targets should be met exactly orapproximately. SimMechanics uses these values and priorities to automatically assemble and determine the initialstate of your mechanism. A report informs you how closely SimMechanics met your state targets and theassembled values.

SimMechanics automatically creates a 3D animation during simulation. You can replay it without rerunning thesimulation. You can also display your simulation results during simulation using Simulink scopes. You can useMATLAB scripts to postprocess and plot the data.

4

Page 5: Sim Mechanics

Exploring SimMechanics Models 3:18Replay 3D animations and configure the views. Explore the model from the 3Drepresentation and via the tree browser.

SimMechanics model of a four-bar linkage. The simulation results can be reviewed in a 3D animation (top left) or on Simulinkscopes (top right), while a Model Report (bottom) shows details about the assembly of your model, including initial conditions.

Visualizing Models

SimMechanics automatically creates a 3D visualization of all bodies in your model. During simulation, ananimation of the machine is generated, showing you the motion of the system. You can replay the animationwithout rerunning the simulation, and save the animation to a file.

You can adjust the color, opacity, and other visual properties of the bodies. For help in verifying locations andorientations, you can display the frames and the center of mass associated with the body. Multiple view angles canbe shown simultaneously, enabling you to see how your mechanism looks and moves from different angles.

To help navigate and explore your model, the 3D view of your mechanism contains a tree browser. You can viewthe parameters for the elements in your mechanism by selecting them in the tree browser or the 3D view. Thecombination of the 2D block diagram and 3D visual representation of your mechanism lets you verify connectionsin your model and see how the system behaves.

5

Page 6: Sim Mechanics

Hardware-in-the-loop (HIL) Testing 5:21Use HIL testing instead of hardware prototypes to test control algorithms. Convert physicalmodel to C code and simulate in real time on controller hardware.

SimMechanics 3D animation and Mechanics Explorer tool. You can review simulation results in an automatically generated 3Danimation (left), and use a tree browser to navigate and explore your model (right).

Deploying Models

You can deploy SimMechanics models using code generated with Simulink Coder. The generated code lets you:

▪ Build standalone executables of SimMechanics models that can be integrated into C programs or otherMATLAB and Simulink models

▪ Run hardware-in-the-loop (HIL) simulations by deploying SimMechanics plant models onto real-timeprocessors that interface directly with other hardware

▪ Improve simulation speed by compiling the C code

▪ Share models without exposing your intellectual property

Sharing Models

You can share SimMechanics models with Simscape users who have not purchased SimMechanics. Simscapeusers can view, simulate, and change parameter values in SimMechanics models with the Simscape EditingModes. As a result, your team can share SimMechanics models with a larger group of engineers who useSimscape.

Working with SimMechanics Models

Task Model Developer(Purchases Simscape and SimMechanics)

Model User(Purchases Simscape)

SimulateLog data or change visualizationChange numerical parametersGenerate code with Simulink CoderChange block parameterization optionsMake or break physical connections

6

Page 7: Sim Mechanics

Integrating Physical Systems and Controller 5:49Detect system integration issues in simulation. Mechanical, hydraulic, electrical, and controlsystems are gradually integrated into a full system model.

SimMechanics Introduction 1:28Create part definitions parameterized with MATLAB for multibody simulation. Reuse partsusing copy and paste.

Product Details, Examples, and System Requirementswww.mathworks.com/products/simmechanics

Trial Softwarewww.mathworks.com/trialrequest

Saleswww.mathworks.com/contactsales

Technical Supportwww.mathworks.com/support

SimMechanics in Academia

SimMechanics can help you teach how theory relates to system behavior. Animations produced fromSimMechanics simulations illustrate a system’s motion and give students a better understanding of the laws ofphysics. To demonstrate how effects such as friction influence the mechanical system represented by yourSimMechanics model, you can implement equations for these effects in the Simscape language.

Using simulation, your students can prototype in a virtual environment, which encourages them to try out newdesigns and to explore the entire parameter space. Simulation enables them to optimize their designs in researchprojects and student competitions.

Because SimMechanics is used widely across industries such as automotive, aerospace, and robotics, graduatingstudents who have experience with this multibody simulation tool are in demand by employers.

SimMechanics Technologies

SimMechanics includes both First-Generation and Second-Generation technologies. Second-Generationtechnology offers a redesigned block diagram language focused on local component definitions to supportreusability and library development. It also offers more advanced 3D visualization and animation capabilities thatare tightly connected to the block diagram representation. You have the option to create and simulate a mechanicalmodel using First- or Second-Generation technology.

For more information on the difference between these two technologies, see the SimMechanics documentationand Release Notes.

Resources

Online User Communitywww.mathworks.com/matlabcentral

Training Serviceswww.mathworks.com/training

Third-Party Products and Serviceswww.mathworks.com/connections

Worldwide Contactswww.mathworks.com/contact

© 2012 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list ofadditional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders. 7