StabiliCtrlTorqueOverlay_MDD

Module -- Stability Control Torque Overlay66

High-Level Description

This function describes the algorithms used to implement the activation logic for torque overlay functionality related to dynamic stability.

Figures

Diagram – Function Data Sharing

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

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 Inputs (Global Variable Name)Module Outputs (Global Variable Name)
DSTTOCState_Cnt_u08DSTActive_Cnt_lgc
DSTEnableRqst_Cnt_lgcDSTState_Cnt_u08
DSTExtSystemFltActive_Cnt_lgcDSTSlewStart_Cnt_lgc
DSTErrCntrRecvLevel_Cnt_u08
DSTTrqOvCmdRqst_HwNm_f32
DSTTrqOvRqstValid_Cnt_lgc
NTCDSTMaxValue_Cnt_T_lgc
NTCDSTMaxRate_Cnt_lgc
NTCDSTMaxTime_Cnt_lgc
NTCDSTXOR_Cnt_lgc
NTCDSTStuckValue_Cnt_lgc
TOEOLDisable_Cnt_lgc
DSTSlewComplete_Cnt_lgc
TrqOvReverseGearEngage_Cnt_lgc
VehicleSpeed_Kph_f32
VehicleSpeedValid_ Cnt_lgc
LimitPercentFiltered_Uls_f32
NTCLowBattVtg_Cnt_T_lgc
DiagStsNonRecRmpToZeroFltPres_Cnt_lgc
DiagStsRecRmpToZeroFltPres_Cnt_lgc
DSTFuncPresent_Cnt_lgc
SystemState_Mode
DSTRevGearValid_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 NameUser Defined TypeResolution

Legal Range

(min)

Legal Range

(max)

Software Segment
DSTRDTimer_M_mS_u32UINT32N/AFULLFULLSTBCTO_START_SEC_VAR_CLEARED_32
DSTTNATimer_M_mS_u32UINT32N/AFULLFULLSTBCTO_START_SEC_VAR_CLEARED_32
RDStateCounter_Cnt_M_u08UINT8N/A0255STBCTO_START_SEC_VAR_CLEARED_8
DSTVspdActive_Cnt_M_lgcBOOLEANN/AFALSETRUESTBCTO_START_SEC_VAR_CLEARED_BOOLEAN
DSTBkwdMotionAbsent_Cnt_M_lgcBOOLEANN/AFALSETRUESTBCTO_START_SEC_VAR_CLEARED_BOOLEAN
VehExtCondDSTActive_Cnt_M_lgcBOOLEANN/AFALSETRUESTBCTO_START_SEC_VAR_CLEARED_BOOLEAN
IntCondDSTEnable_Cnt_M_lgcBOOLEANN/AFALSETRUESTBCTO_START_SEC_VAR_CLEARED_BOOLEAN
LoSpdInactive_Cnt_M_lgcBOOLEANN/AFALSETRUESTBCTO_START_SEC_VAR_CLEARED_BOOLEAN
HiSpdInactive_Cnt_M_lgcBOOLEANN/AFALSETRUESTBCTO_START_SEC_VAR_CLEARED_BOOLEAN
DiagStsNonRecRmpToZeroFltPres_Cnt_M_lgcBOOLEANN/AFALSETRUESTBCTO_START_SEC_VAR_CLEARED_BOOLEAN
DiagStsRecRmpToZeroFltPres_Cnt_M_lgcBOOLEANN/AFALSETRUESTBCTO_START_SEC_VAR_CLEARED_BOOLEAN
DSTInternalCondTimer_mS_M_u32UINT32N/AFULLFULLSTBCTO_START_SEC_VAR_NOINIT_32
DSTBkwdMotionTime_mS_M_u32UINT32N/AFULLFULLSTBCTO_START_SEC_VAR_NOINIT_32
activeTimer_mS_M_u32UINT32N/AFULLFULLSTBCTO_START_SEC_VAR_CLEARED_32
InactiveTimer_mS_M_u32UINT32N/AFULLFULLSTBCTO_START_SEC_VAR_CLEARED_32
DSTState_Cnt_M_enumTOC_STATEN/A08STBCTO_START_SEC_VAR_CLEARED_UNSPECIFIED
StartTNATimer_Cnt_M_lgcBOOLEANN/AFALSETRUESTBCTO_START_SEC_VAR_CLEARED_BOOLEAN
StartRDTimer_Cnt_M_lgcBOOLEANN/AFALSETRUESTBCTO_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)

