Advanced BLDC Motor Control using Freescale Ultra Reliable MPC5676R/MPC5674F MCU

By Mangesh Kale, Shilpa Bandaru, Sneha Kalkhair (einfochips)

This article describes ongoing internal project activities at eInfochips in the control systems domain for applications in motor and engine controls aimed for aerospace and automotive segments.

1. Introduction:

FreescaleTM MPC5676R processor is a new ultrareliable MCU based on twin 32 bit Qorivva e200z7 cores. It includes eTPU and eMIOS subsystems specially designed for needs of Engine Control Systems (Multiple PWM input/output, high speed controllers with critical synchronized timing pulse measurements etc). It also includes large ECC SRAM, four Multiplexed 12 bit ADCs, four FlexCAN ports, 4MB ECC Flash eliminating the need for many external ICs, hence greatly increasing reliability, and providing smaller system footprint.

2. Advantages of MPC5676R:

Typically for advanced control applications such as powertrains and motors, an integrated design involving two or more devices such as FPGA, DSP and Microcontroller are necessary. The role of FPGA or DSP usually is to run very high speed control loops, phase commutation and enable microcontroller handles to manage slower loops for overall speed or current control. Such system solutions require multiple development tool chains and usually a complex design of the hardware. MPC5676R allows the execution of high speed loops within eTPU and eMIOS while providing PowerPC cores that can run slower tasks. Such single chip solution implies a common tool chain, lesser design complexity of hardware, increased reliability due to reduced chip count and lower costs.

3. Advanced Motor Control System:

Brushless DC motors are widely used in various applications such as motor vehicles, industrial applications and aircraft actuation systems among many applications. The primary reason for increasing the usage of BLDC motor can be attributed to good weight/size to power ratio, excellent acceleration performance, little or no maintenance and less acoustic and electrical noise than brushed DC motor. This has led to a significant number of solutions in the speed control of the BLDC motor.

A BLDC motor is driven by rectangular voltage strokes coupled with the rotor position. The generated stator flux interacts with the rotor flux, which is generated by a rotor magnet and defines the torque and thus the speed of the motor. The voltage strokes must be properly applied to two phases of the three-phase winding system so that the angle between the stator flux and the rotor flux is kept as close to 90° as possible to get the maximum generated torque. Therefore, the motor requires electronic control for proper operation.

For the common 3-phase BLDC motor, a standard 3-phase power stage is used. There are several design characteristics that BLDC motor manufactures specify such as sensitivity, repeatability, stability-over-temperature and response time.

4. MPC5674F MCU Representation:

eTPU Module:

MPC5674F has three second generation enhanced processor units (eTPU2).

  • Up to 96 channels eTPU2 channels (32 channels per eTPU2).
  • Enhanced modular input output system supporting 32 unified channels (eMIOS), with each channel capable of single action, double action, pulse width modulation (PWM), and modulus counter operation.

The eTPU is an intelligent, semi-autonomous co-processor designed for timing control, I/O handling, serial communications, motor control, and engine control applications. It operates in parallel with the host CPU. The eTPU processes instructions and real-time input events, performs output waveform generation, and accesses shared data without the host CPU’s intervention. Consequently, the host CPU setup and service times for each timer event are minimized or eliminated.

eMIOS Module:

The eMIOS provides functionality to generate or measure time events. The eMIOS2 is implemented with its own configuration of timer channels to suit the target applications needs, while providing a consistent user interface. Provides multiple modes of operations for each unified channel (UC), any of which may be selected depending on the requirements of the customer application. eMIOS provides key programmable functionalities as:

  • IPWM(Input pulse width modulation)
  • IPM(Input period measurement)
  • OPWM(Output pulse width modulation)
  • OPWFW(Output pulse width modulation and frequency modulation)

Experimental Setup Objectives:

  1. Set up the simulation for generating desired PWM output signals
  2. Set up demo for generating desired PWM output signals using MPC5676
  3. Implement PI algorithm to control speed of the motor
  4. Setup 4-wire 2-phase BLDC motor speed control (2000 to 7600 RPM), two motors are to be controlled independently

The tools used are Code warrior 10.x and Graphical Configuration Tool etc provided with MPC5674F development kit.

Software setup steps:

6. Hardware set up:

The hardware setup consists of The MPC567x evaluation board, JTAG debugger and a two phase BLDC motor connected to eTPU channel. The eTPU code generates PWM at 25 kHz with a duty cycle variation between 10 to 90%. The Hall effect sensor output from motor can be observed along with PWM inputs on oscilloscope.

7. Demonstration of eTPU code, PWM generation and eMIOS timing measurements:

The eTPU code to generate PWM involves calling library functions generated

from eTPU function generator tool. The code samples are:


Duty cycle of 90%

Duty cycle of 10%

Similarly eMIOS code to generate PWM and measure pulse durations is shown below: 

8. Conclusions and Observations:

This technical note provides the description of ongoing internal project to setup closed-loop speed control independently for two 2-phase BLDC motor. The project involves demonstration of the eTPU, ADC and eMIOS subsystems on the PowerPC MPC5676R. This approach shall result in software running on CPU cores (e.g. RTOS, slow control loops, diagnostics) independent of high speed motor control loops enabling it to run multiple systems level tasks on a suitable RTOS. The project application is targeted at the MPC567XX family of devices, hence it can be easily reused with any similar MCU devices that has an eTPU, eMIOS and eDMA devices.

9. References:

  1. MPC5676R Reference Manual, MPC5676Rev_kit
  2. Enhanced Time Processing Unit Reference Manual, ETPURM
  3. eTPU Graphical Configuration Tool, http://www.freescale.com,Search keyword “ETPUGCT”

10. About Authors:

Dr Mangesh Kale is Senior Solution Architect and Key Accounts Manager at eInfochips. He has a well-rounded industry experience of more than 16 years in engineering, technology design and solutions in safety critical control systems hardware and software. Mangesh leads the aerospace practice group at eInfochips with responsibility of new client project acquisitions and managing research and development initiatives. Mangesh has done his PhD from The University of Southampton UK in flight control systems, Masters of Engineering from Indian Institute of Science Bangalore and Bachelors of Engineering from University of Pune, India.

Shilpa Bandaru is an engineer at einfochips. Her areas of interest includes advanced avionics, Aircraft flight-control system and aircraft display system (cockpit). She has done Bachelor’s degree in Electronics Communication engineering from JNTU Hydrabad.

Sneha Kalkhair is an engineer at einfochips. Her areas of interest includes embedded systems, automation and real-time databases. She has done Bachelor’s degree in Computer engineering from University of Pune.

11. ABOUT EINFOCHIPS

eInfochips is a global technology firm specializing in product engineering and software R&D services, we enable digital transformation for companies in Aerospace, consumer devices, Automotive devices, industrial automation, media and broadcast, medical devices and healthcare, We have contributed to 500+ products and over 10m deployments across the world. The company has a proud 20-year history, focused exclusively on R&D services for product companies. We have grown organically over that time to more than 1500 engineering, serving clients from our US headquarters in Sunnyvale, California and from sales and design centers across the US and India.

The company has sales presence in across the world such as USA, UK, Japan, Canada, and India.

×
Semiconductor IP