Many controllers offer an autotune button, and behind a large share of them is a clever experiment called the relay feedback test. Instead of a person slowly raising the gain until a loop oscillates, the controller temporarily switches its output on and off to coax the loop into a controlled, self-limiting oscillation and reads the loop's key numbers straight off it. This guide explains how the relay feedback experiment works, why it identifies the ultimate gain and ultimate period safely and automatically, and how it improves on the manual continuous-cycling test it replaces.
Relay feedback tuning in one line: Relay feedback auto-tuning is a self-tuning technique in which the controller replaces its normal action with a simple on-off relay for a short test, switching its output high and low as the process variable crosses the setpoint. This forces the loop into a steady, controlled oscillation from which the ultimate gain and ultimate period are identified automatically, and tuning rules then compute the PID settings. It achieves the same goal as the manual continuous-cycling test but does so more safely and automatically, because the oscillation is bounded by the relay rather than growing uncontrolled.
The relay feedback experiment works by temporarily turning the controller into an on-off switch. For the duration of the test the normal PID action is set aside and the controller output is driven to one fixed high value when the process variable is below setpoint and to one fixed low value when it is above. This simple switching pushes the process one way, then the other, and because there is always some lag and dead time in a real loop, the process variable overshoots the setpoint each time before the relay catches it and reverses. The result is a steady, sustained oscillation of the process variable around the setpoint that the controller itself is driving.
What makes this so useful is that the oscillation is self-limiting rather than runaway. A relay only ever puts out its two fixed values, so it cannot keep pushing harder and harder; the amplitude of the resulting cycle settles to a modest, bounded size determined by the relay's switching levels and the loop's own dynamics. The controller simply lets a few cycles establish themselves and then measures them. This bounded, controlled quality is the whole appeal of the relay method: it produces exactly the sustained oscillation needed to characterize the loop, but keeps that oscillation small and safe instead of letting it build without limit.
The oscillation the relay produces cycles at very close to the loop's own critical frequency, the frequency at which the loop is naturally on the edge of instability. This is not a coincidence; the on-off relay, by always driving the process in the direction that reduces the error, naturally excites the loop at the frequency where its phase lag is such that oscillation is self-sustaining. Because that is precisely the frequency the ultimate-sensitivity tuning approach cares about, the relay test lands the loop exactly where the useful measurements can be read off, which is why the technique is so well matched to auto-tuning.
From the sustained oscillation the controller reads two things directly. The period of the cycle is the ultimate period, the natural period of oscillation at the loop's stability limit, which sets the timescale for the integral and derivative settings. The amplitude of the process-variable swing, together with the known size of the relay's on-off step, yields the ultimate gain, the effective gain at which the loop would sustain oscillation. In essence the relay presents the loop with a known-size push and measures the size of the resulting swing, and the ratio of those, adjusted for the relay's shape, gives the ultimate gain without ever having to raise a real gain to the point of instability.
These are exactly the two numbers, ultimate gain and ultimate period, that the closed-loop family of tuning rules is built around. Once the relay test has identified them automatically, the controller applies a set of tuning formulas to compute the proportional, integral, and derivative settings, choosing formulas according to how aggressive or conservative a response is wanted. The whole sequence, run the relay test, extract the two numbers, apply the formulas, produces finished PID settings from a short automatic experiment, which is what an autotune feature delivers when the user presses the button.
The automation is the point. A human running the equivalent manual test would have to nurse the gain upward, watch for the onset of oscillation, and judge when it is truly sustained, all while risking overshoot if they go too far. The relay method hands that entire job to the controller, which switches its own output, recognizes the established oscillation, measures the amplitude and period, and computes the settings, all without manual intervention. That is why relay feedback became a standard basis for the autotune functions built into modern controllers and control systems: it makes the identification reliable and repeatable rather than dependent on operator skill and nerve.
The manual alternative is the continuous-cycling test at the heart of the classic ultimate-sensitivity method: put the controller in proportional-only mode and gradually increase the gain until the loop sustains a steady oscillation, then record the gain and period. It works, but it has real drawbacks. Finding the sustained-oscillation point by hand is slow and fiddly, it demands judgment to know when the oscillation is genuinely steady rather than slowly growing or decaying, and it is inherently risky because the procedure deliberately walks the loop up to the edge of instability, where overshooting the gain can drive the process into a large, uncontrolled oscillation that upsets operations.
The relay feedback test removes those drawbacks by construction. Because the relay's output is bounded to two fixed values, the oscillation it induces cannot grow without limit, so the test never risks the runaway that the manual gain-raising method flirts with; the amplitude stays small and controlled throughout. It is also fast, since a controlled oscillation establishes itself in just a few cycles rather than requiring a patient hunt for the critical gain, and it is objective, since the controller measures the amplitude and period rather than relying on a person's eye. The same essential information is obtained, but safely, quickly, and automatically.
For a cloud SCADA operation such as Merobix, where controllers may sit at remote or unmanned sites, relay-based autotuning is especially valuable because it lets a loop be characterized and tuned without a person present to nurse a manual cycling test, and it does so with a bounded, low-risk oscillation that is far less likely to disturb the process or trip alarms. The brief, controlled cycle it produces is visible on the trends as a short, deliberate oscillation that then gives way to a well-tuned loop, and an operator can see the autotune do its work and confirm the improved response afterward. It brings the rigor of the ultimate-sensitivity approach to loops that could never practically be tuned by hand at the edge of instability.
It temporarily replaces the controller's normal action with an on-off relay that drives the output high when the process variable is below setpoint and low when it is above. This forces a steady, self-limiting oscillation around the setpoint, from which the controller reads the ultimate period from the cycle time and the ultimate gain from the swing amplitude and the known relay step size. Tuning formulas then turn those two numbers into finished PID settings.
The manual test raises the real controller gain until the loop sits at the edge of instability, and overshooting that point can drive the process into a large, uncontrolled oscillation. The relay only ever outputs two fixed values, so the oscillation it induces is bounded and cannot grow without limit, staying small and controlled throughout. It reaches the same critical frequency and yields the same measurements without the runaway risk of raising a real gain to instability.
It identifies the loop's ultimate gain and ultimate period, the same two values the closed-loop tuning rules are built on. The ultimate period is the cycle time of the induced oscillation, and the ultimate gain is worked out from the amplitude of the process-variable swing relative to the known size of the relay's on-off step. From those two numbers the controller computes the proportional, integral, and derivative settings automatically.
Merobix reads your field devices into a cloud SCADA - the real thing behind these terms, live in days from any browser.