This is the multi-page printable view of this section. Click here to print.
Component Implementation
1 - InertiaCmpVel_IntegrationManual
Integration Manual
For
InertiaCmpVel
VERSION: 1.0
DATE: 23-Jul-2015
Prepared By:
Spandana Balani
Nexteer Automotive,
Saginaw, MI, USA
Revision History
| Sl. No. | Description | Author | Version | Date | 
| 1 | Initial version | SB | 1.0 | 23-July-2015 | 
Table of Contents
3.2 Global Functions(Non RTE) to be provided to Integration Project 6
4 Configuration REQUIREMeNTS 7
4.2 Configuration Files to be provided by Integration Project 7
4.3 Da Vinci Parameter Configuration Changes 7
4.4 DaVinci Interrupt Configuration Changes 7
4.5 Manual Configuration Changes 7
5 Integration DATAFLOW REQUIREMENTS 8
5.1 Required Global Data Inputs 8
5.2 Required Global Data Outputs 8
5.3 Specific Include Path present 8
Abbrevations And Acronyms
| Abbreviation | Description | 
|---|---|
| DFD | Design functional diagram | 
| MDD | Module 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. | Title | Version | 
|---|---|---|
| <1> | <MDD Guidelines> | Process 4.01.00 | 
| <2> | <Software Naming Conventions> | Process 4.01.00 | 
| <3> | <Coding standards> | Process 4.01.00 | 
| <4> | FDD – SF014A_InertiaCmpVel_Design | See Synergy Subproject version | 
Dependencies
SWCs
| Module | Required Feature | 
|---|---|
| None | 
Global Functions(Non RTE) to be provided to Integration Project
None
Configuration REQUIREMeNTS
Build Time Config
| Modules | Notes | |
|---|---|---|
| FLTINJENA | Set to STD_ON for Fault injection | 
Configuration Files to be provided by Integration Project
None
Da Vinci Parameter Configuration Changes
| Parameter | Notes | SWC | 
|---|---|---|
| N/A | 
DaVinci Interrupt Configuration Changes
| ISR Name | VIM # | Priority Dependency | Notes | 
|---|---|---|---|
| N/A | 
Manual Configuration Changes
| Constant | Notes | SWC | 
|---|---|---|
| N/A | 
Integration DATAFLOW REQUIREMENTS
Required Global Data Inputs
Refer DataDict.m file
Required Global Data Outputs
Refer DataDict.m file
Specific Include Path present
No
Runnable Scheduling
This section specifies the required runnable scheduling.
| Init | Scheduling Requirements | Trigger | 
|---|---|---|
| InertiaCmpVelInit1 | On Init | RTE_Init | 
| Runnable | Scheduling Requirements | Trigger | 
|---|---|---|
| InertiaCmpVelPer1 | None | RTE(2ms) | 
.
Memory Map REQUIREMENTS
Mapping
| Memory Section | Contents | Notes | 
|---|---|---|
| None | ||
* Each …START_SEC… constant is terminated by a …STOP_SEC… constant as specified in the AUTOSAR Memory Mapping requirements.
Usage
| Feature | RAM | ROM | 
|---|---|---|
| None | 
NvM Blocks
None
Compiler Settings
Preprocessor MACRO
None
Optimization Settings
None
Appendix
None
2 - InertiaCmpVel_MDD
Module Design Document
For
InertiaCmpVel
August 18, 2017
Prepared By:
Matthew Leser,
Nexteer Automotive,
Saginaw, MI, USA
Change History
| SNo | Description | Author | Version | Date | 
| 1 | Initial Version | SB | 1.0 | 23-Jul-2015 | 
| 2 | Updated to version 1.3.0 of design | SB | 2.0 | 11-Mar-2016 | 
| 3 | Updated to version 1.7.0 and 1.8.0 of design | KK | 3.0 | 21-Jun-2016 | 
| 4 | Updated to version 1.9.0 of design | KK | 4.0 | 14-Jul-2016 | 
| 5 | Updated Graph and function input | ML | 5.0 | 18-Aug-2017 | 
Table of Contents
2 InertiaCmpVel & High-Level Description 5
3 Design details of software module 6
3.1 Graphical representation of InertiaCmpVel 6
4.1 Program (fixed) Constants 8
5 Software Component Implementation 9
5.1.2 Interrupt Service Routines 9
5.1.3 Server Runnable Functions 9
5.1.4 Module Internal (Local) Functions 9
6 Known Limitations with Design 12
Appendix A Abbreviations and Acronyms 14
Introduction
Purpose
Scope
InertiaCmpVel & High-Level Description
Refer FDD
Design details of software module
Graphical representation of InertiaCmpVel

