Thermal_Duty_Cycle_MDD

Module –

High-Level Description

This module computes a duty cycle limit based on system temperatures. It also outputs a unity scalar value to scale the assist command and a value representing the percentage of reduction.

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
MtrPkCurr_AmpSq_f32ThermalLimit_MtrNm_f32
FilteredPkCurr_AmpSq_f32DutyCycleLevel_Uls_f32
MotorVelCRF_MtrRadpS_f32ThermLimitPerc_Uls_f32
FiltMeasTemp_DegC_f32
SiTempEst_DegC_f32
MagTempEst_DegC_f32
CuTempEst_DegC_f32
DiagStsDefTemp _Cnt_lgc
DefeatDutySvc_Cnt_lgc
IgnTimeOff_Cnt_u32
VehTimeValid_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
TrqCmdTblYRam_MtrNm_M_u9p7[8]2-708.8THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
AbsTempFltAcc_Cnt_M_u161FULLFULLTHRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
Filter1KSV_M_strLPF32KSV_StrTHRMLDUTYCYCLE_START_SEC_VAR_CLEARED_UNSPECIFIED
SV_Uls_f32Single Precision Float031250
K_Uls_f32Single Precision Float0.3264337271091840.326433727109184
Filter2KSV_M_strLPF32KSV_StrTHRMLDUTYCYCLE_START_SEC_VAR_CLEARED_UNSPECIFIED
SV_Uls_f32Single Precision Float031250
K_Uls_f32Single Precision Float0.03874628049563830.0387462804956383
Filter3KSV_M_strLPF32KSV_StrTHRMLDUTYCYCLE_START_SEC_VAR_CLEARED_UNSPECIFIED
SV_Uls_f32Single Precision Float031250
K_Uls_f32Single Precision Float0.00394389122464190.0039438912246419
Filter4KSV_M_strLPF32KSV_StrTHRMLDUTYCYCLE_START_SEC_VAR_CLEARED_UNSPECIFIED
SV_Uls_f32Single Precision Float031250
K_Uls_f32Single Precision Float0.00209220338734350.0020922033873435
Filter5KSV_M_strLPF32KSV_StrTHRMLDUTYCYCLE_START_SEC_VAR_CLEARED_UNSPECIFIED
SV_Uls_f32Single Precision Float0125000
K_Uls_f32Single Precision Float0.0003950908183030870.000395090818303087
Filter6KSV_M_strLPF32KSV_StrTHRMLDUTYCYCLE_START_SEC_VAR_CLEARED_UNSPECIFIED
SV_Uls_f32Single Precision Float0125000
K_Uls_f32Single Precision Float0.0001570672963199270.000157067296319927
AbsTempLimit_MtrNm_M_f32Single Precision Float08.8THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_32
Mult12Temp_DegC_D_f32Single Precision Float-50150THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_32
Mult36Temp_DegC_D_f32Single Precision Float-50150THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_32
MaxOut_AmpSq_D_u16p010200THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
ThermLim_MtrNm_D_f32Single Precision Float08.8THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_32
Mult1_Uls_D_u3p132-1300.5THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
Mult2_Uls_D_u3p132-1300.5THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
Mult3_Uls_D_u3p132-1300.5THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
Mult4_Uls_D_u3p132-1300.5THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
Mult5_Uls_D_u3p132-1302THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
Mult6_Uls_D_u3p132-1302THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
LastTblVal_MtrNm_D_u9p72-708.8THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
LastTblValSlew_MtrNm_D_u9p72-708.8THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_16
AbsTempLimit_MtrNm_D_f32Single Precision Float08.8THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_32
ThrmLoadLmtTblYVal_MtrNm_D_f32Single Precision Float0.018.8THRMLDUTYCYCLE_START_SEC_VAR_CLEARED_32
eFilter3ValueTyH_Cnt_M_u810200THRMLDUTYCYCLE_START_SEC_VAR_SAVED_ZONEH_8
eFilter4ValueTyH_Cnt_M_u810200THRMLDUTYCYCLE_START_SEC_VAR_SAVED_ZONEH_8
eFilter5ValueTyH_Cnt_M_u810200THRMLDUTYCYCLE_START_SEC_VAR_SAVED_ZONEH_8
eFilter6ValueTyH_Cnt_M_u810200THRMLDUTYCYCLE_START_SEC_VAR_SAVED_ZONEH_8

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_EOCCtrlTemp_DegC_f32
k_CtrlTempSlc_Cnt_lgc
k_MtrPrTempSlc_Cnt_lgc
k_AbsMtrVelBkt_MtrRadps_f32
t_MultTblX_DegC_s15p0[5]
t_Mult1NSTblY_Uls_u3p13[5]
t_Mult2NSTblY_Uls_u3p13[5]
t_Mult3NSTblY_Uls_u3p13[5]
t_Mult4NSTblY_Uls_u3p13[5]
t_Mult5NSTblY_Uls_u3p13[5]
t_Mult6NSTblY_Uls_u3p13[5]
t_Mult1STblY_Uls_u3p13[5]
t_Mult2STblY_Uls_u3p13[5]
t_Mult3STblY_Uls_u3p13[5]
t_Mult4STblY_Uls_u3p13[5]
t_Mult5STblY_Uls_u3p13[5]
t_Mult6STblY_Uls_u3p13[5]
t_LastTblValNS_MtrNm_u9p7[5]
t_LastTblValS_MtrNm_u9p7[5]
k_TrqCmdSlewDown_MtrNm_u9p7
k_TrqCmdSlewUp_MtrNm_u9p7
k_SlowFltTempSlc_Cnt_lgc
t_AbsTmpTblX_DegC_s15p0[2]
t_AbsTmpTblY_MtrNm_u9p7[2]
k_AbsTmpTrqSlewLmt_MtrNm_f32
k_MultTempSlc_Cnt_lgc
k_AbsTempDiag_Cnt_str
k_DutyCycFltTrshld_AmpSq_u16p0
t_ThrmLoadLmtTblX_AmpSq_u16p0[8]
t_ThrmLoadLmtTblY_MtrNm_u9p7[8]
k_DefaultIgnOffTime_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_FILT1LPFKN_HZ_F32Single Precision FloatHz1/(2*pi*1.59)
D_FILT2LPFKN_HZ_F32Single Precision FloatHz1/(2*pi*15.9)
D_FILT3LPFKN_HZ_F32Single Precision FloatHz1/(2*pi*159)
D_FILT4LPFKN_HZ_F32Single Precision FloatHz1/(2*pi*300)
D_FILT5LPFKN_HZ_F32Single Precision FloatHz1/(2*pi*1590)
D_FILT6LPFKN_HZ_F32Single Precision FloatHz1/(2*pi*4000)
D_1PERC_ULS_F32Single Precision FloatUnitless0.01
D_FILTOUTLIM_ULS_F32Single Precision FloatUnitless200.0
D_DEFEATDUTYCYCLELEVEL_ULS_F32Single Precision FloatUnitless0.0
D_DEFEATTHERMLIMITPERC_ULS_F32Single Precision FloatUnitless0.0
D_DEFEATTHERMLIMIT_MTRNM_F32Single Precision FloatMtrNm8.8
D_TAU3_SEC_F32Single Precision FloatSec159
D_TAU4_SEC_F32Single Precision FloatSec300
D_TAU5_SEC_F32Single Precision FloatSec1590
D_TAU6_SEC_F32Single Precision FloatSec4000

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_MTRTRQCMDHILMT_MTRNM_F32
D_ZERO_ULS_F32
D_ONE_ULS_F32
D_100MS_SEC_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. TableSize_m

  2. FPM_FixedToFloat_m

  3. FPM_FloatToFixed_m

  4. LPF_KUpdate_f32_m

  5. LPF_OpUpdate_f32_m

  6. Abs_f32_m

  7. IntplVarXY_u16_s16Xu16Y_Cnt

  8. IntplVarXY_u16_u16Xu16Y_Cnt

  9. Max_m

  10. Min_m

  11. Limit_m

  12. DiagPStep_m

  13. DiagNStep_m

  14. DiagFailed_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 NameStepVarXY_u16_s16Xu16Y_CntTypeMinMaxUTP Tol.
