space vector PWM code for three phase inverter

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

space vector PWM code for three phase inverter

3,442 Views
abdullahsahib
Contributor I

Hi for all

I need code for space vector PWM  for three phase inverter to produce sine wave with duty cycle 20 msec and i use KV46F150M microcontroller with Kinetis Design Studio 3 IDE to implement this project.

Best Regard

0 Kudos
Reply
4 Replies

1,872 Views
abdullahsahib
Contributor I

Hi Xiangjun Rong

Great thanks for your care and help, but I need tested code for this project, If you know any one to help me to cntact with us about this case.

Best Regard

Abdullah

0 Kudos
Reply

1,872 Views
abdullahsahib
Contributor I

Hi XiangJun Rong

Great thank for your care, for recent time I download code (MCRSP_PMSM_V1.1.2) for SVPWM control of motor speed project but at this time I need code for produce three phase output voltage with constant voltage e.g 220 v and constant frequency e.g 50 Hz, this inverter must be connected with load.

thanks for you for help.

BR

Abdullah

0 Kudos
Reply

1,872 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Abdullah,

I think you can use the svpwm function to generate the 220V/50Hz waveform, this is the procedure:

you can use PWM reload event to generate interrupt, the interrupt cycle time is the PWM cycle time. For example, you want to get 50HZ sine waveform with 100 points, the PWM frequency is 8KHz, 8K/50Hz=160 points.  For 160 points, the theta increment is 65535/160=409;

In the ISR, you can use the Q15 format to generate the Alpha/Beta coordinator:

static unsigned int  ThetaIncret;

Frac16 Theta=409*ThetaIncret

ThetaIncret++;

if(ThetaIncret>=160) ThetaIncret=0;

MCLIB_2COOR_ALBE_T_F16 psIn;

GMCLIB_3COOR_T_F16 psOut;

psIn.f16Alpha=sine(Theta);

psIn.f16Beta=cos(Theta);

uint16_t GMCLIB_SvmIct_F16_FC(&psIn,
                                     &psOut);

The psOUT is the PWM duty cycle of 3 phase.

Hope it can help you

I do not test bthe above code, it is only my idea.

Hope it can help you

BR

Xiangjun Rong

0 Kudos
Reply

1,872 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Abdullah,

I see You need SVPWM function, you can download the SDK2.0 package based on TWR-KV46, unzip it to directory, you can see the SVPWM library GMCLIB.a in the directory:

C:\Freescale\SDK2.0_TWR-KV46\middleware\rtcesl_4.3\CM4F_RTCESL_4.3_KDS\GMCLIB

You can download SDK2.0 from the link:

http://www.nxp.com/ksdk

Hope  it can help you

BR

XiangJun Rong

0 Kudos
Reply