SPRACM9B June 2019 – November 2020 F29H850TU , F29H859TU-Q1 , TMS320F28384D , TMS320F28384S , TMS320F28386D , TMS320F28386S , TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
The major challenge in digital motor control systems is the influence of sample and hold, as well as transportation lag inside the loop that slows down the system, impacting its performance at higher frequencies and running speeds. Fixing this problem will improve the current loop bandwidth. However, to achieve this without losing out on DC bus utilization, the following are necessary:
While the TMS320F2838x provide the necessary hardware support for higher performance, TI's FCL library, which runs on this real-time controllers, provide the necessary algorithmic support. The source code is available from MC SDK v2.01.00.00 and onward.
In order to make the current loop faster and to improve the operational range of current loops, the latency between feedback sampling and the PWM update must be as small as possible. This is depicted in Figure 4-1. Basically, it shows a PWM carrier cycle where system sampling is done at the carrier peak and the corresponding PWM update resulting from its control action is happening after a time TPWM_update. This substantially reduces the transportation lag and improves the bandwidth. However, the down side is the loss of active PWMing time window that is spent in computing the new values of PWM duty cycles for the inverter. This is called the blanking window. The lower this blanking window, the higher the DC bus utilization and the operating speed range of motor.
Typically, a latency of 2 µs or less is considered acceptable in many applications where the carrier frequency is 10 KHz. Traditionally, this task is implemented using a combination of high-end FPGAs, external ADCs, and MCUs. However, due to the availability of hardware support such as trigonometric math unit (TMU), CLA, high speed ADC or SDFM, single cycle ADC read and PWM write, it is possible to implement this control on this MCU without FPGAs or external ADCs.
The FCL library uses the following features in the F2838x MCU:
Figure 4-2 shows the block diagram of the FCL library with its inputs and outputs. The FCL library partitions the 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 library supports two types of current regulators, a standard PI controller and a complex controller. The complex controller can provide additional bandwidth over the standard 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 4-1 lists the FCL API functions and their descriptions.
API Function | Description |
---|---|
uint32_t FCL_getSwVersion(void) | Function that returns a 32-bit constant, and for this version the value returned is 0x00000007. |
void FCL_runComplexCtrl(void) | Function that performs the complex control as part of the FCL with QEP encoder and hallsensor using ADC |
FCL_runSDFMComplexCtrl(void) | Function that performs the complex control as part of the FCL with QEP encoder and shunt resistor using SDFM |
void FCL_runAbsEncComplexCtrl(void) | Function that performs the complex control as part of FCL with typical absolute encoders and hall sensor using ADC |
void FCL_runSDFMAbsEncComplexCtrl(void) | Function that performs the complex control as part of FCL with typical absolute encoders and shunt resistor using SDFM |
void FCL_runPICtrl(void) | Function that performs the PI control as part of the FCL with QEP encoder and hall sensor using ADC |
void FCL_runSDFMPICtrl(void) | Function that performs the PI control as part of the FCL with QEP encoder and shunt resistor using SDFM |
void FCL_runAbsEncPICtrl(void) | Function that performs the PI control as part of the FCL with typical absolute encoders and hall sensor using ADC |
void FCL_runSDFMAbsEncPICtrl(void) | id)Function that performs the PI control as part of the FCL with typical absolute encoders and shunt resistor using SDFM |
void FCL_runPICtrlWrap(void) | Wrap up function to be called by the user application at the completion of FCL in PI control mode before exiting ISR when QEP is the position sensor |
void FCL_runAbsEncPICtrlWrap(void) | Wrap up function to be called by the user application at the completion of FCL in PI control mode before exiting ISR, when using abs encoders |
void FCL_runQEPWrap(void) | Function to be called by the user application to wrap up the QEP feedback procedure. This function is used only in FCL_LEVE2 |
void FCL_runComplexCtrlWrap(void) | Wrap up function to be called by the user application at the completion of FCL in complex control mode before exiting ISR when QEP is the position sensor |
void FCL_runAbsEncComplexCtrlWrap(void) | Wrap up function to be called by the user application at the completion of FCL in complex control mode before exiting ISR, when using absolute encoders |
void FCL_initPWM(uint32_t basePhaseU, uint32_t basePhaseV, uint32_t basePhaseW) | Function to initialize PWMs for the FCL operation, this will be called by the user application during the initialization or setup process |
void FCL_resetController(void) | This function is called to reset the FCL variables and is useful when you want to stop the motor and restart the motor |
void FCL_initQEP(uint32_t baseA) | This function initializes the eQEP peripheral for connecting to the QEP |
void FCL_initADC(uint32_t resultBaseA, ADC_PPBNumber baseA_PPB, uint32_t resultBaseB, ADC_PPBNumber baseB_PPB, uint32_t adcBasePhaseW) |
This function initializes the ADCs that are used to sense the motor phase currents |
For more information on the library, see the Fast Current Loop MotorControl SDK Library User's Guide available at:
\ti\c2000\C2000Ware_MotorControl_SDK_2_01_00_00\libraries\fcl\docs.
The source code for FCL is available at
\ti\c2000\C2000Ware_MotorControl_SDK_2_01_00_00\libraries\fcl\source