Top Banner
Overview This guide introduces you to the most basic concepts of Using ADAMS/Controls, part of the MSC.ADAMS ® suite of 24software. If you’ve never used ADAMS/Controls before, this guide is a good place to start. You begin learning ADAMS/Controls with Introducing and Starting the Tutorials on page 3. This material explains the basics of the MSC.ADAMS side of the ADAMS/Controls interface. Then, you continue with the tutorial that is associated with the specific controls application you are using, including EASY5, Control System Import, or MATLAB. Introducing and Starting the Tutorials, 3 Learning ADAMS/Controls with MATLAB, 19 Learning ADAMS/Controls with Control System Import, 39 Learning ADAMS/Controls with MSC.EASY5, 57 Learning ADAMS/Controls with Dynamic Systems Import from MSC.EASY5, 77 Getting Started Using ADAMS/Controls
88
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: cntrl_gs

OverviewThis guide introduces you to the most basic concepts of Using ADAMS/Controls, part of the MSC.ADAMS® suite of 24software. If you’ve never used ADAMS/Controls before, this guide is a good place to start.

You begin learning ADAMS/Controls with Introducing and Starting the Tutorials on page 3. This material explains the basics of the MSC.ADAMS side of the ADAMS/Controls interface. Then, you continue with the tutorial that is associated with the specific controls application you are using, including EASY5, Control System Import, or MATLAB.

■ Introducing and Starting the Tutorials, 3

■ Learning ADAMS/Controls with MATLAB, 19

■ Learning ADAMS/Controls with Control System Import, 39

■ Learning ADAMS/Controls with MSC.EASY5, 57

■ Learning ADAMS/Controls with Dynamic Systems Import from MSC.EASY5, 77

Getting Started Using ADAMS/Controls

Page 2: cntrl_gs

Getting Started Using ADAMS/ControlsCopyright2

The information in this document is furnished for informational use only, may be revised from time to time, and should not be construed as a commitment by MSC.Software Corporation. MSC.Software Corporation assumes no responsibility or liability for any errors or inaccuracies that may appear in this document.

Copyright Information

This document contains proprietary and copyrighted information. MSC.Software Corporation permits licensees of

MSC.ADAMS® software products to print out or copy this document or portions thereof solely for internal use in connection with the licensed software. No part of this document may be copied for any other purpose or distributed or translated into any other language without the prior written permission of MSC.Software Corporation.

Copyright © 2005 MSC.Software Corporation. All rights reserved. Printed in the United States of America.

Trademarks

ADAMS, EASY5, MSC, MSC., MSC.ADAMS, MSC.EASY5, and all product names in the MSC.ADAMS Product Line are trademarks or registered trademarks of MSC.Software Corporation and/or its subsidiaries.

NASTRAN is a registered trademark of the National Aeronautics Space Administration. MSC.Nastran is an enhanced proprietary version developed and maintained by MSC.Software Corporation. All other trademarks are the property of their respective owners.

Government Use

Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in FAR 12.212 (Commercial Computer Software) and DFARS 227.7202 (Commercial Computer Software and Commercial Computer Software Documentation), as applicable. 3

Page 3: cntrl_gs

1 Introducing and Starting the Tutorials

OverviewThis chapter starts you off on the process of adding controls to your MSC.ADAMS model. Following this chapter are tutorials for each of the controls applications you can use with ADAMS/Controls: MSC.EASY5, Control System Import, and MATLAB. After you finish this chapter, continue with the tutorial that is specific to the controls application you are using.

This chapter contains the following sections:

■ About the Tutorial, 4

■ How You’ll Learn ADAMS/Controls, 4

■ Starting ADAMS/View, 4

■ Step One - Importing the MSC.ADAMS Model, 6

■ Step Two - Creating the MSC.ADAMS Plant Inputs and Outputs, 10

Note: Before doing these tutorials, you should be familiar with the basic features of the ADAMS/View interface. Refer to the online help for ADAMS/View for information about the ADAMS/View interface.

This tutorial takes about two hours to complete.

Page 4: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials4

About the TutorialThe tutorials in this guide give you an overview of the four-step process of adding controls to an MSC.ADAMS model. This chapter covers Steps One and Two of the process in depth. You’ll learn how to:

■ Import an MSC.ADAMS model and run a trial simulation with ADAMS/View.

■ Use the ADAMS/Controls interface to identify the inputs and outputs from your MSC.ADAMS model, and create the files for the plant model in MSC.EASY5 and MATLAB/Simulink.

Steps Three and Four are covered in the chapters that follow for each controls application.

How You’ll Learn ADAMS/ControlsBy following the tutorials in this guide, you’ll apply the four-step process of using ADAMS/Controls on a simple antenna-pointing problem. The objective of the problem is to add a control system to the antenna that will move the antenna along a defined path to track a satellite signal.

For this tutorial, you will supply the torque that pivots the antenna in the azimuthal (horizontal) direction. The torque level will be computed by a control system, based on the error between the actual antenna position and the desired antenna position. This is more realistic than attaching an MSC.ADAMS motion to the pivot and driving the motion directly. By applying a torque, you can look at issues related to motor size in an actual mechanical system.

Starting ADAMS/ViewIn this section, you learn how to create a new directory and start ADAMS/Controls from within ADAMS/View in the UNIX and Windows environments.

In the UNIX environment, you start ADAMS/View from the MSC.ADAMS Toolbar, and then, from within ADAMS/View, you load the ADAMS/Controls plugin. For information on the MSC.ADAMS Toolbar, see the online help for Running and Configuring MSC.ADAMS.

Page 5: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials 5

In the Windows environment, you start ADAMS/View from the Start menu, and then load the ADAMS/Controls plugin. For more information, see the online help for Running and Configuring MSC.ADAMS.

To start ADAMS/View:

1 Copy all of the files in install_dir/controls/examples/antenna to a new directory.

2 Do either of the following depending on the platform on which you are running ADAMS/View:

❖ In UNIX, type the command to start the MSC.ADAMS Toolbar at the command prompt, and then press Enter. Select the ADAMS/View tool .

❖ In Windows, from the Start menu, point to Programs, point to MSC.Software, point to MSC.ADAMS 2005 r2, point to AView, and then select ADAMS - View.

The Welcome dialog box appears, in the ADAMS/View main window.

Page 6: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials6

Step One - Importing the MSC.ADAMS ModelNow you’ll import an MSC.ADAMS model and familiarize yourself with its construction by following the next four sections:

■ Importing the MSC.ADAMS Model, 6

■ Loading ADAMS/Controls, 7

■ Familiarizing Yourself with the Model, 8

■ Running a Trial Simulation, 8

Importing the MSC.ADAMS Model

1 Select Import a File.

2 In the Start In text box on the ADAMS/View welcome screen, enter the name of your new directory (the one created in Step 1 on page 5).

This sets your new directory as your working directory.

3 Select OK to close the ADAMS/View welcome screen.

4 In the File Import dialog box, right-click the File to Read text box, and then select Browse.

The File Selection dialog box appears.

5 Select the file antenna.cmd.

6 Select OK.

The antenna model main_olt appears as shown in Figure 1 on page 7.

7 To change the display of the antenna from a wire frame into a shaded, three-dimensional image, from the Main Toolbox, select Render.

Page 7: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials 7

Figure 1. Shaded Model of Antenna

Loading ADAMS/Controls

Because ADAMS/Controls is a plugin for ADAMS/View, you need to load ADAMS/Controls when you use it with ADAMS/View.

To load ADAMS/Controls:

1 From the Tools menu, point to Plugin Manager.

2 Select the Load checkbox next to ADAMS/Controls.

3 Select OK.

ADAMS/View loads the ADAMS/Controls plugin. Notice that there is now a Controls menu on the main menu.

Note: To automatically load ADAMS/Controls each time ADAMS/View starts up, select Load at Startup in the Plugin Manager.

Azimuth rotor

Antenna support

Elevation bearings

Plate

Reduction gear

Antenna

Page 8: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials8

Familiarizing Yourself with the Model

This model is designed so that its base turns in the azimuthal (horizontal) direction and its antenna tilts in the vertical direction.

To familiarize yourself with the model, locate the following components:

■ Azimuth rotor (peach) connected to ground by revolute joint.

■ Azimuth reduction gear (sky blue) connected to ground by revolute joint.

■ Azimuth plate (magenta) connected to ground by revolute joint.

■ Antenna support (silver) connected to plate by fixed joint.

■ Elevation bearings (peach) connected to support by fixed joint.

■ Antenna (sky blue) connected to bearings by revolute joint.

■ rotor_gear, couples the revolute joint at the rotor to the revolute joint at the reduction gear.

■ gear_plate, couples the revolute joint at the reduction gear to the revolute joint at the plate.

Running a Trial Simulation

To run a trial simulation with ADAMS/View:

1 From the Simulate menu, select Interactive Controls.

