Wheel_Imbalance_Rejection_MDD

Module --

High-Level Description

The Wheel Imbalance Rejection Function corrects Handwheel vibration or oscillation issues by canceling out the appropriate HW torque disturbances detected by the steering system. This module is responsible for calculating the cancellation torque command to apply to the motor.

Figures

123.tif

Diagram – Function Data Sharing

This diagram shows all data that is shared between functions within the module.

Diagram – Function (Name)

This diagram describes the functional characteristics and data flow of a given function.


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.

(Note: Full variable names required in table.)

(Note: All global variables including End Of Line data used should be shown here)

Module InputsModule Outputs
HwTrq_HwNm_f32WhlImbRejCmd_MtrNm_f32
QualWhlFreqL_Hz_f32WIRCmdAmpBlnd_MtrNm_f32
WhlFreqQualified_Cnt_lgc
QualWhlFreqR_Hz_f32
VehSpd_Kph_f32
WIRMfgEnable_Cnt_lgc
DiagStsWIRDisable_Cnt_lgc
VehSpdValid_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
MaxMagFlt_Cnt_M_StrWIRDiagInfo_StrSee DataType DefWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
DCTrendFlt_Cnt_M_StrWIRDiagInfo_StrSee DataType DefWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
FreqDiagFlt_Cnt_M_StrWIRDiagInfo_StrSee DataType DefWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
CorrFlt_Cnt_M_StrWIRDiagInfo_StrSee DataType DefWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
QualFlt_Cnt_M_StrWIRDiagInfo_StrSee DataType DefWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
MaxPersFlt_Cnt_M_StrWIRDiagInfo_StrSee DataType DefWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
WIRCmdMag_MtrNm_M_f32Single Precision Float0127 * π/2WHLIMBREJ_START_SEC_VAR_CLEARED_32
xRefDelayR_RadpSec_M_f32[41]Single Precision Float-44WHLIMBREJ_START_SEC_VAR_CLEARED_32
xRefDelayL_RadpSec_M_f32[41]Single Precision Float-44WHLIMBREJ_START_SEC_VAR_CLEARED_32
xRefSVR_Uls_M_f32[41]Single Precision Float-20482048WHLIMBREJ_START_SEC_VAR_CLEARED_32
xRefSVL_Uls_M_f32[41]Single Precision Float-20482048WHLIMBREJ_START_SEC_VAR_CLEARED_32
WhlSpdRFiltSV_RadpSec_M_StrLPF32KSV_StrN/AN/AWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
WhlSpdRFiltSV_RadpSec_M_Str.K_Uls_f32Float3200.715390457
WhlSpdRFiltSV_RadpSec_M_Str.SV_Uls_f32Float3204
WhlSpdLFiltSV_RadpSec_M_StrLPF32KSV_StrN/AN/AWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
WhlSpdLFiltSV_RadpSec_M_Str.K_Uls_f32Float3200.715390457
WhlSpdLFiltSV_RadpSec_M_Str.SV_Uls_f32Float3204
WhlFreqRFiltSV_Hz_M_StrLPF32KSV_StrN/AN/AWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
WhlFreqRFiltSV_Hz_M_Str.K_Uls_f32Float3200.715390457
WhlFreqRFiltSV_Hz_M_Str.SV_Uls_f32Float32040
WhlFreqLFiltSV_Hz_M_StrLPF32KSV_StrN/AN/AWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
WhlFreqLFiltSV_Hz_M_Str.K_Uls_f32Float3200.715390457
WhlFreqLFiltSV_Hz_M_Str.SV_Uls_f32Float32040
WIREnTime_mS_M_u32p01FULLFULLWHLIMBREJ_START_SEC_VAR_CLEARED_32
DistMagEnabled_Cnt_M_lgcbooleanFALSETRUEWHLIMBREJ_START_SEC_VAR_CLEARED_BOOLEAN
PrevCalcEnable_Uls_M_f32Single Precision Float0.01.0WHLIMBREJ_START_SEC_VAR_CLEARED_32
PrevEnable_Uls_M_f32Single Precision Float0.01.0WHLIMBREJ_START_SEC_VAR_CLEARED_32
PrevHwTrq_HwNm_M_f32Single Precision Float-10.010.0WHLIMBREJ_START_SEC_VAR_CLEARED_32
WhlImbFltStatus_Cnt_M_b161FULLFULLWHLIMBREJ_START_SEC_VAR_CLEARED_16
UGRRDelay1_Uls_M_f32Single Precision Float-256256WHLIMBREJ_START_SEC_VAR_CLEARED_32
UGRLDelay1_Uls_M_f32Single Precision Float-256256WHLIMBREJ_START_SEC_VAR_CLEARED_32
UGRRDelay2_Uls_M_f32Single Precision Float-256256WHLIMBREJ_START_SEC_VAR_CLEARED_32
UGRLDelay2_Uls_M_f32Single Precision Float-256256WHLIMBREJ_START_SEC_VAR_CLEARED_32
Stage1SV1_Uls_M_f32Single Precision Float-6553665536WHLIMBREJ_START_SEC_VAR_CLEARED_32
Stage1SV2_Uls_M_f32Single Precision Float-6553665536WHLIMBREJ_START_SEC_VAR_CLEARED_32
Stage2SV1_Uls_M_f32Single Precision Float-6553665536WHLIMBREJ_START_SEC_VAR_CLEARED_32
Stage2SV2_Uls_M_f32Single Precision Float-6553665536WHLIMBREJ_START_SEC_VAR_CLEARED_32
MaxMagErrorAcc_Cnt_M_u161FULLFULLWHLIMBREJ_START_SEC_VAR_CLEARED_16
CmdMagFiltSV1_MtrNm_M_StrLPF32KSV_StrN/AN/AWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
CmdMagFiltSV1_MtrNm_M_Str.K_Uls_f32Float3200.715390457
CmdMagFiltSV1_MtrNm_M_Str.SV_Uls_f32Float320127
CmdMagFiltSV2_MtrNm_M_StrLPF32KSV_StrN/AN/AWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
CmdMagFiltSV2_MtrNm_M_Str.K_Uls_f32Float3200.715390457
CmdMagFiltSV2_MtrNm_M_Str.SV_Uls_f32Float320127
TrendSV_MtrNm_M_StrLPF32KSV_StrN/AN/AWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
TrendSV_MtrNm_M_Str.K_Uls_f32Float3200.715390457
TrendSV_MtrNm_M_Str.SV_Uls_f32Float32-127127
TrndThrStartTime_mS_M_u32p01FULLFULLWHLIMBREJ_START_SEC_VAR_CLEARED_32
WhlSpdCorrFltTime_mS_M_u32p01FULLFULLWHLIMBREJ_START_SEC_VAR_CLEARED_32
RtLmtCurrMagR_Uls_M_f32Single Precision Float04 * π/2WHLIMBREJ_START_SEC_VAR_CLEARED_32
RtLmtCurrMagL_Uls_M_f32Single Precision Float04 * π/2WHLIMBREJ_START_SEC_VAR_CLEARED_32
EnabledComp_Uls_M_f32Single Precision Float0.01.0WHLIMBREJ_START_SEC_VAR_CLEARED_32
FreqEstAvg_Hz_M_f32Single Precision Float040WHLIMBREJ_START_SEC_VAR_CLEARED_32
FiltFreqDiffSV_MtrNm_M_StrLPF32KSV_StrN/AN/AWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
FiltFreqDiffSV_MtrNm_M_Str.K_Uls_f32Float3200.715390457
FiltFreqDiffSV_MtrNm_M_Str.SV_Uls_f32Float320254
FreqDiagUGRDelay1_Uls_M_f32Single Precision Float-256256WHLIMBREJ_START_SEC_VAR_CLEARED_32
FreqDiagUGRDelay2_Uls_M_f32Single Precision Float-256256WHLIMBREJ_START_SEC_VAR_CLEARED_32
FrqDiagStartTime_mS_M_u32p01FULLFULLWHLIMBREJ_START_SEC_VAR_CLEARED_32
BlndCmdMagFiltSV1_MtrNm_M_StrLPF32KSV_StrN/AN/AWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
BlndCmdMagFiltSV1_MtrNm_M_Str.K_uls_f32Float3200.715390457
BlndCmdMagFiltSV1_MtrNm_M_Str.SV_Uls_f32Float3208
BlndCmdMagFiltSV2_MtrNm_M_StrLPF32KSV_StrN/AN/AWHLIMBREJ_START_SEC_VAR_CLEARED_UNSPECIFIED
BlndCmdMagFiltSV2_MtrNm_M_Str.K_Uls_f32Float3200.715390457
BlndCmdMagFiltSV2_MtrNm_M_Str.SV_Uls_f32Float3208
LMSOutR_Uls_D_f32Single Precision Float-245760245760WHLIMBREJ_START_SEC_VAR_CLEARED_32
LMSOutL_Uls_D_f32Single Precision Float-245760245760WHLIMBREJ_START_SEC_VAR_CLEARED_32
FiltWhlSpdR_RadpSec_D_f32Single Precision Float-44WHLIMBREJ_START_SEC_VAR_CLEARED_32
FiltWhlSpdL_RadpSec_D_f32Single Precision Float-44WHLIMBREJ_START_SEC_VAR_CLEARED_32
FiltWhlSpdRScld_RadpSec_D_f32Single Precision Float-44WHLIMBREJ_START_SEC_VAR_CLEARED_32
FiltWhlSpdLScld_RadpSec_D_f32Single Precision Float-44WHLIMBREJ_START_SEC_VAR_CLEARED_32
CurrMagR_Uls_D_f32Single Precision Float04 * π/2WHLIMBREJ_START_SEC_VAR_CLEARED_32
CurrMagL_Uls_D_f32Single Precision Float04 * π/2WHLIMBREJ_START_SEC_VAR_CLEARED_32
CancelTrqOutput_MtrNm_D_f32Single Precision Float-127127WHLIMBREJ_START_SEC_VAR_CLEARED_32
WhlSpdCorrPct_Pct_D_f32Single Precision Float0100WHLIMBREJ_START_SEC_VAR_CLEARED_32
ScaleL_Uls_D_f32Single Precision Float01WHLIMBREJ_START_SEC_VAR_CLEARED_32
ScaleR_Uls_D_f32Single Precision Float01WHLIMBREJ_START_SEC_VAR_CLEARED_32
PeakRightTyH_Uls_M_f32Single Precision Float04 * π/2WHLIMBREJ_START_SEC_VAR_SAVED_ZONEH_32
PeakLeftTyH_Uls_M_f32Single Precision Float04 * π/2WHLIMBREJ_START_SEC_VAR_SAVED_ZONEH_32
WIRCmpActTyH_Cnt_M_u32[3]1FULLFULLWHLIMBREJ_START_SEC_VAR_SAVED_ZONEH_32
WIRMaxCompTyH_Pct_M_f32Single Precision Float0100WHLIMBREJ_START_SEC_VAR_SAVED_ZONEH_32
TrndThr2StartTime_mS_M_u32p0UINT32FULLFULLWHLIMBREJ_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)

