MotCtrlMgr_MDD

Module Design Document

For

MotCtrlMgr

VERSION: 2

DATE: 10/28/15

Prepared By:

Software Group,

Nexteer Automotive,

Saginaw, MI, USA

Location: The official version of this document is stored in the Nexteer Configuration Management System.

Revision History

Sl. No.DescriptionAuthorVersionDate
1Initial VersionLucas Wendling105/29/15
2Updates for Signal MappingLucas Wendling210/28/15

Table of Contents

1 Abbrevations And Acronyms 4

2 References 5

3 MotCtrlMgr High-Level Description 6

4 Design details of software module 7

4.1 Graphical representation of MotCtrlMgr 7

4.2 Data Flow Diagram 7

4.2.1 Module level DFD 7

4.2.2 Sub-Module level DFD 7

4.3 COMPONENT FLOW DIAGRAM 7

5 Variable Data Dictionary 8

5.1 User defined typedef definition/declaration 8

5.2 Variable definition for enumerated types 8

6 Constant Data Dictionary 9

6.1 Program(fixed) Constants 9

6.1.1 Embedded Constants 9

6.1.1.1 Local 9

6.1.1.2 Global 9

6.1.2 Module specific Lookup Tables Constants 9

7 Software Module Implementation 10

7.1 Generated file description and logic 10

7.2 Initialization Functions 13

7.3 PERIODIC FUNCTIONS 13

7.3.1 Per1/Per2: 13

7.4 Non PERIODIC FUNCTIONS 13

7.5 Interrupt Functions 13

7.5.1 Isr: <ModuleName>_Isr<n)> 13

7.6 Serial Communication Functions 14

7.7 Local Function/Macro Definitions 14

7.8 GLObAL Function/Macro Definitions 14

7.9 TRANSIENT FUNCTIONS 14

8 Unit Test Considerations 15

9 Known Limitations With Design 16

10 Appendix 17

Abbrevations And Acronyms

AbbreviationDescription
DFDDesign functional diagram
MDDModule design Document
<ADD more to the table if applicable>

References

This section lists the title & version of all the documents that are referred for development of this document

Sr. No.TitleVersion
1MDD GuidelinesProcess 04.00.00
2Software Naming ConventionsProcess 04.00.00
3Software Coding StandardsProcess 04.00.00
4AR300A_MotCtrlMgr_DesignSee Synergy subproject version

MotCtrlMgr High-Level Description

None

Design details of software module

Graphical representation of MotCtrlMgr

None

Data Flow Diagram

None

Module level DFD

None

Sub-Module level DFD

None

COMPONENT FLOW DIAGRAM

None

Variable Data Dictionary

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)

MotCtrlToTwoMilliSecRec1Elements are project specific and generatedstruct
TwoMilliSecFromMotCtrlRec1Elements are project specific and generatedstruct
TwoMilliSecToMotCtrlRec1Elements are project specific and generatedstruct
MotCtrlFromTwoMilliSecRec1Elements are project specific and generatedstruct
MotCtrlIntRec1Elements are project specific and generatedstruct

Variable definition for enumerated types

Enum NameElement NameValue
Enumerations are project specific and generated

Constant Data Dictionary

Program(fixed) Constants

Embedded Constants

Local

Constant NameResolutionUnitsValue
N/A

Global

Constant Name
N/A

Module specific Lookup Tables Constants

Constant NameResolutionValueSoftware Segment
N/A

Software Module Implementation

Generated file description and logic

The following sections provide details on the logic used for generating the data and functions from the MotCtrlMgr configuration. The generator uses text templating to generate the appropriate file content based on the configuration details. The logic described in the following sections are implemented in the text template files provided in this component.

  1. CDD_MotCtrlMgr_Irq.c

This file contains the definition of the interrupt service routine that Motor Control Manager defines. This interrupt service routine primarily contains a task list for executing runnables that are required to be scheduled at the motor control rate or motor control x2 rate. The following table lists the configuration parameters that are required in generation of this file:

Configuration ParameterFile Generation Usage Notes
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/RunnableManagement/RunnableUsed to determine the runnables needed to be called in the ISR task list
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/RunnableManagement/Runnable/RunnableRateUsed to determine if runnable needs to be called every ISR loop (MotorControl) or every other ISR loop (MotorControlx2)
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/RunnableManagement/IncludeHeadersUsed for include list required for this file for runnable prototype definitions
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/RunnableManagement/Runnable/SequenceOrderUsed to help define the relative calling sequence of the runnables in the ISR task list
  1. CDD_MotCtrlMgr.c

This file contains the functions for the RTE interface. This file will receive appropriate signals from the RTE and provide appropriate signals to the RTE. Per1 provides updated signals to the RTE after the DMA transfer of the data successfully completed, and Per2 recieves signals from the RTE and then indicates to the DMA that the data is ready for transfer.

Configuration ParameterFile Generation Usage Notes
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/SignalUsed for the name of the signals being read/written by the runnables being defined.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/WrittenInMotCtrlRunnableUsed in conjuction with “/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ReadIn2msRunnable” to determine when a signal is needed to be managed by Per1
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ReadIn2msRunnableUsed in conjuction with “/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/WrittenInMotCtrlRunnable” to determine when a signal is needed to be managed by Per1
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/WrittenIn2msRunnableUsed in conjuction with “/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ReadInMotCtrlRunnable” to determine when a signal is needed to be managed by Per2
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ReadInMotCtrlRunnableUsed in conjuction with “/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/WrittenIn2msRunnable” to determine when a signal is needed to be managed by Per2
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/SizeUsed to determine if the signals being read/written by the runnables being defined are arrays (Impacts RTE API name).
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ImplementationDataTypeUsed to determine if the signals being read/written by the runnables being defined are boolean types (Impacts RTE API name).
  1. CDD_MotCtrlMgr_Data.c