typedef void(*DSTHandler_T)(boolean*DSTActive_T_lgc,boolean*DSTSlewStart_T_lgc)
TOC_STATETOCSTATE_OFFUint80
TOCSTATE_TNA1
TOCSTATE_PNA2
TOCSTATE_READY3
TOCSTATE_REQUESTDENIED4
TOCSTATE_ACTIVEMODE055
TOCSTATE_ACTIVEMODE066
TOCSTATE_ACTIVEMODE077
TOCSTATE_NOTAVAILABLE8

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_DSTVSpdVLH_Kph_f32
k_DSTVSpdVHH_Kph_f32
k_DSTVSpdVLL_Kph_f32
k_DSTVSpdVHL_Kph_f32
k_DSTVehSpdActvTime_mS_u16
k_DSTVehSpdInActvTime_mS_u16
k_DSTBkwdMotionTime_mS_u16
k_TrqOverlayLimitPerc_Uls_f32
k_TrqOverlaySuspendTime_mS_u16
k_DSTTrqOvActiveMaxLimit_MtrNm_f32
k_DSTTNAMaxTime_mS_u16
k_DSTRDMaxTime_mS_u16
k_DSTRDStateMaxCount_Cnt_u08

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

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_ONE_CNT_U8

Module specific Lookup Tables Constants

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

Constant NameResolutionValueSoftware Segment
t_DSTStates_Cnt_Fnn/a

&StbCTO_DSTSt_Off

&StbCTO_DSTSt_TNA

&StbCTO_DSTSt_PNA

&StbCTO_DSTSt_Ready

&StbCTO_DSTSt_RequestDenied

&StbCTO_DSTSt_Active

&StbCTO_DSTSt_Active

&StbCTO_DSTSt_Active

&StbCTO_DSTSt_NotApplicable

AP_STBCTO_CODE

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,

Data Hiding Functions

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

  1. Rte_Call_NxtrDiagMgr_SetNTCStatus()

Local Functions/Macros Used by this MDD only

(Note if they are defined in another source file, then reference the appropriate header file)

The local functions/macros in this module are identified below,

  1. StbCTO_DSTSt_Notvailable ()

  2. StbCTO_DSTSt_Off()

  3. StbCTO_DSTSt_TNA()

  4. StbCTO_DSTSt_PNA()

  5. StbCTO_DSTSt_Ready()

  6. StbCTO_DSTSt_Active()

  7. StbCTO_DSTSt_RequestDenied()

Software Module Implementation

Initialization Functions

Module state variables are initialized to 0 at start-up by RAM init.

LoSpdInactive_Cnt_M_lgc = TRUE


Periodic Functions

Per: StbCTO_Per1

Design Rationale

  1. StartTNATimer_Cnt_M_lgc, This var is set to TRUE whenever transitioning to TNA state to initialize TNA Timer and set to FALSE when TNA timer is expired. Timer expired is checked in StartandStopTimer()

  2. StartRDTimer_Cnt_M_lgc, This var is set to TRUE whenever transitioning to RD state to initialize RD Timer and set to FALSE when RD timer is expired. Timer expired is checked in StartandStopTimer()

Program Flow Start

Rte_Call_StbCTO_Per1_CP0_CheckpointReached()

Store Module Inputs to Local copies

SysState_Cnt_T_Enum = Rte_Mode_SystemState_Mode()

DSTFuncPresent_Cnt_T_lgc = Rte_IRead_StbCTO_Per1_DSTFuncPresent_Cnt_lgc()

