Damping_Firewall_MDD

Module – Damping Firewall

High-Level Description

This module regulates the damping command according to safety specifications.

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
AsstFirewallActive_Uls_f32CombinedDamping_MtrNm_f32
DampingCmd_MtrNm_f32
HwTorque_HwNm_f32
InertiaComp_MtrNm_f32
MtrVelCRF_MtrRadpS_f32
VehicleSpeed_Kph_f32
BaseAssistCmd_MtrNm_f32
WIRCmdAmpBlnd_MtrNm_f32
FreqDepDmpSrlComSvcDft_Cnt_lgc
VehicleLonAccel_KphpS_f32
Defeat_Damping_Svc_Cnt_lgc
MEC_Counter_Cnt_enum

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
DampFWVBICErrFiltSv_M_strLPF32KSV_Strn/an/aDAMPINGFIREWALL_START_SEC_VAR_CLEARED_UNSPECIFIED
DampFWActiveKSV_M_strLPF32KSV_Strn/an/aDAMPINGFIREWALL_START_SEC_VAR_CLEARED_UNSPECIFIED
DampFWUprBound_MtrNm_D_f32Single Precision FloatFULLFULLDAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DampFWLwrBound_MtrNm_D_f32Single Precision FloatFULLFULLDAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DampFWAddedDamp_MtrNm_D_f32Single Precision FloatFULLFULLDAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DampFWAddedDampAFW_MtrNm_D_f32Single Precision FloatFULLFULLDAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DampFWAddedDampDFW_MtrNm_D_f32Single Precision FloatFULLFULLDAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DampFWTbarVelFiltSv_M_strLPF32KSV_Strn/an/aDAMPINGFIREWALL_START_SEC_VAR_CLEARED_UNSPECIFIED
DampFWSatDamp_MtrNm_D_f32Single Precision Floating Point-1616DAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DampFWPrevTbarAng_HwDeg_M_s6p92^-9-4040DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
DampFWPrev1SclDrvVel_MtrRadpS_M_s14p12^-1-1000010000DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
DampFWPrev2SclDrvVel_MtrRadpS_M_s14p12^-1-1000010000DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
DampFWPrev1PreAttnComp_MtrNm_M_s9p62^-6NANADAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
DampFWPrev2PreAttnComp_MtrNm_M_s9p62^-6NANADAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
DampFWOverBound_Uls_D_lgcN/AFALSETRUEDAMPINGFIREWALL_START_SEC_VAR_CLEARED_BOOLEAN
ReducedPerfSV_Cnt_M_lgcN/AFALSETRUEDAMPINGFIREWALL_START_SEC_VAR_CLEARED_BOOLEAN
DampFWVBICOverThresh_Cnt_D_lgcN/AFALSETRUEDAMPINGFIREWALL_START_SEC_VAR_CLEARED_BOOLEAN
DampFWVBICReducedPerfSV_Cnt_M_lgcN/AFALSETRUEDAMPINGFIREWALL_START_SEC_VAR_CLEARED_BOOLEAN
DampFWDiverseVBIC_MtrNm_D_f32Single Precision Floating Point-8.88.8DAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DampFWDefltDamp_MtrNm_D_f32Single Precision Floating Point-8.88.8DAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DampFWDampActive_Uls_D_f32Single Precision Floating Point0.01.0DAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DampFWLimitedVBIC_MtrNm_D_f32Single Precision Floating Point-8.88.8DAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DampFWInrtCmpPNStatus_Cnt_M_lgcN/AFALSETRUEDAMPINGFIREWALL_START_SEC_VAR_CLEARED_BOOLEAN
DampFWPNCountStatus_Cnt_M_lgcN/AFALSETRUEDAMPINGFIREWALL_START_SEC_VAR_CLEARED_BOOLEAN
InrtCmpPNAccum_Cnt_M_u16UINT16065535DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
DampPNAcc_Cnt_M_u16UNIT16065535DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
PNAcc_Cnt_M_u161065535DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
DampFWOverBound_Cnt_D_lgcN/AFALSETRUEDAMPINGFIREWALL_START_SEC_VAR_CLEARED_BOOLEAN
LimitedDamp_MtrNm_D_f32Single Precision Floating Point-8.88.8DAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
DriverVel_MtrRadpSec_D_s24p72^-7-36024.5850436024.58504DAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
PrevDecelGain_Uls_M_u5p112^-11110DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
PrevRawDecelGain_Uls_M_u5p112^-11110DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
FiltFreq_RadpS_D_s10p52^-56.2831628.3185DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
ScaledDriverVel_MtrRadpS_D_s14p12^-1-1000010000DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
OutputAtten_Uls_D_u8p82^-801DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
RawDecelGain_Uls_D_u5p112^-11110DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
DecelGain_Uls_D_u5p112^-11110DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
ADDCoefCalc_MtrNmSpRad_D_u0p162^-1600.05DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
InertiaCompCalc_MtrNm_D_u9p72^-70228.8085DAMPINGFIREWALL_START_SEC_VAR_CLEARED_16
PreFiltVBICError_MtrNm_D_f320-8.88.8DAMPINGFIREWALL_START_SEC_VAR_CLEARED_32
PostFiltVBICError_MtrNm_D_f320-8.88.8DAMPINGFIREWALL_START_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)

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_DampFWInpLimitDamp_MtrNm_f32
k_DampFWVBICLPF_Hz_f32
k_DampFWFWActiveLPF_Hz_f32
k_DampFWTbarVelLPFKn_Hz_f32
k_DampFWMtrVelScale_Uls_f32
t_DampFWEstCompTblX_Kph_u9p7[]
t_DampFWTbarVelScaleY_Uls_u2p14[]
k_DampFWFilkKn_Hz_f32
t_DampFWEstCompHPF_Hz_u7p9[]
t_DampFWEstCompGain_MtrNmpMtrRadpS_u1p15[]
t_DampFWVehSpd_Kph_u9p7[]
t2_DampFWUprBoundX_MtrRadpS_s10p5[][]
t2_DampFWUprBoundY_MtrNm_s4p11[][]
t_DampFWAddDampX_MtrRadpS_u11p5[]
t_DampFWAddDampY_MtrNm_u5p11[]
t_DampFWDefltDampX_MtrRadpS_u11p5[]
t_DampFWDefltDampY_MtrNm_u5p11[]
k_DampFWErrThresh_MtrNm_f32
t_DampFWDampInrtCmpPNThesh_Cnt_u16[]
k_DampFWInCmpPStep_Cnt_u16
k_DampFWInCmpNStep_Cnt_u16
k_InrtCmp_TBarVelLPFKn_Hz_f32
k_DampFWPstep_Cnt_u16
k_DampFWNstep_Cnt_u16
t_DampFWPNstepThresh_Cnt_u16[]
k_InrtCmp_MtrInertia_KgmSq_f32
t_InrtCmp_ScaleFactorTblY_Uls_u9p7[]
t_InrtCmp_TBarVel_ScaleFactorTblY_Uls_u9p7[]
k_InrtCmp_MtrVel_ScaleFactor_Uls_f32
t_InrtCmp_VehSpdTblX_Kph_u15p1[]
t_FDD_ADDStaticTblY_MtrNmpRadpS_um1p17[]
t2_FDD_ADDRollingTblYM_MtrNmpRadpS_um1p17[][]
t_FDD_BlendTblY_Uls_u8p8[]
t_FDD_FreqTblYM_Hz_u12p4[]
t_FDD_AttenTblX_MtrRadpS_u12p4[]
t_FDD_AttenTblY_Uls_u8p8[]
t_WIRBlndTblX_MtrNm_u8p8[]
t_RIAstWIRBlndTblY_Uls_u2p14[]
t_DmpFiltKpWIRBlndY_Uls_u2p14[]
k_CmnTbarStiff_NmpDeg_f32
t_DmpADDCoefX_MtrNm_u4p12[10]
k_DmpGainOnThresh_KphpS_f32
k_DmpGainOffThresh_KphpS_f32
k_DmpDecelGain_Uls_f32
k_DmpDecelGainFSlew_UlspS_f32
t_DmpDecelGainSlewX_MtrRadpS_f32[]
t_DmpDecelGainSlewY_UlspS_f32[]
k_CmnSysKinRatio_MtrDegpHwDeg_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_ONEOVR2MS_SEC_U9P72^-7Sec500.0
D_2MS_SEC_U0P162^-16Sec0.002
D_2MS_SEC_U2P142^-14Sec0.002
D_PIOVR180_ULS_S4P112^-11Unitless0.0174532925199
D_ONE_ULS_U2P142^-14Unitless1.0
D_ONE_ULS_U8P82^-8Unitless1.0
D_ONE_ULS_U5P112^-11Unitless1.0
D_TWO_ULS_S2P132^-13Unitless2.0
D_2PI_ULS_U2P132^-13Unitless6.2831853071796
D_TBARVELFILTVAL_HWDEGPSEC_S15P162^-16HwDegpSec1024.0
D_TBARVELFILTVAL_HWDEGPSEC_S15P162^-16HwDegpSec2047.9375
D_TERMA_MTRRADPSEC_S20P112^-11MtrRadpS4095.875
D_EIGHT_ULS_U10P62^-6Unitless8.0
D_SCALEDDRIVERVEL_MTRRADPS_S17P142^-14MtrRadpS10000.0
D_COMPENSATIONLIMIT_MTRNM_S11P202^-20MtrNm8.8
D_INERTIACOMPCALCLIMIT_MTRNM_U15P12^-1MtrNm8.8
D_FOUR_ULS_S3P122^-12Unitless4.0
D_ADDCOEFCALCHILIMIT_MTRNMSPRAD_U1P152^-15MtrNmSpRad0.05
D_ADDCOEFCALCHILIMIT_MTRNMSPRAD_U3P132^-13MtrNmSpRad0.05
D_ABSSCALEDRIVERVELHI_MTRRADPS_U15P12^-1MtrNmSpRad4095. 5
VEHICLELONACCEL_MIN_F32Float32KphpS-64.0
VEHICLELONACCEL_MAX_F32Float32KphpS63.99804
D_ONE_ULS_U11P21Uint32Unitless1

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
D_2MS_SEC_F32
D_PIOVR180_ULS_F32
D_ZERO_ULS_F32
D_FALSE_CNT_LGC
D_2PI_ULS_F32
D_MTRTRQCMDHILMT_MTRNM_F32
D_ONE_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. LPF_KUpdate_f32_m

  2. LPF_OpUpdate_f32_m

  3. HPF_KUpdate_f32_m

  4. HPF_OpUpdate_f32_m

  5. FPM_FloatToFixed_m

  6. FPM_FixedToFloat_m

  7. IntplVarXY_u16_u16Xu16Y_Cnt

  8. BilinearXYM_s16_s16Xs16YM_Cnt

  9. TableSize_m

  10. Limit_m

  11. Sign_f32_m

  12. Rte_Call_NxtrDiagMgr_SetNTCStatus

  13. FPM_Fix_m

  14. Abs_s32_m

