双闭环FOC
参考自《现代永磁同步电机控制原理及MATLAB仿真》袁雷编著
1.Clark变换
自然坐标系->α-β坐标系(Clark变换)
[ f α f β f 0 ] T = T 3 S / 2 S [ f A f B f C ] T \begin{bmatrix} f_α&f_β&f_0 \end{bmatrix}^T =T_{3S/2S} \begin{bmatrix} f_A&f_B&f_C \end{bmatrix}^T [fαfβf0]T=T3S/2S[fAfBfC]T
f代表电机的电压、电流或磁链等变量;T3s/2s为坐标变换矩阵
T 3 S / 2 S = k [ 1 − 1 2 − 1 2 0 3 2 − 3 2 2 2 2 2 2 2 ] T_{3S/2S}=k\begin{bmatrix} 1 & -\frac{1}{2} & -\frac{1}{2} \\\\ 0 & \frac{\sqrt{3}}{2} & -\frac{\sqrt{3}}{2} \\\\ \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} &\frac{\sqrt{2}}{2} \end{bmatrix}\\\\ T3S/2S=k⎣⎢⎢⎢⎢⎡1022−212322−21−2322⎦⎥⎥⎥⎥⎤
幅 值 不 变 k = 2 3 幅值不变k=\frac{2}{3} 幅值不变k=32
功 率 不 变 k = 2 3 功率不变k=\sqrt{\frac{2}{3}} 功率不变k=32
三 相 对 称 系 统 , 静 止 坐 标 系 中 f 0 可 忽 略 三相对称系统,静止坐标系中f_0可忽略 三相对称系统,静止坐标系中f0可忽略
void Clark_cal(void)
{
Clark.Alpha = (Clark.A - (Clark.B + Clark.C) * 0.5) * 2.0 / 3.0;
Clark.Beta = (Clark.B - Clark.C) * 0.8660254037844386 * 2.0 / 3.0;
}
α-β坐标系->自然坐标系(反Clark变换)
[ f A f B f C ] T = T 3 S / 2 S [ f α f β f 0 ] T \begin{bmatrix}f_A&f_B&f_C\end{bmatrix}^T=T_{3S/2S}\begin{bmatrix}f_\alpha&f_\beta&f_0\end{bmatrix}^T [fAfBfC]T=T3S/2S[fαfβf0]T
T2s/3s为坐标变换矩阵
T 2 S / 3 S = T 3 S / 2 S − 1 = [ 1 0 2 2 − 1 2 3 2 − 2 2 − 1 2 − 3 2 2 2 ] T_{2S/3S}=T^{-1}_{3S/2S}=\begin{bmatrix} 1 & 0 & \frac{\sqrt{2}}{2} \\\\ -\frac{1}{2} & \frac{\sqrt{3}}{2} & -\frac{\sqrt{2}}{2} \\\\ -\frac{1}{2} & -\frac{\sqrt{3}}{2} &\frac{\sqrt{2}}{2} \end{bmatrix} T2S/3S=T3S/2S−1=⎣⎢⎢⎢⎢⎢⎡1−21−21023−2322−2222⎦⎥⎥⎥⎥⎥⎤
static void Anti_Clark_cal(void)
{
Anti_Clark.A = Anti_Clark.Alpha;
Anti_Clark.B = -0.5 * Anti_Clark.Alpha + 0.8660254037844386 * Anti_Clark.Beta;
Anti_Clark.C = -0.5 * Anti_Clark.Alpha - 0.8660254037844386 * Anti_Clark.Beta;
}
2.Park变换
α-β坐标系->d-q坐标系(Park变换)
[ f d f q ] T = T 2 s / 2 r [ f α f β ] T \begin{bmatrix}f_d&f_q\end{bmatrix}^T=T_{2s/2r}\begin{bmatrix}f_\alpha&f_\beta\end{bmatrix}^T [fdfq]T=T2s/2r[fαfβ]T
T 2 S / 2 r = [ c o s θ e s i n θ e − s i n θ e c o s θ e ] T_{2S/2r}=\begin{bmatrix} cos\theta_e & sin\theta_e \\\\ -sin\theta_e & cos\theta_e \end{bmatrix} T2S/2r=⎣⎡cosθe−sinθesinθecosθe⎦⎤
void Plark_cal(void)
{
Plark.D = Plark.Alpha * cos(Plark.The) + Plark.Beta * sin(Plark.The);
Plark.Q = -Plark.Alpha * sin(Plark.The) + Plark.Beta * cos(Plark.The);
}
d-q坐标系->α-β坐标系(反Park变换)
[ f α f β ] T = T 2 r / 2 s [ f d f q ] T \begin{bmatrix}f_\alpha&f_\beta\end{bmatrix}^T=T_{2r/2s}\begin{bmatrix}f_d&f_q\end{bmatrix}^T [fαfβ]T=T2r/2s[fdfq]T
T 2 r / 2 s = T 2 s / 2 r − 1 = [ c o s θ e − s i n θ e s i n θ e c o s θ e ] T_{2r/2s}=T^{-1}_{2s/2r}=\begin{bmatrix} cos\theta_e & -sin\theta_e \\\\ sin\theta_e & cos\theta_e \end{bmatrix} T2r/2s=T2s/2r−1=⎣⎡cosθesinθe−sinθecosθe⎦⎤
void Anti_Park_cal(void)
{
Anti_Park.Ualpha = cos(Anti_Park.The) * Anti_Park.Vd - sin(Anti_Park.The) * Anti_Park.Vq;
Anti_Park.Ubeta = sin(Anti_Park.The) * Anti_Park.Vd + cos(Anti_Park.The) * Anti_Park.Vq;
}
3.内置式三相PMSM电机方程(d-q坐标系)
定子电压方程
{ u d = R i d + d d t ψ d − ω e ψ q u q = R i d + d d t ψ q + ω e ψ d \begin{cases} u_d=Ri_d+\frac{d}{dt}\psi_d-\omega_e\psi_q\\ u_q=Ri_d+\frac{d}{dt}\psi_q+\omega_e\psi_d \end{cases} { ud=Rid+dtdψd−ωeψquq=Rid+dtdψq+ωeψd
定子磁链方程
{ ψ d = L d + ψ f ψ q = L q i q \begin{cases} \psi_d=L_d+\psi_f\\ \psi_q=L_qi_q \end{cases} { ψd=Ld+ψfψq=Lqiq
定子电压方程
{ u d = R i