Damping_MDD

Module --

High-Level Description

Damping function computes the Total damping Torque. The total damping command is calculated from two terms, Active Damping Term and the HPS Damping Command.

Figures

Component Diagram


Variable Data Dictionary

For details on module input / output variable, refer to the Data Dictionary for the application. Input / output variable names are listed here for reference.

Module InputsModule Outputs
MotorVelCRF_MtrRadpS_f32DampingCmd_MtrNm_f32
HwTorque_HwNm_f32
VehicleSpeed_Kph_f32
DampingDDFactor_Uls_f32
AssistMechTempEst_DegC_f32
AssistCmp_MtrNm_f32
DefeatDampingSvc_Cnt_lgc

Module Internal Variables

This section identifies the name, range and resolutions for module specific data created by this module. If there are no range restrictions on the variable, the term “FULL” is placed into the table for legal range.

Variable NameResolution

Legal Range

(min)

Legal Range

(max)

Software Segment
QDDHwTorqueLPFKSV_Cnt_M_strLPF32KSV_StrN/AN/ADAMPING_START_SEC_VAR_CLEARED_UNSPECIFIED
QDDMtrVelLPFKSV_Cnt_M_strLPF32KSV_StrN/AN/ADAMPING_START_SEC_VAR_CLEARED_UNSPECIFIED
QDDStFilt_Cnt_M_strLPF32KSV_StrN/AN/ADAMPING_START_SEC_VAR_CLEARED_UNSPECIFIED
MtrVelLPFKSV_Cnt_M_strLPF32KSV_StrN/AN/ADAMPING_START_SEC_VAR_CLEARED_UNSPECIFIED
QDDHwTrqBkLash_HwNm_M_f32Single Precision Float-1010DAMPING_START_SEC_VAR_CLEARED_32
QDDMtrVelBckLash_MtrRadpS_M_f32Single Precision Float-11181118DAMPING_START_SEC_VAR_CLEARED_32
QDDStFilt_Uls_D_f32Single Precision FloatFULLFULLDAMPING_START_SEC_VAR_CLEARED_32
DampTrqScale_Uls_D_u1p152^-15FULLFULLDAMPING_STOP_SEC_VAR_CLEARED _16
DampTempScale_Uls_D_u4p122^-12FULLFULLDAMPING_STOP_SEC_VAR_CLEARED _16
DampMtrVelDmp_MtrNm_D_f32Single Precision FloatFULLFULLDAMPING_STOP_SEC_VAR_CLEARED _32
DampHPSDmp_MtrNm_D_f32Single Precision FloatFULLFULLDAMPING_STOP_SEC_VAR_CLEARED _32
DampHPSc1_Uls_D_f32Single Precision FloatFULLFULLDAMPING_STOP_SEC_VAR_CLEARED _32
DampHPSc2_Uls_D_f32Single Precision FloatFULLFULLDAMPING_STOP_SEC_VAR_CLEARED _32
DampHPSc3_Uls_D_f32Single Precision FloatFULLFULLDAMPING_STOP_SEC_VAR_CLEARED _32
DampHPSc4_Uls_D_f32Single Precision FloatFULLFULLDAMPING_STOP_SEC_VAR_CLEARED _32

User defined typedef definition/declaration

This section documents any user types uniquely used for the module.

Typedef NameElement NameUser Defined Type

Legal Range

(min)

Legal Range

(max)

None

Constant Data Dictionary

Calibration Constants

This section lists the calibrations used by the module. For details on calibration constants, refer to the Data Dictionary for the application.