Data Hiding Functions

  1. None

Global Functions/Macros Defined by this Module

None

Local Functions/Macros Used by this MDD only

Local Function #1

Function NameDriverVelCalcTypeMinMax
Arguments PassedHwTroque_HwNm_T_f32float32-1010
CRFMotorVel_MtrRadpS_T_f32float32-11181118
VehicleSpeed_Kph_T_f32float320512
Return ValueScaledDriverVel_MtrRadpS_T_ s14p1float32-1000010000

Description

Calculate ADD Coefficient

Function NameADDCoefCalcTypeMinMax
Arguments PassedBaseAssistCmd_MtrNm_T_f32float32-8.88.8
WIRCmdAmpBlnd_MtrNm_T_f32float3208.8
VehicleSpeed_Kph_T_f32float320512
Return ValueADDCoefCalc_MtrNmSpRad_T_ u0p16uint160.0

0.05

Description

Calculate Filter Coefficients

Function NameFilterCoefCalcTypeMinMax
Arguments PassedADDCoefCalc_MtrNmSpRad_T_ u0p16uint160.00.05
WIRCmdAmpBlnd_MtrNm_T_f32float3208.8
VehicleSpeed_Kph_T_f32float320512
Return Valuenone

Description

FiltFreqLUBlnd_RadpS_T_s10p5 = FPM_Fix_m((FiltFreqLUBlnd_RadpS_T_s10p5 * D_2PI_ULS_U3P13), s13p18_T, s10p5_T)