WIRDiagInfo_StrStartTime_mS_u32p0uint32FULLFULL
Failed_Cnt_lgcbooleanFALSETRUE
ResetFlt_Cnt_lgcbooleanFALSETRUE
MaxRecFailed_Cnt_lgcbooleanFALSETRUE
RecoveryCntr_Cnt_u8uint8FULLFULL

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_AdaptiveMu_Uls_f32
k_DistMagLPFKn_Hz_f32
k_EnSlewPerLoop_Uls_f32
k_MagEstDeltaScale_Uls_f32
k_MagEstDisable_Uls_f32
k_MagEstEnable_Uls_f32
k_MagEstFreq_Hz_f32
k_MagEstFreqDelta_Hz_f32
k_MagEstLeak_Uls_f32
k_NumberOfTaps_Cnt_u16
k_FreqDiagEnable_Cnt_lgc
k_ScaleCancel_Uls_f32
k_UGRPoleMag_Uls_f32
k_WhlImbCmdMax_MtrNm_f32
k_WhlSpdCorrThresh_Pct_f32
k_WhlSpdCorrTime_mS_u16p0
k_WhlSpdLPFKn_Hz_f32
k_WIRRampDownTime_mS_u16p0
t_FreqScaleTblX_Hz_u7p9[]
t_FreqScaleTblY_Uls_u2p14[]
t_PhaseAdjustX_Hz_u7p9[]
t_PhaseAdjustY_Deg_s8p7[]
k_CmdMagLPFKn1_Hz_f32
k_CmdMagLPFKn2_Hz_f32
k_MaxMagFltRecDly_Min_f32
k_MaxMagFltRecLim_Cnt_u8
k_CorrFltRecDly_Min_f32
k_CorrFltRecLim_Cnt_u8
k_DCTrendFltRecDly_Min_f32
k_DCTrendFltRecLim_Cnt_u8
k_FreqDiagFltRecDly_Min_f32
k_FreqDiagFltRecLim_Cnt_u8
k_WIRMaxDur_Cnt_u16
k_WIRDCTrendLPFKn_Hz_f32
k_WIRDCTrendTh_MtrNm_f32
k_WIRDCTrendTime_Sec_f32
k_WIRMaxMag_MtrNm_f32
k_WIRMaxMagDiag_Cnt_Str
k_AutoScaleEnable_Cnt_lgc
k_AutoScaleTarget_RadpSec_f32
k_CurrMagSlewPerLoop_Uls_f32
k_FreqDiagLPFKn_Hz_f32
k_FreqDiagThresh_MtrNm_f32
k_FreqDiagTimeout_mS_u16p0
k_FreqDiagUGRPoleMag_Uls_f32
k_FreqDiagWIRAmpThresh_MtrNm_f32
k_BlndCmdMagLPFKn1_Hz_f32
k_BlndCmdMagLPFKn2_Hz_f32
k_WIRVehSpdEnable_Kph_f32
k_WIRDCTrendTime2_Sec_f32
k_WIRDCTrendTh2_MtrNm_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_WIRQUALFLT_CNT_B161Counts0x0001
D_WIRCORRFLT_CNT_B161Counts0x0002
D_WIRCORRFLTREC_CNT_B161Counts0x0004
D_WIRDCTRENDFLT_CNT_B161Counts0x0040
D_WIRDCTRENDFLTREC_CNT_B161Counts0x0080
D_WIRFREQDIAGFLT_CNT_B161Counts0x0100
D_WIRFREQDIAGFLTREC_CNT_B161Counts0x0200
D_WIRMAXMAGFLT_CNT_B161Counts0x0008
D_WIRMAXPERSFLT_CNT_B161Counts0x0020
D_WIRMAXMAGFLTREC_CNT_B161Counts0x0010
D_PIDIVTWO_ULS_F32Single precision floatUnitless1.57079632679
D_PITIMESSAMPLETIME_ULS_F32Single precision floatUnitless0.006283185307
D_SECPERLOOP_SEC_F32Single precision floatSeconds0.002
D_MSPERMIN_ULS_F32Single precision floatUnitless60000.0
D_STOREDMINSPERCOUNT_ULS_F32Single precision floatUnitless0.000133333333333
D_RADPERDEGDIVTWO_ULS_F32Single precision floatUnitless0.00872664626
D_CALMINSPERCOUNT_ULS_F32Single precision floatUnitless10.0
D_DURATIONDISABLE_CNT_U161Counts18500
D_FILTWHLSPDMAX_RADPSEC_F32Single precision floatRad/Sec4.0
D_PHASEADJMAX_ULS_F32Single precision floatUnitless127.0
D_CNCLTRQMAX_MTRNM_F32Single precision floatMtrNm127.0
D_UGRSVMAX_ULS_F32Single precision floatUnitless256.0
D_LMSFILTSVMAX_ULS_F32Single precision floatUnitless2048.0
D_LEADLAGFILTSVMAX_ULS_F32Single precision floatUnitless65536.0
D_WIRCMDMAX_MTRNM_F32Single precision floatMtrNm8.0
D_ONEHUNDRED_PCT_F32Single precision floatPercent100.0
D_ONEHALF_ULS_F32Single precision floatUnitless0.5

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_ZERO_ULS_F32
D_2PI_ULS_F32
D_2MS_SEC_F32
FLT_EPSILON

