Animating CD-Tire Results
Using an Existing ADAMS (.adm) File to Run in MotionSolve
An existing .adm file written from ADAMS/car or ADAMS/view should not require any modifications to run in MotionSolve.CDTire User Defined Road
The ability to define user roads is an important feature of tire modeling: CD-Tire together with MotionSolve (starting with version 10.0 SA205) is able to support user defined roads.- Creating a user road dll by compiling and linking a series of user road source files.
- Selecting the user road option (1100) in the GFORCE user parameter
list.
<Force_Vector_TwoBody id = "20" label = "CDTire2" type = "ForceAndTorque" i_marker_id = "1621" j_floating_marker_id= "2305" ref_marker_id = "7" usrsub_param_string = "USER(838,1611,1612,1613,1614,2303,2200,2,4,1,1,20,21,1100,21)" usrsub_dll_name = "cdtire" usrsub_fnc_name = "gfosub" />
- Defining the appropriate user road file name string corresponding to the road files
that you want to
use.
<Reference_String id = "25" label = "CDTire2_roadfile_root" string = "./prop_files/cdt_data/road_data/rsm1_" />
The user road file will be opened by CDTire and its file I/O unit will be passed as an argument to the user road dll entry function.
- Defining the user road dll function name string to contain dll_name and function name
separated by double colons
(::).
<Reference_String id = "16" label = "CDTire1_user_road_dll_fname" string = "cdt_zbuser::ZB1100" />
The above snippet corresponds to an example model that will attempt to load a user dll called “cdt_zbuser.dll” and will attempt to call a function named “ZB1100”. If the loading and the calling part fails, for example due to unavailability of the dll or missing ZB1100 export symbol, the process will be halted.
SUBROUTINE ZB1100( X, Y, Z, MUE, IBINIT, INSTANCE, IUNIT, OUNIT, IERR )
INPUTS: X, Y ....... Road coordinates relative to P5 marker in [mm]
IBINIT ..... Initialization flag ( =0 init, <>0 eval )
INSTANCE ... CDTire instance number ( PAR(8) of GFORCE )
IUNIT ...... FORTRAN unit of road data file, already open
OUNIT ...... FORTRAN unit of road log file, already open
OUTPUTS: Z ......... Road surface height in [mm] at (X,Y) relative P5
MUE ....... Friction coefficient of road surface at (X,Y)
IERR ...... Error flag ( =0 success, <>0 stop calculation )
You can write the user road in FORTRAN or C/C++, however the calling function will always pass file units as integers, as opposed to user road file names as strings.
You are responsible for defining the necessary dependencies if the user road function calls mathematical or MotionSolve utility functions, in order to satisfy the linker. Finally, you will also have to ensure that the dll is exporting the entry point name (ZB1100 in this case). The exporting of a symbol from a dll can be accomplished in various ways not described here.