Controller_Temperature_MDD

Module -- Controller Temperature

High-Level Description

This module monitors the controller’s temperature sensor output, filters that output, and checks whether the output is within a lower and upper limit.

Figures

Diagram – Function Data Sharing

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


Module Inputs and Outputs

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 Inputs (Global Variable Name)Module Outputs (Global Variable Name)
DiagStsTempRdPrf_Cnt_lgcFiltMeasTemp_DegC_f32
TemperatureADC_Volt_f32
AmbTemp_DegC_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.

(Note: If no module specific variables are used by the design, place the text “None” in the first Variable Name cell in the table)

Variable NameResolution

Legal Range

(min)

Legal Range

(max)

Software Segment
CtrlTemp_CtrlTempSV_M_strLPF32KSV_Strsee data dictionarysee data dictionaryCTRLTEMP_START_SEC_VAR_CLEARED_UNSPECIFIED
CtrlTemp_CtrlTempSV_M_str .K_Uls_f32Single Precision Floating Pointsee data dictionarysee data dictionary
CtrlTemp_CtrlTempSV_M_str .SV_Uls_f32Single Precision Floating Pointsee data dictionarysee data dictionary
CtrlTemp_CtrlTemp_DegC_M_f32Single Precision Floating Pointsee data dictionarysee data dictionaryCTRLTEMP_START_SEC_VAR_CLEARED_32
CtrlTemp_CtrlTempErrorAcc_Cnt_M_u161see data dictionarysee data dictionaryCTRLTEMP_START_SEC_VAR_CLEARED_16
CtrlTemp_CtrlTempFiltOut_DegC_D_f32Single Precision Floating Pointsee data dictionarysee data dictionaryCTRLTEMP_START_SEC_VAR_CLEARED_32

User defined typedef definition/declaration

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

Variable NameTypedef NameStorage TypeSafety Critical Classification
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.

(Note: If no calibrations are used by the design, place the text “None” in the first location in the table)

Constant Name
k_TempSnsrFiltDft_Cnt_lgc
k_TempSnsrLPFKn_Hz_f32
k_TempSnsrDefVal_DegC_f32
k_TempSensDiag_Cnt_str
k_TempSensLowLimit_DegC_f32
k_TempSensHighLimit_DegC_f32
k_TempSnsrScaling_DegpVolt_f32
k_TempSnsrOffset_Volts_f32
k_CustDiagAmbLowThresh_DegC_f32
k_CustDiagAmbLowEnable_Cnt_lgc

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 NameResolutionValue
D_CTRLTEMPLOLMT_DEGC_F32Single Precision Floating Point-50.0
D_CTRLTEMPHILMT_DEGC_F32Single Precision Floating Point150.0

Note: RtnLoopTime depends on the rate of the periodic function.

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_ZERO_ULS_F32
D_FALSE_CNT_LGC

Module specific Lookup Tables Constants

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

Constant NameResolutionValueSoftware Segment

Functions/Macros used by the Sub-Modules

Library Functions / Macros

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

  1. LPF_Init_f32_m

  2. LPF_OpUpdate_f32_m ()

  3. Limit_m()

  4. DiagPStep_m

  5. DiagNStep_m

  6. DiagFailed_m

Data Hiding Functions

The data hiding functions / macros used in this module are identified below,

  1. None

Local Functions/Macros Used by this MDD only

  1. None

Software Module Implementation

Initialization Functions

Init: CtrlTemp_ Init1

Design Rationale

None

Module Outputs

Module Internal

TempADC_Volts_T_f32 = Rte_IRead_CtrlTemp_Init1_TemperatureADC_Volt_f32()

CtrlTemp_DegC_T_f32 = (TempADC_Volts_T_f32 – k_TempSnsrOffset_Volts_f32) * k_TempSnsrScaling_DegpVolt_f32

CtrlTemp_CtrlTemp_DegC_M_f32 = Limit_m(CtrlTemp_DegC_T_f32, D_CTRLTEMPLOLMT_DEGC_F32, D_CTRLTEMPHILMT_DEGC_F32)