Module specific Lookup Tables Constants

(This is for lookup tables (arrays) with fixed values, same name as other tables)

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. TableSize_m

  2. FPM_FloatToFixed

  3. FPM_FixedToFloat

  4. LPF_OpUpdate_u16InFixKTrunc_m

  5. LPF_SvUpdate_u16InFixKTrunc_m

  6. LPF_SvUpdate_s16InFixKTrunc_m

  7. Abs_s16_m

  8. Abs_f32_m

  9. GetSystemTime_mS_u32

  10. DtrmnElapsedTime_mS_u32

Data Hiding Functions

  1. Rte_Call_NxtrDiagMgr_SetNTCStatus

Global Functions/Macros Defined by this Module

Global Function #1

Function NameTypeMinMaxUTP Tol.
Arguments Passed
Return Value

Description

(Place flowchart/design for local function)

Local Functions/Macros Used by this MDD only

Wheel Speed In Range Check

Function NameWhlSpdInRangeTypeMinMaxUTP Tol.
Arguments PassedWhlSpd_Hz_T_f32float32040
Return ValueInRange_Cnt_T_lgcbooleanFALSETRUE0

Description

Wheel Speed Correlation Check

Function NameWhlSpdCorrelationCheckTypeMinMaxUTP Tol.
Arguments PassedWhlSpdLeft_Hz_T_f32float32040
WhlSpdRight_Hz_T_f32float32040
Return ValueNone

