1.4 PMSM FOC using Sliding Mode Observer
This example application shows how to control the Permanent Magnet Synchronous Motor (PMSM) with Sliding Mode Observer based Field Oriented Control (FOC) on a SAME70 Micro-controller.
Description
Permanent Magnet Synchronous Motor (PMSM) is controlled using Field Oriented Control (FOC). Rotor position and speed is determined using Sliding Mode Observer (SMO) technique. Motor start/stop operation is controlled by the switch and motor speed can be changed by the on-board potentiometer. Waveforms and variables can be monitored runtime using X2CScope.
Key features enabled in this project are:
- Dual shunt current measurement
- Speed control loop
MCC Project Configurations
- AFEC Peripheral:
The AFEC (ADC) is used to measure analog quantities. Four channels are used to measure the Phase Current A, the Phase Current B, the DC Bus Voltage and the Potentiometer. Conversion is triggered at the PWM (zero match + offset of the switch delay).
- PWM Peripheral:
This peripheral is used to generated three phase synchronous PWM waveforms. Fault functionality is also enabled to switch off the output waveforms asynchronously.
- UART Peripheral:
The UART is used for X2CScope communication to observe graphs and variable values in run time.
Control Algorithm
This project has been created using Harmony QSpin Tool. For details refer Harmony QSpin
Development Kits
MCLV2 with ATSAME70 PIM
DOWNLOADING AND BUILDING THE APPLICATION
To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.
Path of the application within the repository is apps/pmsm_foc_smo_sam_e70.
To build the application, refer to the following table and open the project using its IDE.
Project Name | Description | Demo User Guide |
---|---|---|
mclv2_sam_e70_pim.X | MPLABX project for MCLV2 board with ATSAME70 PIM | Hardware Setup and Running The Application on MCLV2 with ATSAME70 PIM |