CmMtrCurr_MDD

Module -- CmMtrCurr

High-Level Description

The Current Measurement function is responsible for measuring the motor phase currents used as feedback by the Motor Control FDD. Two motor phase currents are measured using a shunt resistor and a differential amplifier circuitry, and along with the motor position are transformed into direct (D) and quadrature (Q) axes currents using the combined Clarke/Park transform

UNIT Test Notes:

Unit test should be done with enabling one of the six predefned macro MTRCURRPHASEBC, MTRCURRPHASECB, MTRCRRPHASECA, MTRCURRPHASEAB, MTRCURRPHASEAC, MTRCURRPHASEBA. Hence it should have six UTP results (one for each Macro enabled).

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
FiltCntrlTemp_DegC_f32MtrCurr1TempOffset_Volt_f32
MtrCurrAngle_Rev_f32MtrCurr2TempOffset_Volt_f32
ComOffset_Cnt_u16
CorrMtrPosElec_Rev_f32CDD_ElecPosDelayComp_Rad_G_f32
MtrCurrK1_Amp_f32CDD_MtrElecPol_Cnt_G_s8
MtrCurrK2_Amp_f32CDD_MtrCurrQax_Amp_G_f32[]
ADCMtrCurr1_Volts_f32CDD_MtrCurrDax_Amp_G_f32[]
ADCMtrCurr2_Volts_f32CDD_CorrMtrPosElec_Rev_G_f32[]
Vecu_Volt_f32CDD_MtrCurrK1_Amps_G_f32[]
MtrVel_MtrRadpS_f32CDD_MtrCurrK2_Amps_G_f32[]
VehSpd_Kph_f32CDD_MtrCurr1_Volts_G_f32[]
VhSpdValid_Cnt_lgcCDD_MtrCurr2_Volts_G_f32[]
SrlComSvcDft_Cnt_b32CorrMtrCurrPosition_Rev_f32
MEC_Cnt_enumCurrentGainSvc_Cnt_lgc
CDD_MRFMtrVel_MtrRadpS_G_f32[]
CDD_Vecu_Volt_G_f32[]
DCPhsBComp_Cnt _u16
DCPhsCComp_Cnt_u16
DCPhsCComp_Cnt_G_u16
CDD_MtrCurr1TempOffset_Volt_G_f32[]
CDD_MtrCurr2TempOffset_Volt_G_f32[]
CDD_MtrPosElec_Rev_G_u0p16[]
CDD_CDDDataAccessBfr_Cnt_G_u16
CDD_AppDataFwdPthAccessBfr_Cnt_G_u16
CorrMtrCurrPosition_Rev_f32

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
MtrCurr1OffDelta_VoltpVoltCnts_M_f32Single precision float0.0000125750CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr2OffDelta_VoltpVoltCnts_M_f32single precision float0.0000125750CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr1LpFltrSV_Volts_M_u3p292^-2905CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr2LpFltrSV_Volts_M_u3p292^-2905CMMTRCURR_START_SEC_VAR_CLEARED_32
FiltMtrCurr1_Volts_M_f32single precision float05CMMTRCURR_START_SEC_VAR_CLEARED_32
FiltMtrCurr2_Volts_M_f32single precision float05CMMTRCURR_START_SEC_VAR_CLEARED_32
CurrCorrDiagKSV_M_strN/AN/AN/ACMMTRCURR_START_SEC_VAR_CLEARED_UNSPECIFIED
CurrCorrDiagKSV_M_str.SV_Uls_f32single precision floatSee data dictionarySee data dictionaryCMMTRCURR_START_SEC_VAR_CLEARED_UNSPECIFIED
CurrCorrDiagKSV_M_str.K_Uls_f32single precision floatSee data dictionarySee data dictionaryCMMTRCURR_START_SEC_VAR_CLEARED_UNSPECIFIED
CurroffProcessFlag_M_enumsingle precision floatn/an/aCMMTRCURR_START_SEC_VAR_CLEARED_ UNSPECIFIED
CurrOffTrimFlag_M_lgcBOOLEANTrueFalseCMMTRCURR_START_SEC_VAR_CLEARED_BOOLEAN
CurrOffState_ULS_M_enumN/AN/AN/ACMMTRCURR_START_SEC_VAR_CLEARED_UNSPECIFIED
MtrCurr1SumHi_Volt_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr2SumHi_Volt_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
VecuSum_Volt_M_f32single precision float-2020CMMTRCURR_START_SEC_VAR_CLEARED_32
CurrOffAvgCounter_Cnt_M_u16102^16CMMTRCURR_START_SEC_VAR_CLEARED_16
MtrCurr1OffsetHi_Volts_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr2OffsetHi_Volts_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurrValCmd_VoltCnts_M_f32single precision float080000CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr1SumLo_Volt_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr2SumLo_Volt_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr1OffsetLo_Volts_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr2OffsetLo_Volts_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr1SumZero_Volt_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr2SumZero_Volt_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr1OffsetZero_Volts_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr2OffsetZero_Volts_M_f32single precision float1.03.0CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr1offsetDiff_Volt_D_f32single precision float-0.0468750.046875CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr2offsetDiff_Volt_D_f32single precision float-0.0468750.046875CMMTRCURR_START_SEC_VAR_CLEARED_32
Duty1Cnts_Cnt_D_f32single precision float080000CMMTRCURR_START_SEC_VAR_CLEARED_32
Duty2Cnts_Cnt_D_f32single precision float080000CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr1Offset_Volt_D_f32single precision float-0.0468750.046875CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurr2Offset_Volt_D_f32single precision float-0.0468750.046875CMMTRCURR_START_SEC_VAR_CLEARED_32
CorrMtrCurr1_Amps_D_f32single precision float-550550CMMTRCURR_START_SEC_VAR_CLEARED_32
CorrMtrCurr2_Amps_D_f32single precision float-550550CMMTRCURR_START_SEC_VAR_CLEARED_32
CorrMtrPosElec_Rev_D_f32single precision float01CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurrK1_Amps_D_f32single precision float-550550CMMTRCURR_START_SEC_VAR_CLEARED_32
MtrCurrK2_Amps_D_f32single precision float-550550CMMTRCURR_START_SEC_VAR_CLEARED_32
CurrVectPosition_Rev_D_f32single precision float01CMMTRCURR_START_SEC_VAR_CLEARED_32
VectPosCosTheta_Uls_D_f32single precision float-11CMMTRCURR_START_SEC_VAR_CLEARED_32
VectPosSinTheta_Uls_D_f32single precision float-11CMMTRCURR_START_SEC_VAR_CLEARED_32
CurrCorrDiag_Amps_D_f32single precision float-550550CMMTRCURR_START_SEC_VAR_CLEARED_32
FiltCurrCorrDiag_Amps_D_f32single precision float-550550CMMTRCURR_START_SEC_VAR_CLEARED_32
CurrentGainSvc_Cnt_M_lgcBoolean01CMMTRCURR_START_SEC_VAR_CLEARED_BOOLEAN

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)

