You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old January 11th, 2021, 02:47 PM   #1
Iandayen
Member
United States

Iandayen is offline
 
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?
  Reply With Quote
Old January 11th, 2021, 03:09 PM   #2
ghriver
Member
United States

ghriver is offline
 
ghriver's Avatar
 
Join Date: Aug 2002
Location: Earth>North America>US>CA>Hanford
Posts: 63
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.
  Reply With Quote
Old January 11th, 2021, 03:28 PM   #3
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,602
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.
  Reply With Quote
Old January 11th, 2021, 03:36 PM   #4
Iandayen
Member
United States

Iandayen is offline
 
Join Date: Oct 2020
Location: Colorado Springs
Posts: 5
Quote:
What about F1 operation? - does the temperature have to be under 85 for a further 15 minutes after dropping to F2 operation before F1 become active?
Yes, F1 operation happens if under 85 degrees and F2, F3, F4 are all inactive.

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?
  Reply With Quote
Old January 11th, 2021, 03:42 PM   #5
I_Automation
Member
United States

I_Automation is offline
 
I_Automation's Avatar
 
Join Date: Jun 2020
Location: Detroit, Michigan USA
Posts: 529
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.
  Reply With Quote
Old January 11th, 2021, 03:47 PM   #6
AkaHammer
Member
United States

AkaHammer is offline
 
Join Date: Apr 2020
Location: Davenport, Iowa
Posts: 52
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
  Reply With Quote
Old January 11th, 2021, 03:58 PM   #7
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,554
update: whoops, I just realized F1-F4 are the combinations, not the individual fans.

There are five combinations, not four:
  • Add F1.5 which is all fans off.
three INTs: fnum; losp, hisp (high setpoint).

Use SQO on array sqo
  • sqo[0] = F1
  • sqo[1] = F1.5 = 0
  • sqo[2] = F2
  • sqo[3] = F3
  • sql[4] = F4
two TONs: next_timer_up; next_timer_down
  • next_timer_up is fed by rung output of [GEQ temperature hisp] AND [GRT temperature hisp]
  • next_timer_up.PRE = 900k ms (or equivalent)
  • next_timer_down is fed by rung output of [LES temperatue losp] AND [LEQ temperature losp]
  • next_timer_down.PRE = 900k ms
when next_timer_up.DN is 1, it triggers a few events:
  • reset of next_timer_up
  • SQO (add 1 to .position; I forget how SQO works)
  • MOV hisp losp
  • ADD hisp 5 hisp
  • EQU hisp 100 MOV 98 hisp
when next_timer_down.DN is 1, it triggers:
  • reset of next_timer_down
  • SQO (subtract 1 to position)
  • MOV losp hisp
  • SUB losp 5 losp
  • EQU losp 93 MOV 95 losp
update II: initialize SQO to sqo[0], losp to 85; hisp to 90; we may need to tweak the setpoints by 1 so LEQ and GRT will work i.e.


Quote:
F1 Active below 85 Degrees
F2 Active above 90 Degrees
F3 Active above 95 Degrees
F4 Active above 98 Degrees
is the same as
Quote:
F1 Active above 79 Degrees <= not literal; next_timer_down will not be running when losp is 79
F1.5 Active above 84 Degrees <= requires special handling
F2 Active above 90 Degrees
F3 Active above 95 Degrees
F4 Active above 98 Degrees <= requires special handling

Last edited by drbitboy; January 11th, 2021 at 04:45 PM. Reason: fix many typos
  Reply With Quote
Old January 11th, 2021, 04:23 PM   #8
chelton
Member
Australia

chelton is offline
 
Join Date: Jan 2012
Location: melbourne
Posts: 184
@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 ?
  Reply With Quote
Old January 11th, 2021, 05:01 PM   #9
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,554
Quote:
Originally Posted by drbitboy View Post
update: whoops, I just realized F1-F4 are the combinations, not the individual fans. ...



never mind, I think SQO only goes in one direction.
  Reply With Quote
Old January 11th, 2021, 05:10 PM   #10
Robb B
Lifetime Supporting Member
Canada

Robb B is offline
 
Join Date: Feb 2011
Location: BC, Canuckistan
Posts: 151
Could use an off-delay timer to drop out each fan as temperature drops.
  Reply With Quote
Old January 11th, 2021, 05:14 PM   #11
OkiePC
Lifetime Supporting Member
United States

OkiePC is online now
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 10,914
Quote:
Originally Posted by drbitboy View Post
never mind, I think SQO only goes in one direction.
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.
  Reply With Quote
Old January 11th, 2021, 05:50 PM   #12
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,554
Quote:
Originally Posted by OkiePC View Post
SQO...

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?


Quote:
Originally Posted by OkiePC View Post
I prefer to use MEQ MVM...

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.
  Reply With Quote
Old January 11th, 2021, 06:04 PM   #13
Ken Moore
Lifetime Supporting Member
United States

Ken Moore is offline
 
Ken Moore's Avatar
 
Join Date: May 2004
Location: North, West, South Carolina
Posts: 3,040
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/
  Reply With Quote
Old January 11th, 2021, 06:09 PM   #14
OkiePC
Lifetime Supporting Member
United States

OkiePC is online now
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 10,914
Quote:
Originally Posted by drbitboy View Post
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.
A full blown bit sequencer with input mapping and diagnostics is severe overkill for this job.

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.
  Reply With Quote
Old January 11th, 2021, 06:38 PM   #15
Iandayen
Member
United States

Iandayen is offline
 
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!
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
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


All times are GMT -4. The time now is 10:03 AM.


.