TorqueCmdScaling_MDD

Module -- Torque Command Scaling4.04.0

High-Level Description

The Torque Command Scale module multiplies the Torque_Command_MRF input signal by a calibration which is set during a manufacturing EOL calibration process. This calibration is provided to reduce overall system output torque variation. This scaled version of the torque command is used by all other sub functions within motor control which have a torque dependent component.

Figures

Diagram – Function Data Sharing

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

Diagram – Function (Name)

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

(Note – This is not mandatory, only used where a graphical representation helps explain the function. It is left to the author’s discretion. New headers of this level (Level 3) should be created for each 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.

(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)
MRFMtrTrqCmd_MtrNm_f32MRFMtrTrqCmdScl_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
None

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)

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.

Constant Name
k_MinTrqCmdScl_Uls_f32
k_MaxTrqCmdScl_Uls_f32
TorqueCmdSF_Uls_f32 (NVM)

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
None

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
None

Module specific Lookup Tables Constants

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

Constant NameResolutionValueSoftware Segment
None

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. Limit_m()

Data Hiding Functions

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

  1. Rte_Call_TrqCmdScl_WriteBlock()

  2. Rte_Pim_TorqueCmdSF_Uls_f32()

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,

Software Module Implementation

Periodic Functions

Per: TrqCmdScl_Per1

Design Rationale

None

Program Flow Start

Rte_Call_TrqCmdScl_Per1_CP0_CheckpointReached()

Store Module Inputs to Local copies

MRFMtrTrqCmd_MtrNm_T_f32 = Rte_IRead_TrqCmdScl_Per1_MRFMtrTrqCmd_MtrNm_f32()

TorqueCmdSF_Uls_T_f32 = *Rte_Pim_TorqueCmdSF_Uls_f32()

Apply Torque Command Scaling

Store Local copy of outputs into Module Outputs

Rte_IWrite_TrqCmdScl_Per1_MRFMtrTrqCmdScl_MtrNm_f32(MRFMtrTrqCmdScl_MtrNm_T_f32)

Program Flow End

Rte_Call_TrqCmdScl_Per1_CP1_CheckpointReached()

Flow End

N/A

Scomm: TrqCmdScl_SCom_Get

Design Rationale

None

Program Flow Start

N/A

Store Module Inputs to Local copies

None

Get Torque Command Scaling

Store Local copy of outputs into Module Outputs

None

Program Flow End

N/A


Scomm: TrqCmdScl_SCom_Set

Design Rationale

None

Program Flow Start

N/A

Store Module Inputs to Local copies

None

Set Torque Command Scaling

Store Local copy of outputs into Module Outputs

None

Program Flow End

N/A

Local Function/Macro Definitions

If these are numerous and defined in a separate source file then reference the source file only.

Function

Function NameTypeMinMaxUTP Tol.
Arguments Passed
Return Value

Execution Requirements

Execution Sequence of the Module

TrqCmdScl_Per1 must be executed in the forward path before quadrant detection, the voltage command numerator, phase advance, voltage command denominator, and Modulation Index.

Execution Rates for sub-modules called by the Scheduler

This table serves as reference for the Scheduler design

Function NameCalling FrequencySystem State(s)
TrqCmdScl_Per12msALL

Execution Requirements for Serial Communication Functions

Function NameSub-Module called by (Serial Comm Function Name)
TrqCmdScl_Scom_Get()
TrqCmdScl_Scom_Set()


Memory Map Definition Requirements

Sub Modules (Functions)

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

Name of Sub ModuleSoftware Segment
TrqCmdScl_Per1

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.0Document creation and initial release for the component29NOV11VK
21.1Corrections to assign EOL scaling factor to temporary variable02DEC11VK
33Added checkpoints and memmap software segment is updated for static variables26Sep12Selva
44Heading and format corrected21Nov12Selva
Last modified October 12, 2025: Initial commit (0347a62)