HaLFTO_MDD

Module -- HaLFTO

High-Level Description

This function describes the activation logic used to implement the torque overlay functionality related to lane departure warning with haptic lane feedback.

Figures

Component Diagram

Diagram – Function HaLFTO_Per1

This diagram describes the functional characteristics and data flow of a given function.


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
HaLFEnableRqst_Cnt_lgcHaLFActive_Cnt_lgc
HaLFState_Cnt_u08
HaLFIntSystemFltActive_Cnt_lgcHaLFSuspend_Cnt_lgc
HaLFErrInterfaceActive_Cnt_lgc
HaLFExtSystemFltActive_Cnt_lgc
VehicleSpeed_Kph_f32
HaLFSWATrqFail_Cnt_lgc
HaLFTrqOvReverseGearEngage_Cnt_lgc
HaLFSlewComplete_Cnt_lgc
HaLFFuncPresent_Cnt_lgc
HwTorque_HwNm_f32
SystemState_Mode
LimitPercentFiltered_Uls_f32
DSTState_Cnt_u08
TOEOLDisable_Cnt_lgc
PrevHaLFEnableRqst_Cnt_lgc
PrevHaLFTrqOvCmdRqst_MtrNm_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
HaLFTO_DeactDSTStateChkFail_Cnt_D_lgc1FALSETRUEHALFTO_START_SEC_VAR_CLEARED_BOOLEAN
HaLFTO_IncorHaLFActvnFailed_Cnt_M_lgc1FALSETRUEHALFTO_START_SEC_VAR_CLEARED_BOOLEAN
HaLFTO_HaLFDeactLongFailed_Cnt_M_lgc1FALSETRUEHALFTO_START_SEC_VAR_CLEARED_BOOLEAN
HaLFTO_IncorHaLFActvnHwTrqTimer_mS_M_u321FULLFULLHALFTO_START_SEC_VAR_NOINIT_32
HaLFTO_IncorHaLFActvnVehSpdTimer_mS_M_u321FULLFULLHALFTO_START_SEC_VAR_NOINIT_32
HaLFTO_IncorHaLFActvnRevGearTimer_mS_M_u321FULLFULLHALFTO_START_SEC_VAR_NOINIT_32
HaLFTO_HaLFDeactHwTrqTimer_mS_M_u321FULLFULLHALFTO_START_SEC_VAR_NOINIT_32
HaLFTO_HaLFDeactVehSpdTimer_mS_M_u321FULLFULLHALFTO_START_SEC_VAR_NOINIT_32
HaLFTO_HaLFDeactRevGearTimer_mS_M_u321FULLFULLHALFTO_START_SEC_VAR_NOINIT_32
HaLFTO_DSTSyncTimer_mS_M_u321FULLFULLHALFTO_START_SEC_VAR_NOINIT_32
HaLFTO_LimitPercentFilteredTimer_mS_M_u321FULLFULLHALFTO_START_SEC_VAR_NOINIT_32
HaLFTO_State_Cnt_M_u08103HALFTO_START_SEC_VAR_CLEARED_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_HaLFActvHwTrqTime_mS_u16
k_HaLFActvMaxHwTrq_mS_f32
k_HaLFActvVehSpdTime_mS_u16
k_HaLFActvMinVehSpd_Kph_f32
k_HaLFActvMaxVehSpd_Kph_f32
k_HaLFActvRevGearTime_mS_u16
k_HaLFDeactHwTrqTime_mS_u16
k_HaLFDeactMaxHwTrq_HwNm_f32
k_HaLFDeactVehSpdTime_mS_u16
k_HaLFDeactMinVehSpd_Kph_f32
k_HaLFDeactMaxVehSpd_Kph_f32
k_HaLFDeactRevGearTime_mS_u16
k_HaLFDSTSyncTime_mS_u16
k_TrqOverlayLimitPerc_Uls_f32
k_TrqOverlaySuspendTime_mS_u16

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_HALFSTATEINACTIVE_CNT_U081Counts0
D_HALFSTATEACTIVE_CNT_U081Counts1
D_HALFSTATEIHIBITED_CNT_U081Counts2
D_HALFSTATERECOVERABLE_CNT_U081Counts3
D_DSTACTIVE1_CNT_U081Counts5
D_DSTACTIVE2_CNT_U081Counts6
D_DSTACTIVE3_CNT_U081Counts7
D_INCORHALFACTVNMASK_CNT_U081Counts1
D_HALFDEACTLONGMASK_CNT_U081Counts2

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


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

  2. Rte_Call_SystemTime_GetSystemTime_mS_u32

  3. Rte_Call_SystemTime_DtrmnElapsedTime_mS_u16

  4. Rte_Call_NxtrDiagMgr_GetNTCFailed

  5. Rte_Call_NxtrDiagMgr_SetNTCStatus

  6. Rte_Call_HaLFState_SCom_Transition

