This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMS320F28069M:PM_Sensorless 的构建级别2中 VOLT_MACRO 和 SVGEN_MACRO 的执行顺序

Guru**** 2200880 points
Other Parts Discussed in Thread: CONTROLSUITE
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1473178/tms320f28069m-execution-order-of-volt_macro-and-svgen_macro-in-build-level-2-of-pm_sensorless

器件型号:TMS320F28069M
Thread 中讨论的其他器件:controlSUITE

工具与软件:

您好!

我正在浏览 controlSUITE 中的 PM_Sensorless 项目。 在构建级别2的代码中、我注意到相电压计算(需要 PWM 占空比信息(由空间矢量 PWM 生成模块给出)是在 SVGEN_DQ 计算完成之前完成的。 因此、我假设它使用存储在 T_a、T_b 和 T_c 变量中的旧值、初始化时这些值为零。

在相电压计算之前进行空间矢量计算难道不是更好吗? 为什么这样做呢?

我已用粗体设置了相关代码的格式。

// =============================== LEVEL 2 ======================================
//      Level 2 verifies the analog-to-digital conversion, offset compensation,
//    clarke/park transformations (CLARKE/PARK), phase voltage calculations
// ==============================================================================

#if (BUILDLEVEL==LEVEL2)

// ------------------------------------------------------------------------------
//  Connect inputs of the RMP module and call the ramp control macro
// ------------------------------------------------------------------------------
    rc1.TargetValue = SpeedRef;        
    RC_MACRO(rc1)

// ------------------------------------------------------------------------------
//  Connect inputs of the RAMP GEN module and call the ramp generator macro
// ------------------------------------------------------------------------------
    rg1.Freq = rc1.SetpointValue;
    RG_MACRO(rg1)

// ------------------------------------------------------------------------------
//  Measure phase currents, subtract the offset and normalize from (-0.5,+0.5) to (-1,+1).
//    Connect inputs of the CLARKE module and call the clarke transformation macro
// ------------------------------------------------------------------------------
    #ifdef F2806x_DEVICE_H
    clarke1.As=-(((AdcResult.ADCRESULT0)*0.00024414-cal_offset_A)*2); // Phase A curr.
    clarke1.Bs=-(((AdcResult.ADCRESULT1)*0.00024414-cal_offset_B)*2); // Phase B curr.
    #endif                                                            // ((ADCmeas(q12)/2^12)-0.5)*2            

    #ifdef DSP2803x_DEVICE_H
    clarke1.As=-(_IQ15toIQ((AdcResult.ADCRESULT1<<3)-cal_offset_A)<<1);
    clarke1.Bs=-(_IQ15toIQ((AdcResult.ADCRESULT2<<3)-cal_offset_B)<<1);
    #endif

    CLARKE_MACRO(clarke1)

// ------------------------------------------------------------------------------
//  Connect inputs of the PARK module and call the park trans. macro
// ------------------------------------------------------------------------------
    park1.Alpha = clarke1.Alpha;
    park1.Beta = clarke1.Beta;
    park1.Angle = rg1.Out;
    park1.Sine = _IQsinPU(park1.Angle);
    park1.Cosine = _IQcosPU(park1.Angle);
    PARK_MACRO(park1)
 
// ------------------------------------------------------------------------------
//    Connect inputs of the INV_PARK module and call the inverse park trans. macro
// ------------------------------------------------------------------------------
    ipark1.Ds = VdTesting;
    ipark1.Qs = VqTesting;
    ipark1.Sine=park1.Sine;
    ipark1.Cosine=park1.Cosine;
    IPARK_MACRO(ipark1)

// ------------------------------------------------------------------------------
//  Connect inputs of the VOLT_CALC module and call the phase voltage calc. macro
// ------------------------------------------------------------------------------
    #ifdef F2806x_DEVICE_H
    volt1.DcBusVolt = ((AdcResult.ADCRESULT2)*0.00024414); // DC Bus voltage meas.
    #endif                                                         // (ADCmeas(q12)/2^12)    
    
    #ifdef DSP2803x_DEVICE_H
    volt1.DcBusVolt = _IQ15toIQ((AdcResult.ADCRESULT3<<3));         // DC Bus voltage meas.
    #endif

    volt1.MfuncV1 = svgen_dq1.Ta;
    volt1.MfuncV2 = svgen_dq1.Tb;
    volt1.MfuncV3 = svgen_dq1.Tc;
    VOLT_MACRO(volt1)        

// ------------------------------------------------------------------------------
//  Connect inputs of the SVGEN_DQ module and call the space-vector gen. macro
// ------------------------------------------------------------------------------
    svgen_dq1.Ualpha = ipark1.Alpha;
    svgen_dq1.Ubeta = ipark1.Beta;
    SVGEN_MACRO(svgen_dq1)    

// ------------------------------------------------------------------------------
//  Connect inputs of the PWM_DRV module and call the PWM signal generation macro
// ------------------------------------------------------------------------------
    pwm1.MfuncC1 = _IQtoQ15(svgen_dq1.Ta);
    pwm1.MfuncC2 = _IQtoQ15(svgen_dq1.Tb);  
    pwm1.MfuncC3 = _IQtoQ15(svgen_dq1.Tc);
    PWM_MACRO(pwm1)                            // Calculate the new PWM compare values


    EPwm1Regs.CMPA.half.CMPA=pwm1.PWM1out;    // PWM 1A - PhaseA
    EPwm2Regs.CMPA.half.CMPA=pwm1.PWM2out;    // PWM 2A - PhaseB
    EPwm3Regs.CMPA.half.CMPA=pwm1.PWM3out;    // PWM 3A - PhaseC  
 

// ------------------------------------------------------------------------------
//  Connect inputs of the PWCCMDAC module
// ------------------------------------------------------------------------------    
    PwmDacCh1 = _IQtoQ15(clarke1.As);
    PwmDacCh2 = _IQtoQ15(clarke1.Bs);
    PwmDacCh3 = _IQtoQ15(volt1.Valpha);

// ------------------------------------------------------------------------------
//  Connect inputs of the DATALOG module
// ------------------------------------------------------------------------------
    DlogCh1 = _IQtoQ15(volt1.Valpha);
    DlogCh2 = _IQtoQ15(clarke1.Alpha);
    DlogCh3 = _IQtoQ15(volt1.Vbeta );
    DlogCh4 = _IQtoQ15(clarke1.Beta); 

谢谢你
此致

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    Unknown 说:
    在相位电压计算之前进行空间矢量计算难道不是更好吗? 为什么这样做?

    新的 PWM 占空比将在下一个 PWM 周期更新。 因此电流有源 PWM 占空比和电压应排在前一位。