Professional Documents
Culture Documents
Welcome to Adams/Controls
2 Adams/Controls
About Adams/Controls
About Adams/Controls
Adams/Controls, part of the MD Adams 2010® suite of software, is a plugin to MSC.Software’s
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.
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
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
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 UNIX, type the command 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 MSC.Software, point to MD
Adams 2010, point to AView, and then select Adams - View.
The Welcome dialog box appears, in the Adams/View main window.
2. From the Welcome dialog box, select Import a file, and then select OK.
3. Select the file you want to import.
4. In the Select File dialog box, select OK.
5. In the File Import dialog box, select OK.
The model appears in the Adams/View main window.
6. Load Adams/Controls by doing the following:
• From the Tools menu, point to Plugin Manager.
• Select the Load check box next to Adams/Controls.
• Select OK.
Adams/Controls is now loaded.
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 generated by MATLAB/Real-Time
Workshop or Easy5. The ESL is used by automatically creating a General State Equations (GSE) entity
in Adams. 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://support.adams.com/kb/faq.asp?ID=kb10371.html.
Using Easy5
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 in the following steps.
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_nt_IF91 (Win32) or lib_em64t_IF91 (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.
• Adams supports the Intel Visual Fortran 10.1 and 11 compilers only (note that this will work
with the "91" directory on Easy5). The Easy5 model import feature is not supported with the
GNU or other compilers. Check http://support.adams.com 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:
16 Adams/Controls
Using Easy5
C:\MSC.Software\EASY5\2008r1\
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.
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.
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 (e.g.
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. (e.g.
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.
Co-Simulation and Function Evaluation 23
Initialization
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:
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
Interpolation/Extrapolation Options
Step 1 - Options for Adams/Controls Plant Inputs
The following describe what happens to the Adams Plant inputs (i.e., 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
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:
28 Adams/Controls
Co-Simulation and Interpolation/Extrapolation
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").
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.
Co-Simulation and Function Evaluation 29
Co-Simulation and Interpolation/Extrapolation
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 31
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.
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
• Unix/Linux: Ctrl + C
Optionally, you can enter the number of runs before termination with the -n flag for adams_daemon.py.
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
5. Start the default Adams daemon in your current working directory by entering one of the
following commands in a command shell:
• On Windows: mdadams2010 python adams_daemon.py
• On UNIX: mdadams2010 -c python adams_daemon.py exit
If using MATLAB, 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
Unix: Ctrl+C
--------------------------------------------------------
34 Adams/Controls
Using TCP/IP
Note: When your client connects to the Adams daemon, it displays information similar to the
following:
.
36 Adams/Controls
Using TCP/IP
To delete a GSE:
1. From the Controls menu, select Controls System, and then select Controls System Delete.
2. Enter the name of the model and GSE you want to delete.
3. Select OK.
38 Adams/Controls
Using MATLAB/RTW
Using MATLAB/RTW
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:
http://support.adams.com
Compilers supported by both Adams and MATLAB/RTW must also be available (for example, Microsoft
Visual Studio 2005) - 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 RTW, in particular to how sample times are handled. This is important to Adams since Adams will
be integrating the model, not MATLAB/RTW. 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 RTW-generated 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).
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.
…and in continuous_rsim_rtw/continuous_data.c:
• rtw/c/libsrc
• rtw/c/src
• rtw/c/tools
• rtw/c/tlc
Note: Your make utility and compiler may be sensitive to DOS/UNIX end-of-line character
differences. Therefore, we recommend that you run a dos2unix file conversion utility to
ensure your files have a UNIX end-of-line.
4. Copy all files in the build directory on Windows (C:/pcbench/model_rsim_rtw) to the working
directory on UNIX (/home/rtwuser/workbench).
You may need to run a dos2unix utility against the generated code to conform to UNIX end-of-
line character standards.
Note: This procedure applies if you have Adams/Controls installed on one Windows machine and
MATLAB/Simulink/RTW installed on another Windows machine.
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).
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/support/solutions/data/1-4JEC1P.html?solution=1-4JEC1P
• 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/support/solutions/data/1-3JK8LD.html?solution=1-3JK8LD
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.
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.
46 Adams/Controls
Using MATLAB/RTW
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.
/* task offsets */
ssSetOffsetTime(rtS, 0, 0.0);
ssSetOffsetTime(rtS, 1, 0.0);
}
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 47
Using MATLAB/RTW
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.
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 not support MATLAB function blocks.
• The RSim target does not support noninlined M-file, FORTRAN,or Ada S-functions.
• 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).
Integration with Vertical Products 45
For the latest information on integrating Adams/Controls with Adams/Car, and Adams/Chassis, refer to
the Adams Knowledge Base at http://support.adams.com/kb.
46 Adams/Controls
Examples 47
Examples
48 Adams/Controls
Tutorials and Examples