LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mirroring or Time Delaying a PWM Signal

Hello I am using a NI 9401 Digital IO module to send PWM signals to a system that I have that drives 2 relays.  I want to be able to drive the first relay and vary its ON time by adjusting the duty cycle of the Digital Out signal from the NI 9401. I would like to drive the second during the remainder of the period.

 

For example, if the first relay is on during the first 50% of the pulse wave period, I would like the second relay to be powered on during the last 50% of the pulse wave period.

 

If the first relay is on during the first 30% of the pulse wave period, I would like the second relay to be powered on during the last 70% of the pulse wave period.

 

Also, the duty cycle is dynamic since it will be the output of a closed loop control system.

 

Is there a way to alter the duty cycle of the second pulse signal such that it is on during the latter portion of the period?

 

Thank you

0 Kudos
Message 1 of 4
(3,093 Views)

1. Is it possible to use just 1 relay, and drive the two parts of your system with the "normally open (NO)" and "normally closed (NC)" relay contact terminals?

 

2. Can you add a simple external digital inverter chip?

 

3. DAQmx solution with counters:  if the frequency doesn't need to change, you can probably hw-sync the 2 PWM pulse trains to look like inverses of one another.  You'd just need to configure both to start on the same trigger signal and make sure both tasks are started before the trigger signal arrives.

     However, you cannot hw-sync the instant when the duty cycles change as that happens in response to a software call.  There will be a short period of time when the two relays' connect/disconnect states overlap in time.  If it's crucial to avoid this, you should use one of the first two methods above.

 

 

-Kevin P

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 4
(3,079 Views)

thanks for the reply.

 

1. I have to use 2 relays for my application.

2. I do not have a chip on hand.

3. I think this can be an option.  Where can I find more info on how to do this?  My timing is not critical. My frequency is 5-10 Hz.

0 Kudos
Message 3 of 4
(3,062 Views)

Here's a decent starting point which ran without error on a simulated cDAQ system.

 

 

-Kevin P

 

dual pwm.png

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 4
(3,040 Views)