LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control temperature to a decreasing input

Hello, I have a little problem. It is quite simple but I am new in LV, so I would truly appreciate some help.

I am building a rig that heats up to a set temperature (this part was done), and then cools down following a chosen pattern. This pattern could go from a ramp input (eg: 1 degrees C / min) to a sine wave.

I have not been able to produce any of the two above. I have seen a few examples on ramp generation but nothing satisfies me. How can I generate a decreasing ramp using such a special input as 1 degrees C/min? I'd like to make it easy enough for the user as well.

Could you please help me, I would truly appreciate.

Thank you,

Johnny
0 Kudos
Message 1 of 8
(3,122 Views)
There are probably some VIs hiding in the analyze palettes which can produce the numbers you want, but I don't know what they are.
You can write one yourself fairly easily. It can have a seperate input for each variable and the inputs like Celsius or Minute can be a ring, where the user only has a limited number of choices.

Then, with some simple logic (case structures and maybe a formula node), you can write a formula to calculate the necessary value at each point and use uninitialized shift registers to keep track of the time and of previous values. You check how much time has passed each time you run the subVI and you decide on the value according to that. You may wish to look up uninitialized SRs, if you don't know what they are.

If you need any more help, don't hesitate to ask.

To learn more about LV, I suggest you read the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide.

___________________
Try to take over the world!
0 Kudos
Message 2 of 8
(3,098 Views)
Thank you very much, it makes a lot of sense. It sounds a bit advanced for me though.

I saw the nice DAQmx "Formula Waveform" vi. It sounds perfect for what I am working on. Do you know anything about it? Again, the problem is about setting a time according to my measurements! When implementing it in my loop, it does not work as desired obviously.

Do you have any idea what is going on?

Thank you,

Johnny
0 Kudos
Message 3 of 8
(3,086 Views)
I don't know that example (don't work with DAQmx), but if you've already written some code, post it so we can comment on it directly. That's probably the best way to learn.

___________________
Try to take over the world!
0 Kudos
Message 4 of 8
(3,081 Views)
Sure thing, I should have done that from the start.

Ok, so this vi only contains the first part of the program (since I have not done the second half). At the moment, it acquires quite simply the temperature, sets it in a spreadsheet, displays it on a graph and compare with the demand temperature setting the heater to be on/off and the valve to be open/close.

I would like to start the second part which setting a ramp input and having the machine to follow it.

Any help is much appreciated,

Johnny
0 Kudos
Message 5 of 8
(3,078 Views)
Here is a quick example, with some default values.
I didn't incorporate it into your program, but it shows the basic idea, even without SRs.
The code in the while loop can be turned into a subVI and called multiple times to set the current value.
As a matter of fact, other than the Start time and Start value, the rest of the code can also go into the subVI.
A sine function can be used on the elapsed number of seconds to determine a proper value for the sine case.
Hope this helps to clarify what I meant.

___________________
Try to take over the world!
0 Kudos
Message 6 of 8
(3,058 Views)
Forgot the attachment, of course.

___________________
Try to take over the world!
0 Kudos
Message 7 of 8
(3,051 Views)
Thank you so much, it works perfectly.

We have tried it, implemented it in the main program and it works as a charm.

We cannot sample non-linear inputs but that is not too bad. It was not required in the first place. Hopefully now, some nice research will be done.

Gratefully,

Johnny
0 Kudos
Message 8 of 8
(3,027 Views)