Arguments PassedTableXsint16*-32,76832,767N/A
TableYuint16*065535N/A
Sizeuint1616N/A
inputsint16-32,76832,767N/A
Return ValueSee descriptionuint160655350

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_CuTempEst_DegC_f320
Rte_InitValue_DutyCycleLevel_Uls_f320
Rte_InitValue_FiltMeasTemp_DegC_f320
Rte_InitValue_FilteredPkCurr_AmpSq_f320
Rte_InitValue_MagTempEst_DegC_f320
Rte_InitValue_MotorVelCRF_MtrRadpS_f320
Rte_InitValue_MtrPkCurr_AmpSq_f320
Rte_InitValue_SiTempEst_DegC_f320
Rte_InitValue_ DiagStsDefTemp _Cnt_lgcFALSE
Rte_InitValue_ThermLimitPerc_Uls_f320
Rte_InitValue_ThermalLimit_MtrNm_f328.8
Rte_InitValue_DefeatDutySvc_Cnt_lgcFALSE
Rte_InitValue_ IgnTimeOff_Cnt_u320
Rte_InitValue_ VehTimeValid_Cnt_lgcFALSE

Initialization Functions

Init: _Init1

Design Rationale

None

Module Outputs

None

Store Module Inputs to Local copies

IgnTimeOff_Sec_T_u32 = Rte_IRead_ThrmlDutyCycle_Init1_IgnTimeOff_Cnt_u32()

VehTimeValid_Cnt_T_lgc = Rte_IRead_ThrmlDutyCycle_Init1_VehTimeValid_Cnt_lgc()

Module Internal


Periodic Functions

Per: _Per1

Design Rationale

None

Program Flow Start

Rte_Call_ThrmlDutyCycle_Per1_CP0_CheckpointReached()

Store Module Inputs to Local copies

CuTempEst_DegC_T_f32 = Rte_IRead_ThrmlDutyCycle_Per1_CuTempEst_DegC_f32()

