[go: up one dir, main page]

0% found this document useful (0 votes)
78 views80 pages

Controls 2017

adams control guide
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views80 pages

Controls 2017

adams control guide
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Welcome to Adams Controls 1

Welcome to Adams Controls


2 Adams Controls
About Adams Controls

About Adams Controls


Adams Controls, part of the Adams 2017 suite of software, is a plugin to MSC Softwares Adams Car,
Adams Chassis, Adams View, or Adams Solver that helps you add sophisticated controls to your Adams
model. Adams Controls lets you connect your Adams model to block diagrams that you've developed
with control applications such as Easy5 or MATLAB.
Welcome to Adams Controls 3
Benefits of Adams Controls

Benefits of Adams Controls


By combining mechanical system simulation tools and controls design tools, you can:
Add sophisticated controls to an Adams model and simulate the combined system.
Generate mechanical system simulation models directly from your Adams data without having
to write equations.
Analyze the results of your simulation in the Adams environment or the controls application
environment.

How to Improve the Design Process with Adams Controls


In the typical design process of a mechanical system with controls, the mechanical designer and the
controls designer work from the same concept, but use different sets of software tools. The result is that
each designer produces a model for the same problem.
Each design is then subject to verification and testing, and the first time the two designs are brought
together is during physical prototype testing. If a problem occurs during the interaction between the
controls design and the mechanical design, the engineers must refine the control design, the mechanical
design, or both, and then go through the entire verification process again as shown in the figure below.

With Adams Controls, the two designers can share the same mechanical model. They can also verify from
one database the combined effects of a control system on a nonlinear, non-rigid model. The physical
4 Adams Controls
Benefits of Adams Controls

testing process is greatly simplified, and the risk of the control law being poorly matched to the real
system is eliminated as you can see in the figure below.
Welcome to Adams Controls 5
Ways to Use Adams Controls

Ways to Use Adams Controls


You can use Adams Controls in a variety of ways.
Adams Controls offers you the option of simulating the combined mechanical system and controller:
entirely within the controls application via Function Evaluation.
entirely within Adams via Control System Import.
by solving the controls equations with the control package and solving the mechanical system
equations with Adams via co-simulation.

Using co-simulation or Function Evaluation:


By using Adams Controls with Adams View, you can animate your model and view the effects of the
control system and any structural modifications you make. For faster simulation results, you can run
Adams Controls directly with Adams Solver, MSC Softwares powerful analysis engine. The process is
faster because you're running a simulation in batch mode.
You can also run Adams Controls with Adams template-based products, such as Adams Car, and others.
In these environments, you run the simulations in batch mode and view model animations when the
simulation is complete. Adams Car also requires co-simulation mode to run.

Using Control System Import:


You also have the option with Adams Controls to import the controls system definition into Adams.
Importing the control system requires either Mathwork's Real-Time Workshop or Easy5's XFE.
6 Adams Controls
About the Adams Controls Four-Step Process

About the Adams Controls Four-Step Process


The figure below describes the four-step process of combining controls with a mechanical system. Refer
to Getting Started Using Adams Controls for detailed procedures for each step.

Adams Input Adams


Adams Output

Controls
Application
Controls Input Controls Output

1. Build the Model - The first step in working with Adams Controls is to build or import an Adams
model. The model should be complete and include all necessary geometry, constraints, forces, and
measures.
2. Create the Adams Inputs and Outputs - The outputs describe the variables that go to the
controls application (the output from the Adams model is the input to the controls system). The
inputs describe the variables that come back into Adams (the output of the controls application)
and, therefore, complete a closed loop between Adams and the controls application. All inputs and
outputs must be set up as state variables. After these are defined, you export the plant system files
from Adams for use in the controls simulation software.
3. Build the Block Diagram - Build the control system block diagram with Easy5 or
MATLAB/Simulink. Include the Adams plant in your block diagram, or if using Real-Time
Workshop, export the controls system and import into Adams.
4. Simulate the Model - Simulate the combined mechanical model and control system. Several
different methods are available to run your simulation.
Adams Controls Overview 7

Adams Controls Overview


8 Adams Controls
Loading Adams Controls

Loading Adams Controls


To start Adams Controls, you first start your host product, such as Adams View, import a model, and then
load the Adams Controls plugin.

To start Adams Controls:


1. Start Adams View by doing one of the following:
On Linux, type the command adams2017 to start the Adams Toolbar at the command prompt,
and then press Enter. Select the Adams View tool.
On Windows, from the Start menu, point to Programs, point to Adams 2017, and then select
Adams View.
The Welcome dialog box appears, in the Adams View main window.
2. From the File menu, select Import. The File Import dialog box appears.
3. Right-click the File To Read text box, and then select Browse.
Select the model and click Open and click OK. The model appears in the Adams View main
window.
4. Load Adams Controls by doing the following:
a. From the Tools menu, point to Plugin Manager.
Select the Load check box next to Adams Controls.
Select OK.
Adams Controls is now loaded.
b. Click the Plugin tab on the Adams View ribbon.
From the Controls container, click the Controls icon .

To unload the Adams Controls plugin:


1. From the Tools menu, point to Plugin Manager.
Clear the Load check box next to Adams Controls.
Select OK.
2. Click the Plugin tab on the Adams View ribbon.
From the Controls container, click the Controls icon and then select the Unload the
Controls plugin.
Adams Controls Overview 9
Getting Started Using Adams Controls

Getting Started Using Adams Controls


When first starting using Adams Controls, we recommend that you start by working through the tutorial
entitled 'Getting Started Using Adams Controls'. This tutorial gives you an overview of the four-step
process of adding controls to an Adams model. The example also includes tutorials for each of the
controls applications you can use with Adams Controls: Co-simulation, Function evaluation, and Control
System Import with both Easy5 and MATLAB. See the Examples section to find this tutorial.
10 Adams Controls
Simulation Methods

Simulation Methods
Choosing a Simulation Method
Adams Controls offers you three methods with which you can simulate your integrated model and
controller:
Co-simulation/Discrete mode: Specifies that Adams solve the mechanical system equations and the
control application solve the control system equations. The mode names of "co-simulation" and
"discrete" are synonymous.
Function Evaluation/Continuous mode: Specifies that the control application solve both the mechanical
and control system equations. The mode names of "function evaluation" and continuous are
synonymous.
Control System Import : Specifies that Adams solve the combined mechanical system and control system
equations by importing an External System Library (ESL) which is binary representation of a model
generated by MATLAB/Real-Time Workshop or Easy5. The ESL is used by Adams Controls to
automatically create a General State Equations (GSE) entity, along with other supporting entities. This
process is also known as External Function Evaluation (XFE), External System Import (ESI), Importing
General State Equations, or Dynamic System Import (DSI).
These methods allow you to use different methods to integrate your Adams and controls models (EASY5
or MATLAB). See the table below for an overview of suitable controller/simulation method options.

Simulation Method
Controller type: Discrete mode: Continuous mode: C-code import:
Continuous Yes Yes Yes
Continuous sampled controller Yes Yes Yes
Controller with discrete and Yes Yes Yes
continuous states
Discrete controller with synchronous Yes Yes Yes
sampling rates
Discrete controller with No Yes Yes
asynchronous multi-sampling rates
Logic-based controller No Yes No

Co-simulation
For most analyses, the discrete mode is generally the more efficient simulation method. It is faster and
can handle complex models better than continuous mode. You should use continuous mode when
equations solved in the control system would cause a large coupling effect on the Adams data. For
example, you might prefer to use the continuous mode if your analysis requires a very small time step.
Adams Controls Overview 11
Simulation Methods

To preserve the proper dynamics for a mechanical system, discrete mode should sample the mechanical
system at least five times greater than the highest frequency of interest. If the time step is too small to
sample at five times the highest frequency, then you should use continuous mode.

Note: You can find the highest frequency of your mechanical system by performing a linear
analysis with the Adams add-on module, Adams Linear.

Function Evaluation
In continuous (function evaluation) mode, the control system package solves the equations of motion for
the combined controls and mechanical dynamics system. Adams formulates the equations of motion for
the mechanical subsystem and provides information to the controls package as needed.
Typically Adams simulations involve solving a set of differential (equations of motion) and algebraic
(constraint and applied force) equations, known as a DAE system. The Adams integrators are specially
tuned for efficient solution of this type of problem. Using coordinate partitioning, Adams can also
formulate the equations of motion based on a minimum independent set of system states. This results in
a compact ordinary differential equation (ODE) formulation of the equations of motion. Typically this
system of equations is more difficult to solve numerically than the DAE method described above.
The benefit of this ODE formulation is that the state values and time derivatives can be easily
communicated to the controls package. Using this information, the controls package can form a
combined ODE system describing the controls and mechanical states. This is the problem that the
controls package then solves with its own integration techniques. When a new set of state values is found
in the controls package, Adams is called to find the time derivatives of these states, based on the ODE
formulation that Adams has created for the mechanical states. This is why it is known as function
evaluation mode. Adams simply sets up the equations of motion and provides time derivative
information for the states in this mode.
For more information on how continuous mode works, refer to
http://simcompanion.mscsoftware.com/iKB8015801.

Control System Import


In this mode, you can import into Adams a binary representation of the control system (or any other
model) built in Easy5 or MATLAB. To do this, you have to first export the Easy5 or Simulink model
using Easy5 or Real-Time Workshop along with Adams Controls to generate code. Adams Controls then
allows you to create, in an automated manner, a general state equation (GSE) element and supporting
elements in your Adams model. After this is done, you can simulate your combined model in Adams.
12 Adams Controls
Plant Inputs and Outputs

Plant Inputs and Outputs


