LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control the temperature in a pot.

Hello everyone,

 

I have a Labview problem I need help solving. It's on the practice test for a class I'm taking and I'm wondering if I could get the correct solution from someon here to better prepare for the test.

 

Here is the problem:

 

It is desired to control the temperature in a pot of chocolate (VI Provided) to make Christmas candies. The system has 2 settings: low where desired temperature Td=80 and High where Td=120. The input to the heater is constrained between 0.0 and 1.0 in the provided subVI (i.e. if you send 1.2 to the heater, it will act like you sent it 1.0).
A state diagram can be seen below.

Desired Program Features (with points) (This is my grading rubric)
⦁ (12) Dataflow programming is used (i.e. minimal use of local/global variables)
⦁ (5) States are controlled by enum typedef
⦁ (5) State Machine Architecture
⦁ (5) Data for state machine wired in cluster. (Desired Temp, Measured Temp, Control Output)
Front Panel
⦁ (3)Thermometer Indicator of current Temperature. Min value of 0 and max value of 150.
⦁ (3) Chart displays measured temperatures and desired temperatures.
⦁ (3) Chart amplitude is fixed between 0 and 150.
⦁ (2) Chart legend shows which plot is which.
⦁ (1) Knob with positions (this was provided so don’t delete it)
⦁ (3) Program stops if knob is set to 0
⦁ (3) Controller Gain with default value of 0.0001
⦁ (5) Organized front panel
Controller
⦁ (5) Controller is active every 50ms. This can be done by the Wait Until Next ms Multiple.
⦁ (5) power level calculated in subVI.
⦁ (3) subVI has non default Icon
⦁ (4) SubVI has outputs of Power Level and if you need to save data (|Td-Tm|>0.1)
⦁ (5) The new power level (PLn) into the heater is calculated using
PLn=PLp+K(Td-Tm)
Where
PLp= power level from the previous time through the loop
Td = desired temperature
Tm=measured temp from the previous time through the loop
K=Controller gain from front panel
⦁ (1) Controller power level is entered into Heat Chocolate SubVI
⦁ (3) Stored data is updated with new values
⦁ (5) Goes to Saving or Plotting when finished depending on Td and Tm
Plotting
⦁ (3) Goes to Implement Control after updating front panel indicators
⦁ (1) Data is plotted and sent to indicator.
Saving Data
⦁ (5) Desired Temperature and measured temperature stored to a file (for partial credit you can save using high level IO)
⦁ (10) Data is saved in save data state using low level IO

 

So that's it. Any help would be appreciated. 🙂

 

Thanks guys!

 

 

0 Kudos
Message 1 of 8
(4,244 Views)

Nobody is going to do your homework for you.  Your best bet is to make an attempt.  It's better for you learning than trying to read code.  You'll quickly learn what didn't work for you.  That's how you get the thought process going.

 

Once you do that, you can bring it here and ask for help.  People are more than happy to look at your code and help you find places you could have done things in a better way and help you learn.  There's a vast difference between helping you and doing your work for you.

0 Kudos
Message 2 of 8
(4,231 Views)

<Story Time>

You know I had a similar requirement for an actual large tank of water, and a Watlow heater.  I needed to maintain a set temperature and I didn't have any RT components.  I was a bit concerned that I would have any decent control because without RT I thought my PID loop would be super slow and not work well.  Oh and my power level was a relay, the heater was either on or off.  My first attempt was just a turn on of my temperature is less than setpoint, and turn off if it is greater.  It must have been the fact that my tank of water was very large and so changes were gradual, but it would stay within about a degree C of the setpoint.  That is until the relay was stuck on, and the temperature grew to crazy levels, with the risk of flash steam when more cold water was added.  It was a bomb and could have been a terrible accident.  After that we changed the max temperature setpoint on the heater, which we didnt' know was a thing.

</Story Time>

 

Yeah OP, please take some of the free online training, and come back with specific questions, and post the code you've attempted.

Message 3 of 8
(4,202 Views)

If your system can turn into a bomb, an independent safety themostat and shutdown porcess are important.

 

Lynn

Message 4 of 8
(4,198 Views)

@ShyrtleTheCat wrote:

A state diagram can be seen below.


Sounds like you will want to start with a State Machine.  The rest looks simple and broken out nicely for you to implement one at a time.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 8
(4,192 Views)

@johnsold wrote:

If your system can turn into a bomb, an independent safety themostat and shutdown porcess are important.


Yup, that was an oversight for sure.  It was a near miss, and am glad we discovered, and rectified the issue before handing the system over.

0 Kudos
Message 6 of 8
(4,186 Views)

@ShyrtleTheCat wrote:

 

I have a Labview problem I need help solving. It's on the practice test for a class I'm taking and I'm wondering if I could get the correct solution from someon here to better prepare for the test.

 


There are many "correct" solutions (an even more incorrect ones!). Fortunately it is easy to test if it is correct by just running. If the chocolate never melts or if it burns, the program is incorrect.

 

Your teacher went to great lengths to describe every detail, so all you need is translate it into LabVIEW code. Do you understand the terms used? Are you familiar with the diagram editor? This is not a problem for the first day of the course, so most likley all the concepts employed have already been taught.

 

We are very willing to help you become a great LabVIEW programmer, but you have to do the legwork. Why don't you start implementing all the requirements and see how far you get. If you get stuck, come back and ask for guidance, explaining in detail what is causing you problems and attach what you did so far.

 

I assume this is all just a simulation. Is there actual hardware and real chocolate involved?

 

For general program design, have a look at the CLD prep examples and comments posted here.

0 Kudos
Message 7 of 8
(4,180 Views)

But...it's a bomb...made of...chocolate!


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 8 of 8
(4,174 Views)