Demand based resource sharing switch?

lupinglade

Member
Join Date
Dec 2012
Location
Ontario
Posts
11
Hi all. I am new here and new to PLCs, but I am a programmer so have been able to pick it up pretty quickly. I am using a Koyo CLICK PLC. I was able to write a program to *zone* a humidifier and a dehumidifier, where each zone can either humidify or dehumidify. The PLC watches a number of inputs to check the state of the zone controller and the thermostats:

Inputs:

H1 - Humidification call on zone 1
H2 - Humidification call on zone 2
H3 - Humidification call on zone 3
D1 - Dehumidification call on zone 1
D2 - Dehumidification call on zone 2
D3 - Dehumidification call on zone 3
Z1 - Zone 1 dampers open
Z2 - Zone 2 dampers open
Z3 - Zone 3 dampers open
GT - System fan is running

And then there are these outputs:

G1 - G (fan) terminal on zone 1
G2 - G (fan) terminal on zone 2
G3 - G (fan) terminal on zone 3
HUM - Humidifier ON
DEHUM - Dehumidifier ON

I have the logic currently worked out such that once a humidification or dehumidification call is received, the PLC activates the appropriate G (fan) terminal, which causes the zone controller (separate) to turn on the fan for that zone if possible, unless it is currently heating or cooling another zone, in which case the fan will be activated as soon as the zone controller stops heating/cooling.

Then the PLC checks that the correct zone (Z1, Z2 and/or Z3) is on and checks that GT is on (that the fan is running). This lets the program know that we can now humidify or dehumidify.

All of this was not too difficult to do, but one thing I had to do is cause the dehumidification process to have priority, so that a situation where there is way too much humidity in the home does not occur (causing window condensation, etc possibly). This is a minor problem because if, for whatever reason the dehumidification call could not be satisfied (ie. humidifier failed or is disconnected), the humidification calls would never get a turn to be processed.

So my question is, how can I create logic that will share time between the humidification and dehumidification calls if there is a call for both? Ie. the PLC should be able to run the dehumidifier on the needed zones for a set amount of time and then switch to dehumidification for a set amount of time, then back to dehumidification, etc, etc until either or both calls are satisfied.

I just need some pointers on how logic like this generally gets designed?

Here's my current logic, from memory:

Code:
Check if there is a dehumidification call, if so, set DehumidifyMode to 1

[ ] D1 ___|_________ ( ) DehumidifyMode
[ ] D2 ___|
[ ] D3 ___|

Turn on the right G (fan) terminals

[ ] D1 ___ [ ] DehumidifyMode _____________ ( ) G1
[ ] H1 ___ [/] DehumidifyMode ___|

[ ] D2 ___ [ ] DehumidifyMode _____________ ( ) G2
[ ] H2 ___ [/] DehumidifyMode ___|

[ ] D3 ___ [ ] DehumidifyMode _____________ ( ) G3
[ ] H3 ___ [/] DehumidifyMode ___|

Dehumidify

[ ] DehumidifyMode ___ [ ] GT _______ [ ] Z1 ___________ [ ] Z1 ___ [ ] D1 ___________ [ ] Z2 ___ [ ] D2 ___________ [ ] Z3 ___ [ ] D3 ________________ ( ) DEHUM
                                 |___ [ ] Z2 ___|   |___ [/] Z1 ______________|   |___ [/] Z2 ______________|   |___ [/] Z3 ______________|
                                 |___ [ ] Z3 ___|

Humidify if not dehumidifying

[/] DehumidifyMode ___ [ ] GT _______ [ ] Z1 ___________ [ ] Z1 ___ [ ] H1 ___________ [ ] Z2 ___ [ ] H2 ___________ [ ] Z3 ___ [ ] H3 ________________ ( ) HUM
                                 |___ [ ] Z2 ___|   |___ [/] Z1 ______________|   |___ [/] Z2 ______________|   |___ [/] Z3 ______________|
                                 |___ [ ] Z3 ___|
 
Last edited:
Assuming I understood what you need, here's one (of many) possible solutions:

