TP 3 · Chapter 3
Four-floor elevator
A stepper-driven car with PTO acceleration ramps, encoder position check, door interlocks and safety chain, structured as a GRAFCET with SCR steps.
On this page
Objectives
- Position an elevator car driven by a stepper motor, with acceleration and deceleration ramps generated by the PLC's pulse-train output.
- Check the position independently with an incremental encoder and detect lost steps.
- Program the door interlocks and the safety chain of Chapter 3, and prove that opening any contact stops the car.
- Structure the control as a GRAFCET implemented with sequential control relays.
Background
A traction elevator must stop level with the floor, accelerate and decelerate within the comfort limits of Chapter 3, and never move with a door open or a safety contact broken. On the trainer the stepper motor plays the traction machine: 96 steps (two revolutions) make one floor, and floor 0 is the ground floor. Because a stepper can lose steps without the controller knowing, the encoder, which gives one pulse per motor step, checks the position.
The S7-200 pulse-train output (PTO) on Q0.1 can generate a multi-segment profile: a list of segments, each with a start cycle time, a fixed change per pulse and a number of pulses. Three segments (acceleration, constant speed, deceleration) give the trapezoidal profile; more segments approach the jerk-limited S-curve of Chapter 3.
Bench set-up
With the trainer OFF, connect as in manual Exercise 7-3: TRANSISTOR OUTPUT Q0.0 → STEP MOTOR DIR, Q0.1 → STEP MOTOR CK, ENCODER A → I0.0, ENCODER B → I0.1. Q0.2–Q1.1 drive the 7-segment display (BCD data and digit latches).
| Address | Symbol | Meaning |
|---|---|---|
| I0.0 | ENC_A | encoder phase A (HSC0) |
| I0.1 | ENC_B | encoder phase B (HSC0) |
| I0.2 | CALL_0 | call button, floor 0, momentary |
| I0.3 | CALL_1 | call button, floor 1, momentary |
| I0.4 | CALL_2 | call button, floor 2, momentary |
| I0.5 | CALL_3 | call button, floor 3, momentary |
| I0.6 | CAR_DOOR | car door closed and locked (ON = closed) |
| I0.7 | LANDING_DOORS | all landing doors locked (ON = locked) |
| I1.0 | PIT_STOP_NC | pit stop switch, normally closed (ON = healthy) |
| I1.1 | GOVERNOR_NC | overspeed governor contact, normally closed (ON = healthy) |
| I1.2 | INSPECTION | inspection mode (slow, hold-to-run) |
| I1.3 | RESET | fault reset, momentary |
| I1.4 | LEVEL_0 | ground-floor levelling switch, used for homing, momentary |
| Q0.0 | DIR | stepper direction (ON = up) |
| Q0.1 | CK | stepper clock, PTO1 |
High-speed counter. Define HSC0 in mode 9 (A/B phase counter without reset input). Mode 10, used in the manual, reserves I0.2 as a reset input and would take CALL_0 away.
Preparation
- Calculate the position in steps of each floor, and the number of steps between floor 0 and floor 3.
- Design a three-segment PTO profile for a one-floor trip: acceleration from 20 Hz to 100 Hz, constant speed, deceleration to 20 Hz. Choose the number of pulses of each segment, then compute the cycle time (µs) at the start of each segment and the travel time. Check the frequencies against those of manual Exercise 7-1.
- Draw the GRAFCET of the elevator with at least the steps homing, idle at floor, doors check, travel, arrival check and fault. Write the transition conditions.
- Write the safety-chain condition as a single Boolean expression.
Multi-segment PTO profile
Each segment starts at a cycle time and changes it by a fixed number of µs per pulse. Enter the frequencies and pulse counts of your segments; the tool gives the table values and the travel time.
| # | Start (Hz) | End (Hz) | Pulses | Start cycle (µs) | Δ per pulse (µs) | Last pulse (Hz) | Time (s) | |
|---|---|---|---|---|---|---|---|---|
| 1 | 20000 | 0 | 50.0 | 1.920 |
96 pulses · 1.920 s
MOVB 1, VB500 MOVW +20000, VW501 MOVW +0, VW503 MOVD +96, VD505
The frequency does not change linearly: the cycle time does. Word values above +32767 are written in hexadecimal (16#…). Check the table layout against the manual before you use it.
Control byte
Tick the bits you need; the value to move into the control byte appears below. Check each bit against the manual (Table 10-1.1).
MOVB 16#00, SMB67 (2#00000000 = 0)
Procedure
- Stepper and encoder. Program a single-segment PTO of 96 pulses at 50 Hz (manual Exercise 7-1) and HSC0 in mode 9. After each move, compare the pulses commanded with the encoder count; record five moves in each direction.
- Floor display. Show the current floor on the right-hand digit and a fault code on the two left-hand digits (00 when there is no fault), with the method of manual Exercise 6-1. The display decodes BCD, so it shows only 0 to 9: fault codes are numbers.
- Homing. After power-up the car position is unknown. In the homing step the car moves down slowly until LEVEL_0 operates; the program then resets the encoder count to 0.
- Travel. Program the elevator GRAFCET with SCR steps. A call is accepted only in idle. The car travels with the multi-segment profile of your preparation, in the right direction and for the right number of floors: the profile table is rewritten with the constant-speed pulse count of each trip.
- Door and safety interlocks. The car may start only if the car door and the landing doors are closed and the safety chain is healthy. If any of them opens during travel, the pulse train stops at once (PTO disabled), the car is considered braked, and fault code 01 (doors) or 02 (safety chain) is displayed until RESET.
- Lost steps. At the end of every trip, compare the encoder count with the expected floor position. A difference of more than 2 steps gives fault 03 (re-levelling required) and forces a new homing.
- Inspection mode. With INSPECTION ON, calls are ignored and the car moves at 20 Hz only while a button is held: CALL_3 up, CALL_0 down.
| From | To | Pulses | Encoder | Time (s) | Remarks |
|---|---|---|---|---|---|
| 0 | 1 | ||||
| 1 | 3 | ||||
| 3 | 0 | ||||
| 0 | 2 |
Rehearse on the virtual bench
Test your program before the session: paste or open your exported .awl, choose the wiring of this TP, and run the procedure and the fault-injection tests on the simulated trainer.
- PTO frequency
- 0.0 Hz
- Pulses sent
- 0
- Position (steps)
- 0 (0.00 rev)
- Steps lost
- 0
- HC0
- 0
No errors: the program compiles.
A stepper cannot start above about 120 Hz, nor follow a frequency that changes too fast: it stalls and loses every step until the pulses stop. The encoder shows what really moved. HSC0 in A/B mode counts 4 per pulse unless SM37.2 selects 1×.
Fault-injection tests
| Test | Safe reaction required | Observed |
|---|---|---|
| Open the car door (I0.6 OFF) during a trip | immediate stop, code 01, no restart before reset | |
| Governor contact broken (I1.1 OFF) during a trip | immediate stop, code 02 | |
| Call pressed with a landing door unlocked | call refused, the car does not move | |
| Raise the cruise frequency until the stepper stalls | code 03 at the end of the trip | |
| Reset pressed while a door is still open | the fault stays; the car does not move |
Questions
- Measure the travel time of a one-floor trip with the trapezoidal profile, then with a profile of the same peak frequency whose acceleration is split into three segments of increasing slope. How does the time change, and which is closer to the jerk-limited S-curve of Chapter 3?
- Why is the encoder necessary although the stepper “knows” how many steps it was given? What would happen after a lost step if the program trusted the pulse count alone?
- A bypassed door contact is a dangerous failure (Chapter 3, TD Exercise 3.3). Can your program detect it? Which additional input would a real safety relay use?
- On the trainer the car has no mass. Using the elevator-trip simulation of Chapter 3, explain in which trips a real traction drive would return energy to the supply.
Group report
One report per group, handed in here. Groups are 2 or 3 students; working alone or in a group of 4 needs your teacher's agreement. Everyone edits the same report, each member signs off what they did, then any member hands it in.
Loading…