07-19-2012 09:01 AM
Hi all, I am doing what would seem to be a straight forwared VI. I am controlling a small heater which is being monitored by a thermocouple. I read the thermocouple using the DAQ assistant. I use the example PID from the toolkit. Next I generate a squarewave that varies in duty cycle as per the percentage the PID gives. Strange thing is that all parts work fine seperately. But when I put them together I get no square wave, I only see the transistions that are changed for long periods of time. I have pin pointed the problem to when I use the DAQ assistant to read the temperature. If I remove it and insert a control I see the square wave. The system seems to favor the DAQ assistant that reads the temperature, then outputs the pulses "if it has the time". I am sure there is something I need to do with the sync'ing of the two DAQ assistants. Any help would be great! Thanks
Solved! Go to Solution.
07-19-2012 09:06 AM
Your simulate signals Express VI is set to only output 1 sample. So you are only putting out one sample for each thermocouple reading you are taking rather than a full square wave. Likewise the digital output on the DAQ assistant is set to only output 1 sample.
07-19-2012 09:26 AM
Thanks RavenFan for the quick reply. That was my doing. With the USB-6009 the only generation mode available seems to be 1 Sample on demand. So I had to tell the Simulate Signal to give me 1, if not it would return the error " that the number channels did in the data not match the number in the task.
07-19-2012 10:11 AM
If you are trying to do pulse width modulation, then the inexpensive USB-6009 is the wrong tool for the job. You are going to be stuck with software timing. It can theoretically generate a square wave if you put the digital output in its own loop and it is pumping out the true and false boolean signals as fast as the software will allow. But windows is not a deterministic operating system and there is no way to guarantee the duty cycle of your square wave.
I'd recommend getting a better DAQ device that has hardware timed digital outputs.
07-19-2012 10:21 AM
Yeah I know about that limititation. Since it is to control a heater, "slow response" I can theoretically decrease the frequency for something slow and the PID will adjust as needed. I was able to generate a nice and stable square wave without the first DAQ Assistant reading the temp. I need to try to find a way to have them running sequentially.
07-19-2012 10:33 AM
I second RavensFan's response but if you were happy with the way the USB-6008 was able to generate a square wave in isolation then try something like this:
Using two loops decouples the acquisition timing from the generation timing allowing you to output many points of your square wave for every temperature reading.
Hope this helps,
Simon
07-19-2012 10:46 AM
Thanks Simon, that decoupling did the job. I understand that higher transistions would not be as reliable. But what I am dealing with is heating a rod that has on and off times of more that a second, I am hoping to be good to go. Thanks to both you guys!