|    D1        H1        T2
|---] [---+---] [---+---]/[----+---( T1 ) Dehumidify Run Time
| | | |
| D2 | H2 | |
|---] [---+---] [---+ +---( C1 ) Call for Both
| | |
| D3 | H3 |
|---] [---+---] [---+
|
| T1
|---] [----------------------------( T2 ) Humidify Run Time
|
| C1 T1
|---] [-------]/[------------------( C2 ) Dehumidify Only
|
| C1 T1
|---] [-------] [------------------( C3 ) Humidify Only

The first rung checks if there is a call for both. If so, it starts timer 1. C1 simply indicates that there is a call for both.

Rung 2 starts timer 2 when timer 1 has expired. Notice that when timer 2 expires, it will reset the first rung to repeat the sequence.

The last 2 rungs determine which mode should be used. I made dehumidify always run first. The C1 contacts enable these modes only when there is a 'call for both' situation (actually not needed on the very last rung, as T1 can only be 'done' when this situation occurs).

🍻

-Eric
 
Thanks a lot! Do you see any way to simplify this to just use one bit C1? Where a value of 1 would be dehumidify and 0 would be humidify? I only need the two modes so there is no real requirement to know if both are called for or to use two bits for the two values. Hope that makes sense :/ It would just make the logic following this easier to write when only 1 bit has to be considered.

I'd just like C1 to toggle between 1 and 0 every so many minutes if an alternate call exists, otherwise the value should remain unchanged.
 
I don't think you get away with only 1 bit, because there are actually 3 'modes'. 'Dehumidify ONLY', 'Humidify ONLY', and 'Normal Operation' (NOT calling for both).

I guess you could skip the C2 and C3 bits if you use the T1 bit as your 'Humidity ONLY Override', and C1 AND NOT T1 as your 'Dehumidify ONLY Override', but IMO, that just makes it more difficult for someone in the future to understand.

🍻

-Eric
 
There are 3 input modes but only two possible output modes, that is why I am thinking toggling one bit makes sense... But I am really new to this :/
 
With a single bit you can ONLY Dehumidify when it's in one state, and ONLY humidify when it's in the other state. What is going to toggle the state of this bit when you are in 'normal' operation? This is meant to be an override that occurs only when both are called.

🍻

-Eric
 
The only possible actual outputs are either humidify or dehumidify. There is no normal other mode. Ie. the "both" mode still has to end up one of the two. And if there is no call for anything then the bit value does not matter.

I'm thinking the timer should just be minimum run time per mode, after which switching the bit is allowed if needed. Does that make sense?
 
Using only the first two rungs:

T1's output toggles on and off every 'x' seconds when BOTH are called. There's that 'one toggling bit' you wanted. So, try sticking a normally-closed T1 contact in the dehumidify output rung, and a normally-open T1 contact in the humidify output rung to enable/disable the outputs.

This works perfectly when BOTH are called, but what happens when BOTH are NOT called? The T1 contact now STAYS off, which disables the humidify output indefinitely.

Feel free to play around though. There are a many different ways to do this... (y)

🍻

-Eric
 
The only possible actual outputs are either humidify or dehumidify.
No, as Eric said, you have the "NORMAL" HEAT or COOL modes. I think you may be overlooking or nullifying the main functions of a HVAC system: Heating and Cooling. Those functions should always have priority. Most of us can live with air too dry or wet for a long time, but freezing or boiling temperatures are not desirable in most buildings.

Remember that your little old PLC program is usually just one tooth on one cog wheel in the overall system. Trying to make it take priority in every situation is a big mistake.
 
It does not take priority, the logic will humidify/dehumidify together with the heat if the heating is in the right zone, otherwise it will not as the logic will not be true. The only part that will get executed is the fan being turned on, but the zone controller will ignore this until its done hearing anyway. So as I said, I do not need to worry about any other mode.
 
What about something like this (see top two rungs)?

Is the return needed on the two ends of the second rung?

logic.jpg
 
Last edited:
Hard to see the image, but it looks like you are using differential contacts to enable the timer. That timer won't run.

At least not for more than 1 scan... :ROFLMAO:

And no, the RETURNS need to go.

🍻

-Eric
 
My thought is rung 3 will run first, the timer would be 0 so it would set or reset C1 (as long as there is a humidify or dehumidify call). I realize that it will not run the timer the first time if the first call is for humidity because C1 is already 0 so the edge contact would not work.

The returns are there so that the scan restarts from the top, rung 1 causing the edge contact to become true and thus start the timer.

Then rung 2 would be skipped since the timer is 1 (running).

Then the program would proceed as normal until the timer expires, at which time rung 2 will check whether to continue in the current mode if there is no alternate call, or switch to the other mode if there is one, restarting the timer.

To me it seems to make sense, but I don't even yet have a PLC to test on (its in the mail) and this is my second day learning PLC programming ;)

Edit: ack, just realized that in the situation where the humidity call happens first, it would never actually do anything because it will keep returning since the edge contact won't become true and the timer will never start :(
 
Last edited:

Similar Topics

I need help with what most of you find probably simple, but it has me perplexed, I'm very, very new at this.... I have the basics down but I'm...
Replies
9
Views
1,867
Hi Hopefully this is just a simple question for somebody out there. On FTEM I created a demand analysis report that emails itself regularly...
Replies
0
Views
1,147
Hi, I'm not sure if this idea have a wrong approach :nerves:: Currently programming a Micrologix 1400B: Because this is a stand-alone...
Replies
1
Views
1,287
Hi guy, We have a site using 3 units of Power Meter M6. All of them are link to the workstation thru Ethernet, we can monitor the voltage, amp...
Replies
2
Views
2,478
Does anybody have an example of a macro or VBA that will automatically produce and save a report file from RSView32? I have a panel mounted...
Replies
5
Views
5,471
Back
Top Bottom