Studio 5000 3 floor elevator

Join Date
Nov 2022
Location
Canada
Posts
9
Hey guys ,

I have included a couple attachments here , one of what I was supposed to come up with a program and the program I came up with. Does it look like it will work?

79A13298-07AA-44E9-8842-EE547F232DBE.jpg BB338839-C7DC-474B-9DD9-1699959D09B1.jpg
 
Hard to say, as that's only four rungs out of at least twenty-one; try printing the whole thing a PDF and posting that.

It looks well put together, not much redundancy or extra complexity.

Per-rung comments would be nice, i.e. the purpose of each rung.

Rungs 0017 and 0018 seem to work well together, closing the door 5s after it opens i.e. after it activates the [open Door Limit Switch].

On Rung 0017, the [NXB XIC B3:0/12 BND] could be replaced by [NXB XIC T4:0.EN BND], and the [NXB OTE B3/12 BND] could be dropped; that reduces complexity but is not a necessary functional change.

On Rung 0019, it looks like there is a delay [TON T4:1 1.0 10 0] between the door closing and some other event such as starting the motors, but that TON will also start timing when the elevator first arrives, and stops, at any floor.

Are the three Floor PBs the buttons inside the elevator to request the elevator to move to another floor, or are they the external call buttons, one on each floor, to call the elevator?
_
 
Last edited:
Also, putting the Start/Seal-In BST/BND condition on the left, and the not-Stop condition on the right, makes it easier and quicker to read and grok the Start/Stop Circuit pattern, at least for me, but that is purely a style issue that has nothing to do with function, and not everyone uses the that convention.
_
 
Last edited:
Why didn't you show rungs 0 - 16? The door will reclose five seconds after it reaches the opened limit switch. What caused the door to open in the first place? Rungs 19 and 20 don't do anything, unless T4:1/DN and B3:0/15 are referenced in rungs 0 - 16.
 
Forum expert @James Mcquade has put together a a most excellent and useful recipe for writing applications; that recipe can be adapted widely, from homework assignments to real-world tasks: https://www.plctalk.net/qanda/showthread.php?p=907619#post907619

The key things to understand are

  • All computer programs are models of a real-world process. The program will read inputs, write outputs, and both read, write and maintain internal model state variables.
  • PLC programs are about time.
    • What they do (roughly) is
      • read inputs from physical devices first
      • then execute one scan cycle using those inputs, plus any time-persistent internal state variables and previous output values, to calculate what the outputs and internal model state values should be based on the logic being executed i.e. at end of this scan
      • finally write outputs to physical device
    • PLCs then repeat that cycle again and again over time.
      • The start of each cycle is a new one, with potentially different inputs, outputs, and state model values from the start of the previous cycle.
    • Understanding the scan cycle is crucial; if you have not yet watched @Ron Beaufort's PLC boot camp video series (here), you are wasting your time and will likely flounder in ignorance for quite some time. Watch it and memorize it, or stop wasting your time and move on to summat else in your life.
Here is one approach using relay logic almost exclusively. It is broken into several steps, plus an input output map to move internal states to the physical outputs. The steps correspond roughly to states of the system and the limited and pre-defined transitions between them.

Since this is done with relays, there is no specific place where it says "this is state X;" rather the states are defined by specific combinations of sets of persistent boolean values. That persistence is maintained by using several Start/Stop Circuit patterns i.e. Latch circuits, so that could also be done with Latch/Unlatch (OTL/OTU; Set/Reset) instructions.

Because it is essentially at step-sequence/state-machine approach, it might be cleaner to code it that way explicitly. The improvement would be that, instead of a series of interlocks (e.g. door closed AND current floor not at chosen floor OR ...) defining the steps, there would be an explicit state variable, with specific values and pre-defined transitions between them, that can be translated to step directly and used to control the outputs i.e. summat like this:


  • State 0: elevator car is at any floor with the door fully open, no other floor has been chosen yet
    • Transition to State 10 when choose-floor button is pressed
  • State 10: waits 2s to start closing car door
    • Transition to State 20 when 2s wait expires
  • State 20: turn on motor to close door
    • Transition to State 30 when door-closed limit switch is active
  • State 30: turn off motor that was closing door
    • Transition to State 100 immediately
  • State 100: turn on up or down motor
    • Transition to State 110 when chosen floor is reached
  • State 110: turn off up or down motor, clear chosen floor
    • Transition to State 200 immediately
  • State 200: wait 1s to start opening car door
    • Transition to State 210 when 1s wait expires
  • State 210: turn on motor to open door
    • Transition to State 220 when door-open limit switch is activated
  • State 220: turn off motor to open door
    • Transition to State 0 immediately
There would also need to be logic to handle the the Enable switch, determine state when the PLC enters Run mode, etc., but I think such a state-machine approach would read much cleaner and be easier to debug.

@Baconcrunchwrap, my strong suggestion, to get the most learning and advancement of your skills out of this elevator exercise, would be to program it both ways, and even more ways if you can think of them e.g. OTL/OTU pairs instead of Start/Stop Circuits.



The overall program simply calls each section.
000_main.png
001_composites.png
002_chewslogic.png
003_door_logic.png
004_up_down_motor_logic.png
 
