ni.com checkout is currently experiencing issues.
Support teams are actively working on the resolution.
ni.com checkout is currently experiencing issues.
Support teams are actively working on the resolution.
06-10-2013 05:02 AM
Hello everyone,
I am doing a project on co-simulation, now I was wondering if anyone knows how to generate a fully software based PWM signal in Labview.
Every example I find about it is using a fpga or myDAQmx, but I do not use one of those, it only needs to work software based.
I hope someone can further help me.
Kind regards
Wlew
06-10-2013 06:02 AM
Hello WIew,
I'm not sure to clearly understand the issue. But if you want to generate a square wave and control its duty cycle, pick a look in he paltette Signal Processing » Waveform Generation (requieres Full Development System):
Let me know if it helps.
Best regards,
Mathieu.
06-10-2013 06:48 AM
Hi Mathieu,
Thanks for the reply, I tried to work with the square Waveform.vi, but I need a frequency of 50KHz and then LabVIEW gives me an error. The error has something to do with the sampling frequency and when I change the sampling frequency to a value that is twice the frequency (Nyquist ratio) the Square waveform.vi gives me an triangular output. I am trying to figure out what is the problem, but at the moment I have no idea what it could be.
Best regards
Wlew
06-10-2013 07:07 AM
Okay, just adjust the sampling info. Nyquist ratio is a theorical value. In practive, you often need 5 or 10 times your signal frequency as sampling frequency. If your requiered frequency is 50kHz, try with 1MS/s, this will allow a 5% resolution for your PWM. Be carefull with the number of samples: you can generate an unnecessary hudge amount of data...
06-10-2013 09:07 AM
Hi Mathieu,
Thank you very much for your help, when I set the sampling frequency at 1 MS/s like you said, I get a nice square wave again and I can properly adjust the duty cycle.
Thank you for your help
Kind regards
Wlew
07-02-2013 11:59 AM
hi,
instead of trying to create PWM signals from square waveform ( by adjusting the duty cycle), try to implement your own PWM technique.
You can easily generate sin and triangular waveforms and implement Sinusoidal PWM with variable modulation index by controlling the amplitude of the waveforms. or you can implement some other PWMs also...
if its fully software based PWM means, u can try it easily in labview..