Motors, Drives and PID Control

Motor starter circuits, variable frequency drive control, and PID set-up and tuning.

Motor starter circuits

A standard across-the-line (direct-on-line) starter has a power circuit that carries the motor current (a breaker or fuses, a contactor and an overload relay) and a control circuit at a low voltage that operates the contactor’s coil. The PLC sits in the control circuit: its output enables the coil, and it reads status back. The emergency stop is wired in the coil circuit in hardware.

Power circuit (three-phase)Control circuit (24 V DC)L1L2L3Breaker / fusesContactor KM1power contactsOverload F2trip current setMmotor (3~)+24 V0 VE-stop (NC), hardwiredPLC output contact Q0.0 (NO)relay or interposing relayOverload F2 (NC)KM1contactor coilPLC input I0.2Overload_OK: true whilethe NC contact is closedThe PLC output only enables the coil. The e-stop breaks the coil circuit by itself,so the motor stops even if the PLC or its program fails.
Power and control circuits of a direct-on-line starter. The e-stop breaks the coil circuit by itself; the PLC output only enables it.
  • Breaker or fuses protect the wiring against short circuits; they are sized for the starting current, not the running current.
  • Contactor makes and breaks the motor current. Pick it by the motor’s AC-3 duty rating (starting and stopping a running motor) at the voltage.
  • Overload relay protects the motor from sustained overload; set it to the motor’s full-load current from the nameplate (some codes allow up to 115–125 % for service factor motors).
  • Control power. The PLC output drives the contactor coil, or an interposing relay if the coil draws more than the output can handle, and a suppressor is fitted across the coil.
  • Feedback. An auxiliary contact on the contactor or a current sensor tells the PLC that the motor is really running.
  • Two-wire and three-wire control. A two-wire circuit holds a contact closed to run (a switch or a PLC output); a three-wire circuit uses momentary Start and Stop and a seal-in, so that the motor does not restart by itself when power returns.

Worked example: current and overload for a 7.5 kW motor at 400 V

  • Full-load current: I = P ÷ (√3 × V × η × pf) = 7 500 ÷ (1.732 × 400 × 0.90 × 0.85) = 14.2 A.
  • Set the overload to the nameplate current, about 14.2 A (check the nameplate: it overrides this estimate).
  • Direct-on-line starting current is about 6–8 times the full-load current, 85 to 113 A, for a second or two. The breaker and fuses must allow that, and the supply must tolerate the dip.

Types of starter

StarterHow it worksStarting currentUse for
Direct-on-line (DOL)Full voltage through a contactor6–8 × full load; full torque joltSmall and medium motors where the supply can take it
Star-deltaStarts in star (a third of the starting current), then switches to deltaAbout 2–2.5 × full loadUnloaded or low-torque starts, such as fans and pumps
Soft starterThyristors ramp the voltageAdjustable, typically 2–4 × full loadPumps, conveyors, fans where smooth starting matters; no speed control
Variable frequency drive (VFD)Converts to a variable voltage and frequencyAbout 1–1.5 × full loadSpeed control, energy saving on pumps and fans, controlled torque
Servo drivePrecise torque, speed and position controlControlledMotion and positioning; see Motion Control

Controlling a VFD from a PLC

PLCQ0.0 digital outrun commandQ0.1 digital outfault resetAQ0 analog outspeed 0–10 VAI0 analog inspeed feedbackI0.5 digital indrive faultVFDDI1 runDI2 resetAI1 speed referenceAO1 speed signalRO1 fault relayEthernet / Modbus RTUor control and speed over the network instead of wiresL1 L2 L3three-phase supplyU V WMmotor (shielded cable)
A PLC controlling a VFD with digital outputs, an analog speed reference, a fault relay and optional network control.
SignalDirectionNotes
Run / stop (digital)PLC to driveA digital input on the drive set to run forward; a second for reverse or a direction input
Fault reset (digital)PLC to driveA pulse clears a trip when the cause is gone
Speed reference (analog)PLC to drive0–10 V or 4–20 mA scaled to the drive’s minimum and maximum frequency
Speed or current feedback (analog)Drive to PLCA 0–10 V or 4–20 mA output showing speed or load
Fault relay (digital)Drive to PLCWire normally closed so that a power loss or a trip is seen
Network (Modbus, EtherNet/IP, PROFINET)Both waysControl word, status word, speed reference and actual speed over one cable, plus parameters and diagnostics

Worked example: setting 45 Hz from a 0–10 V analog output

  • The drive is set so that 0 V = 0 Hz and 10 V = 60 Hz, and the PLC analog output card produces 0–10 V from 0–27 648 counts.
  • For 45 Hz the fraction is 45 ÷ 60 = 0.75, so the PLC writes 0.75 × 27 648 = 20 736 counts, which is 7.5 V.
  • A 4-pole motor at 45 Hz runs at about 120 × 45 ÷ 4 = 1 350 rpm synchronous (a little less under load).
  • In structured text: AO_Speed := REAL_TO_INT(Speed_Hz / 60.0 * 27648.0); with the setpoint limited to the allowed range first.
  • Use the network when you can. It saves wiring, gives the drive’s status and faults to the PLC, and allows parameters to be changed remotely. Hardwire a stop or enable (and the safe torque off, STO) for safety.
  • Enable and run are different. Many drives need a hardware enable as well as a run command; check the control logic.
  • Reference limits. Limit the speed reference in the PLC and the drive (minimum and maximum frequency) so that a fault cannot overspeed the machine.

