5
Modeling Complex Mechanical Structures with SimMechanics By Tom Egel, MathWorks Modeling physical components or systems in Simulink ® typically involves a tradeoff between simulation speed and model fidelity or complexity: the higher the fidelity of the model, the greater the effort needed to create it. When modeling 3D mechanical structures, the task is further complicated by the need to formulate complex equations to represent the desired motion. CAD tools can sometimes be used to export models to Simulink or SimMechanics™, but this approach usually requires additional modeling resources or CAD tool expertise. Using a wind turbine blade as an example, this article describes a semi-automated way to create complex 3D mechanical structures using MATLAB and the General Extrusion shape in SimMechanics. Creating a Basic Model We can create a good initial model of the blade by using the default shapes in SimMechanics. The SimMechanics library contains bodies to represent the inertia, coordinate transforms to define the location in 3D space, and joints to constrain the motion of the objects within that space. Default definitions for common shapes such as sphere, cylinder, and brick automatically calculate the inertia tensor based on the dimensions you specify (Figure 1). Figure 1. A SimMechanics model and its properties. Specifying Complex Shapes Using the General Extrusion shape in SimMechanics we can specify a more complex shape while still allowing SimMechanics to automatically calculate the inertia. We begin by providing the outline of the wind turbine blade, using coordinate points or an equation along with the desired length to extrude the shape. We use the NACA_0015 standard [1], a symmetrical airfoil shape described in the equation: where See more articles and subscribe at mathworks.com/newsletters. 1

Modeling Complex Mechanical Structures With SimMechanics - Mathworks

  • Upload
    crms137

  • View
    51

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Modeling Complex Mechanical Structures With SimMechanics - Mathworks

Modeling Complex Mechanical Structures with SimMechanicsBy Tom Egel, MathWorks

Modeling physical components or systems in Simulink® typically involves a tradeoff between simulation speed and model fidelity orcomplexity: the higher the fidelity of the model, the greater the effort needed to create it. When modeling 3D mechanical structures, thetask is further complicated by the need to formulate complex equations to represent the desired motion. CAD tools can sometimes beused to export models to Simulink or SimMechanics™, but this approach usually requires additional modeling resources or CAD toolexpertise.

Using a wind turbine blade as an example, this article describes a semi-automated way to create complex 3D mechanical structures usingMATLAB and the General Extrusion shape in SimMechanics.

Creating a Basic Model

We can create a good initial model of the blade by using the default shapes in SimMechanics. The SimMechanics library contains bodiesto represent the inertia, coordinate transforms to define the location in 3D space, and joints to constrain the motion of the objects withinthat space. Default definitions for common shapes such as sphere, cylinder, and brick automatically calculate the inertia tensor based onthe dimensions you specify (Figure 1).

Figure 1. A SimMechanics model and its properties.

Specifying Complex Shapes

Using the General Extrusion shape in SimMechanics we can specify a more complex shape while still allowing SimMechanics toautomatically calculate the inertia.

We begin by providing the outline of the wind turbine blade, using coordinate points or an equation along with the desired length toextrude the shape. We use the NACA_0015 standard [1], a symmetrical airfoil shape described in the equation:

where

See more articles and subscribe at mathworks.com/newsletters.

1

Page 2: Modeling Complex Mechanical Structures With SimMechanics - Mathworks

c is the chord length,x is the position along the chord from 0 to c,y is the half thickness at a given value of x (centerline to surface),and t is the maximum thickness as a fraction of the chord.

Figure 2 shows the resulting shape.

Figure 2. Cross-section of an NACA_0015 airfoil.

To use the General Extrusion shape in SimMechanics, we must first convert the equation into a MATLAB function. The code is asfollows:

Running this function from the MATLAB command line results in an array containing the points that will create the desired shape:

>> xy_data = Extr_NACA_0015(1,20,0.1)

We can now plot the shape in MATLAB (Figure 3).

