Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9477, PID controls and PWM

Hello everyone,

 

I am trying to use LabVIEW's PID controller with a digital output (NI 9477) in order to drive a relay which is connected to a heating source.  I have managed to get past the PID part but now I am unsure how to turn this into the output I need.  At first, I made up a long complicated algorithm which more or less generates a PWM signal without using any of LabVIEW's built-in PWM tools so I'm sure there is a better way to do it.  My current program uses an Elapsed Time function and the time setting of the function acts as the frequency.  Whatever the output of the PID is, the NI 9477 will send out a signal to switch on the relay for a duration of time (PID Output percent multiplied by frequency) and will then wait for the remaining time of the frequency with the relay off.  I have read up on how the cDAQ-9172 has built in counters but is not accessible with the NI 9477 because it is a static module.  What is exactly the best way of doing this?  I am unsure about how to make the PID output correlate with the NI 9477 switching in order to get the heating profiles that I desire.  

0 Kudos
Message 1 of 2
(5,181 Views)

booxcar, 

 

Thank you for using NI forums! You can use two parallel loops to implement this task. One loop would have the information from the PID and the other would be doing the digital output with the NI 9477. You can use queues to get the information from one loop to the other. This article might also be helpful. 

 

Katie

Katie Collette
National Instruments
Message 2 of 2
(5,153 Views)