Your challenge is to design a thermostat using only primitive engineering blocks in Niagara 4 (N4). The thermostat should feature a setpoint, a high limit, and a low limit. The logic should monitor an input value and control an output based on the relationship between the input and these limits.
This challenge is designed to test your skills and is not necessarily how you would implement this in a real-world scenario. The intent is to see if you can follow a functional description, similar to one a consultant might provide, and produce the corresponding logic.
This exercise helps ensure that you can interpret specifications accurately and translate them into a working solution using Niagara’s primitive logic blocks.
Instructions:
Setup:
You will have one input: InputValue (numeric).
You will define three key parameters:
Setpoint (target value).
HighLimit (upper threshold).
LowLimit (lower threshold).
You will have one output: Output (boolean).
Logic Requirements:
Over Limit Logic (Cooling Mode):
When the InputValue exceeds the HighLimit, the Output should turn true.
The Output remains true until the InputValue falls back to or below the Setpoint.
Under Limit Logic (Heating Mode):
When the InputValue drops below the LowLimit, the Output should turn true.
The Output remains true until the InputValue reaches or exceeds the Setpoint.
Deadband Behavior:
The Output should not rapidly toggle around the Setpoint, HighLimit, or LowLimit. Implement logic to ensure stable operation and avoid unnecessary toggling.
Tools:
Use primitive logic blocks (e.g., Comparators, And, Or, Not, etc.) available in Niagara 4 to implement the thermostat functionality.
Design the logic to handle the high and low limit states, ensuring the Output transitions smoothly based on the input value.
Testing:
Simulate the InputValue to test how the Output behaves when it crosses the HighLimit and LowLimit.
Ensure that when the InputValue exceeds the HighLimit, the Output remains true until it returns to the Setpoint.
Similarly, verify that when the InputValue drops below the LowLimit, the Output remains true until it reaches the Setpoint.
Check for any unwanted toggling near the limits.
Submission:
Save your work and submit the completed Niagara 4 file (.bog) as a reply to this post.
Include a brief explanation of how your logic works, which engineering blocks you used, and how you ensured the system meets the challenge requirements.
A question about the constraints on this one. What is the cut off for “primitive” engineering blocks? Are latches beyond this and I need to keep to basic logic blocks?
Essentially what I meant was don’t use the TStat block or any other logic block that does this function in its entirety. You should build the TStat from scratch.
For cooling the Latches are triggered by either the InputValue being greater than the HighLimit or the InputValue being less than the setpoint, and the value of the Latch is the state of the InputValue being greater than the SetPoint. Heating is basically the opporsite. One criteria I did NOT fulfill was only having one boolean Output as I didn’t know how to drive both a cooling cycle and a heating cycle from one boolean output, Hence my CoolingCall and HeatingCall.
No rush here, and I Don’t know how long it takes to break my Thermostat solution, and I know you guys are wicked busy…but if anybody gets a few minutes to look at this, I’d love to get feedback.
@ControlFreak, I finally had a chance to review this and it works great! The only thing I would change is using Less Than OR Equal and Greater Than OR Equal. This way the outputs would toggle exactly on the limits and setpoint rather than having to be .1 above or below.
Thank you Giantsbane! Thank you for looking while you are so busy. I just didn’t want to go so long I forgot my logic in this. I had fun doing this! I did briefly think about doing Less Than/Greater or equal, but paused as I was trying to get the logic right and was worried about which one to pick as I didn’t want to cycle on both conditions (i.e., Less Than or Equal, and Greater Than or Equal, both triggering on Equal). as you say, the way I’ve done it I’ve left nothing triggering at Equal, so a hole in my programming! Cheers sir! and if I can do any “manuel labor” on this site to help, please do not hesitate to ask.
Thanks @ControlFreak! like always i’m here to help I’ll post a new challenge soon! I guess the best way to help is discourse The more you ask the more I can answer, and the more it will help others who visit in the future
Hello please do not be too hard on me as I am a rookie in the controls world!
so I may have over thought this a bit but how I read the SOO We are to use one input and one output. In this case my input is “Room Temperature” and my output is “SystemOn”.
Description on how logic should work: If the Room temperature is above/below (Above for Cool, Below for Heat) the setpoint but not above/below the limits the latches in value will be true. Once above/below the limits the
Latches will be triggered enabling the Output. Once the limits are satisfied the latch prevents the output from disabling until the Input (RoomTemp) is above/below the setpoint. Since we are to use only one output I needed to find a way to tie both a heat/cool mode to a singular output. To do this I added the enum switches that set the select function of a booleanSelect. If in a heating or cooling state the SystemOn output will be commanded ON. If in at setpoint the SystemOn Output will be FALSE.
Engineering Blocks Used: Using the KitControl Pallete I utilized basic logic blocks, in conjunction with switches, latches, & selects.
How I ensured Operations: I added a ramp block and linked to my input “RoomTemp” to simulate a temperature swing from 60-80 degrees. This cycles the system between a heating and cooling mode.
Please let me know if I missed something. Also this is the exact stuff I have been looking for to help me in my training, thank you! config.bog (3.7 KB)
@GordisGodSSJ, no need to be afraid here my friend! We are all learning always I’ll get to reviewing this as soon as possible if no one else picks it up.
Remember any pointers given are not to criticise you but help you understand where you went wrong. Ten people will engineer the same problem ten different ways. There is nothing to say my way is right and your way is wrong. If it works it works
I’m also just a beginner, so I don’t claim to know if this works or not, but I like how you combined your output to a single block. I did not do this, and as you say, it more closely follows the SSO.
Challenge02_NateJackson.bog (1.1 KB)
This is my tstat logic. I think I’ve got it down. I was having a problem with the latch. I couldn’t get the clock to reset to false. I was going from my setpoint of 68 directly to the high limit of 70 and that did not allow the OR block to have both inputs at false, there by resetting the CLOCK. It then occurred to me that a thermostat would not jump from 68 to 70, it would at least register at 69 even if for a moment and that would allow the OR block to be false and THAT would reset the CLOCK to false. So. That took much longer than it probably should have to figure that out. My next challenge is the LUX lighting and i believe that is going to require some more research. Thanks and I’m sorry this is so long winded.
I have also found latches a bit tricky. The higher ups here have helped me to understand some reasons why they’re tricky, but sometimes I still struggle with them. Sounds like you are charging ahead! Cheers.
Hi, first time here and first time attempting a challenge. I am unable to upload an attachment as a new user, hopefully I will be able to shortly and will upload the bog file, but I have attached a snip of the logic for now
Summary of the logic; High Limit:
If RoomTemp exceeds the HighLimit or is less than or equal to Setpoint, set Boolean Latch clock
Boolean Latch input remains true while RoomTemp is greater than Setpoint
This turns CoolingDemand on when RoomTemp exceeds the HighLimit and remains until it is less than or equal to Setpoint
Low Limit:
If RoomTemp falls below the LowLimit or is greater than or equal to Setpoint, set Boolean Latch clock
Boolean latch input remains true while RoomTemp is less than Setpoint
This turns HeatingDemand on when RoomTemp falls below the LowLimit and remains on until it is greater than or equal to Setpoint
Simulated to confirm expected behaviour and that there isn’t any unwanted toggling near setpoint/limits.