CurrTempOffsetTypeCurrTempOffsetX_DegC_s10p5CurrTempOffsetTblType-50150
CurrOffsetY1_Volts_s4p11CurrTempOffsetTblType-0.0260.026
CurrOffsetY2_Volts_s4p11CurrTempOffsetTblType-0.0260.026
PhaseCurrCal_DataTypeEOLMtrCurrVcalCmd_VoltCnts_f32float080000
EOLPhscurr1Gain_AmpspVolt_f32float20125
EOLMtrCurr2OffsetDiff_Volts_f32float1.03.0
EOLMtrCurr1OffsetDiff_Volts_f32float1.03.0
EOLMtrCurr1OffsetLo_Volts_f32float1.03.0
EOLMtrCurr2OffsetLo_Volts_f32float1.03.0
EOLPhscurr2Gain_AmpspVolt_f32float20125
CurrTempOffsetTblType[16]Sint16FullFull

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_CurrOffGainKn_Cnt_u16
k_CurrCorrErrFiltFc_Hz_f32
k_MaxCurrOffMtrVel_RadpS_f32
k_MtrCurrEOLMaxOffset_Volts_f32
k_MtrCurrEOLMinOffset_Volts_f32
k_MtrCurrEOLMaxGain_AmpspVolts_f32
k_MtrCurrEOLMinGain_AmpspVolts_f32
k_MtrPosComputDelay_Sec_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_MTRCURROFFHICOMOFF_CNT_U161Counts4000
D_CURROFFNOOFAVG_CNT_U161Counts64
D_MTRCURROFFLOCOMOFF_CNT_U161Counts500
D_MTRCURROFFZEROCOMOFF_CNT_U161Counts0
D_REVWITHROUND_ULS_F32single precision floatUnitless65536.5
D_SCALERADTOCNTS_ULS_F32single precision floatUnitless10430.3783505
D_ROUND_ULS_F32single precision floatUnitless0.5
D_CNVRTP29TOP13_CNT_U161Counts16
D_POSITIVEONE_CNT_S81Counts1
D_ONEDIVSQRT3_F32single precision floatUnitless0.57735

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_2PI_ULS_F32
D_FALSE_CNT_LGC
D_VECUMIN_VOLTS_F32
D_ZERO_ULS_F32
D_ZERO_CNT_U16
D_ZERO_CNT_U32
D_MTRPOLESDIV2_CNT_U8
D_2MS_SEC_F32

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

  2. Sinf

  3. Limit_m

  4. Abs_f32_m

  5. TableSize_m

  6. FPM_FloatToFixed_m

  7. FPM_FixedToFloat_m

  8. IntplVarXY_s16_s16Xs16Y_Cnt

  9. LPF_SvUpdate_u16InFixKTrunc_m

  10. LPF_OpUpdate_u16InFixKTrunc_m

  11. LPF_SvUpdate_s16InFixKTrunc_m

  12. LPF_OpUpdate_s16InFixKTrunc_m

  13. LPF_KUpdate_f32_m

  14. LPF_OpUpdate_f32_m

