One application of PID control is vector control of permanent magnet synchronous motors.
Permanent magnet AC synchronous motors, combining the advantages of various motor types, are widely used in booming industries such as new energy vehicles. Their rotors, imbued with magnetic force, their powerful yet compact design, and their textbook-perfect S-curve (external characteristics) have deeply attracted the masses and ignited a desire for conquest. So let's use some methods to manipulate them.
The essence of controlling a motor is the process of transforming the "dream" of expected torque into the "real" torque.
So how many steps are there in total? Two steps:
Step 1: Transform the torque of dreams into the current of dreams.
You can perform modeling and calculations based on the motor's model, or you can first perform a preliminary calibration of the motor to find the correspondence between speed, torque, and current. The calibration points can be more densely spaced, so that there are fewer interpolation points in the middle (which helps improve torque accuracy). Then, based on the current speed detection and the desired torque, you can quickly obtain the current you want.
Step 2: Install a current detection device on the motor.
By introducing the deviation between the actual current and the desired current into P control and I control, and correcting the voltage control magnitude through PI, and adjusting the PI parameters to create a perfect current following curve, the torque you dream of will be achieved.
Motor control is that simple.
The author has stated more than once that electric current can generate a magnetic field, and in turn, a force (torque) can be generated within that magnetic field. For example, when you walk (please stop using this joke!!).
The force you exert with your back foot isn't horizontal. Part of the force increases static friction, giving your foot a greater "stickiness" to the ground, while another part acts as a reaction force, allowing you to walk normally. Similarly, the stator current in an AC motor not only generates torque but also a magnetic field. This magnetic field either strengthens or weakens the rotor's own permanent magnetic field, causing a change in the magnetic field. The stator current then generates torque within this magnetic field, which also varies. Therefore, it becomes unclear how much of the stator current generates the magnetic field and how much generates torque.
We know that three-phase sinusoidal vectors can be synthesized into a rotating vector, as shown in the figure below:
Similarly, the three-phase sinusoidal current vectors can be synthesized into a total current vector, which we denot as Is. This is a quantity whose value remains unchanged but whose direction rotates. If we "wrap" this pink synthesized vector Is in an orthogonal coordinate system and make this coordinate system rotate with it (Is) at the same frequency, like this:
According to kinematic theory, in this coordinate system, Is becomes a relatively stationary quantity, that is, a direct current. The projections of Is onto the x and y axes of the rotating coordinate system, or the projection components of the direct axis and quadrature axis, are the legendary direct current (Id) and quadrature axis current (Iq). This is the entire process of converting three-phase AC to two-phase DC. Of course, these are two well-known transformations: the Clark transformation (three-phase AC to two-phase AC) and the Park transformation (two-phase AC to two-phase DC).
Next, let's look at the physical meaning of Id and Iq. We put this coordinate system on the rotor of the motor and let it rotate with the rotor (for a motor with one pair of poles).
Because the magnetic field directions of the D-axis and the permanent magnet rotor are aligned, the D-axis current can only control the magnetization or demagnetization of the motor's magnetic field. The Q-axis, however, is perpendicular to the magnetic field direction, so the Q-axis current generates torque in the motor. So and Id are called the excitation current, and Iq is called the torque current. Thus, the desired current is decoupled into torque current and excitation current, making motor control simpler.
With more convenience, our control system flowchart becomes like this:
From this perspective, it seems that there's a "formula" for achieving perfect decoupling of the stator current in an AC motor. When calibrating a motor, there's a "routine" for current (Is) decoupling. In the constant torque region, you don't need to magnetize/demagnetize the rotor magnetic field (id=0 control), you only want the torque current to increase. Since torque current is proportional to torque, your desired current vector is Is²=Id²+Iq²=0+Iq². Of course, you can also add a little Id (magnetization). Compared to Id=0 control, for the same torque output, minimizing Is will result in much less loss for the motor (because the current is smaller). This is maximum torque-to-current ratio control (MTPA control).
Next, the motor speed will reach the rated point and enter the constant power region. The back EMF generated by the permanent magnet rapidly cutting the stator will exceed the controller's adjustment voltage. If the back EMF is higher than the upper limit of my (controller's) adjustment voltage, I won't be able to output any current, so how can I manipulate you?
No problem, experienced drivers have a way. Make the direct-axis current negative to perform magnetization (demagnetization). In this way, Id becomes the legendary magnetizing current, which reduces the strength of the air gap magnetic field. This way, your back EMF won't rise. I will always keep you under control. No matter how high your speed goes, and how high the back EMF is generated, it can't withstand my magnetization.
However, when a brand-new motor is designed, it has a peak current. That is, Is has an upper limit; increasing Id² (field weakening current) inevitably leads to a decrease in Iq² (torque current), making the motor's torque output somewhat weak. This explains why, in the constant power region, as the speed increases, the peak torque keeps decreasing. Theoretically, if Is were entirely converted to field weakening current, the peak speed could be infinitely high. However, in reality, motors have mechanical losses, and excessive field weakening current can cause the permanent magnets to lose their inherent magnetic strength (although this is rare). Therefore, the peak speed specification was created.
The MTPA control in the constant torque region and the field weakening control in the constant power region constitute the vector control theory of permanent magnet synchronous motors.