SPRACO3 October 2019 INA240 , LMG5200 , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376D , TMS320F28376S , TMS320F28377D , TMS320F28377D-EP , TMS320F28377D-Q1 , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28378D , TMS320F28378S , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S
The latest C2000 family of microcontrollers supports fast current loop (FCL) implementation for high bandwidth control of motor drives over a wide speed range in high end multi axes industrial servo or robotics applications. Due to the stringent computational demands of the control algorithm and the demands of interfacing to various position feedback sensors used in these applications, traditionally FPGAs and discrete analog-to-digital converters (ADCs) have been widely used to implement the core control solution. However, recent C2000 MCUs can cost effectively replace FPGAs and external ADCs in these applications and exceed the functional requirements due to superior features. This design guide helps to evaluate the fast current loop (FCL) algorithm for high-bandwidth inner loop current control of dual-axis PM servo drives based on the TMS320F2837x or TMS320F28004x MCUs using TI’s LaunchPad kit, inverter BoosterPack kit and the C2000Ware MotorControl SDK. The test bench used in this reference design consists of a motor-generator set (2MTR-DYNO), a TMS320F28379D LaunchPad or TMS320F280049C LaunchPad and TI’s low voltage inverter module based on BOOSTXL-3PHGANINV.
This design guide describes the following topics:
C2000 is a registered trademark of Texas Instruments.
High performance motor drives in servo control and robotics applications are expected to provide high precision and high bandwidth control of current, speed and position loops for superior control of end applications such as robotic arm, CNC machines, and so forth. Since the current loop makes up the inner most control loop, it must have a high bandwidth to enable the outer speed or position loops to be faster. Hence, a high bandwidth FCL is needed in high performance industrial servo control applications. However, the delays due to ADC conversion and algorithm execution limit the current controller bandwidth to about a tenth of the sampling frequency.
Until recently, because of the time critical computational demand of the control algorithm and interface demands of various position encoders, FPGAs and external ADCs were needed to implement the fast current loop. However, with the advent of latest C2000 Delfino and Piccolo family of microcontrollers, it is now possible to replace FPGAs and external ADCs with these MCUs for a cost effective solution. This paper outlines the implementation of fast current loop on a C2000 platform running two motors, and verifies the frequency response of the control loops using TI’s Software Frequency Response Analyzer (SFRA) software library. Dynamic frequency response analysis in real-time on a motor drive system is unique among MCU suppliers and is currently capable only on C2000 MCUs.
Using the released FCL algorithm for this device and the Software Frequency Response Analyzer (SFRA) library for C2000 MCUs from TI, the control bandwidth of fast current loop and the operating speed range of motor are experimentally verified. This design guide documents the test platform setup, procedure and the quantitative results obtained. It is important to note that when the PWM carrier frequency is 10 KHz, the current loop bandwidth obtained is 5 KHz for a phase margin of 45° over a wide speed range. Compared to the traditional MCU based systems, FCL software can potentially triple a drive system’s torque response and double its maximum speed without increasing the PWM carrier frequency.
The Delfino F2837x and Piccolo F28004x series of C2000 microcontroller enable a new value point for dual-axis drives that also delivers very robust motion-control performance. The value comes not only from the achievable control performance and ability to drive two motors concurrently, but also from the high degree of on-chip integration of other key electronic system functions. Since both F2837x and F28004x devices support CPU and CLA cores, CPU offload encoder-feedback and torque control processing to the control law accelerator (CLA) to maximize the performance of dual-axis servo drive.
Acronym | Description |
---|---|
ACIM | AC Induction Motor |
ADC | Analog-to-Digital Converter |
CLA | Control Law Accelerator (in C2000 MCU) |
CLB | Configurable Logic Block (in C2000 MCU) |
CMPSS | Comparator Subsystem Peripheral (in C2000 MCU) |
CNC | Computer Numerical Control |
DMC | Digital Motor Control |
eCAP | Enhanced Capture Module |
ePWM | Enhanced Pulse Width Modulator |
eQEP | Enhanced Quadrature Encoder Pulse Module |
FCL | Fast Current Loop |
FOC | Field-Oriented Control |
FPGA | Field Programmable Gate Array |
INV | Inverter |
MCU | Microcontroller Unit |
PMSM | Permanent Magnet Synchronous Motor |
PWM | Pulse Width Modulation |
SFRA | Software Frequency Response Analyzer |
TMU | Trigonometric Mathematical Unit (in C2000 MCU) |
The C2000 family of MCUs possesses the desired computation power to execute complex control algorithms along with the correct combination of peripherals such as ADC, enhanced pulse width modulator (ePWM), enhanced quadrature encoder pulse (eQEP) and enhanced capture (eCAP) to interface with various components of the digital motor control (DMC) hardware. These peripherals have necessary hooks to provide flexible PWM protection, such as trip zones for PWMs and comparators.
Both F2837x and F28004x MCUs contain additional hardware features such as the following:
Together, these features provide enough hardware support to increase computational bandwidth per CPU core compared to its predecessors and offer superior real-time control performance. In addition, the C2000 ecosystem of software (libraries and application software) and hardware (LAUNCHXL-F28379D, LAUNCHXL-F280049C, BOOSTXL-3PhGaNInv) help to reduce the time and effort needed to develop a high-end digital motor control solution.
Figure 1 shows the basic speed control block diagram of a field oriented control (FOC) based AC motor control system used in servo drives. The current loop is highlighted here because this is the inner most loop and has a higher influence on the bandwidth of the outer speed and position loops. For the outer loop to have a higher bandwidth, the inner loop must have a far higher bandwidth, typically more than three times.
In the current loop, any two of the motor phase currents are measured, while the third can be estimated from these two sensing currents. These measurements feed the Clarke transformation module. The outputs of this projection are designated Iα and Iβ. These two components of the current along with the rotor flux position are the inputs of the Park transformation, which transform them to currents (Id and Iq ) in D-Q rotating reference frame. The Id and Iq components are compared to the references Idref (the flux reference) and Iqref (the torque reference). At this point, the control structure shows an interesting advantage; it can be used to control either synchronous (PM) or asynchronous (ACIM) machines by simply changing the flux reference and obtaining the rotor flux position. In the synchronous permanent magnet motor, the rotor flux is fixed as determined by the magnets, so there is no need to create it. Therefore, when controlling a PMSM motor, Idref can be set to zero, except during field weakening. Unlike PM motor, ACIM motors do not have a rotor flux by default. Since the flux need to be created, the flux reference current must be greater than zero.
The torque command Iqref can be fed from the output of the speed regulator. The outputs of the current regulators are Vdref and Vqref. These outputs are applied to the inverse Park transformation. Using the position of rotor flux, this projection generates Vαref and Vβref, which are the components of the stator vector voltage in the stationary orthogonal reference frame. These components are the inputs of the PWM generation block. The outputs of this block are the signals that drive the inverter.
Both Park and inverse Park transformations need the rotor flux position. Obtaining this rotor flux position depends on the choice of AC machine observer in sensorless control or the position encoder in the case sensored control.
The major challenge in implementing the current loop lies in reducing the latency between feedback sampling and PWM updates. In traditional control schemes, this latency is typically one sampling period, thereby, delaying the control action. In other words, it leads to one sampling period of inaction to any disturbances in the loop. For a fast current loop, this delay must be as small as possible to improve the loop performance over the wide operating speed range of the motor. Typically, a latency of one microsecond or less is considered acceptable in many applications that requires a controller with a fast compute engine, a fast ADC, low latency control peripherals and a superior control algorithm.
On a single F2837x or F28004x, it is possible to run two independent FCLs in less than 2 µs while still supporting the high control bandwidth and double sampling of each axis. In order to maintain the goal of measuring the currents of each motor during voltage transitions, the ADC double sampling is interleaved between each motor so that the sampling and subsequent FOC processing does not need to happen back to back. The motor 1 carrier lags motor 2 by a fixed 90°, then the ADC sampling period is consistent across both motors but interleaved between them as shown in Figure 2. Each ADC sample and conversion is followed by the C2000 CPU performing the FOC algorithm and updating the PWMs. In this way, the sample-to-PWM update remains very consistent for each execution, whether it’s the first or second sample of motor 1 or motor 2.
The major challenge in digital motor control systems is the influence of the sample and hold (S/H) , as well as transportation delay inside the loop that slows down the system, impacting its performance at higher frequencies and running speeds. A minimal current loop time not only helps to improve the control bandwidth, but it also enables a higher modulation index (M-I) for the inverter. A higher M-I translates into the higher phase voltage that the inverter can apply on the motor. Higher loop latency will reduce the maximum available voltage and can restrict the rate of current change in the motor, thereby, adversely impacting the controller performance.
To overcome these challenges, a controller with high computational power, right set of control peripherals and superior control algorithm are needed. The TMS320F2837x and TMS20F28004x provide the necessary hardware support for higher performance, and the FCL algorithm from TI that runs on the C2000 MCU provides the needed algorithmic support.
To improve the operational range of FCL, the latency between feedback sampling and PWM update should be as small as possible. Typically, a latency of 2 µS or less is considered acceptable in many applications. Traditionally, this task is implemented using a combination of high end FPGAs, external ADCs and MCUs.
The FCL algorithm utilizes the following features in the F2837x or F28004x MCUs.
Figure 3 shows the block diagram of FCL algorithm with its inputs and outputs. The FCL partitions its algorithm across the CPU, CLA and TMU to bring down the latency to under 1.0 µs compared to the acceptable 2.0 µs. Further optimization is possible if the algorithm is written in assembly.
The FCL algorithm supports two types of current regulators, a typical PI controller and a complex controller. The complex controller can provide additional bandwidth over the typical PI controller at higher speeds. Both current regulators are provided for user evaluation. In the example project, the current regulator can be selected by setting the FCL_CNTLR macro appropriately and studying how they compare.
Table 2 lists the FCL API functions and their descriptions.
API Function | Description |
---|---|
uint32_t FCL_getSwVersion(void ); | Returns a 32-bit constant and for this version the value returned is 0x00000008. |
void FCL_initPWM(MOTOR_Vars_t *ptrMotor, uint32_t basePhaseU, uint32_t basePhaseV, uint32_t basePhaseW); | Initializes all motor control PWMs for FCL operation, this function is called by the user application during initialization process. Both motors call the same function, the difference is the passed parameters. |
void FCL_initQEP(MOTOR_Vars_t *ptrMotor, const uint32_t baseA) | Assigned QEP base address of all motor control for FCL operation, this function is called by the user application during initialization process. Both motors call the same function, the difference is the passed parameters. |
void FCL_resetController(MOTOR_Vars_t *ptrMotor) | Reset the FCL variables when user wants to stop the motor and restart the motor. |
void FCL_runPICtrl_Mn(MOTOR_Vars_t *pMotor); | Function that performs the PI Control as part of the Fast Current Loop. (n=1 or 2 for motor 1 or motor 2) |
void FCL_runPICtrlWrap_Mn(MOTOR_Vars_t *pMotor ); | Wrap up function to be called by the user application at the completion of FCL in PI Control Mode. (n=1 or 2 for motor 1 or motor 2) |
void FCL_runComplexCtrl_Mn(MOTOR_Vars_t * pMotor ); | Function that performs the Complex control as part of the Fast Current Loop . (n=1 or 2 for motor 1 or motor 2) |
void FCL_runComplexCtrlWrap_Mn(MOTOR_Vars_t *pMotor ); | Wrap up function to be called by the user application at the completion of FCL in Complex Control Mode . (n=1 or 2 for motor 1 or motor 2) |
For more information on the FCL algorithm, the source codes is available at : \ti\c2000\C2000Ware_MotorControl_SDK_version\libraries\fcl\source.
The algorithm is written in a modular format and is able to port over to user platforms using F2837x, F28004x, or F2838x devices if the following conditions are met: