PLC Analog Signals, PID Control and Troubleshooting
Discrete logic — on, off, timers, counters — handles most machine sequences, but process control lives in the analog world: temperatures that rise gradually, pressures that drift, levels that fill and empty, flows that must be held steady. This guide covers the three skills that bridge that world: reading and scaling analog signals, controlling a process with PID, and troubleshooting a PLC program systematically when something goes wrong. It builds on our PLC basics and advanced ladder logic guides, and it assumes you are comfortable with contacts, coils, timers and counters.
As with all our control guides, this is generic educational material from standard PLC practice. Instruction names, addressing and configuration details vary between PLC brands, so check the manual for the controller you are actually using before applying anything here to a running machine. The examples use generic descriptions and round-number illustrations rather than any vendor's proprietary format. Where safety is involved — interlocks, emergency stops, safety-rated functions — those must always be implemented and verified according to the applicable safety standards and the machine's risk assessment, never improvised from a general guide.
Analog signals: the 4–20 mA loop
The industrial standard for analog measurement is the 4–20 mA current loop. A transmitter measuring, say, a tank level from empty to full outputs 4 mA at empty and 20 mA at full, with every value in between representing a proportional level. The signal is a current rather than a voltage because current is the same everywhere in a series loop, so long cable runs and electrical noise affect it far less than they would a voltage signal. The choice of 4 mA rather than 0 mA for the bottom of the range is deliberate and important: 4 mA is a live zero, which means a reading of 0 mA indicates a broken wire, a dead transmitter or a powered-down loop, rather than a genuine empty tank. That fault detection is built into the signal itself, and it is the reason 4–20 mA has survived decades of newer technologies.
Voltage analog signals, typically 0–10 V, are also common, especially for short runs inside panels and for drives and position feedback. They are simpler to measure with a multimeter but more vulnerable to voltage drop and noise over distance. Whatever the signal type, the wiring discipline is the same: shielded cable where the installation requires it, shields earthed at one end unless the design says otherwise, signal cables routed away from power cables, and terminals labelled to match the I/O drawings. Most analog faults turn out to be wiring faults, not program faults, which is why the troubleshooting section of this guide starts at the field.
Scaling: turning milliamps into engineering units
A PLC analog input module converts the loop current into a raw digital count, and scaling converts that count into engineering units the program can use — degrees, bar, percent, litres per minute. Scaling is linear for most transmitters: the bottom of the range maps to the bottom of the engineering range, the top maps to the top, and everything in between is proportional. The classic worked example is a level transmitter ranged 0 to 100 percent on a 4–20 mA loop: at 4 mA the scaled value is 0 percent, at 12 mA it is 50 percent, and at 20 mA it is 100 percent. The scaling instruction in the PLC performs that conversion, and getting its range parameters right — the raw counts for 4 and 20 mA on your particular module, and the engineering range of the transmitter — is the whole job.
The most common scaling errors are all range errors. Scaling a transmitter ranged 0–10 bar as if it were 0–16 bar, because the datasheet was misread or the transmitter was re-ranged in the field without updating the program, produces readings that look plausible and are wrong by a fixed ratio. Scaling with the wrong raw-count range for the module produces a similar proportional error. Always verify scaling end to end: apply a known signal — a calibrator set to 4, 12 and 20 mA — and confirm the program reads the expected engineering values at all three points. Three points catch both offset errors and span errors, while a single-point check catches neither reliably.
PID control: P, I and D in plain language
PID control holds a process variable — temperature, pressure, level, flow — at a setpoint by continuously adjusting an output. The controller compares the measured value with the setpoint to get the error, and computes its output from three terms. The proportional term acts on the present error: the bigger the error, the bigger the correction. On its own, proportional control leaves a steady-state offset, because as the error shrinks, so does the correction, and the process settles slightly away from the setpoint. The integral term acts on the accumulated past error: it keeps growing while any error persists, and it is what finally drives the process onto the setpoint and removes the offset. The derivative term acts on the rate of change of error: it resists rapid change, damping overshoot and oscillation.
Tuning a PID loop means choosing the three gains so the loop is stable, responsive and free of excessive overshoot. The practical approach is to start conservatively: proportional gain low enough for stability, integral action gentle, derivative off or small, and then adjust one term at a time while watching the process response to a setpoint change. Watch for the classic symptoms and their cures: slow, sluggish response usually needs more proportional action; a persistent offset needs more integral action; oscillation usually needs less proportional gain or some derivative action; and a noisy, jittery output often means derivative action is amplifying measurement noise and should be reduced or filtered. Record the final tuning parameters with the date and the operating conditions, because a loop tuned for one operating point may behave differently at another, and the next engineer needs to know where the current settings came from.
Two practical PID features deserve attention. Anti-windup prevents the integral term from accumulating without limit while the output is saturated — for example, while a valve is already fully open — which would otherwise cause a large overshoot when the process finally responds. Manual-to-automatic transfer handling ensures the loop takes over smoothly without a bump in the output when an operator switches modes. Both are standard features of most PID instructions, and both should be understood and configured rather than left at defaults, because a loop that bumps on transfer or winds up during saturation will be distrusted by operators, and a distrusted loop gets switched to manual and left there.
Troubleshooting systematically: field, program, field
When a PLC system misbehaves, the fastest method is also the most disciplined: work from field to program to field, and change one thing at a time. Start at the field device. Is the sensor actually producing the expected signal? Measure the loop current or voltage at the transmitter, at the marshalling terminals, and at the PLC input, and compare. If the signal is wrong at the transmitter, the problem is the device or the process, not the program. If the signal is right at the PLC terminals but wrong in the program, the problem is scaling, addressing, or wiring into the wrong input. If the signal is right in the program but the output device does not respond, check the output wiring, the output module, and the device itself, in that order.
Use the PLC's online monitoring to watch the logic live, but watch it critically. Forcing an input or output to test a rung is a powerful diagnostic tool and a dangerous habit: a forced output that is forgotten will override the program indefinitely, and a forced input can mask a real field fault. If you force anything during fault-finding, record it, tell the shift team, and remove the force as soon as the test is done. The same discipline applies to program changes made during troubleshooting: change one thing, test, and record what changed, because a fault fixed by three simultaneous changes has not been understood, and it will return.
For intermittent faults, think in terms of conditions, not moments. An intermittent fault that appears only on night shift, only at high ambient temperature, or only when a particular machine runs is telling you about its cause: a temperature-sensitive connection, a shared power supply sagging under load, or an interaction between two systems. Log the conditions of each occurrence — time, plant state, what else was running — and look for the pattern before changing anything. And for any fault involving safety functions, stop and follow the site's safety procedures: a safety fault is not a troubleshooting exercise, it is a reason to make the machine safe first and investigate second.
Common analog and PID mistakes
The most common analog mistake is scaling from the wrong transmitter range, as described above, followed closely by earthing a shield at both ends and creating a ground loop that injects noise into the measurement. The most common PID mistake is tuning by turning all three gains at once, which makes it impossible to tell which change helped or harmed. The most common troubleshooting mistake is starting in the program when the fault is in the field, and the second most common is changing several things at once and declaring victory when the symptom disappears. All of these are habits, and habits can be replaced: verify scaling at three points, earth shields as designed, tune one term at a time, and change one thing at a time.
What to learn next
From here, the control picture is complete at the level of this guide series: discrete logic, advanced instructions, analog control and troubleshooting. To go deeper, study the specific PLC platform you work with — its instruction set, its communication networks, and its safety programming — and study the processes you control, because the best PLC engineers understand the plant as well as the program. For the drawings those programs are built from, see our AutoCAD Electrical basics, schematics and panels and reports and automation guides, and for the power systems behind the machines, our ETAP load flow, short-circuit and protection and arc flash and motor starting guides. Our AI tools for engineers page covers documentation workflows, while control logic itself remains human engineering work.
Frequently asked questions
Why is 4–20 mA used instead of 0–20 mA?
Because 4 mA represents zero, a reading of 0 mA means a broken wire or a dead transmitter rather than a genuine zero measurement. The live zero makes wire breaks detectable, which is why 4–20 mA is the standard for industrial analog loops.
What do P, I and D mean in PID control?
P (proportional) acts on the present error, I (integral) acts on the accumulated past error to remove steady-state offset, and D (derivative) acts on the rate of change of error to dampen overshoot. Together they drive a process variable to its setpoint and hold it there.
Where do I start when a PLC program misbehaves?
Start at the field: confirm the input signal is actually present and correct, then check the program logic that uses it, then check the output and the device it drives. Working from field to program to field again finds most faults faster than guessing at code.