Data Hiding Functions

  1. CmMtrCurr_Read_MRFMtrVel_MtrRadpS_f32

  2. CmMtrCurr_Read_Vecu_Volt_f32

  3. CmMtrCurr_Read_Phs1Curr_Cnt_u16

  4. CmMtrCurr_Read_Phs2Curr_Cnt_u16

  5. CmMtrCurr_Read_DCPhsAComp_Cnt_u16

  6. CmMtrCurr_Read_DCPhsBComp_Cnt_u16

  7. CmMtrCurr_Read_DCPhsCComp_Cnt_u16

  8. CmMtrCurr_Read_MtrCurr1TempOffset_Volt_f32

  9. CmMtrCurr_Read_MtrCurr2TempOffset_Volt_f32

  10. CmMtrCurr_Read_MtrElecPol_Cnt_s08

  11. CmMtrCurr_Read_MtrPosElec_Rev_u0p16

  12. CmMtrCurr_Write_ElecPosDelayComp_Rad_f32

  13. CmMtrCurr_Write_MtrCurrQax_Amp_f32

  14. CmMtrCurr_Write_MtrCurrDax_Amp_f32

  15. CmMtrCurr_Write_CorrMtrPosElec_Rev_f32

  16. CmMtrCurr_Write_MtrCurrK1_Amps_f32

  17. CmMtrCurr_Write_MtrCurrK2_Amps_f32

  18. CmMtrCurr_Write_MtrCurr1_Volts_f32

  19. CmMtrCurr_Write_MtrCurr2_Volts_f32