Description

Wheel Imbalance Rejection Command

Function NameWIRActRejCmdTypeMinMaxUTP Tol.
Arguments PassedHwTrq_HwNm_T_f32float32-1010
WhlSpdLeft_Hz_T_f32float32040
WhlSpdRight_Hz_T_f32float32040
VehSpd_Kph_T_f32float320512
VehSpdValid_Cnt_T_lgcbooleanFALSETRUE
WIRDisable_Cnt_T_lgcbooleanFALSETRUE
WIRMfgEnable_Cnt_T_lgcbooleanFALSETRUE
Return ValueCancelTrqOutput_MtrNm_T_f32float32-1271270.0084

Description

Unity Gain Resonator Filter

Function NameUGRFilter_f32TypeMinMaxUTP Tol.
Arguments PassedUGRInput_Uls_T_f32float32040 * 2π
WhlFreqEst_Hz_T_f32float32040
UGRPoleMag_Uls_T_f32float3200.999984741210937
UGRDelay1_Ptr_T_f32pointer to float32-2562560.0084
UGRDelay2_Ptr_T_f32pointer to float32-2562560.0084
Return ValueFilterOut_Uls_T_f32float32-5125120.0084

Description

Calculate Minus A1 Term

Function NameCalcMinusA1TermTypeMinMaxUTP Tol.
Arguments PassedPoleMag_Uls_T_f32float3200.9999847412109375
WhlFreqEst_Hz_T_f32float32040
Return ValueMinusA1Term_Uls_T_f32float3201.9999694824218750.0000610

