State_Output_Control_MDD

Module – State Output Control

High-Level Description

This function performs the ramp up and ramp down of the Torque Command.

Figures

Diagram – Function Data Sharing


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)
TrqCmd_MtrNm_f32FinalTrqCmd_MtrNm_f32
SrlComSvcDft_Cnt_b32OutputRampMult_Uls_f32
DiagRampRate_XpmS_32RampDwnStatusComplete_Cnt_lgc
DiagRampValue_Uls_f32
OperRampRate_XpmS_f32
OperRampValue_Uls_f32
RampSrlComSvcDft_Cnt_lgc
DiagStsDiagRmpActive_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
AttenFactor_Uls_M_f32Single precision floating point1.175494351e-0383.402823466e+038
ActvRampUsr_Cnt_M_u161016
PrevOutputRampMult_Uls_M_f32Single precision floating point01STOPCTRL_START_SEC_VAR_NOINIT_32
PrevTargetRampMult_Uls_M_f32Single precision floating point01STOPCTRL_START_SEC_VAR_NOINIT_32
PrevRate_XpmS_M_f32Single precision floating point0.00010.5STOPCTRL_START_SEC_VAR_NOINIT_32
RampState_M_StrRampState_TSee 3.1.1See 3.1.1STOPCTRL_START_SEC_VAR_NOINIT_UNSPECIFIED

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)

RampState_T

StartTime_mS_u32

Duration_mS_u32

StartVal_Uls_f32

EndVal_Uls_f32

uint32

uint32

float32

float32

0

0

0

0

2^32-1

2^32-1

1

1

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

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_TWO_MS_U3212
D_MAXRAMP_XPMS_F32Single precision floating point0.5

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


Module specific Lookup Tables Constants

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

Constant NameResolutionValueSoftware Segment
None

Lookup Table Definitions

Software Module Implementation

Initialization Functions

None

Periodic Functions

Per: _Per1

Design Rationale

NOTE: For “starttime” calculations there is tendency for underflow and this is expected in s/w design. So for unittesting, VBA model should be implemented

such that it handles underflow and behaves like source code design.

Program Flow Start

Store Module Inputs to Local copies

Rte_Call_StOpCtrl_Per1_CP0_CheckpointReached() OperRampRate_XpmS_T_f32 as float32

OperRampValue_Uls_T_f32 as float32

DiagRampValue_Uls_T_f32 as float32

DiagRampRate_XpmS_T_f32 as float32

DiagStsDiagRmpActive_Cnt_T_lgc as Boolean

RampSrlComSvcDft_Cnt_T_lgc as Boolean

Rate_T_f32 as float32

Target_T_f32 as float32

DiffOutputRampMult_T_f32 as float32

DiffRate_T_f32 as float32

OperRampRate_XpmS_T_f32 = Rte_IRead_StOpCtrl_Per1_OperRampRate_XpmS_f32

OperRampValue_Uls_T_f32 =Rte_Iread_StOpCtrl_Per1_OperRampValue_Uls_f32

DiagRampValue_Uls_T_f32=Rte_Iread_StOpCtrl_Per1_DiagRampValue_Uls_f32

DiagRampRate_XpmS_T_f32=Rte_Iread_StOpCtrl_Per1_DiagRampRate_XpmS_f32

DiagStsDiagRmpActive_Cnt_T_lgc = Rte_Iread_StOpCtrl_Per1_DiagStsDiagRmpActive_Cnt_lgc

RampSrlComSvcDft_Cnt_T_lgc= Rte_Iread_StOpCtrl_Per1_RampSrlComSvcDft_Cnt_lgc

Store Local copy of outputs into Module Outputs

Rte_Iwrite_StOpCtrl_Per1_RampDwnStatusComplete_Cnt_lgc(RampDwnStatusComplete_T_lgc)

Rte_Iwrite_StOpCtrl_Per1_OutputRampMult_Uls_f32(NewOutputRampMult_T_f32)

Program Flow End

Rte_Call_StOpCtrl_Per1_CP1_CheckpointReached()

Fault Recovery Functions

None

Shutdown Functions

None

Interrupt Functions

None

Serial Communication Functions

None

Local Function/Macro Definitions

RampLib

Function NameRampLibTypeMinMax
Arguments PassedrampState_T_StrRampState_T**
Return ValueOutput_Uls_T_f32Float

*Note: For ranges on structure elements check Table 3.1.1 of MDD

Description

Rte_Call_SystemTime_DtrmnElapsedTime_mS_u32(rampState_T_Str.StartTime_mS_u32, &ElapsedRamp_mS_T_u32)


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 NameCalling FrequencySystem State(s) in which the function is called
StOpCtrl_Per1()2 msALL States

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
StOpCtrl_Per1()RTE_START_SEC_AP_STOPCTRL_APPL_CODE RTE_STOP_SEC_AP_STOPCTRL_APPL_CODE

Local Functions

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

Name of Sub ModuleSoftware Segment
RampLib

RTE_START_SEC_AP_STOPCTRL_APPL_CODE

RTE_STOP_SEC_AP_STOPCTRL_APPL_CODE


Known Issues / Limitations With Design

  1. (Item #1)


Revision Control Log

Item #Rev #Change DescriptionDateAuthor Initials
11.0Initial release07-Jun-11SAH
22.0FDD SF055-Jan-12NRAR
33.0Value for D_MAXRAMP_XPMS_F32 is fixed6-Jan-12NRAR
44.0DiagStsF1Active_Cnt_lgc is renamed to DiagStsDiagRmpActive_Cnt_lgc12-Jan-12NRAR
54.0PrevRate_XpmS_M_f32 range correction23-Jan-12NRAR
65.0Anom #3272 Ramp output vs. target fix13-Aug-12BWL
76.0Added checkpoints and memmap software segment is updated for static variables23-Sep-12Selva
Last modified October 12, 2025: Initial commit (0347a62)