04-27-2011 10:50 AM
HI there I am trying to build a vi to control a speed controller for a motor.
The specification that the technician gave me is to produce a pulse width modulation waveform with constant gap time and variable "on" time.
This will give the motor a variable speed that can be manipulate.
I already build a pulse width modulation vi but I don't understand how can I make the gap time constant eg 20ms while varying the on time 1-3ms.
Is there a method that I could use or an example that I can look at? Any help will do thanks in advance.
ill attach my current vi.
Solved! Go to Solution.
04-27-2011 11:35 AM
Mostly you just need to calculate some of the variable that you use from On time and Off time.
I won't speak about style.
04-27-2011 11:40 AM
You want to vary the ON time between 1 to 3ms?
Did you do a search using the keyword "pwm"? There are many posts that have examples.
The idea is that you want to preserve the same frequency and change your duty cycle.
(Example)
Let say you want a waveform at every 20ms, which translates to 50 Hz.
2 ms is 10% duty cycle, 1ms is 5% duty cycle, and 3ms is 15% duty cycle.
Did I understand your question correctly? Somehow, I feel like I missed something..
04-27-2011 11:44 AM
Jeff,
I like your modified code... Very good example... Simplifies the explanation.
We appear to have understood the same thing.. 🙂
04-27-2011 04:12 PM
Thanks for ur guys help. ill be searching for the pwm and thank you jeff for actual changing my program
really2 helpfull
04-27-2011 04:22 PM
Yeah that technical jargon the Technicians use! "Duty Cycle, Frequency, Period..." They oughtta give programmers a tutorial!
![]()
Glad to help