MotRefMdl_MDD
Module Design Document
For
MotRefMdl
VERSION: 6.0
DATE: 15-Nov-2017
Prepared By:
Krishna Anne,
Software Component Group
Location: The official version of this document is stored in the Nexteer Configuration Management System.
Revision History
| Sl. No. | Description | Author | Version | Date |
| 1 | Initial Version | Selva | 1.0 | 12-JUN-2015 |
| 2 | Updated per design rev. 1.2.0 | Rijvi | 2.0 | 13-Mar-2016 |
| 3 | Updated as per v1.3.0 of FDD | Krishna | 3.0 | 29-Apr-16 |
| 4. | Updated as per v2.3.0 of FDD | Krishna | 4.0 | 15-Nov-2016 |
| 5. | Updated as per v4.0.0 of FDD | TATA | 5.0 | 25-Sep-2017 |
| 6. | Fixed Design vs Implementation Mismatch | Krishna | 6.0 | 15-Nov-2017 |
Table of Contents
3 MotRefMdl & High-Level Description 7
4 Design details of software module 8
4.1 Graphical representation of MotRefMdl 8
5.1 User defined typedef definition/declaration 9
5.2 Variable definition for enumerated types 9
6.1 Program(fixed) Constants 10
6.1.2 Module specific Lookup Tables Constants 10
7 Software Module Implementation 11
7.2 Initialization Functions 11
7.2.1.2 Store Module Inputs to Local copies 11
7.2.1.3 (Processing of function)……… 11
7.2.1.4 Store Local copy of outputs into Module Outputs 11
7.3.1.2 Store Module Inputs to Local copies 11
7.3.1.3 (Processing of function)……… 11
7.3.1.4 Store Local copy of outputs into Module Outputs 11
7.6 Serial Communication Functions 12
7.7 Local Function/Macro Definitions 12
7.7.1 Local Function #1 CalcCurrMagSqRef 12
7.7.2 Local Function #2 CalcIq 12
7.7.3 Local Function #3 CurrtoVoltTest 12
7.7.4 Local Function #4 CalcMinMotCurr 12
7.7.5 Local Function #5 CalcTq 13
7.7.6 Local Function #6 CalcMaxTqPt 13
7.7.7 Local Function #7 PrbcIntrpn 13
7.7.8 Local Function #7 PrbcIntrpn 13
7.8 GLObAL Function/Macro Definitions 14
9 Known Limitations With Design 16
Abbrevations And Acronyms
| Abbreviation | Description |
| DFD | Design functional diagram |
| MDD | Module design Document |
References
This section lists the title & version of all the documents that are referred for development of this document
| Sr. No. | Title | Version |
| <1> | <MDD Guidelines> | Process 04.02.01 |
| <2> | <Software Naming Conventions> | Process 04.02.01 |
| <3> | <Coding standards> | Process 04.02.01 |
| <4> | FDD - SF103A_MotRefMdl_Design | See Synergy Subproject version |
| <Add if more available> |
MotRefMdl & High-Level Description
Design details of software module
Graphical representation of MotRefMdl

