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.
On this page
Objectives
- Control the speed of a DC motor by pulse-width modulation (PWM) from the PLC.
- Measure the motor speed with the proximity sensor and plot the speed–duty-cycle characteristic.
- Program an automatic barrier driven by a crank, with position switches, vehicle detection and a movement time-out.
- 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 , where 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
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.
| Address | Symbol | Meaning |
|---|---|---|
| I0.0 | RUN_A | Part A: motor run switch |
| I0.1 | STOP_NC | stop, normally closed (ON = healthy) |
| I0.4 | LOOP_ENTRY | Part B: vehicle detected in front of the barrier (held ON) |
| I0.5 | TICKET | Part B: valid ticket, momentary |
| I0.6 | LOOP_EXIT | Part B: vehicle under or behind the arm (held ON while present) |
| I0.7 | RESET | fault reset, momentary |
| I1.0 | ARM_UP | micro-switch: pointer at the “arm up” position |
| I1.1 | ARM_DOWN | proximity sensor: pointer at the “arm down” position |
| Q0.0 | MOTOR | PWM output to M+ |
| Q0.2 | FAULT | fault lamp (CPU LED) |
Preparation
- 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.
- The pointer passes the proximity sensor once per revolution. If (ms) separates two detections, give the speed in rev/min.
- 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.
| Type | Resolution | Timer numbers | Preset | |
|---|---|---|---|---|
| TON/TOF | 1 ms | T32, T96 | +1000 | exact |
| TON/TOF | 10 ms | T33–T36, T97–T100 | +100 | exact |
| TON/TOF | 100 ms | T37–T63, T101–T255 | +10 | exact |
| TONR | 1 ms | T0, T64 | +1000 | exact |
| TONR | 10 ms | T1–T4, T65–T68 | +100 | exact |
| TONR | 100 ms | T5–T31, T69–T95 | +10 | exact |
Part A: speed–duty-cycle characteristic
- 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.
- 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.
- Fill in the table for duty cycles from 0 to 100 %. Note the smallest duty cycle at which the motor starts.
- Repeat three points with a 20 ms period (same duty cycles). Listen to the motor and compare the speeds.
| Duty cycle (%) | 0 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| (ms) | |||||||||||
| Speed (rev/min) |
Part B: automatic barrier
Specification.
- At rest the arm is down (ARM_DOWN detected) and the motor is stopped.
- 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.
- 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.
- 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.
- 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.
- Count the complete barrier cycles in a counter.
Work.
- Program the GRAFCET of your preparation with SCR steps.
- 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.
- Duty cycle
- 0 %
- Speed
- 0.0 rpm
- C0
- 0
No errors: the program compiles.
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
| Test | Safe reaction required | Observed |
|---|---|---|
| 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 closing | the arm goes up; it does not stop on the vehicle | |
| STOP opened during a movement | motor stops immediately; no restart without a new command | |
| Ticket presented with no vehicle present | nothing happens |
Questions
- 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.
- Compare the 200 ms and 20 ms PWM periods. Why do industrial drives switch at several kilohertz?
- 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?
- Why is a movement time-out indispensable when a limit switch is the only proof that a movement has finished?
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…