Rte_Call_NxtrDiagMgr_GetNTCFailed(NTC_Num_ExVoltageLow, &NTCLowBattVtg_Cnt_T_lgc)

HalfActive_Cnt_T_lgc = Rte_IRead_StbCTO_Per1_HalfActive_Cnt_lgc()

LimitPercentFiltered_Uls_T_f32 = Rte_IRead_StbCTO_Per1_LimitPercentFiltered_Uls_f32()

PrkAssistActive_Cnt_T_lgc = Rte_IRead_StbCTO_Per1_PrkAssistActive_Cnt_lgc()

TrqOvReverseGearEngage_Cnt_lgc = Rte_IRead_StbCTO_Per1_TrqOvReverseGearEngage_Cnt_lgc()

VehicleSpeed_Kph_T_f32 = Rte_IRead_StbCTO_Per1_VehicleSpeed_Kph_f32()

DiagStsNonRecRmpToZeroFltPres_Cnt_M_lgc = Rte_IRead_StbCTO_Per1_DiagStsNonRecRmpToZeroFltPres_Cnt_lgc()

DiagStsRecRmpToZeroFltPres_Cnt_M_lgc = Rte_IRead_StbCTO_Per1_DiagStsRecRmpToZeroFltPres_Cnt_lgc()

VehicleSpeedValid_Cnt_T_lgc = Rte_IRead_StbCTO_Per1_VehicleSpeedValid_Cnt_lgc()

DSTRevGearValid_Cnt_T_lgc = Rte_IRead_StbCTO_Per1_DSTRevGearValid_Cnt_lgc()

PrevDSTState_Cnt_T_enum = DSTState_Cnt_M_enum;

Rte_Call_NxtrDiagMgr_GetNTCFailed(NTC_Num_VLF_10, &NTCDSTNotPresentCmdNotZero_Cnt_T_lgc);

Rte_Call_NxtrDiagMgr_GetNTCFailed(NTC_Num_VLF_11, &NTCDSTEnableTrqRqstNotZero_Cnt_T_lgc);

Rte_Call_NxtrDiagMgr_GetNTCFailed(NTC_Num_VLF_12, &NTCDSTStateRqstDenied_Cnt_T_lgc);

Rte_Call_NxtrDiagMgr_GetNTCFailed(NTC_Num_VLF_13, &NTCDSTPresentTNARDTimerExpired_Cnt_T_lgc)

Perform Over and Low Voltage Diagnostics

Store Local copy of outputs into Module Outputs

Rte_IWrite_StbCTO_Per1_DSTSlewStart_Cnt_lgc(DSTSlewStart_Cnt_T_lgc)

Rte_IWrite_StbCTO_Per1_DSTActive_Cnt_lgc(DSTActive_Cnt_M_lgc)

Rte_IWrite_StbCTO_Per1_DSTState_Cnt_u08 (DSTState_Cnt_M_enum)

Program Flow End

Rte_Call_StbCTO_Per1_CP1_CheckpointReached()

Fault Recovery Functions

None

Shutdown Functions

None

Interrupt Functions

None

Serial Communication Functions

None

Local Function/Macro Definitions

NotAVailable

Function NameStbCTO_DSTSt_NotAvailableTypeMinMax
Arguments PassedDSTActive_T_lgcboolean pointerFALSETRUE
DSTSlewStart_T_lgcboolean pointerFALSETRUE
Return ValueN/A

Description

/* This function does nothing. */

DSTActive_T_lgc = DSTActive_T_lgc

DSTSlewStart_T_lgc = DSTSlewStart_T_lgc

OFF state

Function NameStbCTO_DSTSt_OffTypeMinMax
Arguments PassedDSTActive_T_lgcboolean pointerFULLFULL
DSTSlewStart_T_lgcboolean pointerFALSETRUE
Return ValueN/A

Description

TNA

Function NameStbCTO_DSTSt_TNATypeMinMax
Arguments PassedDSTActive_T_lgcboolean pointerFALSETRUE
DSTSlewStart_T_lgcboolean pointerFALSETRUE
Return ValueN/A

