DTC 直接转矩控制

系列:电机控制系列 - 第 15 篇 难度:⭐⭐⭐

前言

DTC vs FOC

对比FOCDTC
坐标变换需要(Clarke + Park)不需要
电流环
转矩脉动
响应速度中等
计算量中等

DTC 特点

  • ✅ 直接控制磁链和转矩
  • ✅ 无需坐标变换
  • ❌ 转矩脉动大

一、DTC 原理

1.1 磁链估算

 /**
  * @brief 定子磁链估算(u-i 模型)
  */
 void Flux_Estimate(float ua, float ub, float ia, float ib,
                    float Rs, float dt,
                    float *psi_alpha, float *psi_beta) {
     static float psi_alpha_last = 0, psi_beta_last = 0;
     
     // ψ = ∫(u - R·i)dt
     *psi_alpha = psi_alpha_last + (ua - Rs * ia) * dt;
     *psi_beta  = psi_beta_last  + (ub - Rs * ib) * dt;
     
     psi_alpha_last = *psi_alpha;
     psi_beta_last = *psi_beta;
 }

1.2 转矩估算

 /**
  * @brief 转矩估算
  */
 float Torque_Estimate(float psi_alpha, float psi_beta,
                       float ia, float ib, uint8_t P) {
     // Te = (3/2)·P·(ψα·iβ - ψβ·iα)
     return 1.5f * P * (psi_alpha * ib - psi_beta * ia);
 }

1.3 滞环比较器

 /**
  * @brief 滞环比较
  */
 int Hysteresis_Compare(float ref, float meas, float hysteresis) {
     float error = ref - meas;
     
     if (error > hysteresis) return 1;   // 增加
     if (error < -hysteresis) return -1; // 减小
     return 0;  // 保持
 }

二、DTC 开关表

 扇区 | ψ↑ Te↑ | ψ↑ Te↓ | ψ↓ Te↑ | ψ↓ Te↓
 -----|--------|--------|--------|-------
   1  |   V2   |   V6   |   V3   |   V5
   2  |   V3   |   V1   |   V4   |   V6
   3  |   V4   |   V2   |   V5   |   V1
   4  |   V5   |   V3   |   V6   |   V2
   5  |   V6   |   V4   |   V1   |   V3
   6  |   V1   |   V5   |   V2   |   V4
 /**
  * @brief DTC 开关表
  */
 const uint8_t dtc_switch_table[6][4] = {
     {2, 6, 3, 5},  // 扇区 1
     {3, 1, 4, 6},  // 扇区 2
     {4, 2, 5, 1},  // 扇区 3
     {5, 3, 6, 2},  // 扇区 4
     {6, 4, 1, 3},  // 扇区 5
     {1, 5, 2, 4}   // 扇区 6
 };
 
 void DTC_Update(float psi_ref, float Te_ref,
                 float psi, float Te, float theta_psi) {
     // 1. 滞环比较
     int d_psi = Hysteresis_Compare(psi_ref, psi, 0.01f);
     int d_Te  = Hysteresis_Compare(Te_ref, Te, 0.1f);
     
     // 2. 扇区判断
     int sector = (int)(theta_psi / (M_PI / 3.0f)) + 1;
     
     // 3. 查表选择电压矢量
     int index = (d_psi + 1) * 2 + (d_Te + 1);
     int vector = dtc_switch_table[sector - 1][index];
     
     // 4. 应用电压矢量
     Apply_Voltage_Vector(vector);
 }

三、DTC 改进

3.1 DTC-SVM

问题:DTC 转矩脉动大

解决:用 SVM(空间矢量调制)代替滞环

 // 计算期望电压矢量
 float v_alpha = kp * (psi_ref - psi);
 float v_beta  = kq * (Te_ref - Te);
 
 // SVPWM 调制
 SVPWM_Control(v_alpha, v_beta, vdc);

四、总结

DTC 核心要点

  1. 直接控制磁链和转矩
  2. 滞环比较 + 开关表
  3. 转矩脉动大

下一篇MPC 预测控制

最后修改:2026 年 03 月 14 日
如果觉得我的文章对你有用,请随意赞赏