Generate Command

Function NameGenFddIcCmdTypeMinMax
Arguments PassedScaledDriverVel_MtrRadpS_T_ s14p1sint16-1000010000
*FilterCoefStrb0_Uls_ s0p15sint16-0.789770.0
b1_Uls_ u0p16uint160.00.4
b2_Uls_ s0p15sint160.00.78937
a0_Uls_ u2p14uint160.55258853.9498924
a1_Uls_s4p11sint16-7.9996842-4.8417266
a2_Uls_u5p11uint164.050423410.6056849
Return ValueCompenstation_MtrNm_T_ s11p20Sint32-8.88.8

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
Rte_InitValue_AsstFirewallActive_Uls_f320
Rte_InitValue_CombinedDamping_MtrNm_f320
Rte_InitValue_DampingCmd_MtrNm_f320
Rte_InitValue_HwTorque_HwNm_f320
Rte_InitValue_InertiaComp_MtrNm_f320
Rte_InitValue_MtrVelCRF_MtrRadpS_f320
Rte_InitValue_VehicleSpeed_Kph_f320
Rte_InitValue_ BaseAssistCmd_MtrNm_f320
Rte_InitValue _WIRCmdAmpBlnd_MtrNm_f320
Rte_InitValue _ VehicleLonAccel_KphpS_f320
Rte_InitValue _ FreqDepDmpSrlComSvcDft_Cnt_lgcFALSE