Global Functions/Macros Defined by this Module

None

Local Functions/Macros Used by this MDD only

None

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_ADCMtrCurr1_Volts_f320
Rte_InitValue_ADCMtrCurr2_Volts_f320
Rte_InitValue_ComOffset_Cnt_u160
Rte_InitValue_ CorrMtrCurrPosition _Rev_f320
Rte_InitValue_FiltCntrlTemp_DegC_f320
Rte_InitValue_MEC_Cnt_enum0
Rte_InitValue_MtrCurr1TempOffset_Volt_f320
Rte_InitValue_MtrCurr2TempOffset_Volt_f320
Rte_InitValue_MtrCurrAngle _Rev_f320
0
Rte_InitValue_MtrCurrK1_Amp_f320
Rte_InitValue_MtrCurrK2_Amp_f320
Rte_InitValue_MtrVel_MtrRadpS_f320
Rte_InitValue_SrlComSvcDft_Cnt_b320
Rte_InitValue_Vecu_Volt_f325
Rte_InitValue_VehSpd_Kph_f320
Rte_InitValue_VhSpdValid_Cnt_lgcFALSE
Rte_InitValue_ CurrentGainSvc_Cnt_lgcFALSE

Initialization Functions

Init: CmMtrCurr_Init

Design Rationale

None

Module Outputs

None

Module Internal

IF ((Rte_Pim_ShCurrCal()->EOLMtrCurrVcalCmd_VoltCnts_f32) >= FLT_EPSILON)

MtrCurr1OffDelta_VoltpVoltCnts_M_f32=((Rte_Pim_ShCurrCal()->EOLMtrCurr1OffsetDiff_Volts_f32)/(Rte_Pim_ShCurrCal()->EOLMtrCurrVcalCmd_VoltCnts_f32))

MtrCurr2OffDelta_VoltpVoltCnts_M_f32=((Rte_Pim_ShCurrCal()->EOLMtrCurr2OffsetDiff_Volts_f32)/(Rte_Pim_ShCurrCal()->EOLMtrCurrVcalCmd_VoltCnts_f32))

ELSE

MtrCurr1OffDelta_VoltpVoltCnts_M_f32 = D_ZERO_ULS_F32

MtrCurr2OffDelta_VoltpVoltCnts_M_f32 = D_ZERO_ULS_F32

END

LPF_KUpdate_f32_m (k_CurrCorrErrFiltFc_Hz_f32, D_2MS_SEC_F32, &CurrCorrDiagKSV_M_str)

Periodic Functions

Per: CmMtrCurr_Per1

Design Rationale

None

Program Flow Start

Rte_Call_CmMtrCurr_Per1_CP0_CheckpointReached()

Store Module Inputs to Local copies

FiltCntrlTemp_DegC_T_f32=Rte_IRead_CmMtrCurr_Per1_FiltCntrlTemp_DegC_f32()

Processing

Store Local copy of outputs into Module Outputs

Rte_Iwrite_CmMtrCurr_Per1_MtrCurr1TempOffset_Volt_f32(MtrCurr1TempOffset_Volts_T_f32)

Rte_Iwrite_CmMtrCurr_Per1_MtrCurr2TempOffset_Volt_f32(MtrCurr2TempOffset_Volts_T_f32)

Program Flow End

Rte_Call_CmMtrCurr_Per1_CP1_CheckpointReached()

Per: CmMtrCurr_Per2

Design Rationale

None

Program Flow Start

Rte_Call_CmMtrCurr_Per2_CP0_CheckpointReached()

Store Module Inputs to Local copies

MtrCurrAlpha_Rev_T_f32=Rte_Iread_CmMtrCurr_Per2_MtrCurrAngle_ Rev_f32()

CorrMtrPosElec_Rev_T_f32=Rte_Iread_CmMtrCurr_Per2_CorrMtrCurrPosition_Rev_f32()