Description

Resonator Filter

Function NameResFilterTypeMinMaxUTP Tol.
Arguments PassedResFilterIn_Uls_T_f32float32040 * 2π
ResFiltTermMinA1_Uls_T_f32float3201.999969482421875
ResFiltTermA2_Uls_T_f32float3200.999969482421875
UGRDelay1_Ptr_T_f32pointer to float32-2562560.0000153
UGRDelay2_Ptr_T_f32pointer to float32-2562560.0000153
Return ValueFiltOut_Uls_T_f32float32-5125120.0084

Description

Determine Enabled Amount

Function NameDetermineEnabledAmountTypeMinMaxUTP Tol.
Arguments PassedFreqEstAvg_Hz_T_f32float32040
FiltWhlSpdR_RadpSec_T_f32float32-44
FiltWhlSpdL_RadpSec_T_f32float32-44
VehSpd_Kph_T_f32float320512
VehSpdValid_Cnt_T_lgcbooleanFALSETRUE
WIRDisable_Cnt_T_lgcbooleanFALSETRUE
WIRMfgEnable_Cnt_T_lgcbooleanFALSETRUE
Return ValueEnable_Uls_T_f32float320.01.00.0000610

Design Rationale

DCTrendRecFlt, FreqRecFlt,CorRecFlt of FDD sec 5.6.2 are not checked as these faults will not set with out Setting Non recovery flt and these non recovery flt are already checked.Samething Implies for MaxCompRecFlt.

Description

Algorithm Enable Calculation

Function NameEnableCalcTypeMinMaxUTP Tol.
Arguments PassedFreqEstAvg_Hz_T_f32float32040
FiltWhlSpdR_RadpSec_T_f32float32-44
FiltWhlSpdL_RadpSec_T_f32float32-44
VehSpd_Kph_T_f32float320512
VehSpdValid_Cnt_T_lgcbooleanFALSETRUE
WIRDisable_Cnt_T_lgcbooleanFALSETRUE
WIRMfgEnable_Cnt_T_lgcbooleanFALSETRUE
Return ValueEnable_Uls_T_f32float320.01.00.0000610

Description

Calculated Disturbance Magnitude

Function NameCalcDistMagTypeMinMaxUTP Tol.
Arguments PassedCurrMag_Uls_T_f32float3204*π/2
Peak_Uls_T_f32float3204*π/2
FreqEstAvg_Hz_T_f32float32040
Return ValuePeak_Uls_T_f32float3204*π/20.0084

