0x00. Theory of Operation
Last updated
Last updated
一个直流无刷电机由许多的线圈和磁铁组成。为了能够让我们更容易理解它是怎么运行的,我们可以把它化简为最简单的形式 —— 三组线圈,一对磁铁,按这种方式排列。
A brushless direct-current (BLDC) motor is composed of magnets and phase winding coils. To understand the operating principle, we can simplify the motor down to one magnet pole pair and three coils.
线圈被固定在电机的定子上面。当电流流经线圈,就会产生磁场,吸引或排斥这个线圈正对着的磁铁磁极,从而使转子转动。
The coils form the stator of the motor. When current passes through the coil, a magnetic field will be produced, which then attracts or repels the magnet facing this coil. The magnet, which forms the rotor of the motor, then rotates.
我们将这三组线圈的六个端子连接起来,形成三个接线端连接电机的驱动电路。我们有两种连接的方式 —— 星接 (star connection / wye connection) 或 角接 (delta connection)。常见的航模无刷电机都采用星接的方法,三组线圈的一端各引出一根引线,而另一端在内部互相连接到一起,构成中性极。
The end of the three coils are tied together to form three terminals, connecting to the driving circuit. There are two ways to do the connection —— the star connection (sometimes called wye connection), or the delta connection. The star connection is the more common one, where one end of the three coils is exposed as external wire, while the other end of the three coils is tied together to form an internal neutral point.
我们使用名为三相逆变器的电路来驱动这三根引线。如图所示,这个电路由三个半桥驱动器构成,每个半桥又有两个开关,这两个开关可以构成如下四种状态
上开下关 (1)
上关下开 (0)
上开下开 (X)
上关下关 (N)
其中,X 为无效状态,会直接将 VCC 和 GND 短路;我们这里也不考虑 N 状态,因为这样会将这相线圈悬空,电流无法流过,电机驱动效率就会下降 (这里我们不考虑正常六步换向法需要观测反电动势的需求)。剩下的两种状态里,1 状态下会将引线连接 VCC,而 0 状态会将引线连接 GND。
To drive these three wires, we use a three-phase inverter circuit. The circuit is composed of three half-bridge drivers, and we can see it as six switches connecting across VDD and GND. There are four states for each of the half-bridge:
High-side ON, low-side OFF (1)
High-side OFF, low-side ON (0)
High-side ON, low-side ON (X)
High-side OFF, low-side OFF (N)
Among the states, X is an invalid state. It directly connects VCC to GND. N states is not used here, as in this state, the phase coil is in float state, which harms the maximum output capability of the driver. In the remaining two states, state 1 will connect the phase to VCC, while state 0 will connect the phase to GND.
将三组半桥驱动器组合起来,我们就获得以下八种三相逆变器的状态
000
100
110
010
011
001
101
111
其中,000 和 111 为无驱动状态,这时电机的三相全部连接 VCC 或 GND,线圈之间没有电压差。
剩下的六种状态都会使线圈中有电流流动,我们可以来分析一下。
首先,我们将驱动器设定为 100 状态。在这个状态中,A 相线圈连接 VCC,电流经 A 流向中点,然后经 B 和 C 流向 GND。假设线圈产生的磁场指向 A 线圈方向 (0°),转子的磁铁因此被磁铁吸引,也指向 A 线圈。
接下来,切换到 110 状态。A B 线圈都连接 VCC,电流经 A 和 B 流向中点,然后经 C 流向 GND。线圈产生的磁场叠加指向 A 和 B 线圈的中间 (30°),转子因此也转向 30° 方向。
以此类推,010 状态使转子转向 60° 方向;011 状态使转子转向 90° 方向;001 状态使转子转向 120° 方向;101 状态使转子转向 150° 方向;最后回到 100 状态,转子旋转一周返回原点。
因此,将这六种驱动状态按顺序排列,我们就实现了六步换向。
Combining the two states of three phases together, we have the following eight inverter states.
000
100
110
010
011
001
101
111
States 000 and 111 are non-driving states. The phases are all connected to VCC or GND, and there’s no voltage differential between phases.
The rest 6 states are driving states.
Assume the motor is in state 100. Phase A will be connected to VCC, and B and C are connected to GND. Current will flow from phase A, through the neutral point, to B and C, and finally to GND. The phases will generate a magnetic field pointing at phase A’s direction (0°). The magnets on the rotor will be attracted, turning the rotor to 0°.
Next, by switching to state 110, phase A and B are connected to VCC, while phase C is connected to GND. The resulting magnetic field will point between phase A and B (30°), thus turning the rotor to 30° direction.
Similarly, in the rest of the state, the rotor will be turned to 60°, 90°, 120°, 150°, respectively, and finally back to 0° in state 100.
As a result, when the states are switched in this order, the motor can be driven correctly.
Six Step Commutation - MathWorks
The three phase currents, $I_A$, $I_B$, and $I_C$, are three sine-like rotating vectors that are at a 120° offset with each other. Because they share a same plane, Clark transform can be used to convert them to two orthogonal vectors $I_\alpha$ and $I_\beta$.
OR,
OR,
这里我们和电流的变换操作有些不同,因为我们的电压最终控制的是数字量 0 或者 1,对应上下桥臂的 MOSFET 的开关,而不是电流采样的模拟量。因此,我们需要用另一套方法将我们希望的电压离散化。
由上文,我们知道我们的驱动器有六种基础状态。我们可以将这六种状态视为六个基础矢量,从原点分别指向 0°,30°,60°…
而如果我们在两种状态之间快速切换,并且控制每种状态的时间占比,我们就可以合成出一个指向某一方向的叠加矢量。
更进一步,我们还可以添加上之前的两种无驱动状态 000 和 111。他们在上图中就是幅值为 0 的零矢量。因此,通过控制他们的时间占比,我们便可以控制合成矢量的幅值。
From the six-step commutation scheme, we know that the motor driver can generate forces pointing in six different directions. We can view these forces as six fundamental vectors, pointing from the origin to 0°,30°,60°…
If we control the motor driver such that it switches between two states in a short time and controls the percentage of each state, we can form a resulting force pointing in between the two fundamental vectors.
Moreover, by including the two non-driving states, which are two zero vectors, we can also change the magnitude of the resulting vector.
我们可以将电机简化为串联的电阻和电感,由此我们可以得出如下关系式。
The motor can be seen as a resistor and inductor in series, and therefore we have the following equation.
Since we are focusing on low-rpm scenario, the back-EMF term can be ignored.
performing Laplace transform, we get
assuming initial condition I(0) = 0, we get
As result, the model of motor is
There are two configurations of PI controller, the parallel configuration (the most common one) and the series configuration.
For parallel configuration, we have
For series configuration, we have
The C implementation is
For open loop control, we have the transfer function as
In order to simplify the equation, we need
For closed-loop feedback control, we have the transfer function as
Therefore,
In other words, we have
Usually in practice, we want to ensure that the current sampling rate is 10% of the switching frequency, i.e. 20% of the Nyquist rate.
For example, if the switching frequency is 20kHz, the maximum bandwidth would be 2kHz.
Digital PI Controller Equations https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/902/PI-controller-equations.pdf
扭矩又和相电流成正比,有如下比例关系:
We demonstrated how switching between different driving states can create an arbitrary vector. However, the control input of the motor driver is voltage, while we want to control the output torque. Output torque is proportional to phase current, in following relationship:
同样,通过传感器的位置读数,我们可以在电流环的基础上搭建位置环,进行指定位置的控制。
我们由此得出如下控制框图
在任一转子角度下,我们都可以将线圈产生的力分解为垂直于转子方向的分力 ,和平行于转子方向的分力 。
垂直于转子方向的分力 并不会驱动转子转动。换句话说, 是浪费的。因此,我们需要想办法减小 ,将所有的电流都集中产生 驱动转子转动。
If we analyze the magnetic force on posed on the rotor, at any moment, there is a force vertical to the rotor magnet and a force parallel to the rotor magnet.
will not contribute to the rotation of the rotor, and thus is a loss. To drive the motor efficiently, we want to minimize and maximize .
由于电机的项电压总是浮动的,没有一个标准的参考地,我们不便添加功率电阻进行采样。更简单的方案是在低端 MOSFET 下面添加电阻进行采样,获得三个近似 sine 波的相电流 、 和 。但是,我们没办法直接使用这三个非线性电流读数作为对于电压的控制输入。因此,我们需要对电流进行一些数学变换,将他转换为简单的线性变量来控制。
电机的相电流,、 和 ,是三个互成 120° 夹角的近似于 sine 波的旋转矢量。三相电流都处于一个平面内,因此我们可以使用 Clark 变换将它们转化为两个互相垂直的矢量 和 。
接下来,我们可以使用 Park 变换将 和 相对于转子角度反向旋转,这样就可以将两个 sine 波转换为两个 DC 的电流信号, 和 。
Then, Park transform can be used to convert the rotating and to two stationary vectors and .
同样地,我们可以将我们希望的电压 和 通过逆 Park 变换转化为和转子一起旋转的信号 和 。
由上面的框图得知,我们的被控量是 和 ,控制量是 和 。相对简单的方法是使用一个 PI 控制器。
Setting , we can simplify the equation as
substitute into the equation, we can get
The coefficient determines the frequency where the system response decreases by 3dB, or, the response cutoff bandwidth ω. The unit is rad/s.
with ,
一般情况下,我们想控制电机的输出扭矩,而不是电流。因此,我们需要建立 与输出扭矩 的关系。
Usually, we want to control the motor's output torque, instead of the current. Therefore, we must establish the relation between current and the output torque .
其中, 为扭矩常数, 为电机速度常数 ()
is the torque constant witth unit N/A. is the motor KV constant with unit kRPM/V.