LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building delays in pulse width modulation

Solved!
Go to solution

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.

 

0 Kudos
Message 1 of 6
(2,857 Views)
Solution
Accepted by MZ_Xps

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. 

 

 


"Should be" isn't "Is" -Jay
Message 2 of 6
(2,848 Views)

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..

0 Kudos
Message 3 of 6
(2,846 Views)

Jeff,

 

I like your modified code...  Very good example... Simplifies the explanation.

We appear to have understood the same thing..  🙂

Message 4 of 6
(2,845 Views)

Thanks for ur guys help. ill be searching for the pwm and thank you jeff for actual changing my program Smiley Happy really2 helpfull

Message 5 of 6
(2,832 Views)

Yeah that technical jargon the Technicians use! "Duty Cycle, Frequency, Period..."  They oughtta give programmers a tutorial!

 

Smiley Very Happy

Glad to help


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 6
(2,829 Views)