Description

Apply AutoScale

Function NameApplyAutoScaleTypeMinMaxUTP Tol.
Arguments PassedFiltWhlSpdR_Ptr_T_f32pointer to float32-440.00196
FiltWhlSpdL_Ptr_T_f32pointer to float32-440.00196
EnabledComp_Uls_T_f32float3201.0
Return ValueN/A

Description

Least Mean Squared Filter

Function NameLMSFilt_f32TypeMinMaxUTP Tol.
Arguments PassedEnable_Uls_T_f32float320.01.0
PrevEpsilon_Uls_T_f32float32-1010
xRef_Uls_T_f32float32-44
AdaptiveMu_Uls_T_f32float320.00.1
xRefDelay_Uls_T_f32[]float32-440.00196
xRefStateVar_Uls_T_f32[]float32-204820480.000123
NTaps_Cnt_T_u16uint16130
Return ValueOutput_Uls_T_f32float32-2457602457600.00391

Description

Phase Adjust

Function NamePhaseAdjust_f32TypeMinMaxUTP Tol.
Arguments PassedPhaseAdjInput_Uls_T_f32float32-127127
FreqEstAvg_Hz_T_f32float32040
Return ValuePhaseAdjOutput_Uls_T_f32float32-1271270.0084

Description

Calculate Filter Coefficient

Function NameCalcFilterCoeffTypeMinMaxUTP Tol.
Arguments PassedPhase_Rad_T_f32float32-π/4π/4
FreqEstAvg_Hz_T_f32float32040
ZeroCoeff_Ptr_T_f32pointer to float320.2447421.00.000123
PoleCoeff_Ptr_T_f32pointer to float320.2447421.00.000123
GainCoeff_Ptr_T_f32pointer to float320.2496834.0050740.000123
InvMag_Ptr_T_f32pointer to float320.4142135622.4142135620.000123
Return ValueN/A

Description

Lead Lag Filter

Function NameLeadLagFilterTypeMinMaxUTP Tol.
Arguments PassedFilterInput_Uls_T_f32float32-127127
ZeroCoeff_Uls_T_f32float320.2447421.0
PoleCoeff_Uls_T_f32float320.2447421.0
GainCoeff_Uls_T_f32float320.2496834.005074
InvMag_Uls_T_f32float320.4142135622.414213562
LeadLagSV1_Ptr_T_f32pointer to float32-65536655360.00391
LeadLagSV2_Ptr_T_f32pointer to float32-65536655360.00391
Return ValueOutput_Uls_T_f32float32-1271270.0084

Description

WIR Diagnostics

Function NameWIRDiagnosticsTypeMinMaxUTP Tol.
Arguments PassedWhlImbRejCmd_MtrNm_T_f32float32-127127
Return ValueN/A

Description

Diagnose Command Magnitude

Function NameDiagnoseCmdMagTypeMinMaxUTP Tol.
Arguments PassedInputCommand_MtrNm_T_f32float32-127127
Return ValueN/A

Description

Calculate Command Amplitude

Function NameCalcCmdAmplitudeTypeMinMaxUTP Tol.
Arguments PassedInputCommand_MtrNm_T_f32float32-127127

CmdMagFiltSV1_Ptr_T_Str

CmdMagFiltSV1_Ptr_T_Str.k_Uls_f32

CmdMagFiltSV1_Ptr_T_Str.SV_Uls_f32

Ptr to LPF32KSV_Str

N/A

0

0

N/A

0.715390457

127

1.25663E-05

0.0084

CmdMagFiltSV2_Ptr_T_Str

CmdMagFiltSV2_Ptr_T_Str.K_Uls_f32

CmdMagFiltSV2_Ptr_T_Str.SV_Uls_f32

Ptr to LPF32KSV_Str

N/A

0

0

N/A

0.715390457

127

1.25663E-05

0.0084

Return ValueCmdAmp_MtrNm_T_f32float320127*π/2 (*See Note)0.0084

*Note: Range of return value is dependent on range of InputCommand input signal multiplied by π/2, therefore return value range may be less than range defined in this table if InputCommand range is lower than the range defined in this table.

Description

Diagnose Frequency

Function NameDiagnoseFreqTypeMinMaxUTP Tol.
Arguments PassedWhlImbRejCmd_MtrNm_T_f32float32-127127
Return ValueN/A

Description

Diagnose DC Trend