MtrCurrK1_Amps_T_f32=Rte_Iread_CmMtrCurr_Per2_MtrCurrK1_Amp_f32()

MtrCurrK2_Amps_T_f32=Rte_Iread_CmMtrCurr_Per2_MtrCurrK2_Amp_f32()

ADCMtrCurr1_Volts_T_f32=Rte_Iread_CmMtrCurr_Per2_ADCMtrCurr1_Volts_f32()

ADCMtrCurr2_Volts_T_f32=Rte_Iread_CmMtrCurr_Per2_ADCMtrCurr2_Volts_f32()

Processing

Store Local copy of outputs into Module Outputs

None

Program Flow End

Rte_Call_CmMtrCurr_Per2_CP1_CheckpointReached()

Per: CmMtrCurr_Per3

Design Rationale

None

Program Flow Start

Rte_Call_CmMtrCurr_Per3_CP0_CheckpointReached()

Store Module Inputs to Local copies

ADCMtrCurr1_Volts_T_f32=Rte_Iread_CmMtrCurr_Per3_ADCMtrCurr1_Volts_f32();

ADCMtrCurr2_Volts_T_f32=Rte_Iread_CmMtrCurr_Per3_ADCMtrCurr2_Volts_f32();

Vecu_Volt_T_f32=Rte_Iread_CmMtrCurr_Per3_Vecu_Volt_f32();

MtrVel_MtrRadpS_T_f32 = Rte_Iread_CmMtrCurr_Per3_MtrVel_MtrRadpS_f32();

VehSpd_Kph_T_f32= Rte_Iread_CmMtrCurr_Per3_VehSpd_Kph_f32();

VhSpdValid_Cnt_T_lgc= Rte_Iread_CmMtrCurr_Per3_VhSpdValid_Cnt_lgc();

SrlComSvcDft_Cnt_T_b32=Rte_Iread_CmMtrCurr_Per3_SrlComSvcDft_Cnt_b32();

CurroffProcessFlag_T_enum=CurroffProcessFlag_M_enum;

Processing

Store Local copy of outputs into Module Outputs

Rte_Iwrite_CmMtrCurr_Per3_ComOffset_Cnt_u16(ComOffset_Cnt_T_u16)

Program Flow End

Rte_Call_CmMtrCurr_Per3_CP1_CheckpointReached()


Fault Recovery Functions

None

Shutdown Functions

None

Interrupt Functions

CurrDQPer1

Design Rationale

None

Program Flow Start

N/A

Store Module Inputs to Local Copies

CmMtrCurr_Read_MRFMtrVel_MtrRadpS_f32(&MRFMtrVel_MtrRadpS_T_f32);

CmMtrCurr_Read_Vecu_Volt_f32(&Vecu_Volt_T_f32);

CmMtrCurr_Read_Phs1Curr_Cnt_u16(&Phs1Curr_Cnt_T_u16);

CmMtrCurr_Read_Phs2Curr_Cnt_u16(&Phs2Curr_Cnt_T_u16);

CmMtrCurr_Read_MtrCurr1TempOffset_Volt_f32(&MtrCurr1TempOffset_Volt_T_f32);

CmMtrCurr_Read_MtrCurr2TempOffset_Volt_f32(&MtrCurr2TempOffset_Volt_T_f32);

CmMtrCurr_Read_MtrElecPol_Cnt_s08(&MtrElecPol_Cnt_T_s08);

CmMtrCurr_Read_MtrPosElec_Rev_u0p16(&MtrPosElec_Rev_T_u0p16);

Processing

Store Local copy of outputs into Module Outputs

CmMtrCurr_Write_ElecPosDelayComp_Rad_f32(ElecPosDelayComp_Rad_T_f32);

CmMtrCurr_Write_MtrCurrQax_Amp_f32(MtrCurrFinalQax_Amps_T_f32);