2 Enter the following in the Simulation Controls dialog box:

■ End Time: 0.5

■ Steps: 250

3 Select Start at equilibrium.

4 Select the Start tool .

The base of the mechanism turns counterclockwise as the antenna tilts up and down.

Page 9: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials 9

Deactivating the Motion

Now that you know the model is working properly, you can begin the process of adding a control system to it. The first step is to deactivate the azimuthal motion on the model. After the motion has be deactivated, you will apply a torque to the joint .main_olt.azimuth_actuator based on values that the controls system package provides.

To deactivate the motion:

1 From the Edit menu, select Deactivate.

The Database Navigator appears.

2 Double-click the model main_olt.

A list of parts and motions appears.

3 Scroll down the list and select azimuth_motion_csd.

4 Select OK.

ADAMS/View deactivates the motion.

5 Select the Reset to Start tool to reset the simulation back to its first frame.

6 Rerun the simulation.

Now that you’ve deactivated the azimuthal motion, the antenna moves up and down, but it does not sweep horizontally as it did during the last simulation.

Note: You might detect some small movement in the azimuthal direction because the model has no constraints or restoring forces to control its natural movement. You should also notice that the bending of the antenna support beam decreases when the azimuthal motion is deactivated. The flexing illustrates that a certain amount of coupling takes place between the elevation and azimuthal movements.

Page 10: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials10

Step Two - Creating the MSC.ADAMS Plant Inputs and OutputsNow you’ll create the inputs and outputs on the MSC.ADAMS model by:

■ Identifying the MSC.ADAMS Plant Inputs and Outputs, 10

■ Verifying Input Variables, 11

■ Verifying Input Functions, 13

■ Verifying Output Functions, 14

■ Exporting the MSC.ADAMS Plant Files for the Controls Application, 15

Identifying the MSC.ADAMS Plant Inputs and Outputs

Figure 2 indicates the flow path of the input and output variables shared between the antenna model and its control system. This diagram shows that when you supply an input control torque to the antenna model, you send outputs azimuth_position and rotor_velocity to the controller.

The steps you follow to achieve this closed-loop circuit are:

■ Define the input and output variables in ADAMS/View.

■ Read in the plant and the input/output variables using MSC.EASY5 or MATLAB, create an MSC.ADAMS plant, and run a simulation.

■ Animate and plot the simulation results in ADAMS/View.

■ Modify the variables and repeat this process as necessary.

Figure 2. Terminology for MSC.ADAMS Inputs and Outputs

Output = azimuth_position and rotor_velocity

Input = control _torque ADAMSmodel

Controlsystem

Page 11: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials 11

Verifying Input Variables

ADAMS/Controls and controls applications, such as MSC.EASY5 and MATLAB, communicate by passing state variables back and forth. Therefore, you must define your model’s input and output variables (and the functions that those inputs and outputs reference) with a set of MSC.ADAMS state variables.

This step has already been done for you in the antenna model that you imported. When you create a model of your own, you will have to define the state variables for your input and output variables.

For this tutorial, you will only verify that the state variables in the antenna model and control system correspond to the correct input and output variables. For a description of state variables, see the online help.

To verify the input variables:

1 From the Build menu, point to System Elements, point to State Variable, and then select Modify.

The Database Navigator appears.

2 Double-click the model main_olt.

The list of MSC.ADAMS variables appears.

Figure 3. List of MSC.ADAMS Variables

3 Select control_torque.

Page 12: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials12

4 Select OK.

The Modify State Variable dialog box appears.

Figure 4. Modify State Variable Dialog Box

5 Look in the F(time, ...)= text box and verify that the run-time function for the input variable, control_torque, is 0.0.

Because the control torque will get its value from the control application, the 0.0 will be overwritten during each step of the simulation.

6 Select Cancel to close the Modify State Variable dialog box.

Note: After you close the box, click in the background of the screen to clear the selection of the model.

Page 13: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials 13

Verifying Input Functions

Now you’ll verify the function that references the input variable.

To verify the function that is referenced to the input variable control_torque:

1 From the Edit menu, select Modify.

The Database Navigator appears.

2 Double-click main_olt, and then double-click azimuth_actuator (azimuth_actuator is the name of the control torque).

The Modify Torque dialog box appears.

Figure 5. Modify Torque Dialog Box

3 Look in the Function text box and verify that the run-time function for the input variable reads: VARVAL(.main_olt.control_torque).

Note: VARVAL (variable value) is the MSC.ADAMS function that returns the value of the given variable. Notice that the function is defined as the value of the control_torque variable. In other words, the input control torque (azimuth_actuator) gets its value from the input variable.

4 Select Cancel to close the Modify Torque dialog box.

Page 14: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials14

Verifying Output Functions

Now you’ll verify the output functions just as you verified the input functions in the previous section.

To verify the output functions:

1 From the Build menu, point to System Elements, point to State Variable, and then select Modify.

The Variable Selection dialog box appears.

2 Double-click the model main_olt.

The list of MSC.ADAMS variables appears.

3 Select azimuth_position.

4 Select OK.

The Modify State Variable dialog box appears.

Figure 6. Modify State Variable Dialog Box

5 Look in the F(time, ...)= text box to verify that the run-time function for the output variable is AZ(MAR70, MAR26).

This function returns the angle about the z-axis, the vertical axis about which the antenna rotates. Therefore, the function assigns the rotational position of the antenna to the output state variable.

6 Right-click the Name text box, point to ADAMS_Variable, point to Guesses, and then select rotor_velocity.

The Modify State Variable dialog box updates.

Page 15: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials 15

7 Look at the F(time, ...)= text box and verify the run-time function for the output variable is WZ(MAR21, MAR22, MAR22).

This function measures the rotational velocity of the rotor relative to ground.

8 Select Cancel to close the dialog box.

Exporting the MSC.ADAMS Plant Files for the Controls Application

In this section, you will export the MSC.ADAMS linear and nonlinear plant files.

To export the nonlinear plant files:

1 From the Controls menu, select Plant Export.

The ADAMS/Controls Plant Export dialog box appears.

2 In the New Controls Plant text box, enter ant_test.

3 In the File Prefix text box, type ant_test for the filename.

This defines the prefix for the .adm, .cmd, .m, and .inf files created by the Plant Export dialog box.

4 Right-click the Input Signal(s) text box, point to ADAMS_Variable, and then select Browse.

The Database Navigator appears.

5 In the Database Navigator, select control_torque, and then select OK.

6 In the ADAMS/Controls Plant Export dialog box, right-click the Output Signal(s) text box, point to ADAMS_Variable, and then select Guesses.

A selection list appears.

7 From the selection list, select rotor_velocity.

8 Repeat Step 6, and then from the selection list, select azimuth_position.

Note: It is important to maintain the above selection order for selecting output signals.

9 From the Target Software pull-down menu, select the controls application you are using during this session: MATLAB or MSC.EASY5.

Page 16: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials16

10 Confirm that Type is set to non_linear and Initial Static Analysis is set to No.

Note: If Type is set to linear and Initial Static Analysis is set to Yes, ADAMS/Controls conducts a static analysis before the linear analysis. Otherwise, ADAMS/Controls performs an initial conditions analysis.

11 Verify that the ADAMS/Solver choice is set to Fortran and MSC.ADAMS host is set to your machine name.

Be sure that the name for ADAMS Host is a fully qualified hostname. (To be fully qualified, the hostname must contain the workstation and domain name.) If the ADAMS Host is not fully qualified, edit the value in the text box so that it is fully qualified.

12 Verify that Dynamic States Output is selected.

This is only relevant for ADAMS/Chassis models imported into ADAMS/View.

13 Verify that the Plant Export dialog box is completed as shown in Figure 7 on page 17.

Page 17: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials 17

Figure 7. ADAMS/Controls Plant Export Dialog Box

14 Select OK.

ADAMS/Controls saves the input and output information in an .m (for MATLAB) or .inf file (for MSC.EASY5). It also generates a command file (.cmd) and a dataset file (.adm) that are used during the simulation process.

Note: The ant_test plant you just created is saved in the modeling database. By importing settings from an existing plant, you can create new plants based on plants you already created.

This order isimportant.

Page 18: cntrl_gs

Getting Started Using ADAMS/ControlsIntroducing and Starting the Tutorials18

To export the linear plant files:

1 From the Controls menu, select Plant Export.

2 In the ADAMS/Controls Plant Export dialog box, create a new controls plant by importing settings from a previous plant.

3 Change the file prefix from ant_test to ant_test_l.

4 Set Analysis Type to Linear.

5 Set Initial Static Analysis to Yes.

6 Select OK.

ADAMS/Controls generates the linear model of the MSC.ADAMS model in four matrices: ADAMS_a, ADAMS_b, ADAMS_c, and ADAMS_d.

ADAMS/Controls setup is complete after the plant files have been exported. Now you will go to the specific controls application (MSC.EASY5 or MATLAB) and complete the link between the controls and mechanical systems.