Data Flow Diagram
Component level DFD
Refer FDD
Function level DFD
Refer FDD
Constant Data Dictionary
Program (fixed) Constants
Embedded Constants
Local Constants
None
Global Constants
Refer .m file
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) | 
|---|---|---|---|---|
| typedef struct FilCoeffRec | b0_Uls_f32 | Float32 | FULL | FULL | 
| b1_Uls_f32 | Float32 | FULL | FULL | |
| b2_Uls_f32 | Float32 | FULL | FULL | |
| a0_Uls_f32 | Float32 | FULL | FULL | |
| a1_Uls_f32 | Float32 | FULL | FULL | |
| a2_Uls_f32 | Float32 | FULL | FULL | 
Software Component Implementation
Sub-Module Functions
Initialization sub-module InertiaCmpVelInit1()
Design Rational:
Init function is not present in the model but in reference to the Init.txt text file Low pass filter and Notch filter are initialized.
For Low pass filter standard EA4 LPF implementation from NxtrFil.h is followed and for Notch filter initialization, EA3 implementation is followed.
Periodic sub-module InertiaCmpVelPer1()
Interrupt Service Routines
None
Server Runnable Functions
None
Module Internal (Local) Functions
Calculate Driver Velocity
| Function Name | DrvrVelCalc | Type | Min | Max | 
| Arguments Passed | HwTq_HwNwtMtr_T_f32 | float32 | -10 | 10 | 
| MotVelCrf_MotRadPerSec_T_f32 | float32 | -1350 | 1350 | |
| VehSpd_Kph_T_f32 | float32 | 0 | 511 | |
| Return Value | ScadDrvrVel_MotRadPerSec_T_f32 | float32 | -1350 | 1350 | 
Calculate ADD Coefficient
| Function Name | ADDCoeffCalc | Type | Min | Max | 
| Arguments Passed | AssiCmdBas_MotNwtMtr_T_f32 | float32 | -8.8 | 8.8 | 
| WhlImbRejctnAmp_MotNwtMtr_T_f32 | float32 | 0 | 8.8 | |
| VehSpd_Kph_T_f32 | float32 | 0 | 511 | |
| Return Value | ADDCoeffCalc_MotNwtMtrSpRad_T_f32 | float32 | 0.0 | 0.00007 | 
Calculate Gain
| Function Name | DecelGain | Type | Min | Max | 
| Arguments Passed | VehLgtA_KphPerSec_T_f32 | float32 | -35 | 35 | 
| MotVelCrf_MotRadPerSec_T_f32 | float32 | -1350 | 1350 | |
| Return Value | DecelGain_Uls_T_f32 | float32 | 0 | 1 | 
Calculate Filter Coefficients
| Function Name | FilCoeffCalc | Type | Min | Max | |
| Arguments Passed | ADDCoeff_MotNwtMtrPerMotRadPerSec_T_f32 | float32 | 0.0 | 0.041306 | |
| WhlImbRejctnAmp_MotNwtMtr_T_f32 | float32 | 0 | 8.8 | ||
| VehSpd_Kph_T_f32 | float32 | 0 | 511 | ||
| Return Value | *FilCoeff_T_Rec | b0_Uls_f32 | float32 | -2.74156205240179 | 0 | 
| b1_Uls_f32 | float32 | 0.0 | 0.330448 | ||
| b2_Uls_f32 | float32 | -0.160083862455113 | 2.41111405240179 | ||
| a0_Uls_f32 | float32 | 0.5525885 | 3.9498924 | ||
| a1_Uls_f32 | float32 | -7.9996842 | -4.8417266 | ||
| a2_Uls_f32 | float32 | 4.0504234 | 10.6056849 | ||
Generate Command
| Function Name | GenFddIcCmd | Type | Min | Max | |
| Arguments Passed | ScadDrvrVel_MotRadPerSec_T_f32 | float32 | -7226.652 | 7226.652 | |
| *FilCoeff_T_Rec | b0_Uls_f32 | float32 | -2.74156205240179 | 0 | |
| b1_Uls_f32 | float32 | 0.0 | 0.330448 | ||
| b2_Uls_f32 | float32 | -0.166262133009164 | 2.41111405240179 | ||
| a0_Uls_f32 | float32 | 0.5525885 | 3.9498924 | ||
| a1_Uls_f32 | float32 | -7.9996842 | -4.8417266 | ||
| a2_Uls_f32 | float32 | 4.0504234 | 10.6056849 | ||
| Return Value | InertiaCmp_MotNwtMtr_T_f32 | Float | -8.8 | 8.8 | |
NotchCmp
| Function Name | NotchCmp | Type | Min | Max | 
| Arguments Passed | VehSpd_Kph_T_f32 | float32 | 0 | 511 | 
| InertiaCmp_MotNwtMtr_T_f32 | float32 | -8.8 | 8.8 | |
| WhlImbRejctnAmp_MotNwtMtr_T_f32 | float32 | 0 | 8.8 | |
| Return Value | NotchCmp _MotNwtMtr_T_f32 | float32 | -8.8 | 8.8 | 
FilNotchFullUpdOutp_f32
| Function Name | FilNotchFullUpdOutp_f32 | Type | Min | Max | 
| Arguments Passed | Inp | float32 | See unit test consideration | |
| FilNotchStRecPtr | FilNotchStRec1 | |||
| FilNotchGainRecPtr | FilNotchGainRec1 | |||
| Return Value | None | |||
Description
Notch filter output calculation implemented based on ‘Inertia Comp Notch’ block functionality.
FilNotchInit
| Function Name | FilNotchInit | Type | Min | Max | 
| Arguments Passed | Inp | float32 | See unit test consideration | |
| FilNotchStRecPtr | FilNotchStRec1 | |||
| FilNotchGainRecPtr | FilNotchGainRec1 | |||
| Return Value | FilOut | float32 | ||
Description
Notch filter initialization function implemented based on EA3 design.
Transition Functions
None
Known Limitations with Design
None
UNIT TEST CONSIDERATION
- Since the notch filter implementation used in this module is dynamic in nature, absolute ranges are difficult to determine without pre-defined knowledge on the combination of coefficient values (A1, A2, B0, B1, B2). Because of this, the systems group ran simulations on 10 different combinations of coefficients (2 with defined default calibrations, 8 considered extreme cases of notch filters) and logged the ranges of the filter state variables and outputs during a frequency sweep. The ranges given throughout this module were taken as the worst case results of all of the given test cases. 
To provide useful cases for unit testing, the boundary checks tested during unit testing should be altered to test the state variable minimum and maximum for each of the 10 test cases with the given coefficients set to the values given in that test case. In the case where the default values of the coefficients are used in a vector, the unit tester should not test the corresponding state variables with values over the range defined for that set of coefficients. See attached simulation results.
- GenFddIcCmd function is designed to work with argument values from the calling function as used with the other functions in the module, and outputs may be out of the expected range if tested with arbitrary combinations of input values. Unit testing of this function should use only passed argument value combinations coming from the calling function. 
Abbreviations and Acronyms
| Abbreviation or Acronym | Description | 
|---|---|
Glossary
Note: Terms and definitions from the source “Nexteer Automotive” take precedence over all other definitions of the same term. Terms and definitions from the source “Nexteer Automotive” are formulated from multiple sources, including the following:
- ISO 9000 
- ISO/IEC 12207 
- ISO/IEC 15504 
- Automotive SPICE® Process Reference Model (PRM) 
- Automotive SPICE® Process Assessment Model (PAM) 
- ISO/IEC 15288 
- ISO 26262 
- IEEE Standards 
- SWEBOK 
- PMBOK 
- Existing Nexteer Automotive documentation 
| Term | Definition | Source | 
|---|---|---|
| MDD | Module Design Document | |
| DFD | Data Flow Diagram | 
References
| Ref. # | Title | Version | 
|---|---|---|
| 1 | AUTOSAR Specification of Memory Mapping (Link:AUTOSAR_SWS_MemoryMapping.pdf) | v1.3.0 R4.0 Rev 2 | 
| 2 | MDD Guideline | EA4 01.00.00 | 
| 3 | Software Naming Conventions.doc | 2.0 | 
| 4 | Software Design and Coding Standards.doc | 2.1 | 
| 5 | FDD – SF014A_InetiaCmpVel_Design | See Synergy Sub project version | 
3 - InertiaCmpVel_PeerReview
Overview
Summary SheetSynergy Project
Davinci Files
Source Code
MDD
PolySpace
Sheet 1: Summary Sheet