CmMtrCurr_Write_MtrCurrDax_Amp_f32(MtrCurrFinalDax_Amps_T_f32);

CmMtrCurr_Write_CorrMtrPosElec_Rev_f32(CorrMtrPosElec_Rev_T_f32);

CmMtrCurr_Write_MtrCurrK1_Amps_f32(MtrCurrK1_Amps_T_f32);

CmMtrCurr_Write_MtrCurrK2_Amps_f32(MtrCurrK2_Amps_T_f32);

CmMtrCurr_Write_MtrCurr1_Volts_f32(Phs1Curr_Volts_T_f32);

CmMtrCurr_Write_MtrCurr2_Volts_f32(Phs2Curr_Volts_T_f32);

Program Flow End

N/A

Serial Communication Functions

Scomm: CmMtrCurrTempOffset_Scom_Get

Function Name

CmMtrCurrTempOffset_Scom_Get

TypeMinMaxUTP Tol.
Arguments PassedCurrTempOffCalCurrTempOffsetType *
Return ValuevoidNANANA

Design Rationale

None

Program Flow Start

None

Store Module Inputs to Local copies

None

Processing

Store Local copy of outputs into Module Outputs

None

Program Flow End

None

Scomm: CmMtrCurrTempOffset_Scom_Set

Function NameCmMtrCurrTempOffset_Scom_SetTypeMinMaxUTP Tol.
Arguments PassedCurrTempOffCalCurrTempOffsetType *
Return ValuevoidNANANA

Design Rationale

None

Program Flow Start

None

Store Module Inputs to Local copies

None

Processing

Store Local copy of outputs into Module Outputs

None

Program Flow End

None

Scomm: CmMtrCurr_Scom_CalGain

Function NameCmMtrCurr_Scom_CalGainTypeMinMaxUTP Tol.
Arguments PassedNoneNone
Return ValueRetrunValueStd_ReturnType

Design Rationale

None

Program Flow Start

None

Store Module Inputs to Local copies

Rte_Read_MtrVel_MtrRadpS_f32(&MtrVel_MtrRadpS_T_f32)

Rte_Read_VehSpd_Kph_f32(&VehSpd_Kph_T_f32)

Rte_Read_VhSpdValid_Cnt_lgc(&VhSpdValid_T_Cnt_lgc)

Processing

Store Local copy of outputs into Module Outputs

None

Program Flow End

None

Scomm: CmMtrCurr_Scom_CalOffset

Function NameCmMtrCurr_Scom_CalOffsetTypeMinMaxUTP Tol.
Arguments PassedNoneNone
Return ValueRetrunValueStd_ReturnType

Design Rationale

None

Program Flow Start

None

Store Module Inputs to Local copies

Rte_Read_MtrVel_MtrRadpS_f32(&MtrVel_MtrRadpS_T_f32)

Rte_Read_VehSpd_Kph_f32(&VehSpd_Kph_T_f32)

Rte_Read_VhSpdValid_Cnt_lgc(&VhSpdValid_T_Cnt_lgc)

Processing

Store Local copy of outputs into Module Outputs

Rte_Write_CurrentGainSvc_Cnt_lgc(CurrentGainSvc_Cnt_M_lgc)

Program Flow End

None

Scomm: CmMtrCurr_Scom_MtrCurrOffReadStatus

Function NameCmMtrCurr_Scom_MtrCurrOffReadStatusTypeMinMaxUTP Tol.
Arguments PassedCurrOffStatusMtrCurrOffProcessFlag *
Return ValuevoidNANANA

Design Rationale

None

Program Flow Start

None

Store Module Inputs to Local copies

None

Processing

Store Local copy of outputs into Module Outputs

None

Program Flow End

None

Scomm: CmMtrCurr_Scom_ReadMtrCurrCals

Function NameCmMtrCurr_Scom_ReadMtrCurrCalsTypeMinMaxUTP Tol.
Arguments PassedShCurrCalPtrPhaseCurrCal_DataType *
Return ValuevoidNANANA