Drive parameters that matter

ParameterWhat it setsTypical start
Motor nameplate dataVoltage, current, frequency, speed, powerEnter exactly from the motor; run auto-tune if available
Minimum and maximum frequencyThe speed limitsMinimum 5–10 Hz for cooling; maximum the motor and process allow
Acceleration and deceleration timeHow fast it rampsStart with 5–20 s; shorter for light loads; long enough to avoid overcurrent and overvoltage trips
Motor overload (electronic thermal)ProtectionSet to the motor current; use a motor thermistor if there is one
Control sourceWhere run and speed come fromTerminals, network or keypad; set to match the PLC wiring
Control modeV/Hz, sensorless vector, closed loopV/Hz for fans and pumps; vector for torque at low speed
Switching frequencyNoise against heat4–8 kHz; higher is quieter but hotter
Safe torque off (STO)Safety functionWired through a safety relay; see PLC Troubleshooting, Safety and Documentation

VFD trouble spots

SymptomLikely causeTry
Overcurrent trip at startAcceleration too fast, locked rotor, wrong motor data, short in the cableLengthen the ramp, check the mechanics, check the data and the cable
Overvoltage trip when stoppingDeceleration too fast for the load’s inertia: the motor regeneratesLengthen the ramp, or add a braking resistor
Analog reference jumpsNoise, unshielded cable, ground loopShield and ground, separate from the motor cable, filter in the drive or PLC
PLC inputs flicker when the drive runsElectrical noise from the motor cableShielded motor cable, separation, ferrites, input filter time
Motor runs hot at low speedFan on the motor shaft is slow; constant torque loadUse an inverter-duty motor or a separate fan
Drive will not runEnable or STO open, wrong control source, fault not resetCheck the status word and the digital input states

PID control: the idea

A PID controller keeps a measurement (the process variable, PV) at a target (the setpoint, SP) by adjusting an output (the control variable, CV), such as a valve position or a heater power. It compares PV with SP every cycle and computes the correction from three terms.

SPsetpointΣ+−errorPID controllerP: Kp × errorI: sums error over timeD: rate of changeCVActuator andprocess(valve, heater, tank)disturbancePVSensor / transmitterThe controller changes CV to make PV equal SP. PV is measured, scaled to engineering units and fed back every cycle.
The loop: the error between setpoint and process variable goes through the PID block to the actuator, and the sensor feeds the measurement back.

CV = Kp × [ e + (1 ÷ Ti) ∫ e dt + Td × de/dt ]    with e = SP − PV

TermReacts toEffectToo much gives
P (proportional, Kp)The present errorBigger error, bigger correction; leaves a steady offsetOscillation
I (integral, Ti)The accumulated error over timeRemoves the offset; a smaller Ti is a stronger integral actionOvershoot and slow oscillation
D (derivative, Td)How fast the error is changingDamps the response and anticipates; sensitive to noiseNoise amplification, jittery output

Worked example: one calculation of the controller

  • With Kp = 2.0, Ti = 10 s, a 100 ms update, and an error of 5.0 % of range:
  • The proportional term is Kp × e = 2.0 × 5.0 = 10.0 % of output.
  • In each update the integral term adds Kp × e × dt ÷ Ti = 2.0 × 5.0 × 0.1 ÷ 10 = 0.10 %, so a constant 5 % error pushes the output up by 1.0 % per second until the error is removed.
  • That is why the integral action removes a steady offset: it keeps ramping the output while any error remains.
0 %40 %80 %100 %120 %160 %0 s30 s60 s90 s120 s150 sprocess variable (% of range)time after a setpoint step to 100 %P only, Kp = 2: settles short of the setpointPI, Kp = 2, Ti = 15 s: reaches the setpointPI, Kp = 9, Ti = 4 s: too aggressive, oscillatesSimulated: first-order process, time constant 20 s, dead time 3 s. P alone leaves an offset; I removes it.
Simulated step responses for P only, PI and PI with too much gain.

Tuning a PID loop

  • Get the basics right first. The sensor reads correctly, the actuator moves the right way (direct or reverse acting), the process is scaled in percent, and the loop is in manual mode with the output limits set.
  • Step test (open loop): in manual, step the output by 5–10 % and record how the PV responds. The delay before it moves (dead time), the time it takes to go 63 % of the way (time constant) and the change in PV per change in CV (process gain) give starting tunings with lambda or Cohen-Coon rules.
  • Closed-loop method (Ziegler-Nichols): with P only, raise the gain until the PV oscillates steadily. Note that ultimate gain Ku and the oscillation period Pu, then set the values below.
  • Trial and error: start with P only, raise the gain until the response is brisk but not oscillating; add I slowly to remove the offset; add D only if needed.
  • Tune for the load you have, and check with a setpoint change and with a disturbance.
