The advent of frequency converters and advanced motor control methods have made three-phase brushless motors (AC induction motors or permanent magnet synchronous motors) once a huge success in speed control applications. These high-performance motor drivers were mainly used in factory automation systems and robots. In the past decade, the sharp price reduction of electronic components has enabled these motor drivers to enter cost-sensitive markets such as home appliances, air conditioners or personal medical devices. This article will explore how standard ARM-based microcontrollers can break through complex control modes in a market that has long been dominated by DSPs and FPGAs. We will use STMicroelectronics' STM32 series microcontrollers based on the Cortex-M3 core as an example to illustrate this process.
Figure 1: STM32: A solid foundation for growth
First, let's review the basic principles of motor control. Why is the processor so important in motor control systems? Why do we need very good computing performance? After all, Nicolas Tesla didn't need a compiler when he invented the AC motor a century ago. As long as speed regulation is required, people cannot avoid using an inverter to drive a good 3-phase motor. Controlling the operation of a permanent magnet synchronous motor (PMSM) is even more inseparable from the inverter. The core of this complex power electronic system is a 3-phase DC-to-AC inverter, in which the microcontroller plays a management role and performs the common trinity control functions in a fully digital way: detection (current, speed, angle...), processing (algorithms, housekeeping...), and control of power switches (the lowest configuration has at least 6 switches).
The simplest way to achieve variable speed operation of a three-phase AC motor is to use scalar control. The principle of scalar control is to maintain a constant ratio between the frequency and voltage applied to the motor. This is a very popular control method for entry-level motor drives, suitable for applications with very common load characteristics and low control bandwidth requirements (such as very small power pumps and fans). Unfortunately, not all applications can tolerate such a simple control process and its application limitations. In particular, scalar control cannot guarantee the best motor performance (torque, energy efficiency) in transient environments. To overcome these limitations, other motor control methods have been developed, among which field-oriented control (also known as vector control) is one of the most widely used methods. This control method uses two decoupled DC controllers to drive any AC motor (induction motor or permanent magnet motor) in the same way as a separately excited motor, regardless of the operating frequency (i.e. speed). The excitation current is related to the DC main flux (magnet flux in a PMSM motor), while the 90° phase-shifted current can control the torque and function as the armature current of a DC motor. Field-oriented control allows precise speed control with fast response when the load changes, keeping the stator flux and rotor flux in perfect 90-degree phase difference, ensuring optimized energy efficiency even in transient operating environments. This is the basic theoretical framework for more complex control methods based on motor topologies, especially for PMSM motors. This theory is the basis for sensorless motor drives, which can significantly reduce costs (no speed or angle sensors and related wiring are required) and improve motor reliability. In this case, only the motor mathematical model, current and voltage values must be used to estimate the rotor angle position by calculation. This state observer theory (among other control methods) can achieve sensorless speed control at a minimum of only a few hundred revolutions per minute, which in some cases is stationary. However, this is an additional real-time load on the CPU. Finally, the microcontroller must continuously recalculate the vector control algorithm at a rate of 1KHz to 20KHz, depending on the bandwidth of the final application. Processing Parke and Clarke transformations and implementing multiple PID controllers and software phase-locked loops does require intensive digital computing, which is why digital signal processors, microprocessors or FGPA devices have been used as controllers in the past.
Although dedicated dual-mode controllers and low-end fixed-point DSP architectures are available, STMicroelectronics chose to develop STM32 microcontrollers using the Cortex-M3 core. This solution is well suited to meet the requirements of a large number of brushless motor drives, and from a one-time engineering cost perspective, the advantage of this solution is the cost-effectiveness of using an industry-standard ARM® core and a standard microcontroller.
Based on the Harvard architecture, this 32-bit RISC uses the Thumb2 instruction set, providing 16-bit and 32-bit instructions. Compared with pure 32-bit code, this instruction set can greatly improve code density while retaining most of the advantages of the original ARM7 instruction set (additional optimized multiplication and addition operations and hardware division instructions).
Motor control systems require microcontrollers to have excellent real-time responsiveness (short interrupt latency), pure processing functions (such as single-cycle multiplication), and excellent control performance (when handling non-sequential execution flow and conditional branch instructions). The Cortex-M3 can meet all these requirements. For example, when the clock frequency is 72MHz, a sensorless field-oriented control of a permanent magnet motor is completed in 25µs, which is equivalent to 25% CPU load at a 10 kHz sampling rate.
In the STM32 microcontroller, this core works closely with the STMicroelectronics optimized flash interface, and only a few external components are needed to handle external events (Figure 2 shows the block diagram of the STM32F103 medium-capacity microcontroller). Needless to say, the PWM timer and the analog-to-digital converter are the most important components. The PWM timer includes state-of-the-art features such as center-aligned mode PWM signal generation and dead-time insertion logic, with a special emphasis on safety: the module directly controls the commutation of the power switch, which can control the power of several kilowatts. For example, the register code used to configure certain important parameters can be protected by a lock to prevent software failure. As long as the "Emergency Stop" pin is pulled low, all I/O pins are placed in a user-configurable safe state. This function is designed using a combinational logic module, which ensures that the protection circuits can still work properly before switching internally to the backup oscillator when the main clock (crystal) fails. Finally, the microcontroller also includes a fourth comparison channel dedicated to triggering the analog-to-digital converter to achieve the best current measurement accuracy.
Figure 2: STM32F103 medium-capacity microcontroller block diagram
Even the most sophisticated algorithms can hardly correct inaccurate analog measurements, but the overall performance of the motor drive system depends to some extent on the quality of the analog-to-digital converters. The STM32F103 chip has three built-in 12-bit analog-to-digital converters with a sampling rate of 1MSps and a total unadjusted error (TUE) of less than 5 LSB over the entire temperature and voltage range. The digital interface of the analog-to-digital converter has three main functions: first, it frees the CPU from simple control tasks and data processing; second, it connects the rest of the chip (interrupt requests, DMA requests, trigger inputs); and finally, it synchronizes the operation of the STM32's multiplexers. Among these functions that are useful for brushless motor control, we first consider the channel read sequencer. Compared with the traditional scanning circuit (according to the analog input number, a certain number of channels are converted in sequence), in a sequence of 16 conversion channels (for example: Ch3, Ch3, Ch0, Ch11), the sequencer can convert channels in any order. When designers are designing printed circuit boards, this function brings designers greater design flexibility. In order to achieve the purpose of averaging conversion, multiple sampling of the same channel is allowed (in a sequence). When the entire sequence is converted, the DMA channel sends the conversion result to RAM, and the interrupt handler generates an interrupt request.
During the detection of the motor phase current, the noise generated by the transient voltage on the power switch (typically several hundred V/µs in offline switching applications) is an important source of reading errors, which can lead to a very low signal-to-noise ratio of the measurement result. The solution is to synchronize the analog-to-digital converter with the timer controlling the power stage: since the commutation moment can be predetermined (defined by the compare registers of the 3 PWM timers), an additional compare channel can be used to trigger the analog-to-digital conversion operation slightly before or after the commutation moment. For this reason, the STM32 enables a second sequencer (also called injection sequencer), which has a higher priority than the normal sequencer and can interrupt the current conversion operation with a new conversion operation that cannot be delayed. Normally, the normal sequencer is responsible for "housekeeping" the conversion, continuously detecting the temperature or the DC bus voltage (as a background task) and then sending it to the RAM through the DMA channel, while the injection sequencer will handle the time-critical conversion operation and store the conversion result in the analog-to-digital converter register (an interrupt will be generated, but the delay cannot be accepted).
Having a general-purpose microcontroller capable of performing advanced motor control functions is one thing, but getting started with development is another. Both sides of the puzzle can be addressed with hardware and software tools. The first is a motor control development starter kit that includes test tools (JTAG probe and optoisolator), microcontroller chip, and power stage board and demonstration PMSM motor for product performance evaluation and development purposes. The modular design allows upgrading the demonstration application (e.g. dual motor control microcontroller board) to evaluate multiple (or custom) power stages. Finally, STMicroelectronics provides a motor control software library free of charge to STM32 customers. Version 2.0 of the motor control software library supports a variety of configurations using a simple and inexpensive list of #define statements in the header file. The software library contains field-oriented control algorithms for AC induction and synchronous motors, which are written in C programming language to simplify code readability and maintainability, again demonstrating the efficiency of modern compilers. The software library also provides a robust sensorless control algorithm for PMSM motors (based on flux observers) and a dedicated control algorithm for ultra-high-speed interior permanent magnet motors (IPM). Of course, the software also supports common speed and position sensors (incremental encoders, Hall sensors or tachometers). The STM32 supports three current sensing methods by using isolated sensors or shunts. The STM32 peripheral can implement an innovative single current sensing method to perform vector control using the lowest cost configuration (a simple unique resistor). This technology has been patented because it can minimize the intrinsic current distortion rate.
STMicroelectronics’ current main development projects are sensorless permanent magnet motor control to control the motor to standstill and dual motor control with built-in power factor correction. Recently, STMicroelectronics successfully demonstrated a single current sensing method, where only one STM32 microcontroller can perform two single current sensing vector control functions while also managing the PFC stage with a 40 kHz control loop (see Figure 3).
Figure 3: The STM32F103HD can handle dual motor control and digital PF simultaneously
From power switch discrete devices to complex system chips, STMicroelectronics is committed to supporting the motor control market with its unique product portfolio for a long time. The STM32 microcontroller product line will continue to be deployed in four new directions, as shown in Figure 3, two of which are suitable for motor control. The first product line will target the low-cost market and develop low-end 16-bit motor control microcontrollers. The other product line is based on high performance and is aimed at applications that require higher processing performance, larger memory capacity and high-bandwidth interfaces. Such a broad product portfolio combined with the Cortex-M3 core is bound to establish the versatility of the STM32 architecture for current and future motor drives.
Previous article:Design of the lower computer of the environmental monitoring system based on multithreading
Next article:Design of CAN bus node based on Cortex-M3 core chip LM3S2965
Recommended ReadingLatest update time:2024-11-16 14:39
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 98 days later, what will we say goodbye to 2019?
- See how this wireless high-precision temperature and humidity sensor development board works
- Work hard in the right direction and you will break through the ceiling you have built for yourself in the past
- ZigBee Protocol Stack
- EEWORLD University ---- Fundamentals of VLSI Design (Fundamentals of Digital Integrated Circuit Design) (Southeast University)
- CH340 circuit to prevent current backflow
- Bluetooth module responds incorrectly
- 【RT-Thread Reading Notes】Reflections on RT-Thread Learning Chapter 6
- 【ST NUCLEO-H743ZI Review】——by supermiao123
- How to Reduce the Temperature in Your Car's Fuse Box