Note: You have now finished the introduction to the ADAMS/Controls tutorials. To continue learning the ADAMS/Controls interface, go to the tutorials that follow this section. If you are using:

❖ MATLAB, go to Learning ADAMS/Controls with MATLAB on page 19.

❖ Control System Import with MATLAB, go to Learning ADAMS/Controls with Control System Import on page 39.

❖ MSC.EASY5, go to Learning ADAMS/Controls with MSC.EASY5 on page 57.

❖ Control System Import with MSC.EASY5, go to Learning ADAMS/Controls with Dynamic Systems Import from MSC.EASY5 on page 77.

Page 19: cntrl_gs

2 Learning ADAMS/Controls with MATLAB

OverviewThis chapter teaches you how to use ADAMS/Controls with MATLAB. It contains the following sections:

■ About the Tutorial, 20

■ Step Three - Adding Controls to the MSC.ADAMS Block Diagram, 21

■ Step Four - Simulating the Model, 31

Note: Before beginning this tutorial, you should have finished Introducing and Starting the Tutorials on page 3.

Page 20: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB20

About the TutorialThis chapter provides procedures for using ADAMS/Controls with MATLAB. It teaches you Steps 3 and 4 of the four-step process of adding controls to an MSC.ADAMS model. You will learn how to:

■ Add an MSC.ADAMS plant to your block diagram in MATLAB simulation.

■ Simulate an MSC.ADAMS model with a complex control system.

■ Plot simulation results.

Page 21: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB 21

Step Three - Adding Controls to the MSC.ADAMS Block DiagramYou will add controls to the MSC.ADAMS block diagrams by:

■ Starting MATLAB, 21

■ Creating the MSC.ADAMS Block Diagram, 23

■ Setting Simulation Parameters in the Plant Mask, 27

■ Constructing the Controls System Block Diagram, 25

Starting MATLAB

A note about your MSC.ADAMS license(s): Running an ADAMS/Controls cosimulation will check out an ADAMS/Solver license and possibly an ADAMS/View license (for interactive simulations only). To ensure that you are able to run these products, close your current ADAMS/Controls session.

To start using MATLAB:

1 Start MATLAB on your system.

2 Change directories to the one in which your ant_test.m file resides (the working directory you specified during your ADAMS/Controls session).

You can do this by entering the following:

❖ On Windows: cd c:\new_dir, where new_dir is the name of your working directory.

❖ On UNIX, cd /new_dir, where new_dir is the name of your working directory.

3 At the prompt (>>), type ant_test.

MATLAB echoes:%%%INFO:ADAMS plant actuators names:1 control_torque%%%INFO:ADAMS plant sensors names:1 rotor_velocity2 azimuth_position.

Page 22: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB22

4 At the prompt, type who to get the list of variables defined in the files.

MATLAB echoes the following relevant information:ADAMS_cwd ADAMS_inputs ADAMS_poutput ADAMS_sysdirADAMS_exec ADAMS_mode ADAMS_prefix ADAMS_uy_idsADAMS_host ADAMS_outputs ADAMS_solver_typeADAMS_init ADAMS_pinput ADAMS_static

You can check any of the above variables by entering them in at the MATLAB prompt. For example, if you enter ADAMS_outputs, MATLAB displays all of the outputs defined for your mechanism: ADAMS_outputs=

rotor_velocity!azimuth_position

Note: If you want to import the linearized MSC.ADAMS model, use ant_test_l.m instead of ant_test.m. The main difference is in the ADAMS_mode variable:

❖ In ant_test.m, ADAMS_mode=non_linear.

❖ In ant_test_l.m, ADAMS_mode=linear.

Page 23: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB 23

Creating the MSC.ADAMS Block Diagram

To create the MSC.ADAMS block diagram:

1 At the MATLAB prompt, enter adams_sys.

This builds a new model in Simulink named adams_sys_.mdl. This model contains the MSC.Software S-Function block representing your mechanical system.

A selection window containing the MSC.ADAMS blocks appears. These blocks represent your MSC.ADAMS model in different ways:

❖ The S-Function represents the nonlinear MSC.ADAMS model.

❖ The adams_sub contains the S-Function, but also creates several useful MATLAB variables.

❖ The State-Space block represents a linearized MSC.ADAMS model.

The adams_sub block is created based on the information from the .m file (either from ant_test.m or ant_test_l.m). If the ADAMS_mode is nonlinear, the S-Function block is used in the adams_sub subsystem. Otherwise, the State_Space block is copied into adams_sub.

Figure 8. Simulink Selection Window

Page 24: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB24

2 From the File menu, point to New, and then select Model.

A new selection window for building your block diagram appears.

3 Drag and drop the adams_sub block from the adams_sys_ selection window onto the new selection window.

4 Double-click the adams_sub block.

All of the elements in the subsystem appear.

Figure 9. adams_sub block

Note: The inputs and outputs you defined for the model appear in the sub-block. The input and output names automatically match up with the information read in from the ant_test.m file.

Page 25: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB 25

Constructing the Controls System Block Diagram

The completed block diagram is in the file, antenna.mdl, in the examples directory. To save time, you can read in our diagram instead of building it. Remember to update the settings in the plant mask if you decide to use this file (see Setting Simulation Parameters in the Plant Mask on page 27).

Note: If the Simulink model containing the adams_sub block was created in an earlier version of ADAMS/Controls, you should run adams_sys again to create a new adams_sub block to replace the existing one for better performance.

Only one adams_sub block is permitted per Simulink model.

To construct the controls system block diagram:

1 At the MATLAB prompt, type simulink.

The Simulink library selection windows appear. Use the block icons from the windows to complete your controls block diagram. Each icon contains a submenu.

2 Double-click each icon to reveal its submenu.

Note: Be sure to set the step block parameters as follows:

❖ Step time: 0.001

❖ Initial value: 0

❖ Final value: .3

❖ Sample time: .001

3 Look at the controls block diagram. Figure 11 on page 27 describes the topology in tabular form.

4 Drag and drop the appropriate blocks from the Simulink library to complete your block diagram as shown in Figure 11 on page 27.

5 From the File menu, select Save As, and enter a file name for your controls block diagram.

Page 26: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB26

Figure 10. Topology in Tabular Form

Quantity LibraryBlock Type1 SourcesStep2 Continuous Transfer Function2 Math Ops Sum3 Sinks Scope (not floating)

Step ParametersStep Time: 0.001Initial Value: 0Final value: 0.3Sample time: 0.001

[X] Interpret vector parameters as 1-D [X] Enable zero crossing detection

Continuous Transfer Function Parameters1 Numerator: [1040]

Denominator: [0.001 1]Absolute tolerance: auto

2 Numerator: [950]Denominator: [0.001 1]Absolute tolerance: auto

Sum Parameters1 SumP

Icon shape: RectangularList of signs: +-

[ ] Show additional parameters

2 SumV Icon shape: Rectangular List of signs: +-[ ] Show additional parameters

Scopetorquerotor_velazimuth_pos

Page 27: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB 27

Figure 11. Controls Block Diagram

Setting Simulation Parameters in the Plant Mask

To set the simulation parameters:

1 From the controls block diagram, double-click the adams_sub block.

2 From the new Simulink selection window, double-click the MSC.Software block.

The MSC.ADAMS Plant Mask dialog box appears.

Page 28: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB28

Figure 12. MSC.ADAMS Plant Mask

3 In the Output Files Prefix text box, enter ‘mytest’.

Be sure to enclose the name with single quotation marks. ADAMS/Controls will save your simulation results under this name in the three file types listed in Table 1.

Page 29: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB 29

4 Keep the default Interprocess Option of PIPE(DDE).

This option defines the communication method between MATLAB and MSC.ADAMS. You can change this setting to TCP/IP, if you want to run MATLAB and MSC.ADAMS on separate machines and communicate using TCP/IP protocol. Using this protocol, ADAMS_host defines the machine on which MSC.ADAMS runs. For more information, see TCP/IP Communication Mode in the ADAMS/Controls help.

5 Keep the default ADAMS solver type of Fortran.

To run the simulation using ADAMS/Solver (C++), you can change the setting to C++.

6 Keep the default Communication Interval of 0.005.

The communication interval defines how often the communication between MSC.ADAMS and Simulink occurs. You can change this parameter to control the simulation speed (and accuracy).

7 Keep the default Number of communications per output step of 1.0.

This value controls the size of .res, .gra, and .out files. It must be an integer larger than zero. For example, if the value is n, ADAMS/Controls writes to the output file once for every n communication steps. This size-control mechanism only works in discrete mode.

Table 1. File Types

File name: File type: What the file contains:

mytest.res Results ADAMS/Solver analysis data and ADAMS/View graphics data

mytest.req Requests ADAMS/Solver analysis data

mytest.gra Graphics ADAMS/View graphics data