Data Flow Diagram
Module level DFD
Sub-Module level DFD
COMPONENT FLOW DIAGRAM
Variable Data Dictionary
User defined typedef definition/declaration
| Typedef Name | Element Name | User Defined Type | Legal Range (min) | Legal Range (max) |
| MotInterCalcnsRec | RelncTqCoeff_Henry_f32 | Single Precision float | 3e-05 | 0.00041 |
| MotREstimd_Ohm_f32 | Single Precision float | 0.005 | 0.12565 | |
| ReacncDaxOverR_Uls_f32 | Single Precision float | -14.4436 | +14.4436 | |
| ReacncQaxOverR_Uls_f32 | Single Precision float | -14.4436 | +14.4436 | |
| EgOverR_Ampr_f32 | Single Precision float | -200 | 200 | |
| VltgOverR_Ampr_f32 | Single Precision float | -200 | 200 | |
| VovrRAllSqd_AmprSqd_f32 | Single Precision float | 0 | 40000 | |
| EgOverROverZ_Ampr_f32 | Single Precision float | -200 | 200 | |
| VovrRovrZ_Ampr_f32 | Single Precision float | -200 | 200 | |
| MotKeEstimd_VoltPerMotRadPerSec_f32 | Single Precision float | .025 | .075 |
Variable definition for enumerated types
| Enum Name | Element Name | Value |
| N/A | <(Variable name qualified Refer[2])> | <Define the value > |
Constant Data Dictionary
Program(fixed) Constants
Embedded Constants
Local
| Constant Name | Resolution | Units | Value |
| MOTVLTGDAXEFLOLIM_VOLT_F32 | Single precision float | Volt | -26.5F |
| MOTVLTGDAXEFHILIM_VOLT_F32 | Single precision float | Volt | 26.5F |
| MOTVLTGQAXEFLOLIM_VOLT_F32 | Single precision float | Volt | -26.5F |
| MOTVLTGQAXEFHILIM_VOLT_F32 | Single precision float | Volt | 26.5F |
| BITMASK1_CNT_U08 | 1 | Cnt | 1U |
| BITMASK2_CNT_U08 | 1 | Cnt | 2U |
| BITMASK4_CNT_U08 | 1 | Cnt | 4U |
| Refer constants from .m file |
Global
| Constant Name |
| Refer constants from .m file |
Module specific Lookup Tables Constants
| Constant Name | Resolution | Value | Software Segment |
| Refer .m file |
Software Module Implementation
Sub-Module Functions
NONE
Initialization Functions
Per: MotRefMdlINIT1
Design Rationale
Refer to FDD
Store Module Inputs to Local copies
Refer to FDD
(Processing of function)………
Refer to FDD
Store Local copy of outputs into Module Outputs
Refer to FDD
PERIODIC FUNCTIONS
Per: MotRefMdlper1
Design Rationale
Store Module Inputs to Local copies
Refer to FDD
(Processing of function)………
Refer to FDD
Store Local copy of outputs into Module Outputs
Refer to FDD
Non PERIODIC FUNCTIONS
None
Interrupt Functions
None
Serial Communication Functions
None
Local Function/Macro Definitions
Local Function #1 CalcCurrMagSqRef
| Function Name | CalcCurrMagSqRef | Type | Min | Max |
| Arguments Passed | CurrDaxRef_Ampr_T_f32 | float32 | -200 | 200 |
| CurrQaxRef_Ampr_T_f32 | float32 | -200 | 200 | |
| Return Value | CurrMagSqRef_AmprSq_T_f32 | float32 | 0 | 40000 |
Description
Refer FDD (F_CalcIqCommand)
Local Function #2 CalcIq
| Function Name | CalcIq | Type | Min | Max |
| Arguments Passed | Tqcmd_MotNwtMtr_T_f32 | float32 | -8.8 | 8.8 |
| CurrDaxRef_Ampr_T_f32 | float32 | -200 | 200 | |
| MotRefMdlInterCalcns_T_str | struct | Refer Struct Definition in Sec5.1 | Refer Struct Definition in Sec5.1 | |
| Return Value | CurrQaxRefTmp_Ampr_T_f32 | float32 | -200 | 200 |
Description
Refer FDD (F_CalcIqCommand)
Local Function #3 CurrtoVoltTest
| Function Name | CalcIq | Type | Min | Max |
| Arguments Passed | CurrQaxRef_Ampr_T_f32 | float32 | -8.8 | 8.8 |
| CurrDaxRef_Ampr_T_f32 | float32 | -200 | 200 | |
| MotRefMdlInterCalcns_T_str | struct | Refer Struct Definition in Sec5.1 | Refer Struct Definition in Sec5.1 | |
| Return Value | VdR_Ampr_T_f32 | float32 | -200 | 200 |
| VqR_Ampr_T_f32 | float32 | -200 | 200 | |
| CurrQaxRefTmp_Ampr_T_f32 | float32 | -200 | 200 |
Description
Refer FDD ( F_ItoV)
Local Function #4 CalcMinMotCurr
| Function Name | CalcMinMotCurr | Type | Min | Max |
| Arguments Passed | MotTqCmd_MotNwtMtr_T_f32 | float32 | -8.8 | 8.8 |
| MotRefMdlInterCalcns_T_str | struct | Refer Struct Definition in Sec5.1 | Refer Struct Definition in Sec5.1 | |
| Return Value | CurrQaxMin_Ampr_T_f32 | float32 | -200 | 200 |
| CurrDaxMin_Ampr_T_f32 | float32 | -200 | 200 | |
| ImSqrMin_AmprSq_T_f32 | float32 | 0 | 40000 |
Description
Refer FDD (Locate Reference)
Local Function #5 CalcTq
| Function Name | CalcTq | Type | Min | Max |
| Arguments Passed | CosDelta_Cnt_T_f32 | float32 | -1 | 1 |
| SinDelta_Cnt_T_f32 | float32 | -1 | 1 | |
| MotRefMdlInterCalcns_T_str | struct | Refer Struct Definition in Sec5.1 | Refer Struct Definition in Sec5.1 | |
| Return Value | TqCalc_MotNwtMtr_T_f32 | float32 | -8.8 | 8.8 |
| CurrDaxMax_Ampr_T_f32 | float32 | -200 | 200 |
Description
Refer FDD (CalculateTorque)
Local Function #6 CalcMaxTqPt
| Function Name | CalcMaxTqPt | Type | Min | Max |
| Arguments Passed | MotTqCmd_MotNwtMtr_T_f32 | float32 | -8.8 | 8.8 |
| MotRefMdlInterCalcns_T_str | struct | Refer Struct Definition in Sec5.1 | Refer Struct Definition in Sec5.1 | |
| Return Value | MotTqCmdLimd_MotNwtMtr_T_f32 | float32 | -8.8 | 8.8 |
| CurrDaxMax_Ampr_T_f32 | float32 | -200 | 200 |
Description
Refer FDD (LocateTorqueExtremes)
Local Function #7 PrbcIntrpn
| Function Name | PrbcIntrpn | Type | Min | Max |
| Arguments Passed | IntrpnPts_T_f32 | float32 | Full range | Full range |
| Return Value | ParaIntpol_Uls_T_f32 | float32 | Full range | Full range |
Description
Refer FDD ( Parabolic Interpolations)
Local Function #8 Decoder
| Function Name | Decoder | Type | Min | Max |
| Arguments Passed | MotAndThermProtnLoaMod_Cnt_T_u08 | Uin8 | 0 | 255 |
| Return Value | CurrMeasLoaMtgtnEna_Cnt_T_logl | Boolean | FALSE | TRUE |
| IvtrLoaMtgtnEna_Cnt_T_logl | Boolean | FALSE | TRUE | |
| FetLoaMtgtnEna_Cnt_T_logl | Boolean | FALSE | TRUE |
Description
Refer FDD ( Decoder)
Local Function #9 VltgSdlCalc
| Function Name | VltgSdlCalc | Type | Min | Max |
| Arguments Passed | MotQuad_Cnt_T_enum | MotQuad1 | 1U | 4U |
| AbsltMotVelFiltLp_MotRadPerSec_T_u11p5 | uint16 | 0U | 1350U | |
| Return Value | VltgSdl_Volt_T_f32 | Boolean | 0.0F | 40.0F |
Description
This function is split from Per1 to reduce the path count to less than 300.
GLObAL Function/Macro Definitions
None
TRANSIENT FUNCTIONS
None
Unit Test Considerations
None
Known Limitations With Design
None
Appendix
None