To create the connect between the (external) control system and the Adams model, Plant Inputs and Plant
Outputs must be created and used to specify the inputs and outputs from the Adams plant. Plant Inputs
and Plant Outputs are Adams entities that contain a list of state variables. These are either created
automatically by the Plant Export dialog box, or created by using Plant Input/Plant Output option
found in Elements Tab Data Elements container Create an ADAMS Plant Input/Plant Output.
Note that in Adams Controls you can use two types of variables: design variables and state variables.
A design variable is only a preprocessing entity. It is a placeholder for element parameter values. When
writing an .adm file, these entities are evaluated and entered in the Adams Solver dataset as numerical
values. The design variable value can be any expression created in the Adams Expression Builder. Design
variables are also known as Adams View variables and simply as variables (in the Adams View Database
Navigator).
A state variable is a variable whose value is calculated at every simulation step. The value can be any
function created in the Adams View Function Builder. State variables are also known as Adams Solver
variables, Adams_Variable (in Adams View Database Navigator), and VARIABLE (statement in Adams
Solver dataset).
Adams Controls uses state variables to specify the inputs and outputs from the Adams model, because
these variables are computed during runtime.
For more information, see the online help for Adams View Function Builder.
Adams Controls Overview 13
Exporting Adams Controls Plant Files

Exporting Adams Controls Plant Files


When you export the Adams plant files, Adams Controls saves the input and output information in an .inf
file (for Easy5) or an .m file (for MATLAB). It also generates a command file (.cmd) and a dataset file
(.adm) that are used during the simulation process.

To export Adams Controls plant files:


1. Click the Plugin tab on the Adams View ribbon.
2. From the Controls container, click the Controls icon and then select Plant Export.
3. Complete the Adams Controls Plant Export dialog box as described in Adams Controls Plant
Export.
4. Select OK.
14 Adams Controls
Using Easy5

Using Easy5

Installing the Adams Extension for Easy5


To run Adams and Easy5 together, you must install the Adams extension into Easy5. To import models
into Adams that were exported from Easy5 (containing components from licensed Easy5 libraries), you
must also configure your computer so that Adams knows how to find your Easy5 license. The following
procedures explain how to do this.

To install the Adams extension for Easy5:

Note: Check http://simcompanion.mscsoftware.com/ to find the versions of Easy5 that are


compatible with Adams.

1. Make sure that both Easy5 and Adams have been installed.
2. Make sure you have permission (that is, root ('superuser') privilege) to add and modify files in the
Easy5 installation directory.
3. Perform the following, depending on your platform:
On Linux:
a. Open an xterm window and set your working directory to a directory outside the Easy5
installation directory tree.
b. Start Easy5. The standard command is easy5x.
c. In the Easy5 main window, from the File menu, select Open Command Shell.
d. At the prompt in the command shell, enter:
$EZHOME/install_adams_controls.bat <Adams_topdir> <Easy5_topdir>
where: <Adams_topdir> is the top-level directory for Adams, also provided by "adams2017
-top"; <Easy5_topdir> is the top-level directory of Easy5 (for example,
C:\MSC.Software\Adams\2017, C:\MSC.Software\EASY5\2015, respectively).
On Windows:
a. From the Start menu, point to Programs, , point to Easy5 - (version), point to Shell, and then
select Easy5 Command Shell.
b. At the prompt within the command shell type:
install_adams_controls.bat <Adams_topdir> <Easy5_topdir>
Adams Controls Overview 15
Using Easy5

where: <Adams_topdir> is the top-level directory for Adams, also provided by "adams2017
-top"; <Easy5_topdir> is the top-level directory of Easy5 (for example,
C:\MSC.Software\Adams\2017, C:\MSC.Software\EASY5\2015, respectively).

Note: If you are unable to identify a command line command to run Adams but you can
identify the top-level directory of the Adams installation, you can use -d "directory
path" in place of the command line command.

4. Type exit to close the command window.


5. If you started Easy5, from the File menu, select Quit.
The Adams extension installation is complete. Be sure to configure your computer as described
next.

License Configuration
To configure your computer to run licensed exported Easy5 models within Adams:
1. Start Easy5.
2. From the File menu, select Open Command Shell.
3. At the prompt in the command shell, type easy5x -license.
Easy5 displays the licensing information, beginning with the type of license and the server name
(if a server license) or the path to the license file.
4. Write down the contents of the line that starts with Active license file(s), and the value that
appears in the line following it (for example, 1700@rainier).
5. Perform one of the following:
If the line is Active license file(s) [EASY5_LMD_LICENSE_FILE], set the environment
variable EASY5_LMD_LICENSE_FILE to the output value displayed in Step 4 above (for
example, 1700@rainier).
If the line is Active license file(s) [MSC_LICENSE_FILE], find the value of the
environment variable MSC_LICENSE_FILE to see what license file Adams is using.
If Easy5 and Adams are using different licenses (or license servers), set
LM_LICENSE_FILE to the value for the Easy5 license (for example 2500@bosco).
If Easy5 and Adams are using the same license, your computer is configured properly.
6. For Windows platforms only, modify the Path environment variable to include the path to the
lib_em64t_IFORT (Win64) subdirectory of your Easy5 installation tree.
If your Easy5 model contains components from a licensed library (for example, the Thermo-
Hydraulic, Powertrain, or Gas Dynamics libraries), you will need to make sure Adams finds
your Easy5 license. Failure to perform this step will result in the Easy5 license library not
being found.
16 Adams Controls
Using Easy5

Adams supports the Intel Visual Fortran 16 compiler. The Easy5 model import feature is not
supported with the GNU or other compilers. Check
http://simcompanion.mscsoftware.com/DOC9283 for latest compiler support information.
To find the appropriate value for the variable:
a. Start Easy5.
b. Open an Easy5 command shell: from the Easy5 File menu, select Open Command Shell.
c. At the command shell prompt, enter: echo %EZHOME%.
The output is the directory in which Easy5 is installed. You will use the directory information
in Step 5 below. The usual value of EZHOME is:
C:\MSC.Software\Easy5\(version)\

Note: Check http://simcompanion.mscsoftware.com to find the versions of Easy5 that are


compatible with Adams.

To apply the value of the environment variable:


a. From the Start menu, point to Settings, and then select Control Panel.
b. In the Control Panel dialog box, select the System icon.
c. In the System Properties dialog box, select the Advanced tab.
d. In the Advanced tab container, select Environment Variables.
Adams must know the path to the subdirectory of your Easy5 installation tree to be able to
load ez5_lmgr.dll:
e. Using the path from step 3, in the Environment Variables dialog box, append or create the
path to the user variable as follows:
Variable Name = PATH
Enter the following, where <CURRENT_VALUE> is the current value of PATH:
Win32:
Variable Value = <CURRENT_VALUE>; %EZHOME%\easy5x\lib_nt_IF91
Win64:
Variable Value = <CURRENT_VALUE>; %EZHOME%\easy5x\lib_em64t_IF91
and where the value of EZHOME is taken into account.
For more information on Control System Import in Easy5, see Learning Adams Controls with Control
System Import from Easy5 in 'Getting Started Using Adams Controls' tutorial. This tutorial gives you an
overview of the four-step process of adding controls to an Adams model. The example also includes
tutorials for each of the controls applications you can use with Adams Controls: Co-simulation, Function
evaluation, and Control System Import with both Easy5 and MATLAB. See the Examples section for
more details.
Adams Controls Overview 17
Using Easy5

Easy5 Update of Adams Controls Extension Components


Overview
Easy5 now provides an update of all Extension components in the same way that it has updated Library
components in past releases. This also includes the Adams Controls Extension component (that is, AD
block) which has been modified to provide this automatic update. In the past, an update of the component
only occurred when selecting and configuring the AD block within the Easy5 GUI.
The update check is performed automatically anytime a model executable is built (whether done
manually or automatically when a topology change has occurred). A model executable can be an .exe
file, or any exported runtime file (.dll). Easy5 will attempt to synchronize the model component instance
with the library version of a component or Extension being used.

Update Process Details


The update of the Adams Controls Easy5 extension requires an .inf file for the component and by default
will search your Easy5 model for the name of the .inf file provided by 'AdamsFileName'. It also looks
for the execution mode (for example, co-simulation, function evaluation) with the keyword 'ExecMode',
with an additional method of update for old models where ExecMode was not yet available. If this
process fails, you can update the model by configuring the AD block manually in the interface.
In addition, if you are updating from command line with:
easy5x -AutoUpdate
or
easy5x -AutoUpdPurge
and you want to launch the Configure dialog box to manually select the .inf and/or Execution Mode, you
can display the Adams Controls Extension Component (AD Block) by setting the following environment
variable to zero:
set EZ5_EXT_UPDATE_AD_NO_GUI=0
You can set back to the default mode of suppressing the Adams Controls Extension Component (AD
Block) by removing this environment variable or setting the following environment variable to anything
non-zero:
set EZ5_EXT_UPDATE_AD_NO_GUI=1
Although it is recommended that the AD block be updated for each model, to suppress the Extension
Component Update, set the following environment variable:
set EZ5_SKIP_EXT_UPD_CHECK=true
and it will not do any checking for Extensions (this would revert to the prior behavior for Extensions
no checking at all). For users of 8.0.7, this is recommended since an error in 8.0.7 will prevent the correct
timestamp from being updated and running simulations and Exporting Model as External System Library
will fail.
18 Adams Controls
Using Easy5
Co-Simulation and Function Evaluation 19

Co-Simulation and Function Evaluation


20 Adams Controls
Animation Options

Animation Options
Adams Controls lets you choose one of two animation modes: interactive or batch. Both methods allow
you to save results to Adams files for review at a later date.

Method: Its purpose:


Interactive mode Specifies the simulation to run in Adams View.
Provides a dynamic, graphic display of the simulation results.
Allows you to pause during a simulation to review any animation or
plotting results.
Allows you to verify the initial design of your control law for proper signal
phase and magnitude.
Not supported by Adams Car Full-Vehicle analyses.
Batch mode Specifies that the simulation run in Adams Solver. This is the preferred
method if a graphic display of the analysis results is unnecessary, since it
provides a much faster solve time.
Supported by Adams Car Full-Vehicle analyses.
Co-Simulation and Function Evaluation 21
Initialization

Initialization

Initialization Sequence
Adams Controls performs an Initialization Sequence, consisting of a few different steps, before
commencing with the Co-simulation or Function Evaluation run. The initialization sequence is as
follows.
1. If desired, necessary Adams Solver or Adams View commands are submitted (for example,
ADAMS_init variable for MATLAB; see the Initialization Commands section for more details).
2. Following sequence is followed depending on the status of static simulation:
a. If static simulation is requested, then static analysis is performed at time = 0. (for example,
ADAMS_static='yes' for MATLAB)
b. If static simulation is requested and the simulation fails, the initial conditions analysis is
submitted.
c. If static simulation is not requested, then initial conditions analysis is submitted.
4. Dynamic co-simulation/function evaluation run begins at time = 0.
Thus, equivalent commands in Adams View and Adams Solver work in a similar manner. The exception
is that with Adams View, the model is not registered with the Adams Solver until after all the user
commands in Step 1. have been submitted, which means you may create modeling entities with Adams
View commands. In general, when the model is submitted to Adams Solver, you cannot create new
modeling entities, so this feature will not be available.
22 Adams Controls
Initialization

The Plant Export dialog box below displays the options that correspond to the steps listed above. The
option Initialization Command corresponds to Step 1. above, while Initial Static Analysis corresponds
to Steps 2.a.-c.

Initialization Commands
Initialization commands are Adams commands which are executed before the controls package starts the
co-simulation. If you run a simulation with animation in interactive mode, you must use Adams View
commands to initialize your model. If you are in batch mode, use Adams Solver commands.
You can specify a command in two ways. For example, if you want to change the color of the antenna
model, for an interactive (Adams View) simulation, you can issue one of the following commands:
At the MATLAB prompt, enter:
Co-Simulation and Function Evaluation 23
Initialization

Adams_Init=geometry attributes
geometry_name=.main_olt.antenna.REV15 color=RED
Within the Adams mask, Initialization command field reads: Adams_Init.
Alternatively, in the Initialization commands text box, you can enter the complete command
string enclosed in single quotes and square brackets as follows:
[geometry attributes geometry_name=.main_olt.antenna.REV15
color=RED]
For Adams Solver, you can also place all of your initialization commands in a single file, and reference
it with the FILE command. You can do this in the Plant Export dialog box or you can manually edit your
.inf or .m files. For Easy5, your .inf file might look like this:
NUMBER OF COMMANDS
1
file/command=myfile.acf
This reads in and executes the .acf file.
In MATLAB, you would modify the following variable, either in the .m file, or in the workspace:
ADAMS_init='file/command=myfile.acf'
24 Adams Controls
Co-Simulation and Interpolation/Extrapolation

Co-Simulation and Interpolation/Extrapolation