Data Hiding Functions

  1. Rte_Mode_SystemState_Mode

Local Functions/Macros Used by this MDD only

Common HwTrqVehSpdRevGear Check

Function NameHwTrqVehSpdRevGearCheckTypeMinMaxUTP Tol.
Arguments PassedHwTrqTime_mS_T_u16Uint160FULL0
HwTrqTimerPtr_mS_T_u32Uint32*0FULL0
MaxHwTrq_HwNm_T_f32float320.010.00.00390625
VehSpdTime_mS_T_u16Uint160FULL0
VehSpdTimerPtr_mS_T_u32Uint32*0FULL0
MinVehSpd_Kph_T_f32float320255.0078125
MaxVehSpd_Kph_T_f32float320255.0078125
RevGearChkTime_mS_T_u16Uint160FULL0
RevGearTimerPtr_mS_T_u32Uint32*0FULL0
Return ValueHaLFDiagStatus_Cnt_T_enumUint8 NxtrDiagMgrStatus030

Description

HaLFEnableRqst_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_HaLFEnableRqst_Cnt_lgc()

HwTorque_HwNm_T_f32 = Rte_IRead_HaLFTO_Per1_HwTorque_HwNm_f32()

HaLFTrqOvReverseGearEngage_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_HaLFTrqOvReverseGearEngage_Cnt_lgc()

VehicleSpeed_Kph_T_f32 = Rte_IRead_HaLFTO_Per1_VehicleSpeed_Kph_f32()

HaLFDiagStatus_Cnt_T_enum = NTC_STATUS_PASSED

Hw Trq Check

Vehicle Speed Check

Reverse Gear Check

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
DSTState_Cnt_u080
DiagStsNonRecRmpToZeroFltPres_Cnt_lgcFALSE
DiagStsRecRmpToZeroFltPres_Cnt_lgcFALSE
HaLFActive_Cnt_lgcFALSE
HaLFEnableRqst_Cnt_lgcFALSE
HaLFErrInterfaceActive_Cnt_lgcFALSE
HaLFExtSystemFltActive_Cnt_lgcFALSE
HaLFFuncPresent_Cnt_lgcFALSE
HaLFIntSystemFltActive_Cnt_lgcFALSE
HaLFSWATrqFail_Cnt_lgcFALSE
HaLFSlewComplete_Cnt_lgcFALSE
HaLFState_Cnt_u080
HaLFSuspend_Cnt_lgcFALSE
0
HwTorque_HwNm_f320
LimitPercentFiltered_Uls_f320
HaLFTrqOvReverseGearEngage_Cnt_lgcFALSE
VehicleSpeed_Kph_f320
TOEOLDisable_Cnt_lgcFALSE
PrevHaLFEnableRqst_Cnt_lgc
PrevTrqOvCmdRqst_MtrNm_f32

Initialization Functions

Init: HaLFTO_Init1(void)

Design Rationale

The init function here sets all timers to some valid value, and informs SCom that the module is transitioning into the inactive state.

Initial State Transition

Rte_Call_HaLFState_SCom_Transition(D_HALFSTATEINACTIVE_CNT_U08)

Module Internal

Rte_Call_SystemTime_GetSystemTime_mS_u32(&Time_mS_u32)

HaLFTO_IncorHaLFActvnHwTrqTimer_mS_M_u32 = Time_mS_u32

HaLFTO_IncorHaLFActvnVehSpdTimer_mS_M_u32 = Time_mS_u32

HaLFTO_IncorHaLFActvnRevGearTimer_mS_M_u32 = Time_mS_u32

HaLFTO_HaLFDeactHwTrqTimer_mS_M_u32 = Time_mS_u32

HaLFTO_HaLFDeactVehSpdTimer_mS_M_u32 = Time_mS_u32

HaLFTO_HaLFDeactRevGearTimer_mS_M_u32 = Time_mS_u32

HaLFTO_DSTSyncTimer_mS_M_u32 = Time_mS_u32

