Tasks Your TYRSUB Must Perform

All TYRSUBs must perform these tasks:
2. Call the ROAD subroutine to initialize the road model and to determine the road location, local road normal, and road coefficient of friction.
3. Calculate the tire forces and moments in units of Newtons and Newton-meters and return them to Adams Tire at the wheel center in the ISO-C axis system (see About Axis Systems and Sign Conventions).
4. Load results, such as slip angle, in the VARINF array for plotting.
5. Handle errors. For example, report when needed data is missing from the tire property file.
The TYDEX Working Group's Standard Tire Interface version 1.4 (STI v1.4), to which Adams Tire generally adheres, governs how and when your TYRSUB performs these tasks. According to STI v1.4, the TYRSUB performs specific tasks based on the value of the integer argument JOBFLG. The skeletal TYRSUB example, shown below, shows which tasks the TYRSUB performs based on JOBFLG. The arguments and their declarations are omitted here for brevity. For complete descriptions of the arguments, see TYRSUB Arguments (STI).

Skeletal TYRSUB Example

SUBROUTINE TYRxxx(....)
include 'ac_sti_jobflg.inc'
include 'abg_varptr.inc'
 
IF ( JOBFLG .EQ. INIT .OR.
. JOBFLG .EQ. RESET ) THEN
 
c Read Tire Property File
 
ENDIF
 
c Call The ROAD Subroutine
 
CALL ROAD(....)
 
IF ( JOBFLG .EQ. NORMAL .OR.
. JOBFLG .EQ. DIFF ) THEN
 
C Calculate The Tire Forces And Moments
 
c Tire Kinematics
 
c Tire Forces And Moments At Contact Patch
 
c Transfer Forces And Moments to Wheel Center in ISO C-Axis System
 
c Load Results In VARINF Array
 
ENDIF
 
c Handle Errors
 
RETURN
END 

Reading The Tire Property File

During the initialization process, Adams Tire calls your TYRSUB with JOBFLG = 2 (INIT ). When JOBFLG = INIT, your TYRSUB should open and read the tire property file. Your TYRSUB can statically store the data read from the property file or return it to Adams Tire in the TYPARR array. Adams Tire stores the contents of TYPARR in static memory between calls to your TYRSUB.
Adams Tire requires all tire property files to contain specific information in TeimOrbit format that it reads before calling your TYRSUB. For more information about these requirements see Defining and Reading Tire Property Files. Finally, Adams Tire provides utilities for reading property files employing TeimOrbit format. For information about these utilities and TeimOrbit format see Utilities for Reading Property Files.

Calling the ROAD Subroutine

Each time Adams Tire calls your TYRSUB, your TYRSUB must call the ROAD subroutine to ensure that the ROAD subroutine is initialized properly and can perform its work of calculating the tire-road contact point, the local road normal, and coefficient of friction.
Adams Tire passes a pointer to the ROAD subroutine to your TYRSUB. Therefore, your TYRSUB declares ROAD as an external and never knows the exact subroutine that is called. This allows your TYRSUB to work with different road models without having to alter your TYRSUB.

Calculating Tire Forces and Moments

When Adams Tire calls your TYRSUB with JOBFLG = NORMAL (0) or DIFF (5), your TYRSUB should calculate and return tire forces and moments. To calculate tire forces and moments, typically your TYRSUB will:
Call the ROAD subroutine.
Calculate tire kinematics.
Note:  
Adams Tire provides utilities for calculating slip angle, inclination angle, longitudinal slip, and other quantities in SAE coordinates. See Utilities for Reading Property Files.
Calculate tire forces and moments at the tire contact patch.
Transfer the forces and moments from the contact patch to the wheel center in ISO-C axis system for return to Adams Tire.

Loading Results For Plotting

When Adams Tire calls your TYRSUB with JOBFLG = NORMAL(0) or DIFF (5), your TYRSUB should load results in the VARINF array. The specific results and their location in the VARINF array are defined in include file:
install_dir/atire/usrsubs/abg_varptr.inc.
For example, abg_varptr.inc defines integer parameters giving the location of the lateral and longitudinal slips that you use, such as:
VARINF( slipi_ptr ) = alpha
VARINF( slipx_ptr ) = kappa
Where alpha and kappa are the lateral and longitudinal slip, respectively, calculated by your TYRSUB.
Note:  
Adams Car use the effective rolling radius returned in the VARINF array to calculate initial wheel rotational velocities.

Handling Errors

According to TYDEX STI v1.4, a TYRSUB should not stop the execution of a simulation because of a fatal error. Instead, it should use the IERR argument to return a fatal error and use the TYRMOD argument to return an error message. The simulation code can then cleanly terminate execution. In Adams Tire, however, you can call the Adams Solver utility, ERRMES, from your TYRSUB to output a message to your screen and message file to terminate the Adams execution.