This is the multi-page printable view of this section. Click here to print.
SVDrvr_CM
1 - Data Dictionary
Overview
Change LogVariable Dictionary
Calibration Dictionary
Global Constants
Template
Help
Sheet 1: Change Log
SVDrvr_CM- Rev 1 | <- Global Program / Module Name | ||||||
Revision | Author | Date | Change Description | Data Dictionary Type: | Component | ||
1 | Selva | 15-Feb-13 | Initial version | ||||
Sheet 2: Variable Dictionary
Sheet 3: Calibration Dictionary
Sheet 4: Global Constants
SVDrvr_CM- Rev 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variable Information (Global Variables Only) | Achieved in Software Design | Used in Module List | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Layer 2 | Layer 3 | Layer 4 | Layer 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Constant Name | Description | Uints | Type | Engineering Value | ADC | ADC Diagnostics | Data Memory Verification | DC Link Power Control | DSP Computational Integrity | DSP SPI driver | Event Manager Driver | External Memory Driver | Flash Programming Exec | GPIO | Illegal OpCode Handler | Interrupt Handler | Motor Current Driver | Motor Driver Diagnostics | Motor Position Driver | Phase Feedback Capture | Powerdown Control | Primary Shutdown Control | Program Flow | Program Memory Diagnostic | PWM Duty Cycle | Redundant Memory Check | Redundant Rapid Shutdown | Scheduler | Stack Monitor | State Dependent Task List | System Boot & Startup | System Control | Temperature Sensor Diagnostic | Unused Interrupt Handler | Utilization Monitor | Watchdog Dirver | Smith | Battery Voltage | Battery Voltage Diagnostics | Diagnostic CTC Manager | Diagnostic Manager | Diagnostics Application Services | EOL TorqueTest | Flash Boot Loader | Flight Recorder | Handwheel Position | Handwheel Torque | Motor Control Output Conversion | Motor Position Diagnostics | Motor Position Initialization | Motor Velocity | Motor Velocity Tachometer | Serial Communications I/O | Serial Communications Services | States and Modes | Tuning Select | Vehicle Power Mode | Vehicle Speed | Controller Polarity | Current Estimation | Handwheel Velocity | Inverse Motor Model | Motor Temperature Estimation | Motor Torque Limit | Output Reasonableness Dianostic | Parameter Estimation | Quadrant and rate Detection | Active Pull Compensation | Assist | Damping | Duty Cycle | Kinematic Integrity Diagnostic | Long Term Vehicle Speed Diagnostic | Max Assist Limit | Return | State Output Control | Torque Output |
Sheet 5: Template
2.2a | Data File: | |||||
Header: | extern <TYPE><TAB><NAME>; | |||||
Source: | #pragma DATA_SECTION(<ROOTNAME>, "<SEGMENT>"); <TYPE> <NAME>; | |||||
EOL Constants: | ||||||
Header: | extern <TYPE><TAB><NAME>; | |||||
Source: | #pragma DATA_SECTION(<ROOTNAME>, "<SEGMENT>"); <TYPE> <NAME>; | |||||
Global (Embedded) Constants: | ||||||
Header: | #define <NAME><COL40><VALUE> | |||||
A2L Name | ||||||
Measurement: | rte_<SWC>_<NAME> | |||||
Calibration Constants: | ||||||
Tuning ID: | ||||||
Tuning: | N | Index Range: | ||||
Header: | extern CONST(<AUTOSAR_TYPE>, CAL_CONST) <NAME>; | |||||
Source: | #pragma DATA_SECTION(<ROOTNAME>, ".<SEGMENT>"); CONST(<AUTOSAR_TYPE>, CAL_CONST) <NAME> = <VALUE>; | |||||
eCal: | <NAME> | |||||
Tuning: | Y | Index Range: | ||||
Header: | ||||||
Source: | ||||||
eCal: | ||||||
Tuning: | P | Index Range: | ||||
Header: | ||||||
Source: | ||||||
eCal: | ||||||
Sheet 6: Help
Short cut | Macro | Sescription |
Ctrl-q | ClearDataDictFilter | Will clear all autofilters on the Global Data Dictionary |
DFD_Create | Creates a Series of Data Flow Worksheet Pages from the information in the data dictionary. If Data Flow Worksheet pages already exist, they will be deleted first. | |
DFD_Delete | Will clear all Data Flow Diagram pages from the Data Dictionary. This will make the file smaller for archiving. | |
DFD_Print | Formate and prepares to print the Data Flow Worksheet pages. |
2 - PWM_CDD_MDD
Module –
High-Level Description
Non-AUTOSAR PWM driver required to perform EPS motor control PWM profiles.
Figures
Component Diagram
This diagram shows all data that is shared between functions within the module.
No data sharing
Diagram – Function (Per1)
None (For more refer section 6)
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 Inputs (Global Variable Name) | Module Outputs (Global Variable Name) |
---|---|
CDD_PhaseAdvFinal_Cnt_G_u16[2] | CDD_DutyCycleSmall_Cnt_G_u16[2] |
CDD_CommOffset_Cnt_G_u16[2] | CDD_PWMDutyCycleASum_Cnt_G_u32[2] |
CDD_MtrPosElec_Rev_G_u0p16[2] | CDD_PWMDutyCycleBSum_Cnt_G_u32[2] |
CDD_PwmDisable_Cnt_G_lgc[2] | CDD_PWMDutyCycleCSum_Cnt_G_u32[2] |
CDD_MtrTrqCmdSign_Cnt_G_s16[2] | CDD_PWMPeriodSum_Cnt_G_u32[2] |
CDD_DeadTimeComp_Uls_G_u8p8[2] | CDD_PhsReasA_Cnt_G_u16[2] |
CDD_ModIdxFinal_Uls_G_u16p16[2] | CDD_PhsReasB_Cnt_G_u16[2] |
CDD_CDDDataAccessBfr_Cnt_G_u16 | CDD_PhsReasC_Cnt_G_u16[2] |
CDD_AppDataFwdPthAccessBfr_Cnt_G_u16 | CDD_DCPhsComp_Cnt_G_u16[3] |
CDD_AppDataFbkPthAccessBfr_Cnt_G_u16 | CDD_PWMPeriod_Cnt_G_u16 |
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 Name | Resolution | Legal Range (min) | Legal Range (max) | Software Segment |
---|---|---|---|---|
CDD_SeedPWMDither_Cnt_M_u16 | N/A | N/A | N/A | PWMCDD_START_SEC_VAR_CLEARED_16 |
CDD_DitherFlt1SV_Cnt_M_u16 | N/A | N/A | N/A | PWMCDD_START_SEC_VAR_CLEARED_16 |
CDD_DitherFlt2SV_Cnt_M_u16 | N/A | N/A | N/A | PWMCDD_START_SEC_VAR_CLEARED_16 |
CDD_PhaseOffset_Rev_M_u0p16[3] | N/A | N/A | N/A | PWMCDD_START_SEC_VAR_CLEARED_16 |
CDD_NextDCSmall_Cnt_M_u16 | N/A | N/A | N/A | PWMCDD_START_SEC_VAR_CLEARED_16 |
PrevDCPhsAComp_Cnt_M_u16p0 | 1 | 0 | 7150 | PWMCDD_START_SEC_VAR_CLEARED_16 |
PrevDCPhsBComp_Cnt_M_u16p0 | 1 | 0 | 7150 | PWMCDD_START_SEC_VAR_CLEARED_16 |
PrevDCPhsCComp_Cnt_M_u16p0 | 1 | 0 | 7150 | PWMCDD_START_SEC_VAR_CLEARED_16 |
DCPhsAComp_Cnt_M_u16p0 | 1 | 0 | 7150 | PWMCDD_START_SEC_VAR_CLEARED_16 |
DCPhsBComp_Cnt_M_u16p0 | 1 | 0 | 7150 | PWMCDD_START_SEC_VAR_CLEARED_16 |
DCPhsCComp_Cnt_M_u16p0 | 1 | 0 | 7150 | PWMCDD_START_SEC_VAR_CLEARED_16 |
PrevPWMPeriod_Cnt_M_u16 | 1 | 2950 | 7150 | PWMCDD_START_SEC_VAR_CLEARED_16 |
PWMPeriod_Cnt_M_u16 | 1 | 2950 | 7150 | PWMCDD_START_SEC_VAR_CLEARED_16 |
User defined typedef definition/declaration
This section documents any user types uniquely used for the module.
Typedef Name | Element Name | User 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_ADCTrig1Offset_Cnt_s16 |
k_ADCTrig2Offset_Cnt_s16 |
k_DitherLPFKn_Cnt_u16 |
k_PwmDeadBand_Cnt_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 Name | Resolution | Units | Value |
---|---|---|---|
d_NhetFreq_Hz_Cnt_u16 | 1 | u16 | 75000000UL |
d_HalfPrec8_Cnt_u16 | 1 | u16 | 128U |
d_HalfPrec16_Cnt_u16 | 1 | u16 | 32768UL |
d_Scaler1_Cnt_u16 | 1 | u16 | 1U |
d_Scaler8_Cnt_u16 | 1 | u16 | 8U |
d_Scaler16_Cnt_u16 | 1 | u16 | 16U |
d_SeedInitial_Cnt_u16 | 1 | u16 | 10U |
d_SeedMultiplier_Cnt_u16 | 1 | u16 | 57U |
d_SeedOffset_Cnt_u16 | 1 | u16 | 1U |
d_PWMClockFreq_Hz_u32 | 1 | U32 | 75000000UL |
d_PWMFreqBase_Hz_u16 | 1 | u16 | 16000U |
d_PWMFreqDither_Hz_u16 | 1 | u16 | 2000U |
d_PwmPrdMax_Cnt_u16 | 1 | u16 | (d_PwmFreq_Hz_Cnt_u16 /(uint32)(d_PWMFreqBase_Hz_u16 - d_PWMFreqDither_Hz_u16)) |
d_PwmPrdMin_Cnt_u16 | 1 | u16 | d_PwmFreq_Hz_Cnt_u16 /(uint32)(d_PWMFreqBase_Hz_u16 ) + d_PWMFreqDither_Hz_u16) |
d_PwmPrdRange_Cnt_u16 | 1 | u16 | (d_PwmPrdMax_Cnt_u16-(uint16)d_PwmPrdMin_Cnt_u16) |
d_PwmPrdInitVal_Cnt_u16 | 1 | u16 | ((uint16)(d_PWMClockFreq_Hz_u32/(uint32)d_PWMFreqBase_Hz_u16)) |
d_FilterKdBits_Cnt_U16 | 1 | u16 | 5U |
d_MaxModIdx_Uls_u0p16 | 2-16 | u0p16 | (FPM_InitFixedPoint_m(0.9999847412109375,u0p16_T)) |
d_MinModIdx_Uls_u0p16 | 2-16 | u0p16 | (FPM_InitFixedPoint_m(0.0,u0p16_T)) |
d_120Deg_Rev_u0p16 | 2-16 | u0p16 | (FPM_InitFixedPoint_m(0.3333333333,u0p16_T)) |
d_0Deg_Rev_u0p16 | 2-16 | u0p16 | (FPM_InitFixedPoint_m(0.0,u0p16_T)) |
d_30Deg_Rev_u0p16 | 2-16 | u0p16 | (FPM_InitFixedPoint_m(0.0833333333,u0p16_T)) |
d_60Deg_Rev_u0p16 | 2-16 | u0p16 | (FPM_InitFixedPoint_m(0.1666666666,u0p16_T)) |
d_240Deg_Rev_u0p16 | 2-16 | u0p16 | (FPM_InitFixedPoint_m(0.6666666666,u0p16_T)) |
d_180Deg_Rev_u0p16 | 2-16 | u0p16 | (FPM_InitFixedPoint_m(0.5,u0p16_T)) |
d_PhaseAOffsetNrm_Rev_u0p16 | 2-16 | u0p16 | d_0Deg_Rev_u0p16 |
d_PhaseBOffsetNrm_Rev_u0p16 | 2-16 | u0p16 | ((uint16)(d_PhaseAOffsetNrm_Rev_u0p16-d_120Deg_Rev_u0p16)) |
d_PhaseCOffsetNrm_Rev_u0p16 | 2-16 | u0p16 | (d_PhaseAOffsetNrm_Rev_u0p16+d_120Deg_Rev_u0p16) |
d_PhaseAOffsetInv_Rev_u0p16 | 2-16 | u0p16 | d_60Deg_Rev_u0p16 |
d_PhaseBOffsetInv_Rev_u0p16 | 2-16 | u0p16 | (d_PhaseAOffsetInv_Rev_u0p16+d_120Deg_Rev_u0p16) |
d_PhaseCOffsetInv_Rev_u0p16 | 2-16 | u0p16 | ((uint16)(d_PhaseAOffsetInv_Rev_u0p16-d_120Deg_Rev_u0p16)) |
d_RevpCnt_Uls_u0p32 | 2-32 | u0p32 | 699051UL/*(FPM_InitFixedPoint_m(1/d_PACntspRev_Uls_u16p0,u0p32_T))*/ |
d_PACntspRev_Uls_u16p0 | 1 | u16p0 | 6144U |
d_SinePhsToGndTblSize_Cnt_u16 | 1 | u16 | 2049U |
d_MSBMask_Cnt_u16 | 1 | u16 | 0x8000U |
D_POSITIVEONE_CNT_S8 | 1 | s8 | 1 |
D_PHSAIDX_CNT_U16 | 1 | u16 | 0U |
D_PHSBIDX_CNT_ U16 | 1 | u16 | 1U |
D_PHSCIDX_CNT_ U16 | 1 | u16 | 2U |
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
Constant Name | Resolution | Value | Software Segment |
---|---|---|---|
t_S_SinePhsToGndTbl_Cnt_u0p16[2049] | 2-16 | None |
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,
The library functions / Macros that are called by the various sub modules are identified below,
FPM_FloatToFixed_m()
FPM_FixedToFloat_m()
Limit_m()
Max_m()
Min_m()
CDD_Read_PhaseAdvanceFinal_Rev_u0p16()
Data Hiding Functions
None
Global Functions/Macros Defined by this Module
Global Function #1
Function Name | CDD_ApplyPWMMtrElecMechPol | Type | Min | Max | UTP Tol. |
---|---|---|---|---|---|
Arguments Passed | MtrElecMechPol_Cnt_s8 | Sint 8 | |||
Return Value | CDD_PhaseOffset_Rev_M_u0p16 | Uint16 |
Description
Applies the offsets needed for MtrElecMech Polarity Setting
Global Function #2
Function Name | CDDPorts_ClearPhsReasSum | Type | Min | Max | UTP Tol. |
---|---|---|---|---|---|
Arguments Passed | DataAccessBfr_Cnt_T_u16 | Uint16 | |||
Return Value | CDD_PWMDutyCycleASum_Cnt_G_u32 | Uint32 | |||
CDD_PWMDutyCycleBSum_Cnt_G_u32 | Uint32 | ||||
CDD_PWMDutyCycleCSum_Cnt_G_u32 | Uint32 | ||||
CDD_PWMPeriodSum_Cnt_G_u32 | Uint32 |
Description
Local Functions/Macros Used by this MDD only
Local Macros are defined in PWMCDD_Cfg.h file as the return values/calculation of return values are more project specific
Local Function #1
Function Name | PwmPeriodDither_u16 | Type | Min | Max | UTP Tol. |
---|---|---|---|---|---|
Arguments Passed | None | ||||
Return Value | PWMPeriod_Cnt_T_u16 | Unit16 |
Description
Generates the next PWM Period
Local Function #2
Function Name | DeadTimeComp_u16p0 | Type | Min | Max | UTP Tol. |
---|---|---|---|---|---|
Arguments Passed | DCPhsUnComp_Cnt_T_u24p8 | ||||
Phase_Rev_T_u0p16 | |||||
Return Value | DCPhsComp_Cnt_T_u16p0 |
Description
Applies the dead time compensation
Local Function #3
Function Name | ModIndxPhase_u0p16 | Type | Min | Max | UTP Tol. |
---|---|---|---|---|---|
Arguments Passed | PhaseIndex_Rev_T_u0p16 | ||||
Return Value | ModIdxPhs_Cnt_T_u0p16 |
Description
Calculates ModIndx for each phase
Local Macro #1
Function Name | CDD_Read_PhaseAdvanceFinal_Rev_u0p16 | Type | Min | Max | UTP Tol. |
---|---|---|---|---|---|
Arguments Passed | &PhaseAdvFinal_Rev_T_u0p16 | U0p16 | 0 | 1 | |
Return Value | none |
Description
Converts phase advance final from count units to rev units. (Units type conversion)
Local Macro #2
Function Name | CDD_Read_CorrectedMtrPos_Rev_u0p16 | Type | Min | Max | UTP Tol. |
---|---|---|---|---|---|
Arguments Passed | & CorrectedMtrPos_Rev_T_u0p16 | U0p16 | 0 | 1 | |
Return Value | none |
Description
Reads the Motor position global variable and assign it to “CorrectedMtrPos_Rev_T_u0p16”
Local Macro #3
Function Name | CDD_Read_CommOffset_Cnt_u16 | Type | Min | Max | UTP Tol. |
---|---|---|---|---|---|
Arguments Passed | &CommOffset_Cnt_T_u16 | U16 | 0 | 2^16 | |
Return Value | none |
Description
Reads the Commutation offset and assign it global variable and assign it to “CommOffset_Cnt_T_u16”
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.
Data | Value |
---|---|
None |
Initialization Functions
Init: _Init
Design Rationale
None
Module Outputs
None
Module Internal
CDD_DutyCycleSmall_Cnt_G_u16[CDD_CDDDataAccessBfr_Cnt_G_u16] = 0U;
CDD_SeedPWMDither_Cnt_M_u16 = d_SeedInitial_Cnt_u16
Periodic Functions
Per: _Per1
Design Rationale
None
Program Flow Start
N/A
Store Module Inputs to Local copies
None
Processing of function
Store Local copy of outputs into Module Outputs
None
Program Flow End
N/A
Fault Recovery Functions
None
Shutdown Functions
None
Interrupt Functions
None
Serial Communication Functions
SCom: _Scom_
Design Rationale
None
Program Flow Start
N/A
Store Module Inputs to Local copies
None
Processing of function
Store Local copy of outputs into Module Outputs
None
Program Flow End
N/A
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 Name | Calling Frequency | System State(s) in which the function is called |
---|---|---|
PwmCdd_Init | Once | EcuStartup |
PwmCdd_Per1 | Motor control ISR | All states |
Execution Requirements for Serial Communication Functions
Function Name | Sub-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 Module | Software Segment |
---|---|
None |
Local Functions
This table identifies the software segments for local functions identified in this module.
Name of Sub Module | Software Segment |
---|---|
None |
Known Issues / Limitations With Design
INLINE functions defined in GlobalMacro.h are not unit tested.
Revision Control Log
Item # | Rev # | Change Description | Date | Author Initials |
---|---|---|---|---|
1 | 1.0 | Initial Version | 17 Oct 2012 | Selva |
2 | 2.0 | Nhet specific names are changed to common names and project specific variables assignment are moved to configuration Macros to keep PWMCdd same across projects | 15-Feb-12 | Selva |
3 | 3.0 | Changed the Buffer index of CDD_ModIdxFinal_Uls_G_u16p16 from "CDD_AppDataFwdPthAccessBfr_Cnt_G_u16" to "CDD_CDDDataAccessBfr_Cnt_G_u16" | 19-Apr-13 | Selva |
\
3 - PWMCdd_Integration_Manual
Contents
1.2 Configuration Files to be provided by Integration Project (Project Specific) 2
1.3 Functions provided to Integration Project 2
Dependencies
SWCs
Module | Required Feature |
---|---|
CDD_Data | Global variables for DC Phs Comp (for using in Nhet/) |
Configuration Files to be provided by Integration Project (Project Specific)
PWMCdd_Cfg.h ( Note : Make sure Macro assignments match correct global variable included in PWMCdd_Cfg.h . File below is a template. Necessary definition changes needs to be made to template before integration).
Functions provided to Integration Project
CDDPorts_ClearPhsReasSum(uint16 DataAccessBfr_Cnt_T_u16)
CDD_ApplyPWMMtrElecMechPol(sint8 MtrElecMechPol_Cnt_s8)
Configuration
Build Time Config
Constant | Notes | SWC |
---|---|---|
Generator Config
Constant | Notes | SWC |
---|---|---|
Integration
Global Data
The following global symbols must be defined in CDD_Data.c and .h (populated by PwmCdd):
uint16: CDD_DCPhsComp_Cnt_G_u16[3]
uint16: CDD_PWMPeriod_Cnt_G_u16
Component Conflicts
Project Specific
NHET/EPWM version corresponding PWMCdd component spilt and using global variables CDD_DCPhsComp_Cnt_G_u16 and CDD_PWMPeriod_Cnt_G_u16 should be used.
Include Path
The “include” directory of this SWC needs to be included in the integration project include search path.
Runnable Scheduling
This section specifies the required runnable scheduling.
Runnable | Scheduling Requirements | Trigger |
---|---|---|
PwmCdd_Init | Place in EcuStartup. Execute along with NHET initialization. | Init |
PwmCdd_Per1 | Must be placed in the motor control ISR, before Nhet (or whichever function populates the global variables used byNhet). | Cyclic (ISR) * |
*Note: don’t forget include header file from PWMCDD where PwmCdd_Per1 is called
Memory Mapping
Mapping
Memory Section | Contents | Notes |
---|---|---|
PWMCDD_START_SEC_VAR_CLEARED_16 | Variable Definitions |
* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.
Usage
Feature | RAM | ROM |
---|---|---|
Full driver |
Revision Control Log
Rev # | Change Description | Date | Author |
---|---|---|---|
1 | Initial version | 14-Feb-13 | Selva |