I am working on the control of some engineering systems (in Simulink). Therefore I have to solve this logical control issue:
Starting point: I want to model the heating of a chemical system. If the temperature is below a certain level, a heater should be switched on (model "Control on/off"). Once the heater is switched off, its not allowed to swtich it on before a certain time. The "Delay if off" model calculates the time since its input signal switched to fals; the output of the ">" model switched to true when the calculated time of the "Delay if off" block is > as a certain value.
Now i want to do the same thing for the on-status: Once the heater is on, it is not allowed to switch it off before a certain time.
But I am not sure how to do this. I tried the following:
But that is wrong :).
First: Would be great if someone could help me. Second: Is there a structured way to learn this logical things? Any material where I can learn such things :)?
Thank you very much for your help!
edit:
First attempt
If thats correct --> how can I compare this into a single output that is true/false?



First, I think your diagrams are a bit confusing in several ways:
What comes out of the Control On/Off? Does anything come out of there? This is not clear ... Is it maybe whether currently the heater is switched on or off?
Likewise, what does the signal at the output mean? It would be good to indicate that as well (e.g. in top diagram 1 means heater should be switched to on, while 0 means it shouldn't be switched on .. maybe call this signal Switch_On)
The Delay if Off outputs a number ... but all other signals are binary signals, i.e. they signal that something is or is not the case. I would be helpful to make sure all your signals binary to help you think logically about the design ... so maybe simply have one box (or signal?) that says "Delay >" ... and which outputs 1 if enough time has passed, and outputs 0 if not enough time has passed. Actually, since this delay may be different between the on and off cases (maybe we have to wait at least 5 minutes to turn the heater on after it has been switched off ... but we only have to wait 2 minutes to turn the heater off after it has been switched on), you may want to use separate Delay_On_> (has enough time passed for the heater to be turned on?) and Delay_Off_> (has enough time passed for the heater to be turned off?)
Finally, nowhere is there any reference to the temperature being too high or low ... or is that what comes out of the Control On/Off? So maybe use a different box here as well "Temp <" that outputs 1 if the temp is too low ... and likewise a box "Temp >"
A good way to think about these things is to do this purely logically:
The heater should be switched on if the temperature is too low, and enough time has passed since it was switched off (and heater is not currently on?)
The heater should be switched off if the temperature is too high, and enough time has passed since it was switched on (and heater is not currently off?)
So more formally:
(Temp_< AND Delay_On_>) -> Switch_On
(Temp_> AND Delay_Off_>) -> Switch_Off
Notice that you get completely symmetrical diagrams if you were to implement this .. which makes a lot of sense. Indeed, the fact that you got 2 different looking diagrams in logical structure is immediately a bad sign given that the problem is symmetrical in terms of "on" and "off" (unless I am missing something)