Page 30: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB30

8 Select a simulation parameter for each text box.

■ Set Simulation mode to discrete.

This mode specifies that MSC.ADAMS solve the mechanical system equations and that the controls application solve the control system equations. See the online help for more details about simulation modes.

■ Set Animation mode to interactive.

Animation mode allows you to graphically monitor your simulation results in ADAMS/View. See the online help for more details about animation modes.

9 Set the parameters for initializing the MSC.ADAMS model:

■ Initial Static Simulation Flag: Set ADAMS_static to yes or no to control whether or not a static analysis should be performed. ADAMS_static is a parameter in the MATLAB workspace that is passed in through the ant_test.m file (which sets the default). If ADAMS_static is yes, MSC.ADAMS performs a static analysis.

■ Initialization commands: MATLAB string that holds the MSC.ADAMS commands. Default is ADAMS_init.

Note: In batch mode, the static (or initial condition) analysis is performed first, followed by the user-defined initialization commands in ADAMS_init. In interactive mode, the procedure is reversed.

10 To save the change, select Apply.

11 Select Cancel to close the plant mask.

Page 31: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB 31

Step Four - Simulating the ModelYou will simulate your mechanical model and control system by:

■ Setting the Simulation Parameters, 31

■ Executing the Simulation, 32

■ Pausing the Simulation, 32

■ Plotting from MATLAB, 33

■ Plotting from ADAMS/View, 35

Setting the Simulation Parameters

To set the simulation parameters:

1 From the menus on the Simulink window, select Simulation, and then select Configuration Parameters.

The Simulation Parameters dialog box appears.

2 Enter the following simulation parameters:

■ For Start Time, enter 0.0 seconds.

■ For End Time, enter 0.25 seconds.

3 Select the Type text box for the Solver options:

■ Set the first text box to variable step.

■ Set the second text box to ode15s.

■ Accept the default values in the remaining text boxes.

4 Select OK to close the Simulation Parameters dialog box.

Page 32: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB32

Executing the Simulation

To start the simulation:

■ Select Simulation -- Start.

After a few moments, a new ADAMS/View window opens and graphically displays the simulation.

If you’re using Windows, a DOS window appears with the current simulation data. If you’re using UNIX, the current simulation data scrolls across the MATLAB window.

MSC.ADAMS accepts the control inputs from MATLAB and integrates the MSC.ADAMS model in response to them. At the same time, MSC.ADAMS provides the azimuthal position and rotor velocity information for MATLAB to integrate the Simulink model. This simulation process creates a closed loop in which the control inputs from MATLAB affect the MSC.ADAMS simulation, and the MSC.ADAMS outputs affect the control input levels. See Figure 2 on page 10 for an illustration of the closed loop simulation process.

Pausing the Simulation

The interactive capabilities of ADAMS/Controls let you pause the simulation in MATLAB and monitor the graphic results in ADAMS/View. Because MATLAB controls the simulation, you must pause the simulation from within MATLAB. You can plot simulation results during pause mode. This feature is only available when animation mode is set to interactive.

To pause the simulation:

1 A time display in the upper left corner of the MSC.ADAMS screen tracks the seconds of the simulation. To pause the simulation, move your cursor to the Simulink window, point to Simulation, and then select Pause.

MATLAB suspends the simulation.

Page 33: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB 33

2 Now go back to ADAMS/View. While the simulation is paused, you can change the orientation of the model with the View Orientation tools in the Main toolbox. These tools help you to look at the model from different vantage points.

Figure 13. View Orientation Tools

3 Once you have finished reorienting the model, resume the simulation by selecting Simulation, and then Continue, from the toolbar on the Simulink window.

ADAMS/View closes automatically after the simulation finishes.

Plotting from MATLAB

You can plot any of the data generated in MATLAB. In this tutorial, you will plot the ADAMS_uout data that is saved in the adams_sub block. This block is shaded in Figure 14 on page 34.

Page 34: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB34

Figure 14. adams_sub Block

To plot from MATLAB:

■ At the MATLAB prompt, type in the following command:>>plot (ADAMS_tout, ADAMS_uout)

The plot window opens and shows the time history of input from MATLAB to MSC.ADAMS. Figure 15 on page 35 shows you how the plot should look. Notice that the control torque reaches a peak, and then settles down as the antenna accelerates. As the antenna gets close to its final position, the torque reverses direction to slow down the antenna. The antenna moves past its desired position, and then settles down to the point of zero error. At this point, the torque value is also at zero.

To add labels to your plot:

■ At the MATLAB prompt, enter:

>>xlabel(‘time in seconds’)>>ylabel(‘Control Torque Input, N-mm’)>>title(‘ADAMS/Controls Torque Input from MATLAB to ADAMS’)

The labels appear on the plot.

Page 35: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB 35

Figure 15. Control Torque Input from MATLAB to ADAMS

Plotting from ADAMS/View

To plot from ADAMS/View:

1 Start ADAMS/View from your working directory and read in the command file, ant_test.cmd.

2 From the File menu, select Import.

The File Selection dialog box appears.

3 In the File Selection dialog box, select the following:

❖ For the File Type, select ADAMS Results File.

❖ For Files to Read, select Read mytest.res.

❖ For Model, select main_olt. Be sure to include the model name when you read in results files. ADAMS/View needs to associate the results data with a specific model.

Page 36: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB36

4 Select OK.

The results are loaded. Now, you can plot any data from the cosimulation and play the animation.

5 From the Review menu, select Postprocessing.

ADAMS/View launches ADAMS/PostProcessor, a postprocessing tool that lets you view the results of the simulations you performed (see Figure 16 on page 36). ADAMS/PostProcessor has four modes: animation, plotting, reports, and 3D plotting (only available with ADAMS/Vibration data). Note that the page in the plot/animation viewing area can contain up to six viewports to let you compare plots and animations.

Figure 16. ADAMS/PostProcessor Window

6 From the dashboard, set Source to Results.

Menu bar

Menu toolbar

Treeview

Property editor

Status toolbarDashboard

ViewportsPage

Page 37: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB 37

7 From the Simulation list, select mytest.

8 From the Result Set, select control_torque.

9 From the Component list, select Q.

10 Select Add Curves.

ADAMS/PostProcessor generates the curve.

To add labels to your plot:

1 In the treeview, navigate to the plot and select it.

2 In the Property Editor that appears, perform the following:

❖ Uncheck Auto Title.

❖ Set Title to Antenna Azimuth Control Torque in ADAMS.

❖ Uncheck Auto Subtitle.

❖ Set Subtitle to Using Matlab Continuous Controller.

3 Select the vertical axis.

4 In the Property Editor, in the Labels tab, set Label to Control Torque Input (N-mm).

Figure 17 on page 38 illustrates the torque signal received from the MATLAB controller. The difference between this curve and the one plotted in Figure 15 on page 35 is because the number of output steps (MSC.ADAMS has fewer outputs).

Page 38: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MATLAB38

Figure 17. MSC.ADAMS Antenna Joint Peak Torque, Controlled

Page 39: cntrl_gs

3 Learning ADAMS/Controls with Control System Import

OverviewThis chapter teaches you how to import the C-code of control systems designed in control programs into MSC.ADAMS in terms of GSE (General State Equations). It contains the following sections:

■ Step One – Create MSC.ADAMS Target for Real Time Workshop, 40

■ Step Two – Create Control System for Code Generation, 41

■ Step Three – Code Generation of Control System, 46

■ Step Four – Create GSE from the Simulink Model, 50

Page 40: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import40

About the TutorialThis chapter provides the procedures to import control systems designed in MATLAB/Simulink into MSC.ADAMS. It relies on MATLAB/Real-Time Workshop to convert the control model to C-code. This tutorial is based on the files output from ADAMS/View in the previous chapter.

The antenna model is still used in this chapter. The controller used in last chapter will be modified to represent three different types of controllers: continuous, discrete, and hybrid (continuous/discrete). Those three simulink files (continuous.mdl, discrete.mdl, and hybrid.mdl) are in the example directory. Copy them to the local directory.

If MATLAB/Simulink and MSC.ADAMS cannot be run on the same machine, you will have to perform additional steps to realize the cross-platform control system import. For more information, refer to the online help.

Step One – Create MSC.ADAMS Target for Real Time WorkshopHere you will customize the makefile template and source code template for MSC.ADAMS. Once this is done, you can use the customized template files for other Simulink models.

To create code from the Simulink model:

1 Set the MATLAB_ROOT environment variable to the MATLAB installation directory. For example:

❖ On Windows (DOS shell): set MATLAB_ROOT= c:\matlab7\

❖ On UNIX (c shell): setenv MATLAB_ROOT /usr/matlab_r14/

❖ On UNIX (korn shell): export MATLAB_ROOT = /usr/matlab_r14/

Change the directory paths to match your installation.

2 In the directory where your MSC.ADAMS model resides, issue the following command, where $adams_dir is the directory in which MSC.ADAMS is installed:

