AUTOSAR-Compliant Field-Oriented Control for PMSM on Infineon AURIX TC3x Microcontrollers
This example shows how to integrate AUTOSAR microcontroller abstraction layer (MCAL) components and complex device drivers (CDDs) with Simulink® to generate production-ready code. You can deploy this code on an Infineon® AURIX™ TC3x microcontroller to implement an AUTOSAR-compliant field-oriented control (FOC) algorithm to run a permanent magnet synchronous motor (PMSM).
Automotive open system architecture (AUTOSAR) provides an open, standardized software architecture that automotive manufacturers, suppliers, and tool developers use to build scalable, reusable, and maintainable automotive electronic control unit (ECU) software. For more information, see AUTOSAR Standard (AUTOSAR Blockset) and What Is AUTOSAR? (AUTOSAR Blockset).
The AUTOSAR Classic Platform includes these layers:
Application Layer — This layer handles the higher-level speed control algorithm of the motor control system.
Run-time Environment (RTE) — This layer handles communication between AUTOSAR software components within the Application layer and communication between AUTOSAR software components and services provided by the Basic Software layer.
Basic Software (BSW) — This layer includes services, the ECU abstraction, the MCAL, and CDDs.
The MCAL acts as an interface between microcontroller peripherals, other BSW layers, and the application layer. CDD is a specific module located in the complex drivers layer of the BSW. It interacts with the standard BSW layers or the RTE. You can integrate CDDs with other AUTOSAR layers using standard AUTOSAR interfaces and Basic Software module (BSM) APIs. With direct access to the MCAL, CDD handles time‑critical current control by directly accessing hardware peripherals such as analog-to-digital converter (ADC) and pulse width modulator (PWM).
In an AUTOSAR Classic Platform implementation, the FOC algorithm can be positioned within the application and CDD layers, as shown in this architecture diagram.
In this example, you implement an AUTOSAR-based FOC algorithm to run a PMSM. The example includes these steps:
Install Third-Party Tools and Generate MCAL Configuration — Install MCAL packages, EB Tresos Studio, and BIFACES tools. Create an MCAL demo project, import it to BIFACES tool, and generate MCAL configuration in EB Tresos Studio.
Configure MCAL Modules and Generate Code in EB Tresos Studio — Configure peripherals such as ADC, digital input/output (DIO), and universal asynchronous receiver/transmitter (UART) and their interrupt configuration, interrupt priorities, memory allocation, and port configurations.
Implement AUTOSAR‑Compliant Field‑Oriented Control for PMSM on Infineon AURIX™ TC3x Microcontrollers — Integrate MCAL components and CDD with Simulink to generate production‑ready code and deploy it to implement FOC for a PMSM on Infineon AURIX™ TC3x microcontrollers.
Generate Simulink Block Libraries and Data Dictionaries for AUTOSAR-Based applications — Explore MATLAB® scripts for ARXML libraries, data dictionaries, code files, simulation components, scripts, and support files to implement AUTOSAR-based applications.
See Also
Topics
- What Is AUTOSAR? (AUTOSAR Blockset)
- AUTOSAR-Based FOC of PMSM (Motor Control Blockset)
- Field-Oriented Control of BLDC with Encoder Using Infineon AURIX TC3xx Microcontrollers