Constant Name
k_MtrVelDampLPFKn_Hz_f32
t_HwTrqDmpTblX_HwNm_u8p8 []
t_VSpdDmpTblBS_Kph_u9p7 []
t_HwTrqDmpTblY_Uls_u1p15[ ]
t2_MtrVelDmpTblX_MtrRadpS_u12p4[ ] [ ]
t2_MtrVelDmpTblY_MtrNm_u5p11[ ] [ ]
t_TempScaleX_DegC_s8p7[ ]
t_TempScaleY_Uls_u4p12[ ]
t_HPSscaleC1Y_Uls_u4p12[ ]
t_HPSscaleC2Y_Uls_u4p12[ ]
t_HPSscaleC3Y_Uls_u4p12[ ]
t_HPSscaleC4Y_Uls_u4p12[ ]
t_HPSAsstLimY_MtrNm_u4p12[ ]
k_HPSOutLimit_MtrNm_f32
k_Quad13DmpMult_Uls_f32
k_Quad24DmpMult_Uls_f32
k_QddHwTrqDampKn_Hz_f32
k_QddMtrVelDampKn_Hz_f32
k_QDDHwTrqBckLash_HwNm_f32
k_QDDMtrVelBckLash_MtrRadpS_f32
k_QddSfLFPKn_Hz_f32
k_HPSbaseC1_MtrNmpMtrRadpS_f32
k_HPSbaseC2_MtrNmpMtrRadpS_f32
k_HPSbaseC3_MtrNmpMtrRadpS_f32
k_HPSbaseC4_MtrNmpMtrRadpS_f32

Program(fixed) Constants

Embedded Constants

All embedded constants whose values are provided in Eng units will be evaluated to the equivalent counts by using the FPM_InitFixedPoint_m() macro within the #define statement.

Local

Constant NameResolutionUnitsValue
D_DAMPINGCMDMIN_MTRNM_F32Single Precision Floating PointMtrNm-8.8
D_DAMPINGCMDMAX_MTRNM_F32Single Precision Floating PointMtrNm8.8

Global

This section lists the global constants used by the module. For details on global constants, refer to the Data Dictionary for the application.

Constant Name
BC_DAMPING_FAULTINJECTIONPOINT
STD_ON
FLTINJ_DAMPING
D_2MS_SEC_F32
D_ZERO_ULS_F32

Module specific Lookup Tables Constants

Constant NameResolutionValueSoftware Segment
None


Functions/Macros used by the Sub-Modules

Library Functions / Macros

The library and functions / Macros that are called by the various sub modules are identified below,

  1. FPM_FixedToFloat_m

  2. FPM_FloatToFixed_m

  3. Limit_m

  4. Abs_f32_m

  5. Abs_s16_m

  6. Sign_f32_m

  7. IntplVarXY_u16_u16Xu16Y_Cnt

  8. IntplVarXY_u16_s16Xu16Y_Cnt

  9. TableSize_m

  10. LPF_KUpdate_f32_m

  11. LPF_OpUpdate_f32_m

Data Hiding Functions

  1. <None>

Global Functions/Macros Defined by this Module

None

Local Functions/Macros Used by this MDD only

MtrVelDepDampScale

Function NameMtrVelDepDampScaleTypeMinMaxUTP Tol.
Arguments PassedMotorVelCRF_MtrRadpS_T_f32Float32-11181118
VehicleSpeed_Kph_T_f32Float320512
HwTorque_HwNm_T_f32Float32-1010
TempScale_Uls_T_f32Float32010
Return ValueActiveDamping_MtrNm_T_f32Float32-8.88.84.89E-4

Description

HPSDampingFn

Function NameHPSDampingFnTypeMinMaxUTP Tol.
Arguments PassedMotorVelCRF_MtrRadpS_T_f32Float32-11181118
TempScale_Uls_T_f32Float32010
VehicleSpeed_Kph_T_f32Float320512
BaseAssistStCmp_MtrNm_T_f32Float32-8.88.8
Return ValueDampingForce_MtrNm_T_f32Float32-8.88.84.89 e-4

Description

Software Module Implementation

Runtime Environment (RTE) Initial Values

This section lists the initial values of data written by this module but controlled by the RTE. After RTE initialization, the data in this table will contain these values.

DataValue
MotorVelCRF_MtrRadpS_f320
HwTorque_HwNm_f320
VehicleSpeed_Kph_f320
DampingCmd_MtrNm_f320
AssistMechTempEst_DegC_f320
BaseAssistStCmp_MtrNm_f320
DampingDDFactor_Uls_f321
DefeatDampingSvc_Cnt_lgcFALSE

Initialization Functions

Init: _Init1

Design Rationale

