![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: Oct 2020
Location: Colorado Springs
Posts: 5
|
Bit Shift or Sequence?
I have a program I need to work out for a client and I'm having trouble figuring out the correct logic to do it. Let me see if I can explain it properly.
Programming done in Studio 5000 - compactlogix processor. There are some Supply and Exhaust fans I need to control (4 of each) to keep a room temperature around 90 degrees. They have 4 combinations of fans they want to run depending on temperature. I'm calling these F1 through F4. Fans are all on or off, no speed control, just a digital output to a motor starter in MCC. F1 Active below 85 Degrees F2 Active above 90 Degrees F3 Active above 95 Degrees F4 Active above 98 Degrees I'm using a 15 minute timer for each of these setpoints, temperature has to be over that point for 15 minutes for fan operation to kick in. That's the easy part. The part I'm having issues working out is the drop in temperature operation. Say F4 is active currently. They don't want it to drop to F3 until the temp has been below 85 degrees for 15 minutes. So if the temperature suddenly drops below 85 and stays for 15 minutes it goes to F3 operation, if it stays for 15 minutes again it goes to F2 operation. I was thinking about using a BSL/BSR operation but not sure if I'm thinking about this the right way. Timer for under 85 degrees set to 15 minutes. Use the done bit to trigger a BSL. F1-F4 operations are active depending on where the bit is in the bit shift operation. I can't seem to work out how to get the Temperature up bit shift right to work with the different temperature ranges though. Is this something that should be done with a sequence operation maybe? Am I missing a super simple way to do this and overcomplicating it? |
![]() |
![]() |
#2 |
Member
|
you could add a branch to fans 2 and 3 to lock them in with the next higher fan. For example if fan 3 has turned on, a branch with fan 3 running on fan 2 would keep it on until fan 3 is no longer running. then you would start your 15 minute temperature based shutdown timer for fan 2. Thats just a start would have to think about the transitions.
|
![]() |
![]() |
#3 |
Member
![]() ![]() Join Date: Jan 2006
Location: Finland
Posts: 1,528
|
You would need 4 different reset timers, otherwise it can easily reset all stages at same time.
if F4 and under 85c 15mins then reset F4 if F3 and not F4 and under 85c 15mins then reset F3 .. F1 and not F2, F3, F4 and under 85c then reset F1 Or you can use sequence / integer and step down one step (steps/ integer number 1..4) Edit. I would go set/reset or integer value, as it is probably easier to handle than shifting if you need to add or shutdown fans fast on some situations. Last edited by Lare; January 11th, 2021 at 03:33 PM. |
![]() |
![]() |
#4 | |
Member
![]() ![]() Join Date: Oct 2020
Location: Colorado Springs
Posts: 5
|
Quote:
That's why I was thinking bit shift. 4 bits, 1000 =F1, 0100 =F2, 0010 =F3, 0001 =F4 And that works out great for shifting left. Shifting right is where I am getting confused. If F1 is active and Temperature spikes to 100 degrees for 15 minutes, I need to shift that bit right 3 times. Can I just write to that array instead of shifting the bit right? Leave the BSL in place for under 85 degrees then depending on temperature could write to that array? Then use those bits to activate F1-F4 operations? |
|
![]() |
![]() |
#5 |
Member
|
I would use what is used for shop air compressors.
Monitor the runtime hours of each fan, start the lowest hours fan first, then the next lowest as demand increases, up to all 4 on. Program in the ability to turn off each fan for maintenance and take it out of rotation. |
![]() |
![]() |
#6 |
Member
![]() ![]() Join Date: Apr 2020
Location: Davenport, Iowa
Posts: 35
|
I like using compare instruction example:
create rung with compare if greater than say (F4)98 degrees put output coil on. Or another compare with cutoff temp say 85 degress then and coil contact. so if temp above 98(F4)coil on and latched until below 85. You can then use that add timers and additional fans. Just a thought |
![]() |
![]() |
#7 | ||
Lifetime Supporting Member
|
update: whoops, I just realized F1-F4 are the combinations, not the individual fans.
There are five combinations, not four:
Use SQO on array sqo
Quote:
Quote:
Last edited by drbitboy; January 11th, 2021 at 04:45 PM. Reason: fix many typos |
||
![]() |
![]() |
#8 |
Member
![]() ![]() Join Date: Jan 2012
Location: melbourne
Posts: 172
|
@Iandayen do you mean the sequence can go from F1 - F4 within 15 minutes if temperature is above 100 Deg, but when temp drops to below 85 Deg it will take 45 minutes to return to F1 ?
|
![]() |
![]() |
#9 |
Lifetime Supporting Member
|
|
![]() |
![]() |
#10 |
Lifetime Supporting Member
![]() ![]() Join Date: Feb 2011
Location: canuckistan
Posts: 112
|
Could use an off-delay timer to drop out each fan as temperature drops.
|
![]() |
![]() |
#11 |
Lifetime Supporting Member
|
SQO has one flaw when paired with SQI, there must be a false to true transition of the input pattern before it will advance. It also needs to be very well thought out and designed and documented to be most effective. I have come across SQO applications that have had logic strapped onto them inappropriately turning them into a troubleshooting nightmare.
If a sequence has a lot of steps and typically they go in order, then it can be a good programming technique however I prefer to use MEQ MVM pair so I can advance without the required transition and have external control over the step number which is integrated into the SQI/SQO instruction. In sequences with complex input patterns required for each step, the bit sequencer style can create diagnostics which can make visualization and alarms very nice. For this application, I would probably use state logic where you can step forward and backward with logic that is easier to follow on screen. There are not very many conditions and not very many states. I would name the patterns P1 through P4 so they don't get confused with the actual fan numbers, and then map the patterns to the actual fans separately from the state engine.
__________________
You can choose a ready guide in some celestial voice. If you choose not to decide you still have made a choice. |
![]() |
![]() |
#12 |
Lifetime Supporting Member
|
The false-to-true transition to trigger the next pattern is not a showstopper here, the lack of bi-directional capability is, though. maybe we can write directly to .position? Yeah, MVM can be made into a bi-directional SQO, it's four main rungs and maybe some initialization beyond that. I am not sure if OP wants to spend 15minutes at each Fn, or if they need to ever jump more than combination at at a time. |
![]() |
![]() |
#13 |
Lifetime Supporting Member
|
I would use Lare's method, easier for someone else to follow, and easy to code.
__________________
Certified Siemens Functional Safety Professional, ID: SFSP17010238 https://azr.com/ |
![]() |
![]() |
#14 | |
Lifetime Supporting Member
|
Quote:
I have designed some sequencers with a column for "skip this step" so that I can have, for example, 50 total steps and only use a some of them depending on product assembly selections by toggling the correct bits in that column. I have done a sequencer where I had a parallel array of integers for a "minimum time in step" and another array for a "max time in step", the latter would generate a fault and halt the process if the preset was greater than zero and the sequence failed to advance. So you can get pretty fancy with bit sequencers. Here's a fairly plain example where I think I included the step skipping JMP piece. I haven't looked at this in many years. I probably should so I could assess whether I am getting better at this or on the downhill slide. https://forums.mrplc.com/index.php?/...ric-sequencer/
__________________
You can choose a ready guide in some celestial voice. If you choose not to decide you still have made a choice. Last edited by OkiePC; January 11th, 2021 at 06:16 PM. |
|
![]() |
![]() |
#15 |
Member
![]() ![]() Join Date: Oct 2020
Location: Colorado Springs
Posts: 5
|
Appreciate all the help so far guys, I'm gonna go through and look at some of these after meetings today, thank you!
|
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
RS500 Bit Shift | kjacoby | LIVE PLC Questions And Answers | 5 | February 24th, 2017 07:56 AM |
micrologix bit shift | khewes | LIVE PLC Questions And Answers | 8 | May 27th, 2016 03:43 PM |
installing a panelview 600 + | rjmarinaro | LIVE PLC Questions And Answers | 10 | June 17th, 2008 12:52 PM |
Bit Shift Left (BSL) instruction problem - See attached code | jonb452 | LIVE PLC Questions And Answers | 14 | March 19th, 2008 09:51 AM |
Moving data into a bit shift | josepa | LIVE PLC Questions And Answers | 2 | October 17th, 2006 09:37 AM |