Description

PNA

Function NameStbCTO_DSTSt_PNATypeMinMax
Arguments PassedDSTActive_T_lgcboolean pointerFULLFULL
DSTSlewStart_T_lgcboolean pointerFALSETRUE
Return ValueN/A

Description

READY

Function NameStbCTO_DSTSt_ReadyTypeMinMax
Arguments PassedDSTActive_T_lgcboolean pointerFULLFULL
DSTSlewStart_T_lgcboolean pointerFALSETRUE
Return ValueN/A

Description


ACTIVE

Function NameStbCTO_DSTSt_ActiveTypeMinMax
Arguments PassedDSTActive_T_lgcboolean pointerFULLFULL
DSTSlewStart_T_lgcboolean pointerFALSETRUE
Return ValueN/A

Description

REQUEST DENIED

Function NameStbCTO_DSTSt_RequestDeniedTypeMinMax
Arguments PassedDSTActive_T_lgcboolean pointerFULLFULL
DSTSlewStart_T_lgcboolean pointerFALSETRUE
Return ValueDSTActive_T_lgcboolean pointerFULLFULL

Description

StartAndStopTimer

Function NameStartAndStopTimerTypeMinMax
Arguments PassedStartTime_mS_T_u32Uint32FULLFULL
TimeOut_mS_T_u16Uint1605000
StartTimer_Cnt_T_lgcBoolean pointerFALSETRUE
Return ValueN/A

Execution Requirements

Execution Sequence of the Module

(Describe in words relevant details about the execution sequence of the different sub modules.)

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
StbCTO_Init1Executed once after the RTE is startedALL
StbCTO_per12msWARMINIT, OPERATE,DISABLE

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
StbCTO _Per1()RTE_AP_STBCTO_APPL_CODE

Local Functions

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

Name of Sub ModuleSoftware Segment
StbCTO_DSTSt_NotApplicableAP_STBCTO_CODE
StbCTO_DSTSt_OffAP_STBCTO_CODE
StbCTO_DSTSt_TNAAP_STBCTO_CODE
StbCTO_DSTSt_PNAAP_STBCTO_CODE
StbCTO_DSTSt_ReadyAP_STBCTO_CODE
StbCTO_DSTSt_ActiveAP_STBCTO_CODE
StbCTO_DSTSt_RequestDeniedAP_STBCTO_CODE
StartAndStopTimerAP_STBCTO_CODE


Known Issues / Limitations With Design

This module is not meeting FDD for below points:

1) System_State is not shown as input in FDD sec 3 and sec 3.1

2) HalF_Active and PrkAssist_Active is not used in this module, But these are shown in FDD Sec 3, 3.1, 3.3

This is informed to FDD owner and FDD will be updated for next release.

Revision Control Log

Item #Rev #Change DescriptionDateAuthor Initials
11.0Initial AutoSAR release.19-Oct-12NRAR
22.0Updated design rationale in Per1 and Sec 927-Nov-12NRAR
33.0Updated some of the port names27-Nov-12NRAR
44.0Corrected anomaly 4476 and 4477 SCR 743821-Fev-13DD
55.0Set DSTActive as a global variable23-Fev-13DD
66.0Correct transition from ACTIVE to Request Denied23-Fev-13DD
77.0Update to FDD 40C v004, v00509-May-13BDO
88.0Updated StbCTO_DSTSt_Active() to support for Tessy coverage limitations, update StartAndStopTimer()28-May-13BDO
99.0Updated to CF08B Ver 00115-Jul-13SP
1010.0Added logic to pass the NTCs if the enable criteria is FALSE, And added AbsDSTTrqOvCmdRqst_HwNm_T_f32 in StbCTO_DSTSt_Ready to fix the QAC Warning08-Oct-13MR
1111.0Added logic to pass the NTC as per FDD version CF08B Ver4.22-Oct-13MR
1212.0Updated to CF-08B v00523-Jan-14VT
Last modified October 12, 2025: Initial commit (0347a62)