DriveLab
Account

TP 1 · Chapter 1

DC motor characterisation and the automatic barrier

PWM speed control from the PLC, a measured speed–duty-cycle curve, and a crank-driven barrier with position switches, vehicle detection and a time-out.

2 sessions of 1 h 30Trainer modules: DC motor, proximity sensor and micro-switchPLC-200 manual exercises: 10-1, 10-2, 10-3

Print QR code

Objectives

  1. Control the speed of a DC motor by pulse-width modulation (PWM) from the PLC.
  2. Measure the motor speed with the proximity sensor and plot the speed–duty-cycle characteristic.
  3. Program an automatic barrier driven by a crank, with position switches, vehicle detection and a movement time-out.
  4. Measure the duty cycle actually imposed on the motor and classify it by the IEC 60034-1 duty types.

Background

A DC motor supplied by PWM sees an average voltage D VdcD\,V_\text{dc}, where DD is the duty cycle, and a permanent-magnet motor turns at a speed roughly proportional to its armature voltage (Chapter 1). The trainer's motor drives a pointer through a reduction gear; the manual warns that the gear makes the speed–duty relation non-linear, and part of this TP is to measure by how much.

Many real barriers are driven by a crank: the motor always turns the same way, one half-turn raises the arm and the next lowers it. On the trainer the DC motor's pointer plays the crank: the proximity sensor marks arm down, the micro-switch arm up.

Bench set-up

SW2 OFFSW3 OFFSW4 OFFSW5 OFFSW6 OFFSW7 OFFSW8 OFFThumbwheel at 0000; do not press the keypad.

With the trainer OFF, connect as in manual Exercise 10-2: TRANSISTOR OUTPUT Q0.0 → M+; M− → 24 V−; micro-switch NO → I1.0 and COM → 24 V+; proximity sensor PS → I1.1. Turn SPEED ADJ fully clockwise so that the PLC alone sets the speed.

AddressSymbolMeaning
I0.0RUN_APart A: motor run switch
I0.1STOP_NCstop, normally closed (ON = healthy)
I0.4LOOP_ENTRYPart B: vehicle detected in front of the barrier (held ON)
I0.5TICKETPart B: valid ticket, momentary
I0.6LOOP_EXITPart B: vehicle under or behind the arm (held ON while present)
I0.7RESETfault reset, momentary
I1.0ARM_UPmicro-switch: pointer at the “arm up” position
I1.1ARM_DOWNproximity sensor: pointer at the “arm down” position
Q0.0MOTORPWM output to M+
Q0.2FAULTfault lamp (CPU LED)

Preparation

  1. Using manual Table 10-1.1, write the control byte SMB67 for PWM on Q0.0 with a 1 ms time base, and the values of SMW68 and SMW70 for a 200 ms period and a 40 % duty cycle.
  2. The pointer passes the proximity sensor once per revolution. If Δt\Delta t (ms) separates two detections, give the speed in rev/min.
  3. Draw the GRAFCET of the barrier of Part B, with at least the steps closed, opening, open, closing and fault.

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)

Timer choice

The S7-200 timer number fixes its type and resolution. Enter a duration to see the preset of every group.

TypeResolutionTimer numbersPreset
TON/TOF1 msT32, T96+1000exact
TON/TOF10 msT33–T36, T97–T100+100exact
TON/TOF100 msT37–T63, T101–T255+10exact
TONR1 msT0, T64+1000exact
TONR10 msT1–T4, T65–T68+100exact
TONR100 msT5–T31, T69–T95+10exact

Part A: speed–duty-cycle characteristic

  1. Program PWM on Q0.0 with a 200 ms period. The pulse width is held in a V-word that you change from the status chart. RUN_A and STOP_NC enable the output.
  2. Measure the time between two detections of the proximity sensor with the 1 ms timer T32: on each rising edge of I1.1, copy the timer value into a V-word and restart the timer. Convert the result to rev/min in the program.
  3. Fill in the table for duty cycles from 0 to 100 %. Note the smallest duty cycle at which the motor starts.
  1. Repeat three points with a 20 ms period (same duty cycles). Listen to the motor and compare the speeds.
Duty cycle (%)0102030405060708090100
Δt\Delta t (ms)
Speed (rev/min)

Part B: automatic barrier

Specification.

  1. At rest the arm is down (ARM_DOWN detected) and the motor is stopped.
  2. When a vehicle is present (LOOP_ENTRY) and a valid ticket is presented (TICKET), the motor turns until ARM_UP. It runs at full speed and changes to 30 % duty cycle for the last part of the movement; use a time measured in Part A, not a guess.
  3. The arm stays up while the vehicle is under it (LOOP_EXIT ON), then closes 2 s after the vehicle has left: the motor turns until ARM_DOWN.
  4. Safety. If a vehicle appears under the arm (LOOP_EXIT ON) while it is closing, the arm must not come down on it: the motor continues to the up position, and the closing cycle restarts once the vehicle has gone.
  5. Time-out. If the expected position is not reached within 1.5 times the normal travel time, the motor stops and FAULT lights. Only RESET clears it.
  6. Count the complete barrier cycles in a counter.

Work.

  1. Program the GRAFCET of your preparation with SCR steps.
  1. Accumulate the time during which the motor is energised with a retentive timer (TONR), and the total elapsed time. Run ten barrier cycles with realistic pauses between vehicles and calculate the cyclic duration factor.

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
PS · I1.1Micro-switch · I1.0Barrier arm (crank)
Duty cycle
0 %
Speed
0.0 rpm
C0
0
Pull a lead

No errors: the program compiles.

SIMATIC S7-200 · CPU 224SFRUNSTOP
I1.0MICROsensor
I1.1PROXsensor
Q0.0MOTOR0
Timet = 0.00 s · 0 scans

The motor turns at about 1 rev/s at full duty, not at all below about 12 % (friction), and ripples with a long PWM period. PS sees the pointer at 0°, the micro-switch at 180°: a crank lifts the barrier arm between them.

Fault-injection tests

TestSafe reaction requiredObserved
Pull the I1.0 lead while the arm is opening (broken limit switch)motor stops at the time-out, FAULT lit
A vehicle arrives under the arm while it is closingthe arm goes up; it does not stop on the vehicle
STOP opened during a movementmotor stops immediately; no restart without a new command
Ticket presented with no vehicle presentnothing happens

Questions

  1. Plot speed against duty cycle. Where does the curve leave a straight line, and what causes the dead zone at low duty cycle? Relate it to the friction and load torque of Chapter 1.
  2. Compare the 200 ms and 20 ms PWM periods. Why do industrial drives switch at several kilohertz?
  3. From your measured on-time and cycle time, what is the cyclic duration factor of the barrier motor? Which IEC 60034-1 duty type describes it, and what would you write on the motor order?
  4. Why is a movement time-out indispensable when a limit switch is the only proof that a movement has finished?

Group report