Function NameDiagnoseDCTrendTypeMinMaxUTP Tol.
Arguments PassedInputCommand_MtrNm_T_f32float32-127127
Return ValueN/A

Description

Process Status Bits

Function NameProcessStatusBitsTypeMinMaxUTP Tol.
Arguments PassedNone
Return ValueN/A

Description

Update Fault Bits

Function NameUpdateFaultBitsTypeMinMaxUTP Tol.
Arguments PassedDiagInfo_Ptr_T_Strpointer to WIRDiagInfo_StrSee DataType Def0
FaultMask_Cnt_T_b16uint16FULLFULL
RecoveryFaultMask_Cnt_b16uint16FULLFULL
WhlImbFltStatus_Ptr_T_b16pointer to uint16FULLFULL0
Return ValueN/A

Description

Log Compensation Activity

Function NameLogCompActivityTypeMinMaxUTP Tol.
Arguments PassedWIRCmdMag_MtrNm_T_f32float320127*π/2
Return ValueN/A

Description

Check Compensation Persistence

Function NameCheckCompPersTypeMinMaxUTP Tol.
Arguments PassedNone
Return ValueN/A

Description

WIR Fault Recovery

Function NameWIRFltRecoveryTypeMinMaxUTP Tol.
Arguments PassedDiagInfo_Ptr_T_Strpointer to WIRDiagInfo_StrSee DataType Def0
MaxFltRecLmt_Cnt_T_u8uint8FULLFULL
FltRecDly_Min_T_f32float320255
Return ValueN/A

Description

Reset WIR Algorithm

Function NameResetWIRAlgorithmTypeMinMaxUTP Tol.
Arguments PassedN/A
Return ValueN/A

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
HwTrq_HwNm_f320.0
QualWhlFreqL_Hz_f320.0
QualWhlFreqR_Hz_f320.0
WhlFreqQualified_Cnt_lgcTRUE
WhlImbRejCmd_MtrNm_f320.0
WIRCmdAmpBlnd_MtrNm_f320.0
DiagStsDefVehSpd_Cnt_lgcFALSE
VehSpd_Kph_f320
WIRFnEnable_Cnt_lgcTRUE
WIRMfgEnable_Cnt_lgcFALSE

Initialization Functions

Init: _Init1

Design Rationale

None

Processing


Periodic Functions

Per: _Per1

Design Rationale

None

Program Flow Start

Rte_Call_WhlImbRej_Per1_CP0_CheckpointReached()Store Module Inputs to Local copies

Processing

Store Local copy of outputs into Module Outputs

Program Flow End

Rte_Call_WhlImbRej_Per1_CP1_CheckpointReached()

Per: _Per2

Design Rationale

None

Program Flow Start

Rte_Call_WhlImbRej_Per2_CP0_CheckpointReached()Store Module Inputs to Local copies

None

Processing

Store Local copy of outputs into Module Outputs

Program Flow End

Rte_Call_WhlImbRej_Per2_CP1_CheckpointReached()

Per: _Per3

Design Rationale

None

Program Flow Start

Rte_Call_WhlImbRej_Per3_CP0_CheckpointReached()Store Module Inputs to Local copies

N/A

Processing

Store Local copy of outputs into Module Outputs

N/A

Program Flow End

Rte_Call_WhlImbRej_Per3_CP1_CheckpointReached()


Fault Recovery Functions

None


Shutdown Functions

None


Interrupt Functions

None


Serial Communication Functions

SComm: WhlImbRej_Scom_GetWIRInfo

Function NameWhlImbRej_Scom_GetWIRInfoTypeMinMax
Arguments PassedWIRCmpActRng1Ptr_Cnt_u32pointer to uint32FULLFULL
WIRCmpActRng2Ptr_Cnt_u32pointer to uint32FULLFULL
WIRCmpActRng3Ptr_Cnt_u32pointer to uint32FULLFULL
AlgFltStatusPtr_Cnt_b16pointer to uint16FULLFULL
WIRMaxCompPtr_Pct_f32pointer to float320100
Return ValueN/A

Design Rationale

None

Program Flow Start

N/A

Store Module Inputs to Local copies

N/A

Processing

Store Local copy of outputs into Module Outputs

N/A

Program Flow End

N/A


Execution Requirements

Execution Sequence of the Module

The WhlImbRej_Per1() function must be called prior to the module which sums in the WIR output.

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
_Init1Once at InitCold Init
_Per12 msOPERATE
_Per24 msOPERATE
_Per32 msOFF, WARMINIT, DISABLE

