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_u08 | DSTActive_Cnt_lgc |
DSTEnableRqst_Cnt_lgc | DSTState_Cnt_u08 |
DSTExtSystemFltActive_Cnt_lgc | DSTSlewStart_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 Name | User Defined Type | Resolution | Legal Range (min) | Legal Range (max) | Software Segment |
---|---|---|---|---|---|
DSTRDTimer_M_mS_u32 | UINT32 | N/A | FULL | FULL | STBCTO_START_SEC_VAR_CLEARED_32 |
DSTTNATimer_M_mS_u32 | UINT32 | N/A | FULL | FULL | STBCTO_START_SEC_VAR_CLEARED_32 |
RDStateCounter_Cnt_M_u08 | UINT8 | N/A | 0 | 255 | STBCTO_START_SEC_VAR_CLEARED_8 |
DSTVspdActive_Cnt_M_lgc | BOOLEAN | N/A | FALSE | TRUE | STBCTO_START_SEC_VAR_CLEARED_BOOLEAN |
DSTBkwdMotionAbsent_Cnt_M_lgc | BOOLEAN | N/A | FALSE | TRUE | STBCTO_START_SEC_VAR_CLEARED_BOOLEAN |
VehExtCondDSTActive_Cnt_M_lgc | BOOLEAN | N/A | FALSE | TRUE | STBCTO_START_SEC_VAR_CLEARED_BOOLEAN |
IntCondDSTEnable_Cnt_M_lgc | BOOLEAN | N/A | FALSE | TRUE | STBCTO_START_SEC_VAR_CLEARED_BOOLEAN |
LoSpdInactive_Cnt_M_lgc | BOOLEAN | N/A | FALSE | TRUE | STBCTO_START_SEC_VAR_CLEARED_BOOLEAN |
HiSpdInactive_Cnt_M_lgc | BOOLEAN | N/A | FALSE | TRUE | STBCTO_START_SEC_VAR_CLEARED_BOOLEAN |
DiagStsNonRecRmpToZeroFltPres_Cnt_M_lgc | BOOLEAN | N/A | FALSE | TRUE | STBCTO_START_SEC_VAR_CLEARED_BOOLEAN |
DiagStsRecRmpToZeroFltPres_Cnt_M_lgc | BOOLEAN | N/A | FALSE | TRUE | STBCTO_START_SEC_VAR_CLEARED_BOOLEAN |
DSTInternalCondTimer_mS_M_u32 | UINT32 | N/A | FULL | FULL | STBCTO_START_SEC_VAR_NOINIT_32 |
DSTBkwdMotionTime_mS_M_u32 | UINT32 | N/A | FULL | FULL | STBCTO_START_SEC_VAR_NOINIT_32 |
activeTimer_mS_M_u32 | UINT32 | N/A | FULL | FULL | STBCTO_START_SEC_VAR_CLEARED_32 |
InactiveTimer_mS_M_u32 | UINT32 | N/A | FULL | FULL | STBCTO_START_SEC_VAR_CLEARED_32 |
DSTState_Cnt_M_enum | TOC_STATE | N/A | 0 | 8 | STBCTO_START_SEC_VAR_CLEARED_UNSPECIFIED |
StartTNATimer_Cnt_M_lgc | BOOLEAN | N/A | FALSE | TRUE | STBCTO_START_SEC_VAR_CLEARED_BOOLEAN |
StartRDTimer_Cnt_M_lgc | BOOLEAN | N/A | FALSE | TRUE | STBCTO_START_SEC_VAR_CLEARED_BOOLEAN |
User defined typedef definition/declaration
This section documents any user types uniquely used for the module.
Typedef Name | Element Name | User Defined Type | Legal Range (min) | Legal Range (max) |
typedef void(*DSTHandler_T)(boolean*DSTActive_T_lgc,boolean*DSTSlewStart_T_lgc) | ||||
TOC_STATE | TOCSTATE_OFF | Uint8 | 0 | |
TOCSTATE_TNA | 1 | |||
TOCSTATE_PNA | 2 | |||
TOCSTATE_READY | 3 | |||
TOCSTATE_REQUESTDENIED | 4 | |||
TOCSTATE_ACTIVEMODE05 | 5 | |||
TOCSTATE_ACTIVEMODE06 | 6 | |||
TOCSTATE_ACTIVEMODE07 | 7 | |||
TOCSTATE_NOTAVAILABLE | 8 |
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 Name | Resolution | Value |
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 Name | Resolution | Value | Software Segment |
t_DSTStates_Cnt_Fn | n/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,
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,
StbCTO_DSTSt_Notvailable ()
StbCTO_DSTSt_Off()
StbCTO_DSTSt_TNA()
StbCTO_DSTSt_PNA()
StbCTO_DSTSt_Ready()
StbCTO_DSTSt_Active()
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
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()
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 Name | StbCTO_DSTSt_NotAvailable | Type | Min | Max |
Arguments Passed | DSTActive_T_lgc | boolean pointer | FALSE | TRUE |
DSTSlewStart_T_lgc | boolean pointer | FALSE | TRUE | |
Return Value | N/A |
Description
/* This function does nothing. */
DSTActive_T_lgc = DSTActive_T_lgc
DSTSlewStart_T_lgc = DSTSlewStart_T_lgc
OFF state
Function Name | StbCTO_DSTSt_Off | Type | Min | Max |
Arguments Passed | DSTActive_T_lgc | boolean pointer | FULL | FULL |
DSTSlewStart_T_lgc | boolean pointer | FALSE | TRUE | |
Return Value | N/A |
Description
TNA
Function Name | StbCTO_DSTSt_TNA | Type | Min | Max |
Arguments Passed | DSTActive_T_lgc | boolean pointer | FALSE | TRUE |
DSTSlewStart_T_lgc | boolean pointer | FALSE | TRUE | |
Return Value | N/A |
Description
PNA
Function Name | StbCTO_DSTSt_PNA | Type | Min | Max |
Arguments Passed | DSTActive_T_lgc | boolean pointer | FULL | FULL |
DSTSlewStart_T_lgc | boolean pointer | FALSE | TRUE | |
Return Value | N/A |
Description
READY
Function Name | StbCTO_DSTSt_Ready | Type | Min | Max |
Arguments Passed | DSTActive_T_lgc | boolean pointer | FULL | FULL |
DSTSlewStart_T_lgc | boolean pointer | FALSE | TRUE | |
Return Value | N/A |
Description
ACTIVE
Function Name | StbCTO_DSTSt_Active | Type | Min | Max |
Arguments Passed | DSTActive_T_lgc | boolean pointer | FULL | FULL |
DSTSlewStart_T_lgc | boolean pointer | FALSE | TRUE | |
Return Value | N/A |
Description
REQUEST DENIED
Function Name | StbCTO_DSTSt_RequestDenied | Type | Min | Max |
Arguments Passed | DSTActive_T_lgc | boolean pointer | FULL | FULL |
DSTSlewStart_T_lgc | boolean pointer | FALSE | TRUE | |
Return Value | DSTActive_T_lgc | boolean pointer | FULL | FULL |
Description
StartAndStopTimer
Function Name | StartAndStopTimer | Type | Min | Max |
Arguments Passed | StartTime_mS_T_u32 | Uint32 | FULL | FULL |
TimeOut_mS_T_u16 | Uint16 | 0 | 5000 | |
StartTimer_Cnt_T_lgc | Boolean pointer | FALSE | TRUE | |
Return Value | N/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 Name | Task List | Calling Frequency | System State(s) in which the function is called |
StbCTO_Init1 | Executed once after the RTE is started | ALL | |
StbCTO_per1 | 2ms | WARMINIT, OPERATE,DISABLE |
Execution Requirements for Serial Communication Functions
Function Name | Sub-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 Module | Software 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 Module | Software Segment |
StbCTO_DSTSt_NotApplicable | AP_STBCTO_CODE |
StbCTO_DSTSt_Off | AP_STBCTO_CODE |
StbCTO_DSTSt_TNA | AP_STBCTO_CODE |
StbCTO_DSTSt_PNA | AP_STBCTO_CODE |
StbCTO_DSTSt_Ready | AP_STBCTO_CODE |
StbCTO_DSTSt_Active | AP_STBCTO_CODE |
StbCTO_DSTSt_RequestDenied | AP_STBCTO_CODE |
StartAndStopTimer | AP_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 Description | Date | Author Initials |
1 | 1.0 | Initial AutoSAR release. | 19-Oct-12 | NRAR |
2 | 2.0 | Updated design rationale in Per1 and Sec 9 | 27-Nov-12 | NRAR |
3 | 3.0 | Updated some of the port names | 27-Nov-12 | NRAR |
4 | 4.0 | Corrected anomaly 4476 and 4477 SCR 7438 | 21-Fev-13 | DD |
5 | 5.0 | Set DSTActive as a global variable | 23-Fev-13 | DD |
6 | 6.0 | Correct transition from ACTIVE to Request Denied | 23-Fev-13 | DD |
7 | 7.0 | Update to FDD 40C v004, v005 | 09-May-13 | BDO |
8 | 8.0 | Updated StbCTO_DSTSt_Active() to support for Tessy coverage limitations, update StartAndStopTimer() | 28-May-13 | BDO |
9 | 9.0 | Updated to CF08B Ver 001 | 15-Jul-13 | SP |
10 | 10.0 | Added 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 Warning | 08-Oct-13 | MR |
11 | 11.0 | Added logic to pass the NTC as per FDD version CF08B Ver4. | 22-Oct-13 | MR |
12 | 12.0 | Updated to CF-08B v005 | 23-Jan-14 | VT |