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.

Space Vector Modulation: Example project of generating Three phase sine wave using svgen_mf Function

Other Parts Discussed in Thread: CONTROLSUITE

Hello Team,

One of my customers wish to use SVGEN_MF function for generating Three phase sine wave signal in their Three phase Inverter. He has gone through our HVACI_SCALER example and tried to generate his sinewave with below specification:

Sine wave frequency out put: 50Hz

ISR and PWM Frequency: 20KHz

He has calculated Freq and FreqMax parameter accordingly but not getting proper output. Please help me with an example project for the same.

Regards,

Vikas Chola

  • Vikas, 

    For solar MF function is not a good choice to begin with , In a solar control loop the command will be D and Q and they should use SVGEN_DQ instead,

    Now that being said are they trying to use the module just to generate three sinusoidal waves with 120 degree phase shift with space vector generation?? 

    I know i have not been direct in the reply, i am not familiar with the MF module, but for a solar customer that does not look like the right module to be using?

  • Manish,

     I am using the following code in my program. My ISR is running at 20 Khz. The pwm being generated from this function are different from the theoretical waveform. Pls. check and let me know. 

    _iq VdTesting = _IQ(1.0), // Vd reference (pu)

    VqTesting = _IQ(0.0),

    #define ISR_FREQUENCY 20


    #define BASE_FREQ 50 // Base electrical frequency (Hz)
    float32 T = 0.001/ISR_FREQUENCY; 


    void svpwm_dq()
    {

    rg1.Freq = _IQ(0.5);
    rg1.StepAngleMax = _IQ(BASE_FREQ*T);
    RG_MACRO(rg1);

    // ------------------------------------------------------------------------------
    // Connect inputs of the INV_PARK module and call the inverse park trans. macro
    // There are two option for trigonometric functions:
    // IQ sin/cos look-up table provides 512 discrete sin and cos points in Q30 format
    // IQsin/cos PU functions interpolate the data in the lookup table yielding higher resolution.
    // ------------------------------------------------------------------------------
    ipark1.Ds = VdTesting;
    ipark1.Qs = VqTesting;

    park1.Angle = rg1.Out;

    park1.Sine = _IQsinPU(park1.Angle);
    park1.Cosine = _IQcosPU(park1.Angle);

    ipark1.Sine=park1.Sine;
    ipark1.Cosine=park1.Cosine;
    IPARK_MACRO(ipark1)

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

    // ------------------------------------------------------------------------------
    // Computed Duty and Write to CMPA register
    // ------------------------------------------------------------------------------
    EPwm1Regs.CMPA.half.CMPA = _IQmpy(INV_PWM_HALF_TBPRD,svgen1.Ta)+INV_PWM_HALF_TBPRD;
    EPwm2Regs.CMPA.half.CMPA = _IQmpy(INV_PWM_HALF_TBPRD,svgen1.Tb)+INV_PWM_HALF_TBPRD;
    EPwm3Regs.CMPA.half.CMPA = _IQmpy(INV_PWM_HALF_TBPRD,svgen1.Tc)+INV_PWM_HALF_TBPRD;


    }

  • Amit,

    Can you verify that you are able to run the following project, Build level 1 

    C:\ti\controlSUITE\development_kits\HVMotorCtrl+PfcKit_v2.1\HVACI_Sensorless

    (which is exactly what you have above), and the waveforms are satisfactory ?

    you may want to replace the park routine, not that it is incorrect but if you are not using the module then why use it. 

    ipark1.Sine=_IQsinPU(rg1.Out);
    ipark1.Cosine=_IQcosPU(rg1.Out);
    IPARK_MACRO(ipark1)

    Also what specifically is incorrect in the waveforms?

  • Manish,

     Thanks for the reply.