Initialization Functions

Init: DampingFirewall_Init1

Design Rationale

None

Module Outputs

None

Module Internal

None

Initialize Filters

Periodic Functions

Per: DampingFirewall_Per1

Design Rationale

None

Program Flow Start

Rte_Call_ActivePull_Per1_CP0_CheckpointReached()

Store Module Inputs to Local copies

DefeatDampingSvc_Cnt_T_lgc = Rte_IRead_DampingFirewall_Per1_Defeat_Damping_Svc_Cnt_lgc()

MECCounter_Cnt_T_enum = Rte_IRead_DampingFirewall_Per1_MEC_Counter_Cnt_enum()

AsstFirewallActive_Uls_T_f32 = Rte_IRead_DampingFirewall_Per1_AsstFirewallActive_Uls_f32()

DampingCmd_MtrNm_T_f32 = Rte_IRead_DampingFirewall_Per1_DampingCmd_MtrNm_f32()

HwTorque_HwNm_T_f32 = Rte_IRead_DampingFirewall_Per1_HwTorque_HwNm_f32()

InertiaComp_MtrNm_T_f32 = Rte_IRead_DampingFirewall_Per1_InertiaComp_MtrNm_f32()

MtrVelCRF_MtrRadpS_T_f32 = Rte_IRead_DampingFirewall_Per1_MtrVelCRF_MtrRadpS_f32()

VehicleSpeed_Kph_T_f32 = Rte_IRead_DampingFirewall_Per1_VehicleSpeed_Kph_f32()

BaseAsstCmd_MtrNm_T_f32 = Rte_IRead_DampingFirewall_Per1_BaseAssistCmd_MtrNm_f32()

WIRCmdAmpBlnd_MtrNm_T_f32 = Rte_IRead_DampingFirewall_Per1_WIRCmdAmpBlnd_MtrNm_f32()

FDDDefSrvFlg_Cnt_T_lgc = Rte_IRead_DampingFirewall_Per1_FreqDepDmpSrlComSvcDft_Cnt_lgc()

VehicleLonAccel_KphpS_T_f32 = Rte_IRead_DampingFirewall_Per1_VehicleLonAccel_KphpS_f32()

VehicleSpeed_Kph_T_u9p7 = FPM_FloatToFixed_m(VehicleSpeed_Kph_T_f32, u9p7_T)

MtrVelCRF_MtrRadpS_T_s11p4 = FPM_FloatToFixed_m(MtrVelCRF_MtrRadpS_T_f32, s11p4_T)

AbsMtrVelCRF_MtrRadpS_T_u11p5 = FPM_FloatToFixed_m(Abs_f32_m(MtrVelCRF_MtrRadpS_T_f32), u11p5_T)

DampFWPstepNstep_Cnt_T_str.PStep = k_DampFWPstep_Cnt_u16

DampFWPstepNstep_Cnt_T_str.NStep = k_DampFWNstep_Cnt_u16

DampFWPstepNstep_Cnt_T_str.Threshold = t_DampFWPNstepThresh_Cnt_u16[1]