For co-simulation mode, the variables are not continuously in-sync with each other, as in Function
Evaluation mode, since the variables passed between Adams and MATLAB/Simulink or Easy5 are
sampled. Optionally, you can choose to interpolate/extrapolate these variables in between the sample
times. The following is a brief description of how Adams Controls co-simulation
interpolation/extrapolation works.
During co-simulation, if either Simulink or Easy5 is driving the analysis (that is, "leading the co-
simulation"), single communication interval (delta) step consists of the following:
1. Easy5 or MATLAB/Simulink integrates from time = t - 1 to t to compute inputs for Adams
Controls at time = t.
2. Easy5 or MATLAB/Simulink then requests outputs from Adams Controls at time = t.
3. Adams Controls integrates its equations until from t - 1 to t to provide outputs to Easy5 or
MATLAB/Simulink.
4. Easy5 or MATLAB/Simulink takes the Adams outputs at time = t to complete the cycle and
move on to integrate from t to t + 1.
During these four stages, in step 1, the inputs to Adams Controls can be interpolated or held constant,
while in step 3, the outputs from Adams Controls can be extrapolated or held constant.

Interpolation/Extrapolation Options
Step 1 - Options for Adams Controls Plant Inputs
The following describe what happens to the Adams Plant inputs (that is, outputs from Easy5 or
MATLAB/Simulink) when Simulink or Easy5 leads the co-simulation.
If the Plant Input interpolation order is set to zero:
Adams Controls holds the Easy5/Simulink inputs, U, as constant values. In other words, apply a
zero-order hold to the Plant Input values of Easy5 coming into Adams. For example, specify that
the sample times occur at time = 0, 1, 2... If the current sample time is time = 2, and
the last communication interval is time = 1, the Plant Inputs are sampled at time = 2, and
held constant while Adams integrates from the last time (t1) to the current time (t2) to
provide the Plant Outputs to Easy5.
If the Plant Input interpolation order is set to one:
Adams Controls uses linear interpolation between the current and past values from Easy5 or
MATLAB/Simulink. For example, if the current sample time is time= 2 (t2), and the last
sample time is time = 1 (t2), the Plant Inputs are sampled by Adams Controls at time =
2, and linearly interpolated from t1 (saved from the previous communication time) to t2, as
shown below while Adams integrates from the last time (t1) to the current time (t2) to
provide the Plant Outputs to Easy5.
interpolation: Plant Inputs, U (1 2) = U1 + (U2 - U1) /
communication_interval * (current_simulation_time - t1)
Co-Simulation and Function Evaluation 25
Co-Simulation and Interpolation/Extrapolation

Step 3 - Options for Adams Controls Plant Outputs


The following describes what happens to the Adams Plant outputs (that is, inputs to Easy5 or
MATLAB/Simulink)
If the Plant Output extrapolation order is set to zero:
Easy5 or MATLAB/Simulink assumes that the Adams outputs (Y) are constant values. In other
words, apply a zero-order hold to the Plant Output values of Adams coming into Easy5 or
MATLAB/Simulink. For example, if the last sample time was time = 1, and the current
sample time is time = 2, then Easy5 samples the Adams Plant Outputs at time = 1, and
holds them constant while Easy5 integrates from the last time (t1) up to the current time (t2)
to provide the Plant Inputs to Adams.
If the Plant Output extrapolation order is set to one:
Easy5 or MATLAB/Simulink uses linear extrapolation beyond the past two values from Adams.
For example, if the last sample time was time = 1, and the current sample time is time = 2,
then Easy5 uses the saved samples of the Adams Plant Outputs at time = 1 and time = 0,
and linearly extrapolates, as shown below while Easy5 integrates from the last time (t1) up to
the current time (t2) to provide the Plant Inputs to Adams.
extrapolation: Plant Outputs, Y (1 2) = Y1 + (Y1 - Y0) /
communication_interval * (current_simulation_time - t1)
Only in Simulink, optionally, you can choose Adams to lead the co-simulation, which may be used to
break an algebraic loop with the Adams Controls S-Function. In this case, the interpolation and
extrapolation methods are exactly the same, but are reversed for the plant inputs and outputs (that is, the
Plant Inputs are extrapolated and the Plant Outputs are interpolated). This setting can be seen highlighted
below:
26 Adams Controls
Co-Simulation and Interpolation/Extrapolation
Co-Simulation and Function Evaluation 27
Co-Simulation and Interpolation/Extrapolation

Example: Antenna Model


The following shows the antenna example found in the Getting Started Using Adams Controls for setting
interpolation/extrapolation in Co-simulation vs. Function Evaluation. This example shows the effect of
interpolation and extrapolation on the accuracy of the result, and also shows the effect of the
communication interval on extrapolation. Here, Simulink leads the co-simulation.
The first plots show the antenna model output azimuth position for Function Evaluation (red curve) vs.
co-simulation:

The communication interval is set to 1 millisecond, and the results for all interpolation settings are very
close to the result for Function Evaluation. However, upon closer inspection, the plot on the right show
that for linear extrapolation ("extrap1"), the co-simulation results (shown in the green line) are very
close to the results for Function Evaluation. The results for extrapolation off are similar (red and blue
striped line), but a little bit different than Function Evaluation. This can also be seen in the next plot of
the input torque to Adams:

The plot to the right is a close-up of the bottom of the plot on the right. You can see that the red line for
Function Evaluation is more closely matched by the plots that use extrapolation ("extrap1").
28 Adams Controls
Co-Simulation and Interpolation/Extrapolation

Now, for comparison, look at this same example where the communication interval has been changed
from 1 ms to 5 ms. In this case, the linear extrapolation is not as accurate as for 1 ms, and the results
without extrapolation appear to be closer to the Function Evaluation case.
Plot of azimuth position:

Plot of control torque:

Thus, linear extrapolation can help get an accurate answer, as long as the communication interval is small
enough to provide an accurate prediction.
Co-Simulation and Function Evaluation 29
User Libraries

User Libraries
In Adams when you want to link in a user subroutine, you create a library (standard user executable) and
simply select it when you need the subroutine(s) within the library.

To create a user library:


1. Perform one of the following:
On Linux: enter adams2017 -c cr-user
On Windows: From the Start menu, point to Programs, point to Adams 2017, point to
Adams Solver, and then select Create Custom Solver. (Or, type adams2017 cr-user in the
DOS prompt.)
2. Specify if you want to link in debug mode, and provide the list of your user subroutines.
3. Provide a name for the Adams Solver library, such as my_sub.dll.
4. Within Adams View, when you use the Controls Plant Export dialog box to write out your input
and output data, include the name of the user library you just created in the appropriate text box.
The user executable name is now automatically written out to the MATLAB .m file or the EASY5
information file and automatically picked up by the controls program as the proper executable.
Alternatively, you can enter this explicitly in the file. For example, in MATLAB, enter
Adams_exec = '$my_path/my_sub.dll'; (where $my_path is the path to your library).
For more information, see the Running and Configuring online help.
30 Adams Controls
Using TCP/IP

Using TCP/IP

About TCP/IP
TCP/IP (Transmission Control Protocol/Internet Protocol) is the standard for network communications.
In addition to the default pipes-based communication protocol, you can use TCP/IP communication
Adams Controls. TCP/IP-based communication allows you to run Adams on one workstation while
running controls software, such as Easy5 or MATLAB, on a second networked machine of the same or
different architecture. In the Adams Controls communication protocol, the controls software is the client
and Adams is the server.
A python script, adams_daemon.py, is used to setup TCP/IP communication between Adams and Easy5
or MATLAB. This script can be found in /$install_dir/controls/utils, where $install_dir is the directory
in which Adams is installed.
Once started, the default mode of Adams daemon will be available to sequentially service requests from
clients for successive Adams simulations. When a client terminates an Adams simulation, the daemon
becomes available to start another Adams simulation for the next client. In the default mode, the daemon
does not terminate until you explicitly terminate it from the operating system. To terminate the process,
you can either close the window of the process, or enter:
Windows: Ctrl + Break
Linux/Linux: Ctrl + C

Optionally, you can enter the number of runs before termination with the -n flag for adams_daemon.py.

Starting the Adams Daemon Process

Note: Although it is not required for general use, for the instructions below, copy the file
/$install_dir/controls/utils/adams_daemon.py to your local working directory, where
$install_dir is the directory in which Adams is installed

To start the Adams daemon process:


1. On the workstation on which you will run Adams daemon process, export the Adams plant as
instructed in Exporting Adams Controls Plant Files. Verify that the name automatically detected
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.
2. Select OK, and then exit Adams View.
3. Move or copy the .inf or .m file created in step 2 to the directory on the client machine from which
you intend to run Easy5 or MATLAB.
4. To view the options available for the Adams daemon, in a command shell, issue one of the
following commands:
Co-Simulation and Function Evaluation 31
Using TCP/IP

On Windows: adams2017 python adams_daemon.py -h


On Linux: adams2017 -c python adams_daemon.py -h exit
The script returns the available options and the acceptable values for each option, as shown next

This script can be invoked in the following ways:


On Linux/LINUX: $adams_alias -c python
topdir/controls/utils/adams_daemon.py [-h] [-p port] [-n #] exit
On Windows: $adams_alias python topdir\controls\utilsdams_daemon.py
[-h] [-p port] [-n #] exit
topdir is the installation directory of Adams and can be got by issuing
"$adams_alias -top".
-h print this help message.
-p port specify the port number. The default value: 30001
-n # specify the number of runs before the daemon stops.
The default is -1 = infinite loop until process closed.

Note: $adams_alias is the adams command line alias

5. Start the default Adams daemon in your current working directory by entering one of the
following commands in a command shell:
On Windows: adams2017 python adams_daemon.py
On Linux: adams2017 -c python adams_daemon.py exit
If using MATLAB and you are running the Simulink and Adams models on the same machine,
optionally you can start the same process by using the start_adams_daemon.m script found in the
Adams installation. To use it after importing the .m file from the Plant Export, simply enter the
following at a MATLAB command prompt:
>> start_adams_daemon
The Adams daemon starts and displays the following:
--------------------------------------------------------
The Adams Controls server daemon is now operational for
TCP/IP communication with Easy5 or Matlab client(s).
This server daemon will remain in the send/receive mode
until this window is closed or the following keyed in:
Windows: Ctrl+Break
Linux: Ctrl+C
--------------------------------------------------------
32 Adams Controls
Using TCP/IP

Note: When your client connects to the Adams daemon, it displays information similar to the
following:

Running Adams with MATLAB


To run Adams with MATLAB:
1. In the Adams plant mask in MATLAB/Simulink, make the following changes in the mask:
Set Interprocess Option to TCP/IP.
2. Note that the Adams working directory is the directory where the Adams files are on the server
specified by Adams host. These are specified by the .m file generated by Plant Export. Confirm
that these values are appropriate for your simulation or change them accordingly.
3. Select OK to save your settings.
4. Start the Adams daemon on the Adams host before starting the simulation in MATLAB/Simulink
Co-Simulation and Function Evaluation 33
Using TCP/IP

.
34 Adams Controls
Using TCP/IP

Running Adams with Easy5


To run Adams with Easy5:
1. In the component data table for the AD block in Easy5, change the following:
Adams_Communication_Mode to 2.0
The component data table should look as follows:

2. To save your settings, select OK.


3. Note that the .inf file generated by the Adams Controls Plant export contains the Adams working
directory (ADAMS cwd) and host (ADAMS Host). These specify the directory where the Adams
files are on the Adams server. Confirm that these values are appropriate for your simulation or
change them accordingly. For example:
ADAMS Host
My_machine.my_domain.com
ADAMS cwd
C:\adams\antenna
4. Start the Adams daemon on the Adams host before starting the simulation in Easy5.
Co-Simulation and Function Evaluation 35
Limitations

Limitations
Only one Adams Plant Block may be used in a model.
1000 inputs/1000 outputs/1000 independent states.
Name of the Adams model limited to 512 characters.
Adams and the MATLAB/Simulink or Easy5 must communicate at the same time interval.
Quasi-static co-simulations are not supported (co-simulation performs a series of
simulate/dynamic commands).
Kinematic Adams models in Function Evaluation are not supported (Workaround: add a dummy
part to get a dynamic model).
Adams Control Subroutines (CONSUB's) in Function Evaluation are not supported.
Initialization Commands: SAVE and RELOAD are not supported.
The compiler used by EASY5 must be the same as that supported by Adams; see
http://www.mscsoftware.com/ for a list of supported compilers.
36 Adams Controls
Limitations
Control System Import 37

Control System Import


38 Adams Controls
Importing External System Library

Importing External System Library


Imports an External System Library (ESL) into your Adams model by creating general state equation
(GSE) and other supporting elements that use the library.

To import an External System Library:


1. Click the Plugin tab on the Adams View ribbon.
2. From the Controls container, click the Adams Controls icon . Select Controls System
Import.
The Adams Controls System Import dialog box appears.
3. Complete the dialog box as described in Adams Controls System Import help page.
4. Select OK.

Setting External System Library Error Tolerance


Adams Controls System Import loads the equations found in the External System Library (ESL) with an
ADAMS General State Equation (GSE) element. By default, the continuous states of the GSE are
integrated to an error tolerance as specified by the INTEGRATOR statement. However, Adams Controls
gives you the option to override the default computation of the integrator's local integration error using
the error tolerance settings for the continuous states of an ESL. Effectively, you have more control over
the error of the individual states of the ESL. You may want to use this feature to help refine the accuracy
of your ESL states, but just like any INTEGRATOR setting, this may require tuning.
In order to apply the error tolerance of the ESL, Adams Controls will pass a scale factor to the GSE
subroutine that will multiply the ESL error tolerance values to determine the final GSE continuous state
error, that is:
Final GSE error tolerance = Error Scale Factor * ESL error tolerance, Error Scale Factor > 0
For an Error Scale Factor <=0, this will disable the ESL error tolerance values and will use the default
method instead.
For example, if you set the Error Scale Factor = 20, this will loosen the ESL error tolerance values by
multiplying them all by 20.
ESL Error tolerance, state 1 = 1e-8
ESL Error tolerance, state 2 = 1e-6
Error Scale Factor = 20
Final GSE error tolerance, state 1 = 1E-8 *20 = 2E-7
Final GSE error tolerance, state 2 = 1E-6 *20 = 2E-5
These final GSE error tolerance values will then be used to scale the local integration error of the
respective state, as described next.
The integrator error tolerance is compared against a local error measure that depends on the difference
between the current predicted and corrected states, the past history of the states, and the current
integration order.
Control System Import 39
Importing External System Library

The integrator's error tolerance check can effectively be written as:

2 2 2 2
e 1 + e2 + e3 + + en < E
where e is the difference between the predicted and corrected state, and E is the integrator ERROR
setting. If, for example, e3 has an error tolerance setting from the ESL for the GSE of E3, then the formula
becomes:

2 2 2 2
e 1 + e2 + ( e3 E E3 ) + + en < E
which effectively tightens the error tolerance if E3 < E.

As a general guideline, this feature may be more effective when the number of continuous states from
your ESL is much larger than the number of states in the rest of the Adams model. If the opposite is true,
then the addition of the ESL error tolerance values may not have much effect, or may be too restrictive.
Also, you may find this beneficial to decrease simulation times if you are able to increase the integrator
ERROR setting to loosen error needed on the Adams parts, and so on, while maintaining the error
required for the GSE/ESL.
See the INTEGRATOR statement for more details about ERROR. This feature only applies to the C++
Solver, and only Easy5 models currently report error tolerance values.
40 Adams Controls
Removing External System Library

Removing External System Library


You can delete the general state equation (GSE) that uses the external system library, its associated arrays,
and the dependency on the Adams model.

To delete a GSE:
1. Click the Plugin tab on the Adams View ribbon.
2. From the Controls container, click the Adams Controls icon . Select Controls System
Delete.
3. Enter the name of the model and GSE you want to delete.
4. Select OK.
Control System Import 41
Using MATLAB/Code Generation

Using MATLAB/Code Generation


For more information on Control System Import in MATLAB, see the tutorial entitled 'Getting Started
Using Adams Controls'. This tutorial gives you an overview of the four-step process of adding controls
to an Adams model. The example also includes tutorials for each of the controls applications you can use
with Adams Controls: Co-simulation, Function evaluation, and Control System Import with both Easy5
and MATLAB. See the Examples section to find this tutorial.

Software Requirements
This example requires licenses for Adams Solver, Adams View, and Adams Controls. It also requires
licenses for MATLAB/Simulink/Real-Time Workshop, and using the version(s) that are compatible with
Adams. The exact versions supported can be found under "Supported Versions of Integration Products"
in the following link:
www.mscsoftware.com/support/platform-support

Compilers supported by both Adams and MATLAB/Code Generation must also be available (for
example, Microsoft Visual Studio 2013) - again, see the link above for exact details. These products are
all assumed to be on the same machine for this tutorial.

Solver Settings
You can choose either Variable-step or Fixed-step solvers in MATLAB/Simulink, under Simulation
Configuration Parameters Solver Type. The choice will affect the model code that is generated
from Code Generation, in particular to how sample times are handled. This is important to Adams since
Adams will be integrating the model, not MATLAB/Code Generation. In this regard, the Variable-step
integrator is recommended since Adams Solver uses mainly variable-step integrators, and this will ensure
the outputs and states are computed properly. If you would still like to use a Fixed-step integrator setting,
the model should have at least one continuous state to produce the code for Adams that will handle the
sample times properly. For example, if you have a discrete-only model, add a dummy continuous block
(for example, integrator) to the model.

Tip: To look for differences in sample times between Fixed-Step and Variable-step
integrators settings, look for the function ssIsSampleHit(), which handles
evaluation of code at sample times.
As a MATLAB requirement, an Code Generation S-Function must have the same
type of integrator setting as the model that will use it (that is, both Fixed-step, or
both Variable-step).
42 Adams Controls
Using MATLAB/Code Generation

Exporting Parameters in Simulink/Code Generation Models to


Adams
You can export specific parameters from the Simulink/Code Generation model in order to fine-tune the
controller, or conduct design-of-experiments on the External System Library (ESL) without rebuilding
the model.
For the block diagram in the example below, the process of exporting the parameters is as follows:
Step 1 - Define the parameters in MATLAB workspace
Step 2 - Reference the Kp and Kv in the Simulink model
Step 3 - Define the proper storage class for parameter export
Step 4 - Create ESL with the tunable parameters exposed in Adams View

The controller for the antenna model will be used to illustrate this process. This file can be found in
install_dir/controls/example/antenna/continuous.mdl. The parameters to be changed are 1040 in
Transfer Fcn and 950 in Transfer Fcn1.

Step 1 - Define the parameters in MATLAB workspace


In the MATLAB workspace, issue the following:
Kp = 1040
Kv = 950
These two MATLAB variables can be accessed from the Simulink model.
Control System Import 43
Using MATLAB/Code Generation

Step 2 - Reference the Kp and Kv in the Simulink model


1. Double-click the Transfer Fcn block. Notice that the numerator is hard-wired with a value of
1040.
2. In the Numerator text box, enter Kp:
3. Select OK.
4. Double-click the Transfer Fcn1 block.
5. In the Numerator text box, enter Kv.
The parameterized Simulink model now looks like this:

Step 3 - Define the proper storage class for parameter export


1. In the Simulink model window, from the Tools menu, point to Code Generation, and then select
Options.
2. In the Configuration Parameters window that opens, select Optimization Tab.
3. Under Signals and Parameters, select Inline parameters.
4. Select Configure.
5. Highlight Kp and Kv and select Add to Table.
6. Verify that Storage class is set to SimulinkGlobal(Auto).
7. Select OK to apply the changes and close the Model Parameters Configuration window.
8. In the Configuration Parameters window, select the Code Generation tab.
Here, you generate the C-code and External System Library of the Simulink model. For details on
code generation for Adams Controls, refer to the Learning Adams Controls with Control System
Import chapter in Getting Started Using Adams Controls.
44 Adams Controls
Using MATLAB/Code Generation

After the code is generated, the following code appears in continuous_rsim_cg/continuous.h.


/* Parameters (auto storage) */
struct Parameters {
real_T Kp; /* Variable: Kp
* '<Root>/Transfer Fcn'
*/
real_T Kv; /* Variable: Kv
* '<Root>/Transfer Fcn1'
*/
};

extern Parameters rtP; /* parameters */

and in continuous_rsim_cg/continuous_data.c:

/* Block parameters (auto storage) */


Parameters rtP = {
1040.0, /* Kp : '<Root>/Transfer Fcn'
*/
950.0 /* Kv : '<Root>/Transfer Fcn1'
*/
};
Adams Controls wrapper code (adams.tlc) recognizes this structure and will generate Adams
design variables for these parameters. When entering values for these Adams design variables,
these are propagated to the Simulink/Code Generation parameters via the arguments to Adams
GSE.

Step 4 - Create Code Generation-GSE with the tunable parameters exposed in Adams
View
1. Create ESL as described in Learning Adams Controls with Controls System Import.
2. Once the GSE is created, open the Database Navigator and expand the GSE to examine its
children - you should see that the design variables Kp and Kv are created. The default values are
1040.0 and 950.0 as defined in the Simulink model. Those design variables can be changed to
study the effects on ESL.

Using Control System Import with MATLAB/Simulink/RTW on


Windows and Adams Controls on Linux
The process of transporting RTW code from one platform to another is as follows:
Step 1 - Create MATLAB tree on Linux to build RTW library
Step 2 - Create makefile and C-code template on Linux
Step 3 - Generate C-code and makefile
Step 4 - Build RTW dll
Control System Import 45
Using MATLAB/Code Generation

Step 1 - Create MATLAB tree on Linux to build RTW library


You need to emulate the Windows MATLAB file structure (tree) on your Linux machine to build the
RTW library.
1. Create a directory such as, home/rtwuser/cross.
2. Copy the following directories from the Windows MATLAB installation to the
home/rtwuser/cross directory on your Linux machine:
simulink/include
extern/include
rtw/c/rsim
rtw/c/libsrc
rtw/c/src
rtw/c/tools
rtw/c/tlc

Note: Your make utility and compiler may be sensitive to DOS/Linux end-of-line character
differences. Therefore, we recommend that you run a dos2Linux file conversion utility to
ensure your files have a Linux end-of-line.

Step 2 - Create makefile and C-code template on Linux


1. Set the environment variable MATLAB_ROOT to /home/rtwuser/cross.
2. In the file, /home/rtwuser/cross/rtw/c/rsim/rsim_Linux.tmf, change the following:
MATLAB_ROOT = |>MATLAB_ROOT<|
to
MATLAB_ROOT = /home/rtwuser/cross
COMPUTER = |>COMPUTER<|
to
COMPUTER = <MATLAB_computer_name>
where <MATLAB_computer_name> is the name returned by the MATLAB computer
command (for example, GLNX86). There should be no white space at the end of any line you
modified.
This will instruct the template makefile to use /home/rtwuser/cross as your MATLAB tree,
and to build on a Linux machine.
3. Create the Adams target in your working directory (in this example,
/home/rtwuser/workbench).
46 Adams Controls
Using MATLAB/Code Generation

Step 3 - Generate C-code and makefile


Here, assume that the working directory on Windows is C:/pcbench, the location of the Simulink model.
We assume that the working directory on Linux is /home/rtwuser/workbench/.
1. Copy the modified files, rsim_Linux.tmf, rsim.tlc, and adams.tlc, from
/home/rtwuser/workbench/ on Linux to C:/pcbench on Windows.
2. Launch MATLAB from C:/pcbench. Open the Simulink model file. On the RTW Page, change
the template makefile to rsim_Linux.tmf.
3. Select Build.
The RTW generates code and a makefile will display, but the executable will not build. You will
see a subdirectory called model_rsim_rtw in your C:/pcbench directory.
4. Copy all files in the build directory on Windows (C:/pcbench/model_rsim_rtw) to the working
directory on Linux (/home/rtwuser/workbench).
You may need to run a dos2Linux utility against the generated code to conform to Linux end-of-
line character standards.

Step 4 - Build RTW dll


1. Enter make -f model.mk in /home/rtwuser/workbench.
2. If there is build failure, you will see error messages. Check to see if there are any Linux end-of-
line symbols in the makefile (in the build directory), header files, and source code files in
/home/rtwuser/cross.
Now you have the library you require for the Linux platform. Continue with the control system import
procedure described in Getting Started Using Adams Controls.

Using Control System Import with MATLAB/Simulink/RTW and


Adams Controls on Two Windows Machines

Note: This procedure applies if you have Adams Controls installed on one Windows machine and
MATLAB/Simulink/RTW installed on another Windows machine.

To import your Simulink model to Adams Controls using RTW:


1. Create a new directory on the machine where Adams Controls is installed, for example,
c:/pcbench.
2. Set the MATLAB_ROOT variable in a DOS shell to point to this new directory. For example,
enter:
set MATLAB_ROOT=C:/pcbench/
3. Copy the following directories from the MATLAB machine to the directory you just created on
the Adams Controls machine:
simulink/include
Control System Import 47
Using MATLAB/Code Generation

extern/include
rtw/c/rsim
rtw/c/libsrc
rtw/c/src
rtw/c/tools
rtw/c/tlc
4. In the Adams working directory (on the Adams Controls machine), run
<adams_install_dir>/controls/utils/process.py to create the RTW target for Adams Controls.
5. Copy all of the .tmf and .tlc files from the working directory to the directory on the MATLAB
machine where the Simulink model resides.
6. Create the External System Library of the Simulink model on the RTW machine. For specific
instructions, see About Control System Import.
7. Copy the created ESL to the working directory on the Adams Controls machine.
The code generation of the Simulink model now exists on both machines.
8. On the machine where Adams Controls is installed, create the GSE with Control System Import
and run the simulation (see About Control System Import).

Using Control System Import with S-Functions


The following outlines the general steps to generate an External System Library for Control System
Import. For a detailed example, see the Getting Started Using Adams Controls tutorial.

S-Function Support with Source Code

To generate an ESL using an S-Function from source code:


1. Create an S-Function written in C (for example, by using the S-Function Target in Real-Time
Workshop (RTW)).
2. Create Simulink model using S-Function from step 1. It must have the same integrator type
(Fixed-Step vs. Variable-Step) that was specified in step 1.
3. Generate ESL via RTW using Adams Controls-modified RSIM target (all supporting files for S-
Function must be made available, for example, MEX file for S-Function
sfunctionname_sf.mexw32 and other source code)

S-Function Support without Source Code

To generate an ESL using S-Function with no S-Function source code:


1. Create an S-Function using S-Function target in the same manner as in steps 1 for "S-Function
Support with Source Code".
2. Use Adams Controls setup_rtw_for_adams script to generate Adams Controls-modified RSIM
target.
48 Adams Controls
Using MATLAB/Code Generation

3. Modify model with S-Function to choose RSIM target from step 2 and build S-Function again -
this will create an object file that can be used in later steps to build the Adams Controls ESL from
RTW.
4. Provide the following when distributing the model to the person who will make the Adams
Controls ESL from RTW:
sfunctionname_sf.mexw32
sfunctionname_sf.h
sfunctionname_sfcn_rtw/sfunctionname_sf.h
sfunctionname_sfcn_rtw/sfunctionname_mid.h
sfunctionname_sfcn_rtw/sfunctionname_sid.h
sfunctionname_sfcn_rtw/sfunctionname_sf_private.h
sfunctionname_sfcn_rtw/sfunctionname_sf_types.h
sfunctionname_sfcn_rtw/sfunctionname.mk
sfunctionname_sfcn_rtw/sfunctionname_sf_data.c (if applicable)
modelname_rsim_rtw/sfunctionname_sf.obj
modelname.mdl
5. At the receiver's end, using the files from Step 4, retain the directory structure and place the object
file in the directory of the new model's name, for example,
"newmodelname_rsim_rtw/sfunctionname_sf.obj"
6. Put the S-Function block in modelname.mdl within the new Simulink model (for example,
newmodelname.mdl").
7. Build the ESL using the Adams Controls-modified RSIM target.

Limitations:
If your S-function depends on other modules, this method may fail. You may have to manually add the
dependent modules to the S-function by using the following command:
set_param('Sfunction_blockpath','SFunctionModules','file1 file2 file3')
Where:
'Sfunction_blockpath' is the path of the Sfunction block.
'file1', 'file2' and so on are the names of the dependent files.

These details can be found also written for another example here:
How do I build my model that contains an RTW generated S-function block if I do not have the
source code?
http://www.mathworks.com/matlabcentral/answers/196427
How do I build my model containing a C-MEX S-function if I don't have the S-function C source
file using Real-Time Workshop?
http://www.mathworks.com/matlabcentral/answers/196428

The overriding rules for working with MATLAB/Simulink/Real-Time Workshop must be followed in use
of S-Functions. Please consult Mathworks and their documentation for more details.
Control System Import 49
Using MATLAB/Code Generation

Parameterizing S-Functions for Adams

To parameterize an S-Function for Adams, when building the S-Function block using an S-
Function target, you must:
1. Build the S-Function using the S-Function target in RTW and choose the parameters to be Global
(tunable) Parameters - (that is, Inline, and then choose exceptions -- just as you would for an
Adams ESL)
2. Build the ESL using the Adams Controls-modified RSIM target and again choose the same
parameters to be Global (tunable) Parameters.
The parameters can be generally found in the "_data.c" files, for example, "sfunctionname_sf_data.c"
and "ESL_model_name_data.c" when this is done properly.
For more details on these steps, see the Learning Adams Controls with Control System Import from
MATLAB with S-Functions.

Sample Time Setting of Simulink Source Blocks for Adams


Controls Target of RTW
In Simulink, some blocks in the source library have a parameter Sample Time, which is the interval at
which those block are sampled. Setting sample time in your Simulink/RTW model can change the
behavior of the system, and you should take care to select this. If the Sample Time is zero, the blocks can
be sampled at any time. In real-time applications, or when the simulation is based on explicit and fixed
step-size integration, a nonzero setting of Sample Time makes sense because it controls the progression
of the simulation to guarantee accuracy. Adams Solver integrators usually maintain accuracy with
variable-step integrator, error controls, and step-size settings (for example, HMAX), which is also true
when solving the Adams Controls External System Library (ESL). Thus, the sample rate of continuous
states depends on the integrator settings. At the same time, the sample rate for the blocks in the ESL is
maintained with internal calls to GSE_SAMP to compute non-zero sample times, and GSE_UPDATE to
call the sampled blocks. Therefore, you may want to set the sample time to zero to let Adams Solver
sample the block as needed (that is, continuous) instead of at a specified sample rate. You can confirm
the sample rates by looking at the RTW source code generated for the Simulink model, for example:
Model_rsim_rtw/Model.c:

/* Function to initialize sample times */


void MdlInitializeSampleTimes(void)
{
/* task periods */
ssSetSampleTime(rtS, 0, 0.0);
ssSetSampleTime(rtS, 1, 0.001);

/* task offsets */
ssSetOffsetTime(rtS, 0, 0.0);
ssSetOffsetTime(rtS, 1, 0.0);
}
50 Adams Controls
Using MATLAB/Code Generation

Here, there is one non-zero sample time (0.001) which will set the sample rate in GSE_SAMP. You can
confirm the blocks that use these sample times by searching for the ssIsSampleHit function in this same
file.
Finally, setting the Fixed-step size for Simulink can add a sample time to your model, even if it is purely
continuous.
Control System Import 51
Using MATLAB/Code Generation

Limitations
The models supported by Adams Controls are firstly limited by those restrictions enforced by
MATLAB/Real-Time workshop itself. Please consult the Mathworks documentation for the official
limitations, but a summary of these can be found next. In addition, Adams Controls has its own
limitations for S-Functions support for ESL creation/use which are also listed.

S-Function Target Limitations

Sample Time Propagation in Generated S-Functions


A generated S-Function block can inherit its sample time from the model in which it is placed if certain
criteria are met. Six conditions that govern sample time propagation for S-functions and for the S-
function code format are described in Inheriting Sample Times in the Simulink documentation. These
conditions also apply to sample times propagated to Model blocks, and are further discussed in Inherited
Sample Time for Referenced Models.

Rapid Simulation Target Limitations


Adams Controls uses a modified version of the RSIM (rapid simulation) target, and an S-Function must
be written in C or C++ to work with the RSim target. The RSim target does not support noninlined M-
52 Adams Controls
Using MATLAB/Code Generation

file, FORTRAN, or Ada S-functions (inlining means to use an RTW .tlc file to write the code for the S-
Function directly in the generated code).
The RSim target is subject to the following limitations:
The RSim target does not support algebraic loops.
The RSim target does support MATLAB function blocks, if there is no discrete-time block.
However to make this work with discrete-time block, use the below methods.
Step 1: Generate the S-Function block from RTW by applying the S-Function Target in
Code Generation.

Step 2: Create Adams ESL from the Simulink model that contains the S-Function block
generated in Step 1.

The RSim target does not support the transport delay block. However to make this work, use the
similar method mentioned in the discrete-time block.
The RSim target does not support noninlined M-file, FORTRAN, or Ada S-functions.
Control System Import 53
Using MATLAB/Code Generation

If an RSim build includes referenced models (by using Model blocks), these models must be set
up to use fixed-step solvers for code to be generated for them. The top model, however, can use a
variable-step solver as long as all blocks in the referenced models are discrete (variable-step
solver not supported by Adams).
In certain cases, changing block parameters can result in structural changes to your model that
change the model checksum. An example of such a change would be changing the number of
delays in a DSP simulation. In such cases, you must regenerate the code for the model.

Adams Controls Limitations


1. RSIM Target
a. Models need to have only one output value per outport.
b. Solver Type: Variable-step solver setting in MATLAB recommended; otherwise, Fixed-step
models with no continuous states need to add a continuous block (for example, a dummy
integrator block)
c. Inputs and outputs (ports) must be double variable type (that is, "real_T" in RTW code)
d. Variable-time steps for a variable-step integrator are not supported.
2. RSIM and S-Function Targets
a. Parameters must be double type (that is, "real_T" in RTW code) (From SimulinkGlobal(Auto)
storage class)
b. Target Language must be in C
Choice of Solver Type: S-Function setting for Solver Type must match setting in the model
where it is used. Variable-step solver setting in MATLAB recommended; otherwise, Fixed-
step models with no continuous states need to add a continuous block (for example, a dummy
integrator block)
c. Blocks:
Discrete Pulse Generator: The discrete pulse generator must be time-based, not sample based.
d. Misc
Must have at least one input and one output for the model, even if it is a dummy (for example,
use terminator block to import/outport).
54 Adams Controls
Limitations

Limitations
External System Libraries (ESL's) are not guaranteed to be compatible from release to release;
you must rebuild the ESL for each new version of Adams.
The ESL may be used only once per Control System Import. (Workaround: to use the same
model more than once, create duplicate ESL's with different names and repeat the Control
System Import. This includes copying/renaming a file already generated. Mechatronics excluded
from workaround.)
A maximum limit of 100 ESL's can be loaded.
The name of the ESL is limited to 32 characters Easy5, 200 characters MATLAB/Simulink.
SAVE and RELOAD are not supported for an External System Library (ESL).
MATLAB/Simulink and Easy5 Interactive (IS) blocks are not supported (that is, recreated in
Adams).
"From File" block in Simulink is not supported - see Article KB8016298 "How to prepare a
Simulink model for RTW DLL creation."
The compiler used by EASY5 or MATLAB/RTW must be the same as that supported by Adams;
see http://www.mscsoftware.com/ for a list of supported compilers.
Easy5 models may not be implicit.
Adams Solver (FORTRAN) does not have a bisection method for SENSOR's to improve the
accuracy of the detection of continuous state reset and switch states in Easy5. So, if you have
these in your model, you may improve the accuracy of your simulation by using the C++ Solver
instead of FORTRAN.
Also see the Limitations under the section "Using MATLAB/RTW".
Functional Mock-up Interface (FMU) 55

Functional Mock-up Interface (FMU)


56 Adams Controls
Adams support for FMI standard

Adams support for FMI standard


Functional Mock-up Interface (FMI) is an open standard to support the exchange of simulation models
and coupling between different tools. It provides two user scenarios: Model Exchange and Co-
Simulation. Currently Adams provides the support for FMI 1.0 and 2.0 Co-Simulation (both Master and
Slave mode) and Model Exchange (Master mode).
In the FMI Master mode, Adams could import external models that conform to the FMI 1.0 and 2.0 Co-
Simulation/Model Exchange standard. The model is also called Functional Mock-up Unit (FMU). The
user needs to specify the communication interval in case of co-simulation. The user could then perform
simulation using Adams as the master.
In the FMI Co-Simulation Slave mode, the user could export an Adams model as an FMU, and then use
it in any software which supports the FMI Co-Simulation Master mode.
The FMU file is a zip formatted file which contains a model description file in XML format, a binary file
for the model as well as optional resource files and source codes for the binary file. The model description
file provides information such as input/output and capability flags.

Note: Microsoft Visual Studio C compiler is required on Windows platforms (supported version:
14.0) and Intel C compiler is required on Linux platforms for FMU export. Compilers are
not required for FMU import.

For more information please refer to https://www.fmi-standard.org/.


Functional Mock-up Interface (FMU) 57
Exporting an FMU

Exporting an FMU
Adams model could be exported as an FMU with the FMI 1.0 Co-Simulation Tool standard. This could
be done by using the existing Adams Controls Plant Export dialog box.

The procedure will be very similar to existing Plant Export. The user would specify the Input and Output
signals, select the Target Software as FMU and then choose whether to use TCP/IP or PIPE (TCP/IP
unchecked) during the co-simulation.
An FMU file will be created in the current working directory with the name specified in "File Prefix"
field and the extension .fmu. A pair of .cmd and .adm file will also be generated with the same name.
The exporting FMU will have the following capability flags:
canHandleEvents="false" // The slave does not support event handling during co-simulation.
58 Adams Controls
Exporting an FMU

canSignalEvents="false" // The slave cannot provide information about events during a


communication step.
canBeInstantiatedOnlyOncePerProcess="true" // Only one instance per FMU is
possible.
maxOutputDerivativeOrder="0" // The slave is not able to provide derivatives of outputs.
canInterpolateInputs="false" // The slave is not able to interpolate continuous inputs.
canHandleVariableCommunicationStepSize="true" // The slave can handle variable
communication step size.
To use this FMU on a different machine, the alias "adamsXXXX" (where XXXX is the version of Adams,
for example adams2017) needs to be set up. To do this, on Windows platforms, add
"Adams_installation_path\bin\" (for example, C:\MSC.Software\Adams\2017\bin) to the User PATH
environment variable, which could be found under Control Panel System System Properties
Advanced Environment Variables.
Functional Mock-up Interface (FMU) 59
Exporting an FMU

On linux64 platform, create the alias as specified in the Adams installation guide. It is suggested that the
exporting and importing machine has the same Adams installation path. Otherwise the Adams cannot be
called during a Co-Simulation. Or the user could use TCP/IP instead of PIPE.
To use TCP/IP, the Adams Host Name should be set correctly and adams_daemon.py should be running
on the host machine. The adams_daemon.py could be found under
"Adams_installation_path\controls\utils\" (for example,
C:\MSC.Software\Adams\2017\controls\utils\). To run the adams_daemon.py, see Using TCP/IP in the
help document.
After the Co-Simulation, the Adams FMU generated result files could be found in the resource directory
of the extracted FMU. This is decided by the software importing the Adams FMU. For example, if the
60 Adams Controls
Exporting an FMU

Adams FMU is imported into another Adams session, the extracted FMU could be found in the current
working directory. Other software may use the user temporary directory.
Functional Mock-up Interface (FMU) 61
Importing an FMU

Importing an FMU
An external FMU could be loaded in Adams by using the Adams Controls System Import dialog box.
The FMU should confirm to FMI 1.0 or 2.0 Co-Simulation or Model Exchange standard. Currently
Adams cannot handle events during co-simulation, nor does it support interpolation/extrapolation.
Adams will not allow string inputs and outputs.

To import an FMU into Adams, simply choose the FMU in the External System Library field. The Output
and Input signals should be selected using Existing Controls Plant or from Poutput/Pinput.
The Communication Interval should be set according to the frequency of interest of the FMU model
(above the Nyquist Frequency). The Visibility specifies whether the importing FMU could be visible or
not during the Co-Simulation (needs to be supported by the importing FMU). If the imported FMU
belongs to Adams, then after the simulation, GUI of the imported FMU would not be closed
automatically. It would remain open so that users can continue perform other simulation activity by
interacting with the FMU master Adams window. The GUI of the imported FMU does not support any
user interaction. It automatically gets closed once user resets the simulation from the FMU master Adams
window.
The Communication Interval and Visibility fields are automatically disabled if the imported FMU is of
Model Exchange type. If the FMU supports FMI 2.0 and supports both Model Exchange and Co-
62 Adams Controls
Importing an FMU

Simulation, the user would be presented with an option to choose the kind of simulation that is to be run.
Accordingly, the corresponding simulation would be executed.
The imported FMU will be extracted in the current working directory under /fmu/<General State
Equation Name>/.
Integration with Vertical Products 63

Integration with Vertical Products


Adams Mechatronics
Features in Adams Mechtronics may be attractive to Adams Car users who want to use Adams Controls.
Adams Mechatronics is a plug-in to Adams which can be used to easily incorporate control systems into
mechanical models. Adams Mechatronics has been developed based on the Adams Control functionality
and contains modeling elements which transfer information to/from the control system. For example,
using Adams Mechatronics in Adams Car, you can quickly create assemblies of vehicle systems
including control systems, and then analyze them to understand their performance and behavior. Adams
Mechatronics enables you to work faster and smarter with control systems, letting you have more time
to study and understand how design changes as well as changes in the controls systems affect the total
mechanical model performance.
From a modeling perspective, Adams Mechatronics has following benefits:
A control system has to be setup and coupled only once.
Control systems and control signals are handled as components among others.
The model can easily be used by different users, including those who are not familiar with the
control systems.
Automatic signal unit conversions.
Easy to connect transducer and actuator signals to the control systems.
Overview and modify the control system input and output specifications.

For more information, see the Adams Mechtronics documentation.

For the latest information on integrating Adams Controls with Adams Car, and Adams Chassis, refer to
the Adams Technical Articles at http://simcompanion.mscsoftware.com.
64 Adams Controls
Examples 65

Examples
66 Adams Controls
Tutorials and Examples

Tutorials and Examples


The following Adams Controls examples are available:
Getting Started Using Adams Controls - Gives you an overview of the four-step process of
adding controls to an Adams model. The example also includes tutorials for each of the controls
applications you can use with Adams Controls: Co-simulation, Function evaluation, and Control
System Import with both Easy5 and MATLAB.
MSC Software Simcompanion Article KB8016239 - Various examples of Adams Controls
features:
Using Adams Solver (C++) with Adams Controls in an Easy5 co-simulation
Performing a design study with an Adams External Systems Library (ESL) containing Easy5
parameters and requests
Generalized communication using TCP/IP
Improved performance of co-simulation through first-order interpolation
MSC SoftwareSimcompanion Article KB8014597 - A list of links to several articles in our
Knowledge Base dealing with Adams Controls.
install_dir/ainsight/examples/ain_tut_110_asc_mat.txt - Studies the control system of a linearized
model using the Adams Insight ASCII conduit and MATLAB.
install_dir/ainsight/examples/ain_tut_102_asc_aco.txt - Studies the control system using the
Adams Insight ASCII conduit and Adams Controls.
Dialog Box - F1 Help
68 Adams Controls
Adams Controls Plant Export

Adams Controls Plant Export


Controls Plant Export

Exports the Adams plant files. Adams Controls saves the input and output information in an .m (for
MATLAB) or .inf file (for EASY5). It also generates a command file (.cmd) and a dataset file (.adm) that
are used during the simulation process. Adams could also export the model as a .fmu file (Functional
Mock-up Unit or FMU) that follows the FMI standard.

For the option: Do the following:


Tips on Entering Object Names in Text Boxes

Tips on Entering File Names in Text Boxes


Controls Plant selection Specify whether you are creating a new controls plant or modifying
an existing one. Enter the name of the new or existing plant in the text
box to the right.
File Prefix Enter the prefix for the .adm, .cmd, .acf, .m, and .inf files that Adams
Controls creates.
Initial Static Analysis Select one of the following:

Yes: Performs initial static analysis.


No: Does not perform initial static analysis.
Note: If Initial Static Analysis is set to Yes and Type is set to
linear, Adams Controls performs a static analysis before the
linear analysis. Otherwise, Adams Controls performs an
initial conditions analysis.
Initialization Command Check if you want to enter Adams View or Adams Solver non-time
advancing (NTA) commands that you want to have executed before
the co-simulation or function evaluation starts. In the text box that
appears, enter one NTA command. To execute more than one NTA
command, create an .acf file and refer to it using the
FILE/COMMAND = command_file_name string in this text box.
Import Settings from Existing Select to display the Database Navigator, where you can choose an
Controls Plant existing controls plant whose settings you want to use in your current
plant. Adams Controls updates the Adams Controls Plant Export
dialog box with the appropriate settings.
Input Signals Enter names of state variables that you want to use as plant inputs.
Select From Pinput to enter state variables from existing plant
inputs.
Output Signals Enter names of state variables that you want to use as plant outputs.
Select From Poutput to enter state variables from existing plant
outputs.
Dialog Box - F1 Help 69
Adams Controls Plant Export

For the option: Do the following:


Re-order Adams Inputs The reorder of plant inputs and outputs change the order of the signals
Signal(s)/Re-order Adams in the PINPUT and POUTPUT entities. This is useful when you
Output Signal(s) already created the PINPUT and POUTPUT entities and at a later
point in time (during plant export) would like to reorder the signals
within them.

Important: The order of signals should be same during plant export


and plant import. Otherwise, simulation could fail and
produce undesired results.
Target Software Select one of the following:

Easy5
MATLAB
FMU - Creates a Functional Mock-up Unit that follows the
FMI standard.
Analysis Type Select one of the following:

linear - Creates a linearized representation of the model in


terms of (A, B, C, D) matrices. A linear analysis is performed.
For Target Software of FMU, this option is not supported.
non_linear - Exports plant for dynamic analysis.
Adams Solver Choice Select one of the following:

Fortran - Uses the default Adams Solver (FORTRAN) for


this simulation.
C++ - Uses Adams Solver (C++) for this simulation.
User Defined Library Name Enter the name of the user-defined library.
Adams Host Name Enter the name of the host machine from which the Adams plant is
being exported. This host name is used if you choose TCP/IP-based
communication to perform cosimulation or function evaluation
between Adams and MATLAB, Easy5 or FMU.
70 Adams Controls
Adams Controls Plant Export

For the option: Do the following:


TCP/IP This option is only available for FMU target software. TCP/IP allows
you to run Adams on one workstation while running FMU Master on
a second networked machine of the same or different architecture.
Dynamic State Output Dynamic States Output performs an initial conditions analysis or a
static analysis (if Initial Static Analysis is set to Yes), and computes
the number of states (that is, displacements, velocities) in the model.
This is used by Easy5 for Function Evaluation mode. If your model
has difficulty computing this properly, you can disable this feature,
but you will not be able to use Function Evaluation mode unless the
number for NUMBER OF STATES is modified in the .inf file from
Plant Export. This may be relevant for Adams Chassis models
imported into Adams View.
Dialog Box - F1 Help 71
Adams Controls System Delete

Adams Controls System Delete


Controls Controls System Controls System Delete

Deletes the general state equation (GSE), its associated arrays, and the dependency on the Adams model.

For the option: Do the following:


Tips on Entering Object Names in Text Boxes
Model Enter the name of the model.
General State Equation Name Enter the name of the GSE you want to delete.
72 Adams Controls
Adams Controls System Import

Adams Controls System Import


Controls Controls System Controls System Import

Imports a control system into your Adams model as a general state equation (GSE).

For the option: Do the following:


Tips on Entering Object Names in Text Boxes

Tips on Entering File Names in Text Boxes


Model Enter the name of the model.
General State Equation Name Enter the name of the GSE to be created.
External System Library Enter the name of the external system library. If the extension entered
is .fmu, Adams will expect an FMU that conforms to the FMI
standard.
Import I/O Signals from Select to display the Database Navigator, where you can select an
Existing Controls Plant existing controls plant from which output and input signals are to be
imported.
From Poutput Select to display the Database Navigator, where you can select an
existing poutput from which to import output signals.

For more information on creating plant outputs, see Data Element


Create Plant Output.
From Pinput Select to display the Database Navigator, where you can select an
existing pinput from which to import input signals.

For more information on creating plant inputs, see Data Element


Create Plant Input.
Re-order Adams Inputs The reorder of plant inputs and outputs change the order of the
Signal(s)/Re-order Adams signals in the PINPUT and POUTPUT entities. This is useful when
Output Signal(s) you already created the PINPUT and POUTPUT entities and at a
later point in time (during plant export) would like to reorder the
signals within them.

Important: The order of signals should be same during plant export


and plant import. Otherwise, simulation could fail and
produce undesired results.
Static Hold Select one of the following:

Off: Turns static hold off.


On: Turns static hold on.
For more information on static hold, see GSE statement.
Dialog Box - F1 Help 73
Adams Controls System Import

For the option: Do the following:


Use External System Library Check to apply the error tolerance values of the continuous states of
Error Tolerance ESL to the GSE during integration. The ESL error tolerance values
change the computation of the local integration error that is
computed after the corrector as converged. If the estimated error is
greater than the specified integration ERROR the integrator rejects
the solution. See the INTEGRATOR statement for more details
about ERROR. You may want to use this feature to help refine the
accuracy of your ESL states, but just like any INTEGRATOR setting,
this may require tuning. This feature only applies to the C++ Solver,
and only Easy5 models currently report error tolerance values.

Error Scale Factor: Values > 0 will scale all of the ESL error
tolerance values in order to tighten or loosen these values, that is,
Final GSE error tolerance = Error Scale Factor * ESL error tolerance

Values <= 0 will disable using the ESL error tolerance values, and the
default computation for the local integration error will be used.
Information Check to display verbose information about the general state
equation (GSE) that the controls system import created.
Communication Interval This option is only enabled for External System Libraries of type
FMU co-simulation. For co-simulation with the FMU, you need to
specify the communication interval. Sample the FMU at least two
times faster than the highest frequency of interest (refer to Nyquist
frequency). This option is disabled for FMU of type model exchange
and other ESLs exported using MATLAB or Easy5.
Visibility This option is only enabled for External System Libraries of type
FMU co-simulation. Visibility means the FMU runs in interactive
mode. Turn it off if you want to run it in batch mode. In order for this
option to work in Adams, visibility needs to be supported by the
specified FMU.
Overwrite PINPUT Functions Check to overwrite the values of any existing PINPUT functions in
the GSE. Default is to add to the existing values.

One caveat when checking this option is that, if the same PINPUT
variable is updated by multiple ESLs, then only the last imported
ESL value would be retained.
74 Adams Controls
Adams Controls System Import
Appendix
74 Adams Controls
Entering File Names in Text Boxes

Entering File Names in Text Boxes


To enter file names in text boxes, you can do either of the following:
Enter the file name directly in the text box.
Clear the text box and then double-click to open a selection window.
Right-click to either:
Search a database
Browse a database
Appendix 75
Entering Object Names in Text Boxes

Entering Object Names in Text Boxes


To enter object names in text boxes, you can do either of the following:
Enter the object name directly in the text box.
Clear the text box and then double-click to open the Database Navigator.
Right-click to either:
Pick an object shown on the screen.
Browse a complete list of available objects.
Choose from a product-generated list of guesses.
76 Adams Controls
Entering Object Names in Text Boxes
MSC.Fatigue Quick Start Guide

Index
Adams Controls

A Control system import


Adams Expression Builder running on different machines, 44
expression Builder, 12 running on different machines (using
knowledge Base, 63 RTW), 46
mask, 21 Control System Import with S-Functions, 47
plant, 21 Controller/simulation, 10
Adams extension for Easy5, 14 Controls system delete, 40
Adams/Controls, 2 Co-simulation, 10, 24
about, 2 Creating
benefits of using, 3 user libraries, 29
Four-step process, 6
improving your design process, 3 D
plugin, 8 Daemon process, 30
simulation methods, 10 Data exchange, 24
starting, 8 Design process, 3
target, 49 Design variables, 12
tutorials and examples, 66 Design variables versus state variables, 12
user libraries, 29 Design-of-experiments, 42
vertical product integration, 63 Discrete simulation mode, 10
ways to use, 5 Dos2unix, 45, 46
Adams/Solver dataset, 12
Adams/Solver variable, 12
Adams/View commands, 21
E
Easy5
Adams/View variable, 12
exporting plant files, 13
Animation options
running adams with, 34
batch, 20
XFE, 5
interactive, 20
Easy5 extension for Adams, 14
EASY5_LMD_LICENSE_FILE, 14, 15
B Examples
Batch animation mode, 20 Adams/Controls, 66
Block diagram, 6 Exporting
parameters, 42
C plant files, 13
C-code, 10, 11, 43, 45, 46 Extension, Adams for Easy5, 14
generating, 46
import simulation, 11 F
makefile, 46 Four-step process, 6
template, 45
Continuous simulation mode, 11
78 Adams Controls

G RTW
General state equations building library, 45
deleting, 40 C-code import, 11
importing, 38 dll, 46
RTW-GSE, 42, 46
simulink Model, 42
I
Import
C-code, 11 S
General state equations, 38 Sample rate, 49
RTW-GSE, 46 Sample time settings, 49
Initialization commands, 22 Simulation
Integration with vertical products, 63 animation options, 20
Interactive animation mode, 20 choosing a method, 10
continuous, choosing, 11
discrete, 10
L initialization commands, 22
Libraries, user, 29
Simulink
LM_LICENSE_FILE, 14, 15
simulink model to RTW, 42
Loading Adams/Controls plugin, 8
source blocks, 49
using control system import via RTW-GSE,
M 46
Mathwork's Real-Time Workshop, 5 Simulink, sample time setting, 49
MATLAB Sine wave, 49
C-code import, 11 Solver dataset, 12
creating tree, 45 Starting Adams/Controls, 8
MATLAB/Simulink/RTW, 44 State variables, 12
RTW-GSE, 46 Storage class for parameter export, 43
running adams with, 32
running on different machines, 44
MSC_LICENSE_FILE, 14, 15
T
tcp/ip, 30

P U
Parameter Sample Time, 49
Uniform random number, 49
Parameters
Unload Adams Controls plugin, 8
design variables versus state variables, 12
User libraries, 29
exporting, 42
Plant files, exporting, 13
Plugin manager, 8 V
Pulse generator, 49 Variables, 12
design, 12
state, 12
R Vertical product integration, 63
Random Number, 49

X
XFE, 11

You might also like