LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Heater Control

Hi all

 

Is this a correct way to implement PID with PWM ? I have the following

 

NI9178

9211 to read k-type thermocouples

9474 for 24V DO

4 x 10A SSR

 

Basically there are two tubs . One smaller tub (TA) with a single 1000watt heater feeds (valve in between) a larger tub TB with (3) 1000watt heaters. I would like to mantain the temp in TA and TB independent of each other. The process is slow so period can be large

0 Kudos
Message 1 of 3
(2,678 Views)

I don't know about the PID and PWM.  But the event structure and queued state machine won't run right.

 

You have an event called "Check Limits Value Change".  It will never run because Check Limits is an indicator, and you don't have any Value(signalling) property nodes to trigger it either.

 

Your consumer loop appears to have a state machine in it.  But the only state that will ever run is exit.  You don't havy anywhere that you queues up any other state except CheckTB.  And that one will never get queued because of the reaons given above.

0 Kudos
Message 2 of 3
(2,654 Views)

I'm not entirely sure why you would need PID or PWM for this system unless you have been specifically asked for them. Even with 3000W the temperature of the tubs should change relatively slowly, for a start I would recommend simply controlling whether the elements are on or off depending on the tempertaure of the tub.

 

Once you have got a simple version like this working that will simply switch on the elements when the temp is too low and switch them off when the temperature reaches a desired temp, if you leave some hysteresis room then this shuld easily be able to control the temp then I would recommend moving on to the PWM and PID methods. But onto those then. 

 

1. As RavensFan said your Event structure is not going to work properly without property nodes to trigger it.

 

2. Your producer loop case structure only has one event at this stage, so that can go, and the stop button produces an Enum state called Error which is never actually going to do anything because the while look closes as soon as it is produced.

 

3. Your initialize state in the consumer loop is never actually called, you go straight into idle in the beginning.

 

4. Your error case structure out of the back of the Producer loop does nothing, the queued item "Error" doesn't relate to anything.

 

5. You would be better off with a case structure that contains all of the PID and PWM controllers controlled by the Heater Control switch, then you wouldn't need the select in the for loop.

 

6. Since I don't have your PID VI I can't be sure what it outputs but I'm going to assume that it outputs a number from 0 - 100 indicating a desired percentage of power from the heaters, then the PWM should work although I am expecting that there will be some issues to arise from rounding and transformations of the values.

 

Also would it not be better to have a single state that checks and controls both the tubs? Unless you are planning on controlling the PWM generation seperately so that they have different update frequencies then it seems odd to have two seperate cases where one would do.

Message 3 of 3
(2,631 Views)