HaLFTO_LimitPercentFilteredTimer_mS_M_u32 = Time_mS_u32

(void)Rte_Call_NxtrDiagMgr_SetNTCStatus(NTC_Num_VLF_04, 0x0U, NTC_STATUS_PASSED);


Periodic Functions

Per: _Per1(void)

Design Rationale

None

Program Flow Start

Rte_Call_HaLFTO_Per1_CP0_CheckpointReached()

Store Module Inputs to Local copies

DSTState_Cnt_T_u08 = Rte_IRead_HaLFTO_Per1_DSTState_Cnt_u08()

DiagStsNonRecRmpToZeroFltPres_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_DiagStsNonRecRmpToZeroFltPres_Cnt_lgc()

DiagStsRecRmpToZeroFltPres_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_DiagStsRecRmpToZeroFltPres_Cnt_lgc()

HaLFEnableRqst_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_HaLFEnableRqst_Cnt_lgc()

HaLFErrInterfaceActive_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_HaLFErrInterfaceActive_Cnt_lgc()

HaLFExtSystemFltActive_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_HaLFExtSystemFltActive_Cnt_lgc()

HaLFFuncPresent_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_HaLFFuncPresent_Cnt_lgc()

HaLFIntSystemFltActive_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_HaLFIntSystemFltActive_Cnt_lgc()

HaLFSWATrqFail_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_HaLFSWATrqFail_Cnt_lgc()

HaLFSlewComplete_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_HaLFSlewComplete_Cnt_lgc()

LimitPercentFiltered_Uls_T_f32 = Rte_IRead_HaLFTO_Per1_LimitPercentFiltered_Uls_f32()

TOEOLDisable_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_TOEOLDisable_Cnt_lgc()

PrevHaLFEnableRqst_Cnt_T_lgc = Rte_IRead_HaLFTO_Per1_PrevHaLFEnableRqst_Cnt_lgc()

PrevTrqOvCmdRqst_MtrNm_T_f32 = Rte_IRead_HaLFTO_Per1_PrevHaLFTrqOvCmdRqst_MtrNm_f32()

Initialize Faults

Incorrect HaLF Activation Diagnostic

HaLF Deactivation Diagnostic

HaLF Deactivation Diagnostic continued…

HalF Torque Overlay Enable

Transition Vector Logic

Inactive Transitions

Active Transitions

Recoverable Transitions

Transitions Complete

Store Local copy of outputs into Module Outputs

Rte_IWrite_HaLFTO_Per1_HaLFState_Cnt_u08(HaLFTO_State_Cnt_M_u08)

Rte_IWrite_HaLFTO_Per1_HaLFSuspend_Cnt_lgc(HaLFSuspend_T_lgc)

Program Flow End

Rte_Call_HaLFTO_Per1_CP1_CheckpointReached()


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
HaLFTO_Per12msWarm Init, Disable, Operate

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
HaLFTO_Init1RTE_START_SEC_AP_HALFTO_APPL_CODE
HaLFTO_Per1RTE_START_SEC_AP_HALFTO_APPL_CODE

Local Functions

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

Name of Sub ModuleSoftware Segment
HwTrqVehSpdRevGearCheckRTE_AP_HALFTO_APPL_CODE


Known Issues / Limitations With Design

  1. Inline functions in GlobalMacro.h are not unit tested.


Revision Control Log

Rev #Change DescriptionDateAuthor Initials
1Initial component creation.5-Nov-12BWL
2Corrected vehicle speed check Incorrect HaLF activation(DST Active State Deactivation)20-Feb-13SR
3Corrected Transition T5 from Recoverable to Inactive as per anomaly 452726-Feb-13SR
4Update to FDD 40D v00409-May-13BDO
5Updated to CF 08A V00109-Jul-13SP
6Added logic to pass the NTCs if the enable criteria is FALSE.08-Oct-13MR
7Updated to FDD CF-08C v00423-Jan-14VT
8Updated to FDD CF-08C v00504-Feb-14VT
9Unit Testing Finding Fixes20-Feb-14KPIT-PM
10Updated to FDD CF-08C v00624-Feb-14VT
11Updated to FDD CF-08C v00706-Mar-14VT
12Updated per Design Review and Updated to FDD CF-08Cv00824-Apr-14M. Story
13A6806 anomaly fix 1195920-May-14SB
Last modified October 12, 2025: Initial commit (0347a62)