Design Rationale

None

Program Flow Start

None

Store Module Inputs to Local copies

None

Processing

Store Local copy of outputs into Module Outputs

None

Program Flow End

None

Scomm: CmMtrCurr_Scom_SetMtrCurrCals

Function NameCmMtrCurr_Scom_SetMtrCurrCalsTypeMinMaxUTP Tol.
Arguments PassedShCurrCalPtrPhaseCurrCal_DataType *
Return ValuevoidNANANA

Design Rationale

None

Program Flow Start

None

Store Module Inputs to Local copies

None

Processing

Store Local copy of outputs into Module Outputs

None

Program Flow End

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
CmMtrCurr_InitOn InitInit
CmMtrCurr_Per1100msAll
CmMtrCurr_Per22msOperate
CmMtrCurr_Per32msOperate
CurrDQPer1125us (MtrCtrl ISR)All

Execution Requirements for Serial Communication Functions

Function NameSub-Module called by (Serial Comm Function Name)
CmMtrCurr_Scom_CalGain
CmMtrCurr_Scom_CalOffset
CmMtrCurr_Scom_MtrCurrOffReadStatus
CmMtrCurr_Scom_ReadMtrCurrCals
CmMtrCurr_Scom_SetMtrCurrCals
CmMtrCurrTempOffset_Scom_Get
CmMtrCurrTempOffset_Scom_Set


Memory Map Definition Requirements

Sub Modules (Functions)

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

Name of Sub ModuleSoftware Segment
CmMtrCurr_InitRTE_START_SEC_SA_CMMTRCURR_APPL_CODE
CmMtrCurr_Per1RTE_START_SEC_SA_CMMTRCURR_APPL_CODE
CmMtrCurr_Per2RTE_START_SEC_SA_CMMTRCURR_APPL_CODE
CmMtrCurr_Per3RTE_START_SEC_SA_CMMTRCURR_APPL_CODE
CurrDQPer1
CmMtrCurr_Scom_CalGainRTE_START_SEC_SA_CMMTRCURR_APPL_CODE
CmMtrCurr_Scom_CalOffsetRTE_START_SEC_SA_CMMTRCURR_APPL_CODE
CmMtrCurr_Scom_MtrCurrOffReadStatusRTE_START_SEC_SA_CMMTRCURR_APPL_CODE
CmMtrCurr_Scom_ReadMtrCurrCalsRTE_START_SEC_SA_CMMTRCURR_APPL_CODE
CmMtrCurr_Scom_SetMtrCurrCalsRTE_START_SEC_SA_CMMTRCURR_APPL_CODE
CmMtrCurrTempOffset_Scom_GetRTE_START_SEC_SA_CMMTRCURR_APPL_CODE
CmMtrCurrTempOffset_Scom_SetRTE_START_SEC_SA_CMMTRCURR_APPL_CODE

Local Functions

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

Name of Sub ModuleSoftware Segment


Known Issues / Limitations With Design

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


Revision Control Log

Rev #Change DescriptionDateAuthor Initials
1.0Initial Version (FDD 01 C Ver 005)01-Dec-12Selva
2.0Configured global read/write macros for global data (anomaly 4696)23-Mar-13OT
3.0Fixes for Anamoly 5561 and A5566 added4-Sep-13Selva
4.0Updated to FDD 01C Ver 00607-Oct-13VK
5.0Anomaly 5967 and 587306-Nov-13SP
6.0Range corrections for ‘MtrCurr1OffDelta_VoltpVoltCnts_M_f32’ and ‘MtrCurr2OffDelta_VoltpVoltCnts_M_f32’9-Nov-13SR
7.0Changed CurrCorrDiag filtering from fixed point to floating point to achieve specified range and resolution – CR 1089520-Nov-13KMC
Last modified October 12, 2025: Initial commit (0347a62)