Execution Requirements for Serial Communication Functions

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


Memory Map Definition Requirements

Sub Modules (Functions)

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

Name of Sub ModuleSoftware Segment
_Init1RTE_START_SEC_AP_WHLIMBREJ_APPL_CODE
_Per1RTE_START_SEC_AP_WHLIMBREJ_APPL_CODE
_Per2RTE_START_SEC_AP_WHLIMBREJ_APPL_CODE
_Per3RTE_START_SEC_AP_WHLIMBREJ_APPL_CODE
WhlImbRej_Scom_GetWIRInfoRTE_START_SEC_AP_WHLIMBREJ_APPL_CODE

Local Functions

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

Name of Sub ModuleSoftware Segment
WhlSpdCorrelationCheckN/A (Inline with calling function)
WhlSpdInRangeN/A (Inline with calling function)
DetermineEnabledAmountN/A (Inline with calling function)
EnableCalcN/A (Inline with calling function)
WIRActRejCmdN/A (Inline with calling function)
CalcDistMagN/A (Inline with calling function)
UGRFilter_f32N/A (Inline with calling function)
CalcMinusA1TermN/A (Inline with calling function)
ResFilterN/A (Inline with calling function)
LMSFilt_f32N/A (Inline with calling function)
PhaseAdjust_f32N/A (Inline with calling function)
CalcFilterCoeffN/A (Inline with calling function)
LeadLagFilterN/A (Inline with calling function)
WIRDiagnosticsN/A (Inline with calling function)
DiagnoseCmdMagN/A (Inline with calling function)
CalcCmdAmplitudeN/A (Inline with calling function)
DiagnoseFreqN/A (Inline with calling function)
DiagnoseDCTrendN/A (Inline with calling function)
LogCompActivityN/A (Inline with calling function)
CheckCompPersN/A (Inline with calling function)
WIRFltRecoveryN/A (Inline with calling function)
ResetWIRAlgorithmN/A (Inline with calling function)
ApplyAutoScaleN/A (Inline with calling function)
ProcessStatusBitsN/A (Inline with calling function)
UpdateFaultBitsN/A (Inline with calling function)


Known Issues / Limitations With Design

  1. Inline functions defined in globalmacro.h are not unit tested

  2. Safety Critical WIR Diagnostics are not implemented in this ver.


Revision Control Log

Item #Rev #Change DescriptionDateAuthor Initials
11Initial version14-Jul-11LWW
22Fixed MDD typos found during UTP. Made changes required from FDD21-Jul-11LWW
33Changed all WIRDiagInfo_T function parameters to be passed through address so that data elements can be modified in functions they are passed to.25-Jul-11LWW
44Removed phase adjust enable calibration and added frequency diagnostic enable calibration.27-Jul-11LWW
55Fixed MDD typos found during UTP. Added WIR enable global input04-Aug-11LWW
66Corrected anomaly in DiagnoseFreq function, added enum value for SetNTCStatus function.17-Oct-11LWW
77Updates for FDD changes: moved input qualification out of this module to better match FDD, added vehicle speed check and new algorithm Enable signals.20-Feb-12LWW
88Updated to define UTP tolerances on local functions that are passed pointers. Anomaly corrections per new FDD revision.25-May-12LWW
99

Updated as per FDD Ver 005(Excluding SafetyCritical functions) and Ver 006

  1. k_WIRDCTrendTime_Sec_f32 default value and resolution changed.

  2. Two new cals are added: k_WIRDCTrendTh2_MtrNm_f32, k_WIRDCTrendTime2_Sec_f32

  3. Global Input WIRFnEnable is changed to DiagStatus

  4. In Diagnose Freq(), Abs is done after LowPassFilter

  5. In DetermineEnableAmt(), MaxMagRecFlt check is removed

  6. LPF are changed from Fixed type to Floating type(And related range changes are shown in DD)

18-July-12NRAR
1010Added checkpoints and memmap software segment is updated for static variables24-Sep-12Selva
1111Changed Per2 trigger rate from 8ms to 4ms.24-Oct-12BWL
1212Update NTC number constant to VLF per new version of StdDef.13-Nov-12BWL
1313Updated the tolerance for the pointer variables in LeadLagFilter()01-Apr-13VK
Last modified October 12, 2025: Initial commit (0347a62)