CtrlLPF_Init_f32_m(CtrlTemp_CtrlTemp_DegC_M_f32, k_TempSnsrLPFKn_Hz_f32, D_2MS_SEC_F32, & CtrlTemp_CtrlTempSV_M_str)

Rte_IWrite_CtrlTemp_Init1_FiltMeasTemp_DegC_f32 (CtrlTemp_CtrlTemp_DegC_M_f32)


Periodic Functions

Per: CtrlTemp_Per1

Design Rationale

None

Program Flow Start

Rte_Call_CtrlTemp_Per1_CP0_CheckpointReached()

Store Module Inputs to Local copies

DiagStsTempRdPrf_Cnt_T_lgc = Rte_Iread_CtrlTemp_Per1_DiagStsTempRdPrf_Cnt_lgc();

TempADC_Volts_T_f32 = Rte_Iread_CtrlTemp_Per1_TemperatureADC_Volt_f32()

CtrlTemp_DegC_T_f32 = (TempADC_Volts_T_f32 – k_TempSnsrOffset_Volts_f32) * k_TempSnsrScaling_DegpVolt_f32

(Processing of function)………

Calculate Temperature

Store Local copy of outputs into Module Outputs

CtrlTemp_DegC_T_f32 = Limit_m(CtrlTemp_DegC_T_f32, D_CTRLTEMPLOLMT_DEGC_F32, D_CTRLTEMPHILMT_DEGC_F32);

Rte_Iwrite_CtrlTemp_Per1_FiltMeasTemp_DegC_f32 (CtrlTemp_DegC_T_f32 );

Program Flow End

Rte_Call_CtrlTemp_Per1_CP1_CheckpointReached()

Per: CtrlTemp_Per2

Design Rationale

None

Program Flow Start

Rte_Call_CtrlTemp_Per2_CP0_CheckpointReached()

Store Module Inputs to Local copies

(Processing of function)………

Store Local copy of outputs into Module Outputs

Program Flow End

Rte_Call_CtrlTemp_Per2_CP1_CheckpointReached()


Fault Recovery Functions

None

Shutdown Functions

None

Interrupt Functions

None

Serial Communication Functions

None

Local Function/Macro Definitions

None


Execution Requirements

Execution Sequence of the Module

Execution Rates for sub-modules called by the Scheduler

This table serves as reference for the Scheduler design

Function NameTask ListCalling FrequencySystem State(s) in which the function is called
CtrlTemp_Init1()OnceOnce after RTE is started
CtrlTemp_Per1()2msAll
CtrlTemp_Per2()100msAll

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
CtrlTem_Init1()RTE_SA_CTRLTEMP_APPL_CODE
CtrlTem_Per1()RTE_SA_CTRLTEMP_APPL_CODE
CtrlTem_Per2()RTE_SA_CTRLTEMP_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. None


Revision Control Log

Item #Rev #Change DescriptionDateAuthor Initials
11.0Initial release18MAY11SAH
22.0Added Reduced Performace temperature selecture per #SF-6 00102DEC11M. Story
33.0Anomaly 2995 Limits not set correctly29FEB12M. Story
44.0Anomaly 2994 use CntrlTemp_DegC_T_f32 temporary variable internal to the Per1 function03MAR12M. Story
55.0Updated component to FDD SF-06 revision 416May12KJS
66.0Updated floating point filter structure with K and SV ranges12Jun12KJS
77.0Anomaly 3505 Use output from LPF for diagnostics.23Aug12Srikanth
88.0Added watchdog checkpoints.16 Sept 12BWL
99.0Added “Variables” missing from Module internal variable and their software segment18 sep 12SSK
1010.0Changed local constants to calibration to facilate the use of different temperature sensors.
1111.0Corrected naming conventions of new conversion calibrations.08Nov12LN
1212.0Corrected anomaly 454106Apr13KJS
1313.0Changed conditions on diagnostic per FDD SF—06 ver007; updated module and display variable names per naming conventions; updated temporary variable names for clarity; added missing section 5 and updated numbering on remaining sections17-Sep-13KMC
Last modified October 12, 2025: Initial commit (0347a62)