Sheet 2: Synergy Project
Sheet 3: Davinci Files
Sheet 4: Source Code
| Rev 7.1 | 8-Jun-15 | |||||||||||||||||||||||
| Peer Review Meeting Log (Source Code Review) | ||||||||||||||||||||||||
| Source File Name: | Source File Revision: | |||||||||||||||||||||||
| Module Design Document Name: | MDD Revision: | |||||||||||||||||||||||
| FDD/SCIR/DSR/FDR/CMS Revision: | ||||||||||||||||||||||||
| Quality Check Items: | ||||||||||||||||||||||||
| Rationale is required for all answers of No | ||||||||||||||||||||||||
| Working EA4 Software Naming Convention followed: | ||||||||||||||||||||||||
| for variable names | Yes | Comments: | ||||||||||||||||||||||
| for constant names | N/A | Comments: | ||||||||||||||||||||||
| for function names | N/A | Comments: | ||||||||||||||||||||||
| for other names (component, memory | N/A | Comments: | ||||||||||||||||||||||
| mapping handles, typedefs, etc.) | ||||||||||||||||||||||||
| All paths assign a value to outputs, ensuring | N/A | Comments: | ||||||||||||||||||||||
| all outputs are initialized prior to being written | ||||||||||||||||||||||||
| All source code changes have Requirements Tracability | N/A | Comments: | ||||||||||||||||||||||
| tags in the component | ||||||||||||||||||||||||
| No Variables are declared at the Module level. | N/A | Comments: | ||||||||||||||||||||||
| Synergy version matches change history | Yes | Comments: | ||||||||||||||||||||||
| and Version Control version in file comment block | ||||||||||||||||||||||||
| Change log contains detailed description of changes | Yes | Comments: | ||||||||||||||||||||||
| and Work CR number | ||||||||||||||||||||||||
| Code accurately implements FDD (Document or Model) | N/A | Comments: | ||||||||||||||||||||||
| No Compiler Errors or Warnings verified | Yes | Comments: | ||||||||||||||||||||||
| Is component.h included | N/A | Comments: | ||||||||||||||||||||||
| Are all includes actually needed? System includes | Yes | Comments: | ||||||||||||||||||||||
| only allowed in Nexteer library components | ||||||||||||||||||||||||
| Software Design and Coding Standards followed: | Version: 2.1 | |||||||||||||||||||||||
| Code comments are clear, correct, and adequate | N/A | Comments: | ||||||||||||||||||||||
| and have been updated for the change: [N40] and | ||||||||||||||||||||||||
| all other rules in the same section as rule [N40], | ||||||||||||||||||||||||
| plus [N75], [N12], [N23], [N33], [N37], [N38], | ||||||||||||||||||||||||
| [N48], [N54], [N77], [N79], [N72] | ||||||||||||||||||||||||
| Source file (.c and .h) comment blocks are per | Yes | Comments: | ||||||||||||||||||||||
| standards and contain correct information: [N41], [N42] | ||||||||||||||||||||||||
| Function comment blocks are per standards and | Yes | Comments: | ||||||||||||||||||||||
| contain correct information: [N43] | ||||||||||||||||||||||||
| Code formatting (indentation, placement of | Yes | Comments: | ||||||||||||||||||||||
| braces, etc.) is per standards: [N5], [N55], [N56], | ||||||||||||||||||||||||
| [N57], [N58], [N59] | ||||||||||||||||||||||||
| Embedded constants used per standards; no | N/A | Comments: | ||||||||||||||||||||||
| "magic numbers": [N12] | ||||||||||||||||||||||||
| Memory mapping for non-RTE code, function parameters | N/A | Comments: | ||||||||||||||||||||||
| to | ||||||||||||||||||||||||
| All execution-order-dependent code can be | N/A | Comments: | ||||||||||||||||||||||
| recognized by the compiler: [N80] | ||||||||||||||||||||||||
| No possibility of a non-terminating loop: [N63] | N/A | Comments: | ||||||||||||||||||||||
| No possibility of divide by zero: [N65] | N/A | Comments: | ||||||||||||||||||||||
| All integer division and modulus operations | N/A | Comments: | ||||||||||||||||||||||
| handle negative numbers correctly: [N76] | ||||||||||||||||||||||||
| All typecasting and fixed point arithmetic, | Yes | Comments: | ||||||||||||||||||||||
| including all use of fixed point macros and | ||||||||||||||||||||||||
| timer functions, is correct and has no possibility | ||||||||||||||||||||||||
| of unintended overflow or underflow: [N66] | ||||||||||||||||||||||||
| No possibility of converting a negative floating | Yes | Comments: | ||||||||||||||||||||||
| point value to an unsigned type: [N67] | ||||||||||||||||||||||||
| All conversions between signed and unsigned | N/A | Comments: | ||||||||||||||||||||||
| types handle msb==1 as intended: [N78] | ||||||||||||||||||||||||
| No possibility of dereferencing a null | N/A | Comments: | ||||||||||||||||||||||
| pointer: [N70] | ||||||||||||||||||||||||
| Module outputs are limited to the legal range | N/A | Comments: | ||||||||||||||||||||||
| defined in the FDD DataDict.m file : [N53] | ||||||||||||||||||||||||
| All code is mapped with FDD (all FDD | Yes | Comments: | ||||||||||||||||||||||
| subfunctions and/or model blocks identified | ||||||||||||||||||||||||
| with code comments; all code corresponds to | ||||||||||||||||||||||||
| some FDD subfunction and/or model block): [N40] | ||||||||||||||||||||||||
| No violations of other coding standard rules | Yes | Comments: | ||||||||||||||||||||||
| identified during review | ||||||||||||||||||||||||
| Incorrect items that require FDD changes | N/A | Comments: | ||||||||||||||||||||||
| ie (display variables used incorrectly, limiting on outputs, | ||||||||||||||||||||||||
| NvM struct types, divide by zero, other?) | ||||||||||||||||||||||||
| General Notes / Comments: | ||||||||||||||||||||||||
| Change Owner: | Matt Leser | Review Date : | 08/18/17 | |||||||||||||||||||||
| Lead Peer Reviewer: | Avinash James | Approved by Reviewer(s): | Yes | |||||||||||||||||||||
| Other Reviewer(s): | Bri Spencer | |||||||||||||||||||||||
Sheet 5: MDD
Sheet 6: PolySpace
| Rev 7.1 | 8-Jun-15 | |||||||||||||||||||||||
| Peer Review Meeting Log (QAC/PolySpace Review) | ||||||||||||||||||||||||
| Module Name: | Source File Revision: | 8 | Module | 1 | of | 1 | ||||||||||||||||||
| Compliance Guidelines Version: | 01.03.00 | |||||||||||||||||||||||
| Quality Check Items: | ||||||||||||||||||||||||
| Rationale is required for all answers of No | ||||||||||||||||||||||||
| Contract Folder's header files are appropriate | Yes | Comments: | ||||||||||||||||||||||
| function prototypes match the latest component version | ||||||||||||||||||||||||
| 100% Compliance to the MISRA Compliance Guidelines | Yes | Comments: | ||||||||||||||||||||||
| Are previously added suppression comments still | Yes | Comments: | ||||||||||||||||||||||
| appropriate | ||||||||||||||||||||||||
| Cyclomatic complexity and Static path count ok per | Yes | Comments: | ||||||||||||||||||||||
| Design and Coding Standards rule [N47] | ||||||||||||||||||||||||
| General Notes / Comments: | ||||||||||||||||||||||||
| Change Owner: | Matt Leser | Review Date : | 08/18/17 | |||||||||||||||||||||
| Lead Peer Reviewer: | Avinash James | Approved by Reviewer(s): | Yes | |||||||||||||||||||||
| Other Reviewer(s): | Bri Spencer | |||||||||||||||||||||||