■ On UNIX:

adams05r2 -c python ($adams_dir)/controls/utils/process.py -v 7 exit

Page 41: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import 41

■ On Windows:

adams05r2 python ($adams_dir)\controls\utils\process.py -v 7

Alternatively, you can copy the process.py file from the <adams_dir>/controls/utils/ directory on UNIX or <adams_dir>\controls\utils\ on Windows to the current directory and issue the following command:

■ On UNIX:

adams05r2 -c python process.py -v 7 exit

■ On Windows:

adams05r2 python process.py -v 7

Note: The argument -v 7 stands for MATLAB 7 (R14). For other supported MATLAB releases and their associated arguments, run the python script with the argument -h.

This command customizes several files from the MATLAB installation for the MSC.ADAMS target and your computer setup. You should notice several new files in your working directory with a .tlc extension and two new files with a .tmf extension. These are files required by MATLAB’s Real Time Workshop in the steps that follow.

Step Two – Create Control System for Code GenerationFirst you will start MATLAB, and then you will create a simulink model for control system design. You will use the antenna model files from the last section, plus several additional files.

To start MATLAB:

1 Start MATLAB in the same directory as the one the model and Simulink files reside.

2 Set up the MEX utility, if not already set up.

Enter mex -setup from the MATLAB command window, and then select the appropriate compiler.

Page 42: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import42

3 At the prompt (>>), type ant_test.

MATLAB displays:%%%INFO:ADAMS plant actuators names:1 control_torque

%%%INFO:ADAMS plant sensors names:1 rotor_velocity2 azimuth_position.

4 At the prompt, type who to view the list of variables defined in the files.

MATLAB displays the following relevant information:ADAMS_cwd ADAMS_inputs ADAMS_poutput ADAMS_sysdirADAMS_exec ADAMS_mode ADAMS_prefix ADAMS_uy_idsADAMS_host ADAMS_outputs ADAMS_solver_typeADAMS_init ADAMS_pinput ADAMS_static

You can check any of the above variables by entering them at the MATLAB prompt. For example, if you enter ADAMS_outputs, MATLAB displays all of the outputs defined for your mechanism. For example:ADAMS_outputs=

rotor_velocity!azimuth_position

To create the Simulink template for the control system:

1 Enter setio at the MATLAB prompt.

MATLAB creates a template model with the inport(s) and outport(s) defined, as shown in Figure 18 on page 43.

Page 43: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import 43

Figure 18. Simulink Template

Based on this template, you can design continuous, discrete, or hybrid control systems. These are the files you already copied into the local directory.

2 To open hybrid.mdl, from the File menu, select Open. Or, double-click the file in the file browser.

In the following context, the hybrid control system will be used as the example to illustrate the process. Figure 19 shows the hybrid system. Figure 20 on page 44 and 45 shows the topology.

Figure 19. Hybrid Control System

Page 44: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import44

Figure 20. Hybrid Control System Topology

Quantity Library Block Type

1 Sources Step

2 Continuous Transfer Function

2 Discrete Transfer Function

5 Math Ops Sum

1 Math Ops Gain

2 Ports Inport

1 Ports Outport

Step Parameters

Step Time: 0.001

Initial Value: 0

Final value: 0.3

Sample time: 0.01

[X] Interpret vector parameters as 1-D

[X] Enable zero crossing detection (greyed out)

Continuous Transfer Function Parameters

1 Numerator: [1040]

Denominator: [0.001 1]

Absolute tolerance: auto

2 Numerator: [950]

Denominator: [0.001 1]

Absolute tolerance: auto

Discrete Transfer Function Parameters

1 Numerator: [657.4]

Denominator: [1 -.3679]

Sample time: 0.001

2 Numerator: [600.5]

Denominator: [1 -.3679]

Sample time: 0.001

Page 45: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import 45

Hybrid Control System Topology (continued)Sum Parameters

1 SumP

Icon shape: Rectangular

List of signs: +-

[ ] Show additional parameters

2 SumV

Icon shape: Rectangular

List of signs: +-

[ ] Show additional parameters

3 SumP1

Icon shape: Rectangular

List of signs: +-

[ ] Show additional parameters

4 SumV1

Icon shape: Rectangular

List of signs: +-

[ ] Show additional parameters

5 Icon shape: Round

List of signs: ++

[ ] Show additional parameters

Gain

Gain: 0.5

Multiplication: Element-wise(K, *u)

[ ] Show additional parameters

Inport

Name: rotor_velocity

Port number: 1

Name: azimuth_position

Port number: 2

Outport

Name: control_torque

Port number: 1

Page 46: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import46

Step Three – Code Generation of Control SystemFirst you will create code from the Simulink model and then you will create the Simulink model object file.

Given a controller designed with the appropriately designated inports and outports, the following steps are required to export the model using RTW.

1 From the Tools menu, point to Real-Time Workshop, and then select Options.

The Simulation Parameters dialog box appears.

2 Verify that Generate code only is not selected.

3 Complete the Simulink Parameters dialog box for your release of MATLAB, as shown in Figure 21 on page 47.

Page 47: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import 47

Figure 21. Simulation Parameters

4 Perform one of the following:

■ For MATLAB R13.1 and below, select the Solver tab.

■ For MATLAB R14 and higher, from the treeview on the left side of the window, select Solver.

The dialog box displays the Solver options as shown next (depending on your version of MATLAB).

Real-Time Workshop MATLAB R13.1 and below

Real-Time Workshop MATLAB R14 and higher

Page 48: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import48

Figure 22. Simulation Parameters - Solver Options

5 Set Solver options Type to Fixed-Step.

6 Set Mode to SingleTasking.

7 Select a continuous integrator (because the control system has continuous states).

For the control system discrete.mdl, you would select a Discrete integrator.

Real-Time Workshop MATLAB R13.1 and below

Real-Time Workshop MATLAB R14 and higher

Page 49: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import 49

8 Perform one of the following:

■ For MATLAB R13.1 and below: Select the Advanced tab.

■ For MATLAB R14 and higher: From the treeview on the left side of the window, select Optimization.

The dialog box displays the Advanced options as shown in Figure 23 on page 49.

9 Verify that Inline parameters is selected.

Figure 23. Simulation Parameters - Advanced Options

Real-Time Workshop MATLAB R13.1 and below

Real-Time Workshop MATLAB R14 and higher

Page 50: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import50

10 Select the Real-Time Workshop tab.

11 To begin code generation and build the RTW library, select Build.

Messages will appear in the MATLAB command window indicating successful code generation and RTW library creation. You can safely ignore any error messages that follow, such as:Error executing build command: Error using ==> make_rtwError using ==> rtw_cError(s) encountered while building model “hybrid”

All generated files are created in your working directory.

Step Four – Create GSE from the Simulink ModelFirst you will start ADAMS/View and import the command file, and then simulate your MSC.ADAMS model containing the GSE for the control system.

To start ADAMS/View and load the command file:

1 Launch ADAMS/View and import the file ant_test.cmd.

2 Load the ADAMS/Controls plugin, if not already loaded.

3 From the Controls menu, point to Control System, and then select Control System Import.

The ADAMS/Controls System Import dialog box appears.

4 Select Import I/O Signals from Existing Controls Plant.

5 From the Database Navigator, select ant_test for the plant. The values for the Output Signals and Input Signals text boxes appear.

Page 51: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import 51

6 Complete the dialog box as shown in Figure 24, and then select OK.

Figure 24. ADAMS/Controls System Import Dialog Box

ADAMS/View displays information on the GSE created (see Figure 25 on page 52). The Database Navigator shown in Figure 26 on page 52, shows the GSE and its associated arrays.

Page 52: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import52

Figure 25. Information Window

Figure 26. Database Navigator

Page 53: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import 53

To simulate your model:

1 From the Settings menu, point to Solver, and then select Dynamics.

The Solver Setting dialog box displays.

2 Change Formulation to SI2.

3 Set Category to Executable.

4 Set Hold License to No.

This setting is critical to using the RTW dll in repeated simulations in ADAMS/View.

5 Select Close.

6 Run a simulation with a step size of .001s and duration of .25s.

During the simulation, the antenna motion behaves the same as the one in the co-simulation.

7 Press F8 to open ADAMS/PostProcessor.

8 Plot and animate, as desired.

ADAMS/PostProcessor displays the plot of azimuth position versus time, as shown in Figure 27 on page 54.

Page 54: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import54

Figure 27. Plot of Azimuth Position vs. Time

A comparison of the results of the above simulation, discrete simulation, and continuous simulation is conducted. In all cases, the output step (sampling time in discrete simulation) is set to .001 second. The control torque versus time from three simulations is plotted in Figure 28 on page 55. As shown, the result from the simulation with imported GSE is almost the same as that from continuous simulation. The control torque from the discrete simulation is slightly larger in magnitude because the one-step delay introduced by the discrete control system results in a control-mechanical system with less damping.