DampFWInrtCmpPstepNstep_Cnt_T_str.PStep = k_DampFWInCmpPStep_Cnt_u16

DampFWInrtCmpPstepNstep_Cnt_T_str.NStep = k_DampFWInCmpNStep_Cnt_u16

DampFWInrtCmpPstepNstep_Cnt_T_str.Threshold = t_DampFWDampInrtCmpPNThesh_Cnt_u16[1]

Damping Limiter – Interpolate and Filter Boundaries

PNCounter

Additional Damping

Store Local copy of outputs into Module Outputs

DampFWUprBound_MtrNm_D_f32 = UprBoundRaw_MtrNm_T_f32

DampFWLwrBound_MtrNm_D_f32 = LwrBoundRaw_MtrNm_T_f32

DampFWAddedDamp_MtrNm_D_f32 = AddedDamp_MtrNm_T_f32

DampFW_ddedDampAFW_MtrNm_D_f32 = AFWAddDamping_MtrNm_T_f32

DampFWAddedDampDFW_MtrNm_D_f32 = DFWAddDamping_MtrNm_T_f32

Rte_IWrite_DampingFirewall_Per1_CombinedDamping_MtrNm_f32(CombinedDamping_MtrNm_T_f32)

Program Flow End

Rte_Call_ActivePull_Per1_CP1_CheckpointReached()

Fault Recovery Functions

None

Shutdown Functions

None

Interrupt Functions

None

Serial Communication Functions

None

Execution Requirements

Execution Sequence of the Module

DampingFirewall_Per1 is called at a rate of 2 ms.

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
DampingFirewall_Init1On EventOn Init
DampingFirewall_Per12 msALL

Execution Requirements for Serial Communication Functions

Function NameSub-Module called by (Serial Comm Function Name)


Memory Map Definition Requirements

Sub Modules (Functions)

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

Name of Sub ModuleSoftware Segment
DampingFirewall_Init1RTE_START_SEC_AP_DAMPINGFIREWALL_APPL_CODE
DampingFirewall_Per1RTE_START_SEC_AP_DAMPINGFIREWALL_APPL_CODE

Local Functions

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

Name of Sub ModuleSoftware Segment
DriverVelCalcAP_DAMPINGFIREWALL_CODE
ADDCoefCalcAP_DAMPINGFIREWALL_CODE
FilterCoefCalcAP_DAMPINGFIREWALL_CODE
GenFddIcCmdAP_DAMPINGFIREWALL_CODE


Known Issues / Limitations With Design

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

Revision Control Log

Item #Rev #Change DescriptionDateAuthor Initials
11.0Initial Version27-Apr-12OT
22.0Fixed UTP Issues (naming consistency)08-May-12OT
33.0Fixed calibration naming conflict10-May-12OT
44.0Anomaly 3324 (using wrong value for boundary calc), fixed units in names18-May-12OT
55.0Updated to SF-35 v002 (anomaly 3325)22-May-12OT
66.0Updated to SF-35 v00329-May-12JW
77.0Updated to SF-35 v00431-May-12OT
88.0Updated to SF-35 V0057-Aug-12NRAR
99.0Updated to SF-35 V006. Removed input limit on inertia comp input for VBIC limiter. Added multiple display variables. Variable name changes for state variables for filter.28-Aug-12KJS
1010.0Added watchdog checkpoints16-Sept-12BWLs
1111.0Corrected software segments of internal variables19-Sep-12SSK
1212.0MDD updates based on UTP catch up23-oct-12NRAR
1313.0Anom 3957- VBICFaultmode is not set25-Oct-12NRAR
1414.0Updates as per the implementation of v007 of the FDD10-Feb-13VK
1513.1.1Updates for anomaly 440712-Apr-13SP
1613.1.2Updates for anomaly 480916-Apr-13LN
1714.0Anomaly 4913 fixes30-Apr-13SP
1814.1.1VBIC Error filter robustness change07-Jun-13JJW
1915.0Updated to SF-35 Ver 008, Generate Cmd calculations changed to fixed point15-May-13SP
2016.0Updated to SF-35 Ver 009, undone Generate Cmd fixed point changes and merged 14.1.1 changes18-Jun-13SP
Last modified October 12, 2025: Initial commit (0347a62)