How to use SV PWM in vissim/ecd?

hi everybody. i'm using vissim/ecd to control V/F motor ACI( just beginner). my diagram must use SV PWM and i used space vector PWM (Quadrature) RUN ON 2407. how can i simulate and create signal on DSP. Can someone who used space vector PWM (Quadrature) block can explain me the input and output to this block? thanks


I want to make a control of induction motor SVPWM for that I need to generate 6 PWM respecting the dead time using VISSIM, .. HOW CAN I DO IT?

teshis of the university

akkisudhakar's picture

space vector pwm for a 2leg inverter

dear friends i done my project in matlab, before my project i done 3leg svpwm &got correct result. in a over modulation the harmonics re-apper so thats the reson in my project(2leg) i didn't get the out put. please help me to over come it...

Best regards

SUDHAKAR AKKI CEL:9042366656 9908292937

lenin444's picture


hi........i am doing on dsp 2812 kit.......i want the block simulation block diagram of pwm generation


my problem here is simulation

my problem here is simulation and load to DSP. i used diagram "acim_vf_openloop.vsm" Mr Anders89 send for me. it's ok, but i don't know Frequency and volt is how many? because it's on PU units. i want use diagram on real units ( volt and hezts), how can i fix it?

V/Hz Profile Generator

sorry again, but when i use V/Hz Profile Generator i don't know how much frequency in the input. the diagram acim_vf_openloop.vsm you send me don't work at 50hz. so i replace some block and it's not work. i'm doing a diagram to simulation and load to DSP for control a v/f motor ( 3 phase 380v/50hz) with herts change from 20hz~60hz. the diagram i make below but not run, i don't known why? can everyone help me. how can i see 6 sector of SV PWM if i use this diagram? the diagram space vector[PWM (Space Vector).vsm] can use code generation for dsp? thanks very much to everyone.

You need to think in per units

thbt86, Your diagram has several problems.

  • You can't reference actual frequency or voltage in the Volt/Hertz Profile block. You must use a fraction of full scale frequency and voltage. So if your max voltage at 100% duty cycle is 380V, and you want to start at 220V at the low frequency point, you use 220/380 = .579 at V at Low Freq Point. If your high frequency is 50Hz, and low freq is 20 Hz, your low freq point is 20/50 or 0.4 . Slope is (VhighPU-VlowPU)/(fHighPU-fLowPU). I have attached an updated diagram with proper settings and calculation of Per Unit values. (You may need the latest VisSim/ECD to get the proper slope scaling)
  • You switched from Full Compare PWM to the "Space Vector" PWM. You did not connect the period scaling pin, so the period is set to zero. Also, you can't set the deadband with the "Space Vector" PWM, and you have an IGBT, which requires deadband setting. For that reason I recommend using the Full Compare.

You can download the updated V/Hz 50Hz diagrams below.

Doubts: SVM (pulse center)outputs, scaling and ePWM inputs

Hi, I have few questions about the scaled SVM outputs and ePWM configuration in the above examples.

Question about SVM regarding correlation between actual, TI and Vissim duty cycles: Consider an example where Ualpha = 1 and Ubeta = 0; the ON duty cycles of normal SVM are (0.933, 0.0669 and 0.0669). However, the duty cycles calculated in TI documentation are (0.0669, 0.933 and 0.933) and in fact shown in the documentation representing the OFF duration. On the other hand, duty cycles as per vissim PC SVM are (-0.866025, 0.866025 and 0.866025). My question here: Is TI duty cycles correct? Or did I make a mistake somewhere? Actual results- Theoretical formula used: TI results- Formula used:

Question about scaling block between SVM and ePWM block: In these two examples „acim_vf_openloop50Hz_sim.vsm“ and „acim_vf_openloop50Hz_sim.vsm“.
Here if f= 0.7, then v= 0.789, SVMop = (-0.789 to +.789), ScalingOp = (+0.106 to 0.895) and not (0 to +.789) Again if f= 0.2, then v= 0.5789, SVMop = (-0.58 to +.58), ScalingOp = (+0.21 to 0.79) and not (0 to +.58) I could not get clarifications for the below questions: 1. Is this scaling correct? Here is my concern: I see a relationship viz. Scaled output =0.5 +0.5Vissim_PC_SVM_output. (i.e. pulse centered output). But also Vissim_PC_SVM_output. = 1- 2 Actual _SVM_output (i.e. Non pulse centered output using general TI document). That means Scaled output =1 - Actual _SVM_output. a. Clearly this scaled output is giving toggle value of the actual output. So, why are we doing this? b. Also, I see that in the example of „acim_vf_openloop50Hz_sim.vsm“, the output from scaling block are fed directly to the ePWM blocks. But, the example uses the following configuration for the action qualifier, ePWMA: CA Up: 0 ; CA Down: 1 ePWMB: CA Up: 1 ; CA Down: 0 However, as per TI documentation (pg 80), we should use the below config: ePWMA: CA Up: 1 ; CA Down: 0 ePWMB: CA Up: 0 ; CA Down: 1 So, are we using output of duty cycles as cmpa signals (when in fact cmpa signal and duty cycles are complementary to each other)? c. Also, we are again converting a pulse centered switching sequence into a non pulse centered switching sequence (although with a toggle status). Are we then not losing the advantage of the PC output approach? 2. Is there any way that I can have a non-pulse centered output instead of getting PC output directly from SVM? How do we do that? Then we do not need any scaling for ePWM.

Thanks in advance!