None

Module Outputs

None

Module Internal

LPF_KUpdate_f32_m(k_QddHwTrqDampKn_Hz_f32, D_2MS_SEC_F32, &QDDHwTorqueLPFKSV_Cnt_M_str)

LPF_KUpdate_f32_m(k_QddMtrVelDampKn_Hz_f32, D_2MS_SEC_F32, &QDDMtrVelLPFKSV_Cnt_M_str)

LPF_KUpdate_f32_m(k_QddSfLFPKn_Hz_f32, D_2MS_SEC_F32, &QDDStFilt_Cnt_M_str)

LPF_KUpdate_f32_m(k_MtrVelDampLPFKn_Hz_f32, D_2MS_SEC_F32, &MtrVelLPFKSV_Cnt_M_str)

Periodic Functions

Per: _Per1

Design Rationale

None

Program Flow Start

Rte_Call_Damping_Per1_CP0_CheckpointReached()

Store Module Inputs to Local copies

AssistMechTempEst_DegC_T_f32 = Rte_IRead_Damping_Per1_AssistMechTempEst_DegC_f32()

BaseAssistStCmp_MtrNm_T_f32 = Rte_IRead_Damping_Per1_AssistCmd_MtrNm_f32()

DampingDDFactor_Uls_T_f32 = Rte_IRead_Damping_Per1_DampingDDFactor_Uls_f32()

DefeatDampingSvc_Cnt_T_lgc = Rte_Iread_Damping_Per1_DefeatDampingSvc_Cnt_lgc()

HwTorque_HwNm_T_f32 = Rte_Iread_Damping_Per1_HwTorque_HwNm_f32()

MotorVelCRF_MtrRadpS_T_f32 = Rte_Iread_Damping_Per1_MotorVelCRF_MtrRadpS_f32()

VehicleSpeed_Kph_T_f32 = Rte_Iread_Damping_Per1_VehicleSpeed_Kph_f32()

Calculate Damping Command

Store Local copy of outputs into Module Outputs

Rte_Iwrite_Damping_Per1_DampingCmd_MtrNm_f32(DampingCmd_MtrNm_T_f32)

Program Flow End

Rte_Call_Damping_Per1_CP1_CheckpointReached()


Fault Recovery Functions

None

Shutdown Functions

None

Interrupt Functions

None

Serial Communication Functions

None

Execution Requirements

Execution Rates for sub-modules called by the Scheduler

This table serves as reference for the Scheduler design

Function NameCalling FrequencySystem State(s) in which the function is called
Damping_Init1On EventOn Init
Damping_Per12msALL STATES

Execution Requirements for Serial Communication Functions

Function NameSub-Module called by (Serial Comm Function Name)
<None>


Memory Map Definition Requirements

Sub Modules (Functions)

This table identifies the software segments for functions identified in this module.

Name of Sub ModuleSoftware Segment
Damping_Init1RTE_START_SEC_AP_DAMPING_APPL_CODE
Damping_Per1RTE_START_SEC_AP_DAMPING_APPL_CODE

Local Functions

This table identifies the software segments for local functions identified in this module.

Name of Sub ModuleSoftware Segment
MtrVelDepDampScale
HPSDampingFn


Known Issues / Limitations With Design

  1. INLINE functions in GlobalMacro.h are not unit tested


Revision Control Log

Item #Rev #Change DescriptionDateAuthor Initials
11.0Initial MDD20May11NRAR
22Included scaling from driving dynamics.02-Jun-11YY
33Added Rolling Assist Damping and Filter Kp Blending Interface14-Jul-11LWW
44Made changes to match FDD SF#03 001a18-Nov-11VK
55Changes done as per FaultInjectionTechnique1-May-12NRAR
66Software segment for internal variable used in the module addd19-Sep-12SSK
77Implemented SF-03 v00625-Oct-12OT
99Implemented SF-03 v00721-Feb-13Selva
99.1.1

Changed the range of

MotorVelCRF_MtrRadpS_T_f32 from +/- 1100 to +/-1118

02-May-13Selva
Last modified October 12, 2025: Initial commit (0347a62)