Many new motor control designs utilize Digital Signal Processors (DSPs) to provide the computational power for vector control of electric machines. Up to now, the rule of thumb has been that each inverter and motor requires its own DSP controller due to the considerable amount of processing power and peripherals required for the vector control. Recently, both DSP's processing power and peripheral capacity have been extended to the point where they can easily control two motors and can potentially handle even more. A practical walkthrough of the control of dual three-phase inverters using a single DSP controller shows how this is accomplished. This example includes the complete system implementation of a dual Permanent Magnet Synchronous Motor (PMSM) drive together with DSP interfacing.
Switching electric machines from scalar control to vector control significantly improves operating efficiency, saving energy while allowing the use of smaller, less expensive motors. Vector control manages the torque and speed of motors by generating the appropriate magnetic vectors. But it takes a considerable amount of processing power to solve the algorithms needed to generate the correct Pulse Width Modulated (PWM) outputs for each motor. Current motor control applications typically require 20 to 25 MIPS processing power per inverter. In addition, driving each inverter requires an individual encoder interface block and six PWM outputs.
Previous Methods
These stringent requirements dictated that each motor application use a separate DSP control. For applications with only a single motor, this is not an issue, but it can be burdensome and costly in many multiple-motor applications. Typical multiple-motor applications include industrial machinery, heating ventilation air conditioning (HVAC) equipment, automobiles, and many others. With the processing power of today's most advanced DSPs in the 100 to 150 MIPS range, the potential for controlling multiple motors with a single DSP controller increases. In fact, DSPs have been developed specifically for this application with multiple encoder interfaces and a large number of PWM outputs.
Hardware Description
The hardware for the dual motor control includes the two, three-phase PMSMs, each connected to a three-phase voltage source PWM inverter with one DSP controller (Texas Instruments TMS320F2808) independently controlling both inverters. The on-chip analog-to-digital converter records phase currents, dc bus voltage information, and other data from both inverters. Encoder interface modules in the DSP controller accept the encoder feedback. The on-chip power electronics peripherals provide a glue-less interface to the inverters, simplifying the overall system design.
To generate the necessary signals for two three-phase voltage-source inverters, the hardware set up uses six PWM outputs. The PWM channels operate at 20 kHz for the inverter function with the compare values for the PWM blocks updated every PWM cycle. A DSP development board (TMS320F280eZdsp) serves as the main controller platform. The sinusoidal-commutated three-phase permanent magnet motors (Applied Motion A0100-103-3-000) have eight poles and use a 2k line encoder. The on-chip Quadrature Encoder Pulse (QEP) interfaces in the DSP connect to each of the motor encoders.
Software Development
Software written in modular form using C code allows for future expansion with Interrupt Service Routines (ISRs) driving the application. The background loop that constitutes the main code consists simply of initializing the peripherals, including the Phase Locked Loop (PLL), watchdog, interrupt control and event manager. The remainder of the code includes the PWM-ISRs. The individual motor system's time-based interrupts invoke the ISRs every PWM cycle.
Independent control of the two, three-phase PMSMs requires the implementation of two sets of field control algorithms. All calculations for both motors are done within each PWM cycle in a cycle-by-cycle manner utilizing multiple software blocks. This clearly defines each block's inputs and outputs allowing reuse in different systems. All of the calculations use fixed-point math to reduce computational requirements.
Motor Control Algorithms
The well-known Clarke-Park Field-Oriented Control (FOC) transformation converts three-phase current vectors from a three-dimensional stationary reference frame to a two-dimensional rotating reference frame. Separate Proportional-Integral-Differential (PID) controllers process the resulting orthogonal components. A PWM switching pattern transforms the outputs of the PID controllers back to the three-dimensional stationary reference plane using the encoder feedback to compute the flux angle.
A PID block controls the PWM duty cycle that regulates the voltage delivered to the motor. The QEP block accepts a quadrature pulse — the output of an optical encoder connected to the motor shaft. The QEP block then calculates the armature position and the rotation speed.
Using the previously-described algorithms, the PID controller block calculates the PWM compare register's value to implement the variable-speed operation. The complete algorithm runs at 20 kHz with the PWM duty ratio updated every PWM cycle. Duplicating this setup for the second motor provides a completely independent two-motor drive controlled by a single DSP controller.
Fixed-Point Algorithm Development
A special fixed-point math library, called IQMATH, optimizes algorithm performance on the DSP hardware and compiler. IQMATH consists of a collection of highly-optimized and high-precision mathematical functions for C/C++ designed to seamlessly port floating-point algorithms into fixed point code on DSPs. The IQMATH routines make it possible to write fixed programs as if they were in floating point format. These routines also manage saturation and overflow, which would otherwise be a concern in fixed-point programming. In addition, the IQMATH routines operate in computationally-intensive, real-time applications requiring high execution speed and accuracy.
The software module definitions used were created as a specific data type. This makes it possible to reuse software modules multiple times by instancing the module object as many times as necessary to implement the total system. For a dual drive implementation, all required modules were instanced twice by simply declaring the appropriate data type. Implementing dual algorithms used about 4 kW of program space and 0.5 kW of data space out of the available 63 kW of Flash and 18 kW of RAM.
Fault management is an important consideration in multiple inverter drives. Traditional DSP controllers that run a single inverter normally incorporate a single fault management system that shuts down the controller when a fault is received. Multiple inverter controllers should be configured with dedicated pins to receive fault detection signals from each motor. For example, six pins might be associated with over-voltage, over-current and over-temperature sensors for each of two motors. The three pins for a single motor connect to an OR block that generates an interrupt to shut down the PWM associated with that motor if any one of the pins goes from low to high or high to low.
Experimental Results
The software development for the dual-motor drive was completed in phases, significantly reducing the time required for debugging. The incremental software build process tested a few software blocks at a time and proceeded to the next build level only after completion of the previous phase. The end result successfully provided independent control of each drive. With the MIPS requirement well below the available 100 MIPS on the DSP controller, the remaining bandwidth could easily be used to provide additional functionality.
The PMSM vector control performance benefits are well known. However, traditional controllers only provide enough bandwidth and on-chip peripherals to implement a single high-performance drive. On the other hand, providing a separate drive for each motor adds to the cost of the overall system. The latest generation of DSP controllers addresses the cost aspect by providing the processing horsepower, multiple encoder interfaces, and multiplicity of PWM outputs needed to control two or potentially even more motors. The integration of the DSP core with the necessary peripherals simplifies the design process and provides options for additional drive features. One DSP controller capable of operating up to four, three-phase source inverters can drastically reduce the cost and space requirements of machinery and transportation equipment using multiple motors.