Basic knowledge of FOC motor algorithm design

Publisher:快乐兔子Latest update time:2023-08-09 Source: elecfansKeywords:FOC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The FOC algorithm (Field-Oriented Control) is an algorithm commonly used for AC motor control. Its goal is to convert the control problem of the AC motor into the control problem of the DC motor, so that the AC motor can be effectively controlled like a DC motor.


The basic idea of ​​the FOC algorithm is to convert the AC motor into an equivalent DC motor model and control the motor speed and torque by controlling the direction and size of the motor's electromagnetic field.


What does motor torque relate to?

Motor torque refers to the torque output by the motor, that is, the torque generated by the motor rotor.

In a DC motor, the motor torque is proportional to the armature current, which is proportional to the magnetic field strength, which is proportional to the number of pole pairs;

In an AC motor, motor torque is related to supply voltage, current, power factor, and motor speed.


What is an AC motor?

AC motors usually consist of two parts: the stator and the rotor. The stator is a stationary part that is usually made up of several coils and an iron core. When current passes through the stator coils, it generates a magnetic field in the iron core. The rotor is a rotating part that is usually made up of several poles and an iron core. When the magnetic field rotates in the stator core, it generates an induced current in the rotor core, causing the rotor to start rotating.


The operating principle of AC motors is based on the interaction of magnetic fields and the phenomenon of electromagnetic induction. When AC current passes through the stator coil, it generates a magnetic field in the stator core, which changes direction periodically as the current changes. Since the magnetic field induced in the rotor core also changes direction periodically, the rotor will produce rotational motion.


Differences from DC motors:

1. Different power supply methods: AC motors are powered by AC power, while DC motors are powered by DC power.

2. Different structures: The internal structure and construction of AC motors and DC motors are different. The rotor and stator of AC motors both contain coils, and their magnetic fields interact to generate electromotive force. The stator of a DC motor is usually stationary, and its magnetic field generates electromotive force that interacts with the magnetic field of the rotor.

3. Different speed regulation methods: The speed of an AC motor is usually determined by the power supply frequency, while the speed of a DC motor can be adjusted by changing the power supply voltage or the armature current.

4. Different application occasions: AC motors are suitable for high power, high speed, and low load occasions, such as air conditioners, refrigerators, electric fans, etc. DC motors are suitable for occasions that require speed regulation and reverse control, such as electric vehicles, power tools, etc.


Direct current refers to current whose direction does not change, that is, the charge moves in only one direction in the circuit. Alternating current refers to current whose direction and magnitude change with time. Its current direction changes periodically over time, that is, positive and negative currents alternate. Usually, the frequency of alternating current refers to the number of times the positive and negative currents change periodically per unit time, and the unit is Hertz (Hz), while the voltage and current magnitude will change continuously with time. Compared with alternating current, the advantage of direct current is that the voltage is stable and it is not easy to generate electromagnetic interference, so it is suitable for some occasions with high requirements for power quality.


1. Converting AC to DC: This process is usually called rectification, which can be achieved using a diode or a bridge rectifier circuit. Diode rectification can only convert single-phase AC to unipolar (DC), while a bridge rectifier circuit can convert three-phase or single-phase AC to DC.

2. Convert DC to AC: This process is usually called inversion, which can be achieved using an inverter. The inverter can convert DC to AC, and can output AC with different frequencies and voltages. Therefore, inverters are widely used in household appliances, electric vehicles, solar energy and other fields.


What is phase voltage?

Phase refers to the time deviation of the periodic change of a physical quantity relative to a reference point, usually expressed in the form of angle or radian.

Phase voltage refers to the voltage magnitude and phase angle of a phase voltage in an AC circuit relative to the common neutral point or point of the circuit.

In a three-phase AC circuit, phase voltage refers to the voltage difference between each phase line and the common neutral point or ground of the circuit. If the neutral point of the circuit is the same as the ground, the phase voltage is the voltage difference between each phase line. Concepts related to phase voltage also include line voltage and effective voltage.

Phase voltage refers to the voltage difference between each phase line and the neutral point of the circuit in a multi-phase circuit, which can also be called phase-to-phase voltage. Phase voltage is a voltage representation method in a multi-phase AC circuit.

In a three-phase AC circuit, phase voltage refers to the voltage difference between each phase line, that is, the voltage difference between phase A voltage and phase B voltage, phase B voltage and phase C voltage, and phase C voltage and phase A voltage. In a three-phase circuit, the magnitude of the phase voltage is generally the square root of 3 times the line voltage.

Line voltage refers to the voltage between two adjacent phase lines in an AC circuit, and effective voltage refers to the voltage that produces equivalent power in an AC circuit.

PWM stands for Pulse Width Modulation. It is a modulation technique commonly used in electronic devices and circuits to control the size, shape and frequency of electronic signals. From a mathematical point of view, PWM is a periodic digital signal consisting of a fixed-frequency carrier signal and a modulating signal with a variable duty cycle.


The cycle of the PWM signal is fixed and determined by the frequency of the carrier signal; while the duty cycle is variable, which indicates the ratio of the time that the modulated signal is at a high level in one cycle to the entire cycle time. The larger the duty cycle, the higher the average value of the output voltage or current, and vice versa. In other words, the pulse width and frequency of the electrical signal in one cycle are controlled to control the output voltage or current. Usually, the pulse width and frequency in one cycle can be adjusted, so that the average value and waveform of the output signal can be controlled.


1. Carrier frequency: also known as the operating frequency of the PWM signal, which is usually fixed and generally selected from a few thousand hertz to tens of kilohertz to ensure sufficiently high modulation accuracy and low distortion.

2. Modulation waveform: This is the modulation signal used to control the duty cycle of the PWM signal, which can be an analog signal or a digital signal. In a digital control system, the modulation waveform is usually a digital signal generated by a microprocessor or FPGA.

3. Duty cycle: Duty cycle refers to the ratio of the high level time to one cycle time in the PWM signal. In practical applications, the duty cycle is usually controlled by the amplitude of the modulation waveform. For example, when the amplitude of the modulation waveform is 0, the PWM signal output is a low level; when the amplitude of the modulation waveform is the maximum value, the PWM signal output is the maximum high level.

Once these three parameters are determined, the PWM signal can be generated by multiplying the modulating signal with the carrier signal. Since the carrier frequency is fixed and the modulating signal duty cycle is variable, the average value of the PWM signal can be controlled by changing the duty cycle.


How to generate PWM wave?

1. Use timer/counter: In digital circuits such as microcontrollers or digital signal processors (DSPs), timers/counters can be used to generate PWM waveforms. Timers/counters generate timed pulse signals by calculating specified time intervals, and generate PWM waveforms by changing the duty cycle of the pulse, that is, the ratio of pulse width to period.

2. Using analog circuits: PWM waveforms can be generated using analog circuits. For example, a PWM waveform can be generated by comparing the input signal with a triangle wave signal. The comparator can be implemented using an operational amplifier or other devices.

51 timer, I have written before:

1. Timer 0: Timer 0 is an 8-bit timer with a 13-bit counter. It can achieve different timing and counting functions through different working modes (mode 0, mode 1, mode 2 and mode 3). Generally, Timer 0 is widely used to control delay, and the counting frequency can reach a maximum of 12MHz.

2. Timer 1: Timer 1 is a 16-bit timer with a 16-bit counter. It can achieve different timing and counting functions through different working modes (mode 0, mode 1, mode 2, mode 3, mode 4 and mode 5). The counting frequency of Timer 1 can reach a maximum of 6MHz.

The working principle of the timer is: when the timer starts timing, the timer counter starts counting, and the count value continues to increase. When the counter value reaches the specified count value, the timer will send an interrupt signal. The interrupt service routine can perform some specific operations when the timer overflows.

The principle of generating PWM waveform by comparing the input signal with a triangle wave signal is based on the output of a comparator. In this process, the input signal is compared with a reference voltage and the output result is called the output of the comparator.

[1] [2] [3]
Keywords:FOC Reference address:Basic knowledge of FOC motor algorithm design

Previous article:The difference between wound rotor asynchronous motor and squirrel cage motor
Next article:The difference between scalar control and vector control

Recommended ReadingLatest update time:2024-11-16 10:14

Introduction to Field Oriented Control (FOC)
Because the six-step commutation method has some shortcomings, the FOC algorithm has the characteristics of small torque fluctuation and fast dynamic response, which can make the motor rotate more smoothly and efficiently. What is the principle of FOC algorithm? In simple terms, the FOC control algor
[Embedded]
Introduction to Field Oriented Control (FOC)
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号