Page 55: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import 55

Your RTW dll can contain discrete states and counters. When performing repeated simulations (for example, design of experiments or design optimization), these entities need to be reset to their original values at the beginning of each simulation. When you rewind a simulation in ADAMS/View, the RTW dll is released and reacquired, thereby resetting the discrete states and counters to their original state. Changing this behavior by issuing commands in ADAMS/View causes unexpected simulations after the first one.

Figure 28. Control Torque vs. Time

Page 56: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Control System Import56

Page 57: cntrl_gs

4 Learning ADAMS/Controls with MSC.EASY5

OverviewThis chapter teaches you how to use ADAMS/Controls with MSC.EASY5. This chapter does not include information on the basics of MSC.EASY5. For that information, refer to the appropriate MSC.EASY5 documentation.

It contains the following sections:

■ About the Tutorial, 58

■ Step Three - Adding Controls to the MSC.ADAMS Block Diagram, 58

■ Step Four - Simulating the Model, 67

Note: Before beginning this tutorial, you should have finished Chapter 1, Introducing and Starting the Tutorials, and have the MSC.ADAMS Extension for MSC.EASY5 installed (refer to the online help for more information).

Page 58: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY558

About the TutorialThis chapter provides you with procedures for using ADAMS/Controls with MSC.EASY5. It teaches you Steps Three and Four of the four-step process of adding controls to an MSC.ADAMS model. Steps One and Two are described on page 6 and 10, respectively. You’ll learn how to:

■ Add an MSC.ADAMS plant to your block diagram in the MSC.EASY5 simulation.

■ Simulate an MSC.ADAMS model with a complex control system.

■ Plot simulation results.

Note: This tutorial was created using MSC.EASY5 2005.

Step Three - Adding Controls to the MSC.ADAMS Block DiagramYou will add controls to the MSC.ADAMS block diagrams by:

■ Starting MSC.EASY5, 58

■ Creating the MSC.ADAMS Interface Block, 59

■ Constructing the Controls System Block Diagram, 65

Starting MSC.EASY5

To start MSC.EASY5:

■ Start MSC.EASY5 on your system from the directory that contains the file with the antenna example. This is the working directory that you created in Step One - Importing the MSC.ADAMS Model on page 6.

The MSC.EASY5 main window appears.

Page 59: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY5 59

Creating the MSC.ADAMS Interface Block

You create the MSC.ADAMS interface block by defining its component parts in the Add Components dialog box. After you define the component parts, you place the block in the work space area of the MSC.EASY5 main window.

To create the MSC.ADAMS interface block:

1 From the MSC.EASY5 toolbar, select Add or type Ctrl+A.

The Add Components window appears.

Figure 29. Add Components Window

Page 60: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY560

2 Select a category for each of the component fields in the window.

❖ Under Library, select Extensions.

❖ Under Extensions, select MSC.Software.

❖ Under MSC.Software, select the ADAMS Mechanism block.

The information you supply in these fields becomes part of the MSC.ADAMS interface block.

3 Move the cursor to the center of the MSC.EASY5 main window and click.

The MSC.ADAMS interface block appears. You build the controls block diagram by adding elements to this block.

Figure 30. MSC.ADAMS Mechanism Block

Initializing the MSC.ADAMS Interface Block

To initialize the MSC.ADAMS interface block:

1 Double-click the MSC.ADAMS interface block.

The Component Data Table appears as shown in Figure 31 on page 61.

Page 61: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY5 61

Figure 31. Component Data Table

2 Select Select/Configure ADAMS model in the lower left corner of the Component Data Table.

The MSC.ADAMS Interface dialog box appears as shown below.

Figure 32. MSC.ADAMS Interface Dialog Box

3 Select ant_test.

4 Select Co-Simulation (Discrete).

Options 1 and 2 are continuous simulation methods and option 3 is a discrete simulation method. For information on choosing a simulation method, see the online help.

Page 62: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY562

If you’ve linearized a nonlinear MSC.ADAMS model and represented it as A, B, C, and D matrices and the matrix D is zero at all times, then there is no feed-through from the input variables to the output variables. If the matrix D is not zero at all times, then there is feed-through from the input variables to the output variables.

5 Select Done.

The MSC.ADAMS Interface dialog box closes, and the Component Data Table now looks like Figure 33 on page 62:

Figure 33. Component Data Table for Cosimulation

Tip: For a description of the component inputs, outputs, and states, select the respective tabs.

Note: You configure the ADAMS block the first time by reading in an .inf file. This defines the extension inputs, such as ADAMS_ANIMATION_MODE, ADAMS_Solver, and so on. Subsequest reconfigurations of the block by reading in a new .inf file do not overwrite the existing setting. You can change the settings of the extension inputs at any time by manually resetting them before closing the ADAMS block CDT using the OK button.

Page 63: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY5 63

6 In the Component Data Table, in the Inputs tab, enter a value for the following input modes:

■ For ADAMS_Animation_mode, enter 1 to define interactive mode as the animation mode. For more details about animation modes, see the ADAMS/Controls online help.

❖ For ADAMS_Output_Interval (output rate interval), enter .001.

❖ For Communication_Interval (communication rate interval between MSC.ADAMS and MSC.EASY5), enter 0.001. It should not be larger than the ADAMS_Output _Interval.

Note: The ADAMS_Output_interval in the Component Data Table determines the rate at which ADAMS/Controls writes its result to file (and updates the animation, if in interactive mode). It is the interval at which the result is written to file once. It has the lower limit of Time Increment (see step 5 on page 70), and works best if ADAMS_Output_interval is a multiple of Time Increment for integration. The same rule applies to the Strip Chart output rate.

■ Alternatively, if you select Option 1 in step 4, the Component Data Table appears as follows:

❖ In function evaluation mode, the communication interval option is not needed because the integrators determine the communication interval.

❖ Leave Use_Adams_ICs at its default (1).

If the Use_Adams_ICs flag is set to 1, the model uses the MSC.ADAMS initial conditions.

If the flag is set to 0, the model relies on MSC.EASY5 to provide the initial conditions (for example, starting a simulation from the end of the last run simulation, which is stored in MSC.EASY5).

❖ Set the parameters as shown in Figure 34 on page 64.

Page 64: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY564

Figure 34. Component Data Table - Function Evaluation Mode

■ Note the following in Figures 33 and 34:

❖ ADAMS_Solver has a default value of 1.0, which uses the MSC.ADAMS FORTRAN solver for cosimulation or function evaluation. Setting this value to 2.0 allows you to use the MSC.ADAMS C++ solver.

❖ ADAMS_Communication_module has a default value of 1.0, which uses the pipes-based communication protocol for communication between MSC.EASY5 and MSC.ADAMS. Setting this value to 2.0 specifies that TCP/IP-based communication be used between the two products. For more information on TCP/IP-based communication, see TCP/IP Communication Mode in the ADAMS/Controls help.

blank

Page 65: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY5 65

Constructing the Controls System Block Diagram

The completed block diagram is in the file, antenna.0.ezmf, in the examples directory. To save time, you can read in this diagram instead of building it.

Note: Only one MSC.ADAMS block is allowed per MSC.EASY5 model.

To construct the controls system block diagram:

1 Review the controls block diagram in Figure 35. Begin recreating the diagram with the blocks from the Add Components menu.

2 Place the Step Function Generator block in the diagram first.

3 Click on the Step Function Generator block using the middle mouse button.

The Component Data Table appears.

4 Set the step time (TO) to 0.01 and the step value (STP) to 0.3, and then select OK.

Figure 35. Controls Block Diagram

5 Connect the input blocks by clicking once on the First Order Lag block and then on the MSC.ADAMS Mechanism Block.

MSC.EASY5 labels this connection as S_Out_LA11.

Page 66: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY566

6 Connect the output blocks in the diagram by clicking on the MSC.ADAMS Mechanism Block and then on the Summing Junction block. Be sure to connect the azimuth+position output to the first Summing Junction block (SJ) and the rotor_velocity output to the second Summing Junction block (SJ11).

7 Connect the Strip Chart to the MSC.ADAMS Mechanism Block.

Be sure to connect only the rotor_velocity output to the Strip Chart.

The rotor_velocity output corresponds to the rotor-velocity signal from the MSC.ADAMS Mechanism Block.

8 Click the Strip Chart using the middle mouse button to display the Component Data Table. Set the sample period TAU to .001, and then select OK.

Note: You must edit the connection from the MSC.ADAMS Mechanism Block to the Strip Chart because MSC.EASY5 automatically connects the state vector from the MSC.ADAMS block to the display variable on the Strip Chart.

9 From the File menu, select Save As, and then enter a file name for your controls block diagram.

You have now created the controls block diagram.

Page 67: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY5 67

Step Four - Simulating the ModelYou’ll simulate your mechanical model and controls system by:

■ Building the Executable, 67

■ Executing the Simulation, 67

■ Pausing and Stepping Through the Simulation, 71

■ Plotting from MSC.EASY5, 72

■ Plotting from ADAMS/View, 74

Building the Executable

You must build an executable for your model before you execute a simulation in MSC.EASY5.

To build the executable:

■ In MSC.EASY5, from the Build menu, select Create Executable.

After a few moments, MSC.EASY5 displays the message, Executable has been created, at the bottom of the main window.

You are now ready to execute the simulation.

Executing the Simulation

To execute the simulation from MSC.EASY5:

1 From the toolbar at the top of the MSC.EASY5 main window, point to Analysis, and then select Simulation.

The Simulation Data Form window appears.

2 Select the Plotting tab.

3 For plot variables, select Selected from the pull-down menu.

Page 68: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY568

A Plot Specification Form appears where you define the variables that you want to plot after the simulation.

Note: If you are using the completed block diagram from the file, antenna.0.ezmf, which was provided for you in the examples directory, you may find that the Plot Specification Form opens with information that is unnecessary for this tutorial. After removing this information, the Plot Specification Form should look like the one shown in Figure 36.

Figure 36. Plot Specification Form

Page 69: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY5 69

4 Select the variables that you want to plot for the simulation.

For this tutorial, you will select three variables: rotor_velocity, azimuth_position, and S2 LA11.

a Under Dependent Variables, select the Variable #1 field. Then, select the box next to the field.

The Select Plot Variables select list appears.

b Expand the AO component, and then double-click rotor_velocity to select it.

The rotor_velocity component now appears as Variable #1 to be plotted.

c Repeat this procedure for a second and third variable. For the second variable, select azimuth_position, and for the third, select S2 LA11 (the input to the MSC.ADAMS block as indicated in Figure 35 on page 65).

The finished Plot Specification Form should look like the one in Figure 37.

Figure 37. Plot Specification Form

Page 70: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY570

5 Return to the General tab in the Simulation Data Form window, and then specify the following simulation parameters:

❖ For Start Time, enter 0.0.

❖ For Stop Time, enter .25.

❖ For Time Increment, enter .001.

❖ For Integration Method, enter BCS Gear.

6 Select the Play tool to begin the simulation.

For more information about the simulation settings, see the MSC.EASY5 manual.

A new ADAMS/View window appears and the analysis begins on the model specified in the MSC.ADAMS block. ADAMS/View displays the analysis for you.

To run an interactive simulation:

1 As the simulation begins, arrange the windows so that you have a good vantage point to view the antenna model.

Note: The MSC.ADAMS model is initialized to the current simulation time in MSC.EASY5.

2 Start and pause the simulation by selecting Continue and Break on the interactive plot window.

ADAMS/View accepts the control inputs from MSC.EASY5 and integrates the MSC.ADAMS model in response to them. At the same time, MSC.ADAMS provides the azimuthal position and rotor velocity information for MSC.EASY5 to integrate the Simulink model. The simulation process creates a closed loop in which the control inputs from MSC.EASY5 affect the MSC.ADAMS simulation, and the MSC.ADAMS outputs affect the control input levels. See Figure 2 on page 10 for an illustration of the closed-loop simulation process.

Page 71: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY5 71

Pausing and Stepping Through the Simulation

The interactive capabilities of ADAMS/Controls let you pause the simulation in MSC.EASY5 and monitor the graphic results in ADAMS/View. You can plot simulation results during pause mode.

To pause the simulation:

1 Select Break to pause the simulation at the next sample step.

You can use the interactive plot window (Figure 38) to pause the simulation, or you can single-step through the simulation. If you select Step, the simulation steps through one sample step (.001 seconds) of the interactive Strip Chart.

Figure 38. Interactive Plot Window

Page 72: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY572

2 Now go back to ADAMS/View. While the simulation is paused, you can change the orientation of the model with the View Orientation tools in the Main toolbox. These tools help you to observe the model from different vantage points.

Figure 39. View Orientation Tools

3 Once you have finished reorienting the model, select Continue to continue the simulation.

ADAMS/View closes automatically after the simulation finishes.

The MSC.EASY5 Plotter window and the Plot Selection Menu appear.

Plotting from MSC.EASY5

MSC.EASY5 automatically displays the Plot window after running a simulation. By default, MSC.EASY5 displays the plot of the first variable you defined in the Plot Specification Form (see Figure 37 on page 69). You can plot any data generated in MSC.EASY5 by selecting a variable from the Plot Selection Menu. In this tutorial, you’ll plot the curve for control torque.

To plot from MSC.EASY5:

■ From the Plot Selection menu, point to Displays, and then select the variable, S2 LA11, which is the control torque input to the MSC.ADAMS block from MSC.EASY5.

The MSC.EASY5 Plotter window displays the plot for control torque.

Page 73: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY5 73

Figure 40 on page 73 shows how the plot should look. Notice that the control torque reaches a peak, and then settles down as the antenna accelerates. As the antenna gets close to its final position, the torque reverses direction to slow down the antenna. The antenna moves past its desired position, and then settles down to the point of zero error. At this point, the torque value is also zero.

To add labels to the plot:

1 At the bottom of the Plot Selection Menu, select Edit Display.

The Display Specification Form appears.

2 Enter the following labels:

❖ In the Plot Title text box, enter ADAMS/Controls Torque Input from MSC.EASY5 to ADAMS.

❖ In the x-axis text box, enter time in seconds.

❖ In the y-axis text box, enter Control Torque, Newton-mm.

The labels you entered appear on the plot as shown in Figure 40.

Figure 40. Plot of Control Torque Input

Page 74: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY574

Plotting from ADAMS/View

To plot from ADAMS/View:

1 Display ADAMS/View in a new system window and read in the command file, ant_test.cmd.

2 From the File menu, select Import.

The File Selection dialog box appears.

3 Select the following:

❖ For File Type, select ADAMS Results File.

❖ For Files to Read, select ant_test.res.

❖ For Model, select main_olt.

When you read in results files, be sure to include the model name because ADAMS/View needs to associate the results data with a specific model.

Note: You can plot any data from the simulation and rerun the animation from ADAMS/View.

4 From the Review menu, select Postprocessing.

ADAMS/View launches ADAMS/PostProcessor, a postprocessing tool that lets you view the results of the simulations you performed. Take a minute to familiarize yourself with ADAMS/PostProcessor.

Figure 16 on page 36 shows the ADAMS/PostProcessor window.

5 From the dashboard, set Source to Objects.

6 From the Model list, select .main_olt.

7 From the Filter list, select constraint.

8 From the Object list, select antenna_joint.

9 From the Characteristic list, select Element Torque.

10 From the Component list, select Y.

11 Select Add Curves.

ADAMS/PostProcessor generates the curve.

Page 75: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY5 75

To add labels to the plot:

1 In the treeview, navigate to the plot and select it.

2 In the Property Editor, in the Title text box, enter the name: Antenna Joint Peak Torque, Controlled.

The plot title appears above the plot.

Figure 41 illustrates how the curve should look. The curve shows the torque in the antenna joint from the azimuth control loop. You can use the information on the plot to help you determine how to modify the control system of the antenna model. For example, you can reduce the load in the antenna joint by decreasing the velocity gain of the azimuth controller at the expense of slowing the overall response of the controller. This is the type of trade-off between the mechanism design and the control design that you can analyze using ADAMS/Controls.

Figure 41. MSC.ADAMS Antenna Joint Peak Torque, Controlled

Page 76: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with MSC.EASY576

Page 77: cntrl_gs

5 Learning ADAMS/Controls with Dynamic Systems Import from MSC.EASY5

OverviewThis chapter teaches you how to import dynamic system models designed in MSC.EASY5 into an MSC.ADAMS model. Importing an MSC.EASY5 model into MSC.ADAMS enables you to build, test, and refine your combined model using the 3D visualization and design features available in ADAMS/View.

This feature is available only with MSC.EASY5 version 7.1 and later.

We assume that you:

■ Read the previous chapter in this guide

■ Know how to export MSC.ADAMS plant files

■ Know how to use MSC.ADAMS Mechanism Blocks in MSC.EASY5

This chapter contains the following sections:

■ Setting Up the Environment, 78

■ Step One - Export Your EASY5 Model, 80

■ Step Two - Import the Exported MSC.EASY5 Model into MSC.ADAMS, 84

■ Step Three - Run a Simulation, 87

This tutorial takes about 1 hour to complete.

Page 78: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY578

About the TutorialIn this chapter you will continue using the MSC.EASY5 model of the antenna controller that you used in the previous ADAMS/Controls tutorials.

We assume that you have MSC.EASY5 and ADAMS/Controls installed on the same machine. For instructions on using this feature when MSC.ADAMS and MSC.EASY5 are not installed on the same machine, see the MSC.ADAMS Knowledge Base Article 10581 at: http://support.adams.com/kb/faq.asp?ID=kb10581.dasp. We assume that the ADAMS/Controls extension has been installed in your version of MSC.EASY5 (for more information about the MSC.ADAMS product installation, see the Running and Configuring online help).

Setting Up the EnvironmentNo setup is required for MSC.EASY5 2005 r1 on UNIX or Linux platforms. On Windows, you need to set the PATH environment variable.

Notes:

■ If, unlike the antenna controller model, your MSC.EASY5 model contains components from a licensed library (for example, the Thermo-Hydraulic, Powertrain, or Gas Dynamics libraries), you will need to make sure MSC.ADAMS finds your MSC.EASY5 license. Failure to perform this step will result in the MSC.EASY5 license library not being found. You will not be able to proceed with the tutorial.

■ MSC.ADAMS supports the Compaq Visual Fortran Version 6.6B compiler only. The MSC.EASY5 model import feature is not supported with the GNU or Microsoft FORTRAN compilers on Microsoft Windows.

To find the appropriate value for the variable:

1 Start MSC.EASY5.

2 Open an MSC.EASY5 command shell: from the MSC.EASY5 File menu, select Open Command Shell.

Page 79: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY5 79

3 At the command shell prompt, enter: echo %EZHOME%.

The output is the directory in which MSC.EASY5 is installed. You will use the directory information in Step 5 below. The usual value of EZHOME is:

C:\Program Files\MSC.Software\MSC.EASY5\

To apply the value of the environment variable:

1 From the Start menu, point to Settings, and then select Control Panel.

2 In the Control Panel dialog box, select the System icon.

3 In the System Properties dialog box, select the Advanced tab.

4 In the Advanced tab container, select Environment Variables.

MSC.ADAMS must know the path to the subdirectory of your MSC.EASY5 installation tree:

❖ lib_nt_DVF6 - If you are using the Compaq Visual FORTRAN compiler.

❖ lib_nt_IF8 - If you are using the Intel FORTRAN 8 compiler.

5 Using the path from step 3 on page 79, in the Environment Variables dialog box, append or create the path to the user variable as follows:Variable Name = PATH

For the Compaq Visual FORTRAN compiler, enter the following, where <CURRENT_VALUE> is the current value of PATH:

Variable Value = <CURRENT_VALUE>; C:\Program Files\MSC.Software\MSC.EASY5\easy5x\lib_nt_DVF6

For the Intel FORTRAN 8 compiler, enter the following, where <CURRENT_VALUE> is the current value of PATH:

Variable Value = <CURRENT_VALUE>; C:\Program Files\MSC.Software\MSC.EASY5\easy5x\lib_nt_IF8

and where the value of EZHOME is taken into account.

Page 80: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY580

Step One - Export Your EASY5 ModelThis section details the procedure to export an MSC.EASY5 model as an MSC.ADAMS External System Library.

An MSC.ADAMS External System Library is a binary file that can be loaded into MSC.ADAMS as a General System Equation (GSE) element. In this form, the equations in the MSC.EASY5 model become equations of the MSC.ADAMS model just as if you had entered them as run-time function expressions within MSC.ADAMS State Variable or Differential Equation elements.

To create an MSC.ADAMS External System Library:

1 Launch MSC.EASY5, move to the directory where the MSC.ADAMS model files and MSC.EASY5 model files reside, and open the MSC.EASY5 antenna controller model.

2 If MSC.EASY5 is running on an IBM RS6000 workstation, you must modify the antenna control system by removing the Interactive Simulation components, such as strip charts, because you will not run the MSC.EASY5 model in the MSC.EASY5 environment.

Page 81: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY5 81

Figure 42. Antenna Control System

In the previous chapter, you configured the MSC.ADAMS component of the antenna controller model to run in co-simulation mode. Because you want the controller to execute as a set of equations inside MSC.ADAMS, you must reconfigure the MSC.ADAMS Mechanism component to be in function-evaluation mode. Failure to reconfigure the MSC.ADAMS component may result in a model that does not behave correctly in MSC.ADAMS. If you have already configured your MSC.ADAMS component to be in function-evaluation mode, you may skip 3.

Page 82: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY582

3 To reconfigure the MSC.ADAMS component:

a Double-click the MSC.ADAMS Mechanism Block to open the Component Data Table (CDT) shown in Figure 43.

Figure 43. Component Data Table

b Select Select/Configure ADAMS Model to open the Configure MSC.ADAMS block panel.

Figure 44. Configure MSC.ADAMS Block Panel

Page 83: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY5 83

c Select ant_test as the exported MSC.ADAMS model and choose the first option for execution mode: Function Evaluation (no feedthrough).

d Close the panel by selecting Done.

The Component Data Table for the MSC.ADAMS Mechanism Block is updated as shown next.

Figure 45. Component Data Table after Re-Configuration

e Select OK to close the CDT for the MSC.ADAMS Mechanism component.

The updated MSC.ADAMS Mechanism Block now contains all the information necessary to interface with MSC.ADAMS.

Note: The following MSC.ADAMS block inputs in the CDT are not relevant: ADAMS_Animation_mode, ADAMS_Output_Interval, and Use_Adams_ICs.

Page 84: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY584

6 Create the MSC.ADAMS External System Library files:

a From the MSC.EASY5 Build menu, point to Export Model as, and then select ADAMS External System Library.

The Export ADAMS External Systems form appears.

b Accept the settings in this form, and then select Export to start creating the library.

Messages in the message line at the bottom of the MSC.EASY5 window show the progress of the library build. After a successful build, you will have two new files in your working directory. The first file is a binary demand-loaded library file (named antenna.dll on Windows, antenna.sl on HP-UX11 workstations, or antenna.so on other UNIX platforms). The second file (named antenna.xfe.ezanl) contains the parameter values and other information the MSC.EASY5 model needs. If you need to move these files to another directory (for example, to make the MSC.EASY5 model available to other MSC.ADAMS users), you must move the two files together or the exported MSC.EASY5 model will not work.

c Exit MSC.EASY5.

Step Two - Import the Exported MSC.EASY5 Model into MSC.ADAMSIn this section, you import the exported MSC.EASY5 antenna controller model into the MSC.ADAMS antenna model.

1 Launch ADAMS/View.

2 Import the MSC.ADAMS antenna model, ant_test.cmd: from the ADAMS/View File menu, select Import.

3 If the Controls menu does not appear on the ADAMS/View menu bar, load the ADAMS/Controls plugin:

❖ From the Tools menu, select Plugin Manager.

❖ In the list of plugin names, find ADAMS/Controls, and then select Load.

Page 85: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY5 85

4 From the Controls menu, point to Control System, and then select Control System Import.

The ADAMS/Control system Import Dialog box appears.

a In the General State Equation Name text box, enter antenna_gse. You may use any name here that has not already been used as an element name in your MSC.ADAMS model and is not an MSC.ADAMS keyword.

b Right-click the External System Library text box, and then select Browse.

c Select the demand-load library file created in the previous step (named antenna.dll, antenna.sl, or antenna.so depending on your platform).

d Select Import I/O Signals from Existing Controls Plant to display the Database Navigator.

e In the Database Navigator, select ant_test.

The output and input signal text boxes update automatically, as shown in Figure 46.

Figure 46. ADAMS/Controls System Import Panel

f Select OK or Apply to import the model.

Page 86: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY586

If there is a problem in the importing process, the MSC.ADAMS Message window will explain it. Correct the problem and try importing again. When the import is successful, the Information window appears as shown in Figure 47 on page 86, containing details about the GSE element created in the MSC.ADAMS model.

Figure 47. Message indicating the Creation of GSE

7 When you have finished examining the Information window, select Close.

The MSC.EASY5 controls system has now been incorporated into your MSC.ADAMS model. Next you'll run a simulation to see how it performs.

Page 87: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY5 87

Step Three - Run a SimulationIn this section, you will run a simulation of the antenna model containing the MSC.EASY5 controller.

To run the simulation:

1 From the Settings menu, point to Solver, and then select Dynamics.

The Solver Settings dialog box appears.

2 Change the Formulation setting to SI2.

This change is necessary because the SI2 formulation is better able to deal with the rapid value change. In this model, the rapid change is associated with the STEP function in the MSC.EASY5 model.

3 Select Close.

4 Run a simulation with step size of 0.001 seconds and duration of 0.25 seconds.

During the simulation, the antenna moves the same as it did during the co-simulation in the preceding chapter.

5 Switch to ADAMS/PostProcessor and examine the results.

Page 88: cntrl_gs

Getting Started Using ADAMS/ControlsLearning ADAMS/Controls with Dynamic Systems Import from MSC.EASY588

6 From the list of analysis results plot the azimuth_position versus time.

ADAMS/PostProcessor displays the plot of azimuth position versus time, as shown next.

Figure 48. Simulation Result: Azimuth Position versus Time