This file contains the definition of all of the structures containing the Motor Control ISR related signals. This includes providing initial values for all of the signals in the structure and padding the structure for proper structure size alignment restrictions.

Configuration ParameterFile Generation Usage Notes
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/SignalUsed to determine signal names as part of the logic to determine if special grouping is needed for TSG3 signals
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/WrittenInMotCtrlRunnableUsed to determine which initial values are needed in which structure.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ReadIn2msRunnableUsed to determine which initial values are needed in which structure.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/WrittenIn2msRunnableUsed to determine which initial values are needed in which structure.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ReadInMotCtrlRunnableUsed to determine which initial values are needed in which structure.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/SizeUsed in the structure size calculation to determine how many pad bytes are needed for alignment at the end of the structure. Used also to add the appropriate braces for arrays on structure elements.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ImplementationDataTypeUsed in the structure size calculation to determine how many pad bytes are needed for alignment at the end of the structure.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/InitialValueUsed as the initializer value for a given signal in the structure
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/IncludeHeadersUsed for include list required for this file for definition of any intial values that may be required
  1. CDD_MotCtrlMgr_Data.h

This file defines the structure definition of the Motor Control Data structures containing all Motor Control ISR related signals. It also defines any enumerations that need to be accessed by Non-RTE related code. Prototype statements for all Motor Control Data structures are included in this file as well as the macros defined for accessing individual signals of the Motor Control Data structures.

Configuration ParameterFile Generation Usage Notes
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/NonRteEnumUsed to define enumeration accessed by Non-RTE related code. Used for enumeration name.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/NonRteEnum/EnumImplementationDataTypeUsed to define enumeration accessed by Non-RTE related code. Used for enumeration datatype.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/NonRteEnum/EnumElementUsed to define enumeration accessed by Non-RTE related code. Used for enumeration element name.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/NonRteEnum/EnumElement/ValueUsed to define enumeration accessed by Non-RTE related code. Used for enumeration element value.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/SignalUsed to determine signal names as part of the logic to determine if special grouping is needed for TSG3 signals. Also used as signal name for structure element definitions. Used to also determine name of signal access macros that are generated.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/WrittenInMotCtrlRunnableUsed to determine the structure the signal should be added to.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ReadIn2msRunnableUsed to determine the structure the signal should be added to
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/WrittenIn2msRunnableUsed to determine the structure the signal should be added to
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ReadInMotCtrlRunnableUsed to determine the structure the signal should be added to
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ImplementationDataTypeUsed to determine datatype of structure element. Also used as part of the structure size calculation to determine how many pad bytes are needed for alignment at the end of the structure.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/EnumerationNameReferenceUsed to determine if a given signal is an enumeration and used to determine the corresponding enumeration name
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/SizeUsed in the structure size calculation to determine how many pad bytes are needed for alignment at the end of the structure. Used also to add the appropriate array size on signals that are arrays (having size > 1).
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/SignalMappingUsed for creation of motor control signal access macros for inputs that are named differently than outputs
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/SignalMapping/OutputSignalNameOutput name for signal mapping (used to define an input signal macro definition)
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/SignalMapping/InputSignalNameInput name(s) for signal mapping (used to define the names of the signal macros)
  1. AR300A_MotCtrlMgr_DataDict.m

This file is the generated data dictionary for MotCtrlMgr. This is intended to be used for documentation purposes as well as to aid in creating the AUTOSAR component description files.

Configuration ParameterFile Generation Usage Notes
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/SignalUsed to determine signal name for I/O depending on signal useage.
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ImplementationDataTypeUsed to determine datatype of signal. Also used for stripping off c constant qualification (“U”, “L”, “F”) on standard datatypes that is assumed to be present in the initial value. Also used to convert boolean type initial values to “0/1” from “TRUE/FALSE”
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/EnumerationNameReferenceUsed to determine if a given signal is an enumeration and used to determine the corresponding enumeration name
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/InitialValueUsed for the initial value of a signal
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/SizeUsed to determine if the signal is an array and to set the format of the initial value appropriately
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/ReadIn2msRunnableUsed to determine if signal is an output from Per1 runnable
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/WrittenIn2msRunnableUsed to determine if signal is an input to Per2 runnable
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/MaxUsed for Maximum value property of signal
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/MinUsed for Minimum value property of signal
/Nexteer/MotCtrlMgr/MotCtrlMgrConfigSet/SignalManagement/Signal/UnitsUsed for units property of signal

Initialization Functions

None

PERIODIC FUNCTIONS

Per1/Per2:

See section 7.1.2

Non PERIODIC FUNCTIONS

None

Interrupt Functions

Isr:

See section 7.1.1

Serial Communication Functions

None

Local Function/Macro Definitions

None

GLObAL Function/Macro Definitions

None

TRANSIENT FUNCTIONS

None

Unit Test Considerations

Known Limitations With Design

  1. None

Appendix

Last modified October 12, 2025: Initial commit (1fadfc4)