>> plot(xy_data(:,1),xy_data(:,2),’b-o’,’LineWidth’,1.5);

2

Page 3: Modeling Complex Mechanical Structures With SimMechanics - Mathworks

Figure 3. Plot of points created by the Extr_NACA_0015 function.

Building a Structural Model

We call the MATLAB Extr_NACA_0015 function from the General Extrusion option in SimMechanics (Figure 4). The blade isrepresented in SimMechanics as a Solid block. Within the SimMechanics model, the Solid block calls the MATLAB Extr_NACA_0015

function, which creates the points to form the outline of the blade.

Figure 4. Left: SimMechanics Solid block properties using General Extrusion with the MATLAB function. Right: The resulting 3D rendering inSimMechanics, where c = 1, cseg = 100, t = 0.1.

The length property specifies how long to extrude the shape. Because the Solid block is a rigid body, extruding the airfoil shape for theentire length of the blade would result in a rigid blade. To model a flexible blade, we break it into multiple segments and insert joints withstiffness and damping properties between each segment (Figure 5).

Figure 5. Ten-segment flexible blade model.

3

Page 4: Modeling Complex Mechanical Structures With SimMechanics - Mathworks

We use the test bench shown in Figure 5 to validate the model performance against measured data. During simulation we apply a knownforce to the tip of the blade and measure the amount of deflection along the x, y, and z axes. (We could use automated parameteroptimization tools to tune a set of parameters to match measured test data; this is an important step in the modeling process, but beyondthe scope of this article.)

Once we have modeled and validated a single blade assembly, it is easy to connect additional assemblies to a hub to model a wind turbineblade assembly (Figure 6). We use the rigid transform blocks to position the three blades around the hub 120 degrees apart and at a fixedpitch angle of 45 degrees.

Figure 6. Full hub and blade assembly.

Extending This Approach

This article described the process of creating a mechanical structure using the General Extrusion shape in SimMechanics. This techniqueuses a set of data points to outline an arbitrary shape that can be extruded to a desired length. The data points can be entered manually orcreated using an equation in the form of a MATLAB function. During simulation the resulting geometry is created and the moment ofinertia is automatically calculated from the shape and material properties.

We can apply the method described here to flexible bodies by partitioning the structure into multiple segments. Segments are connectedby joints with spring and damping properties to model the structural stiffness. Using this modular modeling approach we can easilyreuse the assembly, positioning it as desired by performing coordinate transformations. We could use MATLAB to further speed up themodeling process by automatically constructing the blade assembly based on input we provide (such as blade length, number of blades,number of segments, and material properties). Ultimately, this blade assembly could be used in a system simulation with electrical orhydraulic actuators to control the hub speed and blade pitch.

4

Page 5: Modeling Complex Mechanical Structures With SimMechanics - Mathworks

About the Author

Tom Egel is a MathWorks principal technical consultant. Tom specializes in physical modeling of multidomain systems usingSimscape and Simulink physical modeling products. He has over 25 years of experience with modeling and simulation ofphysical systems, and is a contributing author to the book The System Designer’s Guide to VHDL-AMS (Morgan Kaufmann,2003). He holds a B.S. in electrical engineering from Washington University and a B.A. in physics from St. Louis University.

References

[1] The equations to precisely describe common wing profiles are provided by the National Advisory Committee for Aeronautics(NACA; http://en.wikipedia.org/wiki/NACA_airfoil).

Products Used

▪ MATLAB

▪ Simulink

▪ SimMechanics

Learn More

▪ Download: Wind Turbine System Model

▪ Webinars: Developing Wind Power Systems Using

MathWorks Tools

▪ Video: Modeling Multibody Systems (5:42)

▪ Video: Importing and Merging CAD Models into

SimMechanics (7:14)

▪ Video: Modeling an Aileron (4:59)

See more articles and subscribe at mathworks.com/newsletters.

Published 201392150v00

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

5