ControllerKpTiTd
P0.5 Ku——
PI0.45 KuPu ÷ 1.2—
PID0.6 KuPu ÷ 2Pu ÷ 8

Worked example: Ziegler-Nichols settings

  • With P only, the loop oscillates steadily at Ku = 4.0 with a period Pu = 20 s.
  • PI: Kp = 0.45 × 4.0 = 1.8, Ti = 20 ÷ 1.2 = 16.7 s.
  • PID: Kp = 0.6 × 4.0 = 2.4, Ti = 20 ÷ 2 = 10 s, Td = 20 ÷ 8 = 2.5 s.
  • Ziegler-Nichols settings are aggressive and typically give a quarter-amplitude decay; reduce Kp by a third to a half for a calmer response.

PID in the PLC

PlatformInstructionNotes
Allen-Bradley LogixPIDE (enhanced PID), PIDConfigure the loop with auto-tune options; handles scaling, limits and bumpless transfer
Siemens S7-1200/1500PID_CompactCyclic interrupt OB; commissioning wizard with auto-tune
MitsubishiPID instruction, auto-tuningParameters in a data block of registers
OmronPIDAT, PIDAuto-tuning PID instruction
CODESYSPID function block (Util library)Add limits and anti-windup in your wrapper
Unitronics, IDEC, ClickPID function block or instructionCheck update-time and scaling settings
  • Run it at a fixed update time. A PID in a task that runs every 100 ms behaves the same each time; in the main scan, whose time varies, the integral and derivative terms are wrong.
  • Anti-windup. If the actuator saturates (the valve is fully open), the integral term must stop growing; otherwise the loop overshoots badly when the error reverses. Built-in blocks have it; write it yourself if you write the loop.
  • Bumpless transfer. Switching between manual and auto should not jump the output. Make the PID follow the manual output while in manual.
  • Output limits and rate limits. Limit CV to the range the actuator can accept, and limit the rate if a fast change would damage something.
  • Derivative filter. Filter the derivative term (or use derivative on PV instead of on the error) to avoid noise kicks and a jump when the setpoint changes.
  • Scale PV and SP to the same units (percent or engineering units), and know whether the block is direct or reverse acting (cooling against heating).
  • Start with PI. Most flow, pressure and level loops need no derivative.

Typical loops

LoopTypical controlNotes
FlowPI, fastShort time constant; low gain and a moderate integral; filter the noisy measurement
PressurePI, fast to mediumGas pressure is fast; liquid pressure depends on the system
LevelP or PI, often with a gapThe process integrates; a tank level may need only a P controller, or averaging level control to smooth flow
TemperaturePID, slowLong time constants and dead time; derivative helps; auto-tune is useful
SpeedPI, often in the driveUse the drive’s own PI loop and let the PLC send a setpoint
pH, concentrationPI with careVery non-linear; gain scheduling or split-range control

Related

FAQ

Do I need a contactor if I have a VFD?

Usually not for normal control; the drive starts and stops the motor. A contactor or a safe-torque-off input can still be needed for isolation and for safety. Never switch the motor output (U, V, W) with a contactor while the drive runs, unless the drive allows it.

How do I choose between a soft starter and a VFD?

A soft starter only limits the starting current and torque; the motor then runs at full speed. A VFD also controls speed and can save energy on pumps and fans, but costs more and adds electrical noise. Choose the VFD if you need speed control.

What do P, I and D each do?

P gives a correction proportional to the error; I removes any steady offset by accumulating the error over time; D reacts to how fast the error is changing and damps the response. Most loops use PI.

Why does my PID loop oscillate?

The gain is too high, the integral time is too short, or the loop has dead time that the settings do not allow for. Lower Kp, lengthen Ti, and check for sticking valves and noisy measurements.

Should I use the drive’s PID or the PLC’s?

For a single loop whose PV goes straight into the drive (a pump holding pressure), the drive’s own PID is simple and fast. Use the PLC when the loop involves other logic, several devices, or data you want to log.

References

  • Ziegler, J. and Nichols, N., “Optimum Settings for Automatic Controllers”, Transactions of the ASME, 1942.
  • Åström, K. and Hägglund, T., Advanced PID Control, ISA.
  • Drive manuals: ABB ACS, Siemens SINAMICS, Allen-Bradley PowerFlex, Yaskawa, Danfoss (parameters, control terminals, EMC).
  • Siemens, PID Control function manual (PID_Compact); Rockwell Automation, Logix 5000 Process Control and Drives Instructions.
  • NEMA ICS 2 and IEC 60947-4-1 (contactors and motor starters); NFPA 70/79 for overload and branch protection.

Last reviewed: October 2026. Instruction names, addresses and data sizes differ by manufacturer: confirm against your controller’s manual, and keep safety functions independent of standard PLC logic. Do not work on live mains equipment unless you are qualified.