FiltMeasTemp_DegC_T_f32 = Rte_IRead_ThrmlDutyCycle_Per1_FiltMeasTemp_DegC_f32()

FiltPkCurr_AmpSq_T_f32 = Rte_IRead_ThrmlDutyCycle_Per1_FilteredPkCurr_AmpSq_f32()

MagTempEst_DegC_T_f32 = Rte_IRead_ThrmlDutyCycle_Per1_MagTempEst_DegC_f32()

MotorVelCRF_MtrRadpS_T_f32 = Rte_IRead_ThrmlDutyCycle_Per1_MotorVelCRF_MtrRadpS_f32()

MtrPkCurr_AmpSq_T_f32 = Rte_IRead_ThrmlDutyCycle_Per1_MtrPkCurr_AmpSq_f32()

SiTempEst_DegC_T_f32 = Rte_IRead_ThrmlDutyCycle_Per1_SiTempEst_DegC_f32()

DefeatDutySvc_Cnt_T_lgc = Rte_IRead_ThrmlDutyCycle_Per1_DefeatDutySvc_Cnt_lgc_Cnt_lgc();

PrevAbsTempLimit_MtrNm_T_f32 = AbsTempLimit_MtrNm_M_f32

AbsMotorVelCRF_MtrRadpS_T_f32 = Abs_f32_m(MotorVelCRF_MtrRadpS_T_f32) Rte_Call_NxtrDiagMgr_GetNTCFailed(NTC_Num_Thermistor, &DiagStsDefTemp_Cnt_T_lgc)

Temperature Selection

Load Limiting – Multiplier

Load Limiting – Max Filter Percentage

Load Limiting – Thermal Load Limit

Temperature Limiting

Temperature Limiting Status

Store Local copy of outputs into Module Outputs

AbsTempLimit_MtrNm_M_f32 = AbsTempLimitSlew_MtrNm_T_f32

Mult12Temp_DegC_D_f32 = Mult12Temp_DegC_T_f32

Mult36Temp_DegC_D_f32 = Mult36Temp_DegC_T_f32

MaxOut_AmpSq_D_u16p0 = MaxOut_Uls_T_u16p0

ThermLim_MtrNm_D_f32 = ThermalLoadLmt_MtrNm_T_f32

Mult1_Uls_D_u3p13 = Mult1_Uls_T_u3p13

Mult2_Uls_D_u3p13 = Mult2_Uls_T_u3p13

Mult3_Uls_D_u3p13 = Mult3_Uls_T_u3p13

Mult4_Uls_D_u3p13 = Mult4_Uls_T_u3p13

Mult5_Uls_D_u3p13 = Mult5_Uls_T_u3p13

Mult6_Uls_D_u3p13 = Mult6_Uls_T_u3p13

LastTblVal_MtrNm_D_u9p7 = LastTblValRaw_MtrNm_T_u9p7

LastTblValSlew_MtrNm_D_u9p7 = LastTblVal_MtrNm_T_u9p7

AbsTempLimit_MtrNm_D_f32 = AbsTempLimit_MtrNm_T_f32

ThrmLoadLmtTblYVal_MtrNm_D_f32 = DivFactor_MtrNm_T_f32

Rte_IWrite_ThrmlDutyCycle_Per1_DutyCycleLevel_Uls_f32(MaxSlowFilt_Uls_T_f32)

Rte_IWrite_ThrmlDutyCycle_Per1_ThermLimitPerc_Uls_f32(ThermLimitPerc_Uls_T_f32)

Rte_IWrite_ThrmlDutyCycle_Per1_ThermalLimit_MtrNm_f32(ThermalLimit_MtrNm_T_f32)

Program Flow End

Rte_Call_ThrmlDutyCycle_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
ThrmlDutyCycle_Init1On EventOn Init
ThrmlDutyCycle_Per1100 msALL

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
ThrmlDutyCycle_Init1RTE_START_SEC_AP_THRMLDUTYCYCLE_APPL_CODE
ThrmlDutyCycle_Per1RTE_START_SEC_AP_THRMLDUTYCYCLE_APPL_CODE

Local Functions

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

Name of Sub ModuleSoftware Segment
None


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 Version (implements SF-09 v001)21-May-12OT
22.0Updated initial value of AssistThermScalar output, added limit on maxout terms to prevent overflow per new FDD design30-May-12LWW
33.0Updated values of 6 filter embedded data constants- Anom 344516-June-12NRAR
44.0Updated to SF-09 v00309-Jul-12OT
55.0Updated to SF-09 v00409-Aug-12BWL
66.0MDD fixes per unit test review.10-Aug-12BWL
77.0Added checkpoints and memmap software segment is updated for static variables24-Sep-12Selva
88.0Replaced multiplier interpolation with step function.16-Oct-12BWL
99.0Updated to SF-09 v00629-Jan-13Selva
1010Corrected Diag_Status reading function31-Jan-13Selva
1111Updated to SF-09 v00720-Feb-13SP
1212Fix Anomoly 451728-Feb-13Selva
1313,14

Updated to SF-09 v008`

Tessy Unit test fixes

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