08-31-2017 04:08 AM
Hi there! Need some help here!
So im really quite new to labview and currently im involved in a project that requires me to control the temperature in a chamber using a power source to a heater and a DAQ to a thermocouple. If the temperature of the chamber rise above the set point, I would require the power source to switch off. When it drops below, the power source switch on again. Right now im trying to use a case structure to activate/deactivate my power source, however
1) Im not so sure how to settle the false part (true part as well actually) and
2) How to link my DAQ readings to the temperature comparison part.
3) Also, would the method of using a relay be better?
Attached is my VI. Thank you very much!
08-31-2017 06:10 AM
Hi Shalalas,
I would require the power source to switch off.
How do you switch this power supply on/off?
All you do in your VI is setting some voltage/current levels on two "channels"…
What are these "channels"?
1) Im not so sure how to settle the false part (true part as well actually)
Why do you need this case structure? Isn't it possible to set certain voltage/current levels as needed for the heater?
2) How to link my DAQ readings to the temperature comparison part.
I don't know. Do you need to "link" DAQ readings with temp readings?
3) Also, would the method of using a relay be better?
Depends on your hardware. Unfortunately you don't tell so much about the hardware…
08-31-2017 07:18 AM
It seems to me that I've seen numerous "Exercises" for DAQmx devices or "Getting Started with LabVIEW" that involve temperature controllers. That must be why it is such a popular homework assignment. Talk to your classmates.
Bob Schor
08-31-2017 10:01 AM
To do thermal control properly, you probably need to look into implementing a PID controller. LabVIEW has good PID tools, search the examples..
http://zone.ni.com/reference/en-XX/help/371361L-01/lvpid/pid_vi/
09-04-2017 02:57 AM
Thank you for the reply!
-I was actually thinking of switching it off by using the true/false case structure, so ill set the voltage of the power source to zero when it is false. The channels are the channels of my power source GPS3303S.
-I needed it as I thought when the temperature rises above a certain temperature it will enter the false case and set the voltage to 0.
-Im using GPS-3303S for power and Measuring Computing DAQ for temperature reading.
Actually I tried an alternative method of building a state machine which many say its a better way, and I am having some troubles.
I tried to integrate 4 thermocouples together to get the mean value at each timing, and im not very sure what i have done is correct. I want to use the mean value to compare with the maximum temperature that i set.
As for the off heater option, I am thinking of switching only channel 1 off with 2 still running continuously, is the use of local variable correct?
Thank you!
09-04-2017 02:59 AM
Here's the VI
09-04-2017 03:32 AM - edited 09-04-2017 03:36 AM
Hi Shalalas,
I tried to integrate 4 thermocouples together to get the mean value at each timing, and im not very sure what i have done is correct. I want to use the mean value to compare with the maximum temperature that i set.
So you read an array of waveforms,, where each waveform contains samples of just one thermocouple.
Then you convert this array to a 1D array of DBL using this evil FromDDT function: which kind of data do you expect after the conversion?
Why use waveform datatype at all? Why not use waveform functions to read the samples and do the averaging afterwards?
As for the off heater option, I am thinking of switching only channel 1 off with 2 still running continuously, is the use of local variable correct?
No. You just set the locals, but never output their value to your device. Did you try simple debugging using the highlight execution mode?
On your VI:
- Using while loops inside the states looks wrong to me. Why not repeat the state until the user presses the stop button? ("IF (error OR stop) THEN next state ELSE current state")
- why do you need to initialize and de-init resources each time you go into state "measurement" and "heater on"? Why not do this once in an "init" state and clear all resources in the "exit" state"?
09-04-2017 04:36 AM
hmm to answer the second question, I would actually like the VI to auto run, i was hoping for the DAQ to run continuously and for the power source to respond along the way so i can keep collecting data of my temperature. Is having a state machine a bad idea?
09-04-2017 05:35 AM
@Shalalas wrote:
Is having a state machine a bad idea?
No, State Machines are very useful. But a general rule is that states should not have continuously running loops in them. If you need a task to repeat, you just keep calling the same state.
09-09-2017 11:39 AM
State machines are extremely useful, but may be an over-complication for a simple temperature threshold evaluation. Unless you are planning to add more complex functionality, something like this may work: