DriveLab
Account

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.

3 sessions of 1 h 30Trainer modules: stepper motor, encoder, 7-segment displayPLC-200 manual exercises: 7-1, 7-3, 7-4, 6-1, 5-2

Print QR code

Objectives

  1. Position an elevator car driven by a stepper motor, with acceleration and deceleration ramps generated by the PLC's pulse-train output.
  2. Check the position independently with an incremental encoder and detect lost steps.
  3. Program the door interlocks and the safety chain of Chapter 3, and prove that opening any contact stops the car.
  4. 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

SW2 ONSW3 OFFSW4 OFFSW5 OFFSW6 OFFSW7 OFFSW8 ONThumbwheel at 0000; do not press the keypad.

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).

AddressSymbolMeaning
I0.0ENC_Aencoder phase A (HSC0)
I0.1ENC_Bencoder phase B (HSC0)
I0.2CALL_0call button, floor 0, momentary
I0.3CALL_1call button, floor 1, momentary
I0.4CALL_2call button, floor 2, momentary
I0.5CALL_3call button, floor 3, momentary
I0.6CAR_DOORcar door closed and locked (ON = closed)
I0.7LANDING_DOORSall landing doors locked (ON = locked)
I1.0PIT_STOP_NCpit stop switch, normally closed (ON = healthy)
I1.1GOVERNOR_NCoverspeed governor contact, normally closed (ON = healthy)
I1.2INSPECTIONinspection mode (slow, hold-to-run)
I1.3RESETfault reset, momentary
I1.4LEVEL_0ground-floor levelling switch, used for homing, momentary
Q0.0DIRstepper direction (ON = up)
Q0.1CKstepper 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

  1. Calculate the position in steps of each floor, and the number of steps between floor 0 and floor 3.
  2. 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.
  3. 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.
  4. 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)PulsesStart cycle (µs)Δ per pulse (µs)Last pulse (Hz)Time (s)
120000050.01.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

  1. 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.
  1. 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.
  2. 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.
  3. 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.
  1. 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.
  2. 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.
  3. 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.
FromToPulsesEncoderTime (s)Remarks
01
13
30
02

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.

Virtual PLC-200 bench: stepper, encoder and DC motor
Stepper · 7.5°Encoder · 60 p/rev
PTO frequency
0.0 Hz
Pulses sent
0
Position (steps)
0 (0.00 rev)
Steps lost
0
HC0
0
Pull a lead

No errors: the program compiles.

SIMATIC S7-200 · CPU 224SFRUNSTOP
I0.0 sensor
I0.1 sensor
Q0.0DIR0
Q0.1CK0
Timet = 0.00 s · 0 scans

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

TestSafe reaction requiredObserved
Open the car door (I0.6 OFF) during a tripimmediate stop, code 01, no restart before reset
Governor contact broken (I1.1 OFF) during a tripimmediate stop, code 02
Call pressed with a landing door unlockedcall refused, the car does not move
Raise the cruise frequency until the stepper stallscode 03 at the end of the trip
Reset pressed while a door is still openthe fault stays; the car does not move

Questions

  1. 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?
  2. 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?
  3. 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?
  4. 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