here is one approach using relay logic almost exclusively. It is broken into several steps, plus an input output map to move internal states to the physical outputs. The steps correspond roughly to states of the system and the limited and pre-defined transitions between them....
The overall program simply calls each section.
I forgot to annotate the code sections:

At the "run program" step of the scan cycle (refer to @Ron Beaufort's boot camp video series), the PLC calls MAIN Program File View attachment 63584, which in turn simply calls the other Program Files in sequence. Remember that the "run program" step is something that happens at repeated and discrete times, at a frequency of at least 10Hz, and typically between 100Hz-1kHz. The entire program starts over and executes the logic on the rungs, left-to-right and top-to-bottom, but with a new (i.e in time) set of inputs on each execution.

The COMPOSITES Program File View attachment 63580 creates some composite or compound booleans out of atomic booleans, which simplifies the logic in the business logic of the other Program Files. It also keeps track of the last floor visited by the elevator car, which is necessary to know which motor, up or down, to use to get to the middle of the three floors; note the use of the Start/Stop Circuit pattern.

The CHEWSLOGIC (Choose Logic) Program File View attachment 63581 responds to the push buttons that choose the floor. Note again the use of Start/Stop pattern.

The DOOR_LOGIC Program File View attachment 63582 controls the motors that open and close the elevator car doors. Note for a third time the use of the Start/Stop pattern

The MOTORLOGIC Program File View attachment 63583 controls the motors that move the elevator car up or down. They do not need the full Start/Stop pattern, specifically they don't need the Seal-in branch, because the condition(s) that cause the motor to run are True until the motor should stop. Now that I look at it again, I think the middle contact on the door-closed limit switch, [XIC IN_DOOR_IS_CLOSED_LS], that would seem to there to stop the motor when the door opens, is probably unnecessary. Although, if someone forced the door open between floors then its presence would be a nice safety feature, if such features did not have to be hardwired to be safety-related.

Finally, there is one more useful pattern, the Process Simulation pattern, that many programmers keep in their toolbox. Note that all of the business logic of the program operates on internal memory (N- and B-files), and it is the the INPUT_MAP and OUTPUT_MAP Program Files that transfer between that the physical I/O. There are several advantages to that, which has been discussed elsewhere on this forum and also here. One useful feature, especially during code development, is that the I/O maps make it easy to integrate a process simulation to emulate the behavior of the physical system: you can write the code and do some pre-FAT (Factory Acceptance Test) exercising of the business logic without any (elevator) hardware at all; with a PLC emulator (e.g. RSEmulate 500), you don't even need the PLC hardware. The simulation does not have to be overly complex; again, there is a design choice of the level of fidelity necessary to do the job. But the Simulation pattern can save a lot of time while the coder is still at the keyboard, by not having to waste time running up and down stairs to manually trigger a limit switch or some such to debug the logic.
 
Last edited:
drbitboy,
thanks for the compliment.

Baconcrunchwrap,
i am not sure about the rules in Your local area, but i am going to ask.

1. what type of elevator is this application?
freight elevator, human passenger elevator, or both?

i would check your local codes !
if people are to travel on the elevator, i do not believe a plc is allowed.
it must be redundant relay controls.
but, that was years ago.
You will still need safety, engineering, and maintenance to do a risk assessment. if it falls, questions will be asked and you will need the answers.
regards,
james
 
my apologies to all, i was on a quick break and did not notice the number of posts and also unaware this is a homework assignment.

i was asked many years ago to do this exact job for a customer.
we looked into the requirements and passed on the job.
regards,
james
 
James is correct, it is unlikely that a PLC will have the required approval as we have already said that positive guided relays are a must even with modern controls (Microprocessor controlled), a couple of years ago I helped install new controls in existing lifts with the supplier engineer.
I know this is just an assignment but a few things come to mind, it is not mentioned & I have not looked at the codes posted in detail but there is no mention of up & down buttons in any system that has more than two floors the intermediate floors will need two call buttons i.e. up or down.
Also if someone was to call a floor from an intermediate floor then if the lift was travelling up & they wanted down & the original call was to a floor above then it will not stop until it has reached the floor above, then travel down to the calling floor, in other words, if travelling up & a down floor is required, it will go to the first selected floor.
 

Similar Topics

Hello Friends, I am working on a new project to add in a NU-EP1 from Keyence to a 5069-L306ERS2. The EDS file registration goes just fine with no...
Replies
0
Views
27
As the title says, all of the client HMIs at the plant freeze up for about 5-10 minutes everytime I or a vendor make new routines or new tags in...
Replies
4
Views
60
I'm trying to compare strings in Studio 5000 on an Allen Bradley 1769-L33ER and came across this weird incorrect string comparison. Neither of the...
Replies
10
Views
240
Hello everyone, I'm new here, I hope someone can help me. I've been trying to install EDS files to my Studio 5000 with the EDS tool installer but...
Replies
3
Views
140
Hi Everyone, I am facing an issue while installing the STUDIO 5000 in my windows 10 PC. During installation I am getting an error that " Error...
Replies
4
Views
212
Back
Top Bottom