Forward / reverse motor on a PLC (Ladder)

This tutorial moves the relay forward/reverse circuit to a PLC. The PLC reads three buttons and the overload contact, and controls the two contactors K1 (forward) and K2 (reverse). The interlock is written in Ladder, and you will also see why a hardware interlock on the contactors is still needed.

It uses a Siemens S7-1200 in Virtuino Circuits. If you are new to PLCs, do the PLC start/stop tutorial first.

Open the ready-made circuit in the simulator

I/O list

AddressDeviceNote
%I0.0S0 StopNC button, 1 when not pressed
%I0.1S1 ForwardNO button
%I0.2S2 ReverseNO button
%I0.3F2 Overload 95-96NC, 1 when healthy
%Q0.0K1 Forward contactor
%Q0.1K2 Reverse contactor

Wiring

  1. Draw the power circuit exactly as in the relay version: L1 L2 L3, motor protection, K1 straight, K2 with two phases swapped, motor M1.
  2. Place the PLC, choose S7-1200 CPU 1214C, supply it from L1/N, and feed the inputs from 24 V DC (L+ to the buttons, 1M to M).
  3. Wire S0, S1, S2 and the overload contact to inputs .0 to .3.
  4. Outputs: 1L from L1 through a fuse. Output .0 goes to coil K1 and output .1 to coil K2, and each coil returns to N through the NC auxiliary contact of the other contactor: .0 → coil K1 → K2 21-22 → N, and .1 → coil K2 → K1 21-22 → N.
Why interlock in hardware too? The PLC only switches its outputs; it does not know whether a contactor really dropped out. If K1 is welded or mechanically stuck, the PLC program could still energise K2, and two phases would short-circuit. The NC contacts in the coil circuits prevent that whatever the program does. Real panels often also use a mechanically interlocked contactor pair.

Ladder program

 Rung 1 – Forward
      %I0.1         %I0.0   %I0.3   %I0.2   %Q0.1        %Q0.0
 |-----| |----+------| |-----| |-----|/|-----|/|----------( )---|
      %Q0.0   |
 |-----| |----+

 Rung 2 – Reverse
      %I0.2         %I0.0   %I0.3   %I0.1   %Q0.0        %Q0.1
 |-----| |----+------| |-----| |-----|/|-----|/|----------( )---|
      %Q0.1   |
 |-----| |----+
  • Seal-in: each output is held by a NO contact of itself, in parallel with its button.
  • Stop and overload: NO contacts of %I0.0 and %I0.3, because both inputs are 1 when healthy.
  • Software interlock: a NC contact of the other output (%Q0.1 in the forward rung, %Q0.0 in the reverse rung).
  • Button interlock: a NC contact of the other button input (%I0.2 in the forward rung). Pressing both buttons together starts nothing.

Simulate

  1. Press F5 and open the Ladder window. Live power flow is drawn in red.
  2. Click S1: rung 1 conducts, %Q0.0 switches on, K1 pulls in and the motor runs forward.
  3. Click S2: rung 2 stays blocked by the NC contact %Q0.0. Press S0 first, then S2: the motor reverses.
  4. In simulation you can force a PLC output by clicking it on the PLC symbol. Force output .1 while the motor runs forward: the hardware interlock K1 21-22 keeps K2 off. This is exactly the case the hardware interlock is there for.

Variation: reverse only after a pause

Add an off-delay timer TOF named T1 whose input is %Q0.0 OR %Q0.1, with PT = 2 s. Add a NC contact T1 in series with both buttons. After Stop, a new start is possible only when the motor has had 2 s to slow down. Timers are explained in the star-delta PLC tutorial.

Open this circuit in the simulator