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.
- 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
| Starter | How it works | Starting current | Use for |
|---|---|---|---|
| Direct-on-line (DOL) | Full voltage through a contactor | 6–8 × full load; full torque jolt | Small and medium motors where the supply can take it |
| Star-delta | Starts in star (a third of the starting current), then switches to delta | About 2–2.5 × full load | Unloaded or low-torque starts, such as fans and pumps |
| Soft starter | Thyristors ramp the voltage | Adjustable, typically 2–4 × full load | Pumps, conveyors, fans where smooth starting matters; no speed control |
| Variable frequency drive (VFD) | Converts to a variable voltage and frequency | About 1–1.5 × full load | Speed control, energy saving on pumps and fans, controlled torque |
| Servo drive | Precise torque, speed and position control | Controlled | Motion and positioning; see Motion Control |
Controlling a VFD from a PLC
| Signal | Direction | Notes |
|---|---|---|
| Run / stop (digital) | PLC to drive | A digital input on the drive set to run forward; a second for reverse or a direction input |
| Fault reset (digital) | PLC to drive | A pulse clears a trip when the cause is gone |
| Speed reference (analog) | PLC to drive | 0–10 V or 4–20 mA scaled to the drive’s minimum and maximum frequency |
| Speed or current feedback (analog) | Drive to PLC | A 0–10 V or 4–20 mA output showing speed or load |
| Fault relay (digital) | Drive to PLC | Wire normally closed so that a power loss or a trip is seen |
| Network (Modbus, EtherNet/IP, PROFINET) | Both ways | Control 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
| Parameter | What it sets | Typical start |
|---|---|---|
| Motor nameplate data | Voltage, current, frequency, speed, power | Enter exactly from the motor; run auto-tune if available |
| Minimum and maximum frequency | The speed limits | Minimum 5–10 Hz for cooling; maximum the motor and process allow |
| Acceleration and deceleration time | How fast it ramps | Start with 5–20 s; shorter for light loads; long enough to avoid overcurrent and overvoltage trips |
| Motor overload (electronic thermal) | Protection | Set to the motor current; use a motor thermistor if there is one |
| Control source | Where run and speed come from | Terminals, network or keypad; set to match the PLC wiring |
| Control mode | V/Hz, sensorless vector, closed loop | V/Hz for fans and pumps; vector for torque at low speed |
| Switching frequency | Noise against heat | 4–8 kHz; higher is quieter but hotter |
| Safe torque off (STO) | Safety function | Wired through a safety relay; see PLC Troubleshooting, Safety and Documentation |
VFD trouble spots
| Symptom | Likely cause | Try |
|---|---|---|
| Overcurrent trip at start | Acceleration too fast, locked rotor, wrong motor data, short in the cable | Lengthen the ramp, check the mechanics, check the data and the cable |
| Overvoltage trip when stopping | Deceleration too fast for the load’s inertia: the motor regenerates | Lengthen the ramp, or add a braking resistor |
| Analog reference jumps | Noise, unshielded cable, ground loop | Shield and ground, separate from the motor cable, filter in the drive or PLC |
| PLC inputs flicker when the drive runs | Electrical noise from the motor cable | Shielded motor cable, separation, ferrites, input filter time |
| Motor runs hot at low speed | Fan on the motor shaft is slow; constant torque load | Use an inverter-duty motor or a separate fan |
| Drive will not run | Enable or STO open, wrong control source, fault not reset | Check 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.
CV = Kp × [ e + (1 ÷ Ti) ∫ e dt + Td × de/dt ] with e = SP − PV
| Term | Reacts to | Effect | Too much gives |
|---|---|---|---|
| P (proportional, Kp) | The present error | Bigger error, bigger correction; leaves a steady offset | Oscillation |
| I (integral, Ti) | The accumulated error over time | Removes the offset; a smaller Ti is a stronger integral action | Overshoot and slow oscillation |
| D (derivative, Td) | How fast the error is changing | Damps the response and anticipates; sensitive to noise | Noise 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.
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.
| Controller | Kp | Ti | Td |
|---|---|---|---|
| P | 0.5 Ku | — | — |
| PI | 0.45 Ku | Pu ÷ 1.2 | — |
| PID | 0.6 Ku | Pu ÷ 2 | Pu ÷ 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
| Platform | Instruction | Notes |
|---|---|---|
| Allen-Bradley Logix | PIDE (enhanced PID), PID | Configure the loop with auto-tune options; handles scaling, limits and bumpless transfer |
| Siemens S7-1200/1500 | PID_Compact | Cyclic interrupt OB; commissioning wizard with auto-tune |
| Mitsubishi | PID instruction, auto-tuning | Parameters in a data block of registers |
| Omron | PIDAT, PID | Auto-tuning PID instruction |
| CODESYS | PID function block (Util library) | Add limits and anti-windup in your wrapper |
| Unitronics, IDEC, Click | PID function block or instruction | Check 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
| Loop | Typical control | Notes |
|---|---|---|
| Flow | PI, fast | Short time constant; low gain and a moderate integral; filter the noisy measurement |
| Pressure | PI, fast to medium | Gas pressure is fast; liquid pressure depends on the system |
| Level | P or PI, often with a gap | The process integrates; a tank level may need only a P controller, or averaging level control to smooth flow |
| Temperature | PID, slow | Long time constants and dead time; derivative helps; auto-tune is useful |
| Speed | PI, often in the drive | Use the drive’s own PI loop and let the PLC send a setpoint |
| pH, concentration | PI with care | Very non-linear; gain scheduling or split-range control |
Related
- PLC & Logic Control: the overview of this guide.
- I/O Wiring and Signals: analog signals and noise on drive wiring.
- Connecting PLCs, Drives and HMIs: network control of drives (Modbus, EtherNet/IP).
- Motion Control and Actuators.
- Motor Torque & Inertia Matching Calculator.
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.