sorry, in diagram 'acim_vf_openloop50Hz.vsm' when i pull slider to change the value frequency over 0.6 vissim has a fautl "fixed point overflow"? i'm using VisSimEcdWeb70. How can i fix this problem? and i have a question about Space Vector Generator(Magnitude, Frequency)block, what is the frequence scaling? if i put 1 in these what's this mean? thank you and i hope for fast reply.

There was a bug

It is fixed in the most recent download. Now the slope is calculated automatically. There is no need to enter it. Download the latest ECD here.

yes, thank you! i'm using

yes, thank you! i'm using vissim v7.0 and i think it's a latest vesion. in your diagram, you can explain the offset and frequence scaling in block space vector generator, why do you enter o and 0,12. with Space Vector" PWM if i enter a carrier frequency in fourth pin, how diffirent between it and full compare? because with Space Vector" PWM i can choice EVM A or B on DSP, so i try to use it.

There was a recent update to v7

The update was just this week. Just install the update over your current install. It will only update changed files. Do not uninstall.
The full compare PWM lets you select Timer 1 (EVA) or Timer 3 (EVB), plus you can set deadband for IGBT driving, and it generates more efficient in-line code. The 4th pin of space vector PWM takes a value between 0 and .9997 that controls the fraction of full PWM switching frequency that is desired. This is explained in the help document that you get if you click the help button. The FullCompare PWM requires scaling of the -1/+1 range from the "Space Vector Generator (Mag Freq)" block to 0/+1. The "Space Vector" PWM does not require such scaling.

thank you for reply to me. i

thank you for reply to me. i wished success and thanks again.

Your simulation problem


I am the french tech support of VisSim. Can you please give me more informations. As far as I understood your problem, you have simulation problems with your diagram. I downloaded it and it works fine. But it is a simulation diagram, it is not dedicated for dsp control. If you use a dsp in emulation mode, you must know that the JTAG is very slow, and at 50Hz, it does not give any accuracy. If you need faster transfer protocol, you must embed in your diagram Monitor buffers, in order to get fast informations on your screen.

I am sorry no to have understood all, please give me some more information, send the complete diagram, with your I/O, screen shots... and we will help you the best we can.


V/F ACI Motor Control

sorry.i has a dsp 2407, a igbt driver in this pictur, a 3 phase ac motor 380volt/50hz. cab i use a diagram you give me to control v/f it? how i conect my dsp with digram? because i borrow DSP in my university, my teacher sure that my diagram is true. and i know run vissim om dsp. Thanks very much again.

Your motor circuit picture is pretty terse

The acim_vf_openloop.vsm files below will correctly perform open-loop V/F control of a 3 phase AC induction motor. Your .bmp above does not give enough information to say if it is correct for your inverter topology. You must properly connect the LF2407 PWM pins to your IGBT drivers in the correct way. However, I updated the acim_vf_openloop.vsm files below to include an enable pin. This means that the PWM outputs will be in a high impedance state until you click the enable button. This lets you download and start the LF2407 with PWM in high impedance state. Then you can turn on the PWMs to test the the inverter and switch them off quickly if it starts to smell bad or catches fire.

You need to avoid floating point on the LF2407

thank for fast reply. i downloaded this file and work with it. i don't understand the output waveform space vector PWM block is sin but it only positive( >0). if it is a 3 phase sin waveform, i think it has symmetrical. if it is PWM signal, it only has 2 level (0 and 1). why do you use block scale before input fullcomparePWM. if i don't use scale and wire direct to fullcomparePWM block. it's right or wrong. which problem will happen?

The input to PWM block is duty cycle

The PWM block takes a fractional value between 0 and 1 on each of the 3 input pins. The input will control the duty cycle of the PWM. Yes, the hardware output of the PWM has only 2 levels, 0 (off) and 1 (on), but power is modulated by controlling the amount of on-time. The space vector wave form block produces values between +1 and -1. The PWM block needs values between 0 and 1, so the scaling maps the +1/-1 to 0/1. Without the mapping you will get wrong PWM response and a bad smell from the inverter as random signals are sent to it.

V/F ACI Motor Control

You can download and watch the instructional videos that show how to compile and download to a TI target here. I recommend you start with the ECD introduction I have attached 2 files below that show V/F ACI control. One is pure simulation and is used to generate code to produce an .out file that will perform the V/F control on the LF2407. The other will run the .out file and use the PWM commands to run a virtual motor simulated in the VisSim diagram.

You can see and download the files if you are signed in.

V/F ACI Motor Control

thank you very much for reply to me. i downloaded attach file but i don't understand something about it. why must gain 65 the output rotor angular, gain 25 in svggain. if i complie and load to DSP, it can generate signal PWM on DSP? or must i add fullcomparePWM block to control modune PWM on dsp kit. i'd finish a diagram use SVPWM control v/f ACI. can you give me some advise about it.

You need to avoid floating point on the LF2407

The SVgain is the voltage supplied to the simulated motor, to be honest, I'm not sure what the "65" gain on the rotor speed is for. "9.55" would make more sense to convert from rad/sec to RPM. It is not so important as the speed control will generate inverter waveforms to match the speed no matter the gain.
Regarding your diagram for motor control, you have used the wrong blocks for embedded use. You used simulation only blocks. If you select menu item View > Data Types, connector pins will be colored according to their data type. Floating point pins will be red, scaled integer yellow, and pure integer green. It is important that you see only yellow and green pins in the diagram portion that will be compiled to run on the target. Yes, you can put a fullCompare PWM inside the "PI + VHz + SVGEN - MF" block to control a real inverter attached to an AC induction motor. The attached files show how. acim_vf_openloop.vsm is the source diagram to be compiled, then *acim_vf_openloop-d.vsm" will run the diagram letting you vary the open loop frequency command with a slider.