Swinging door trending is the algorithm that lets a historian throw away most of its incoming samples while promising that the discarded points can always be reconstructed within a known tolerance. Rather than comparing each new reading to the last stored one, it tracks a corridor of allowed slopes and stores a point only when that corridor collapses to nothing. This page walks through the geometry of that corridor and the compression deviation that sets its width, rather than repeating a general overview of deadband compression.
Swinging Door Compression in one line: Swinging door compression is a historian algorithm that holds the last archived point fixed and swings two sloped lines, an upper and a lower door, to bracket every incoming sample within a tolerance band called the compression deviation. As long as a straight line can still be drawn through the held point that stays within the deviation of all points seen so far, nothing is stored; when a new point makes that impossible, the previous point is archived and a fresh corridor opens.
Start from the last point the historian actually stored; call it the anchor. Around that anchor the algorithm imagines a compression deviation, a tolerance in engineering units, extending above and below. Each new sample that arrives is bracketed by drawing an upper door, a line from the anchor to the point plus the deviation, and a lower door, a line from the anchor to the point minus the deviation. Together these two sloped lines define a wedge of allowed straight-line slopes that could pass through the anchor and still represent every point seen so far within tolerance.
As more samples arrive, the algorithm keeps the steepest upper door and the shallowest lower door it has seen. Each new point can only narrow the wedge, never widen it: the upper door pivots down if a new point sits low, and the lower door pivots up if a new point sits high. This is the swinging motion the name describes, the two doors closing in on each other as the incoming data constrains the range of lines that could still fit.
The trigger to store is the moment the two doors cross, meaning the upper door has become shallower than the lower door. When that happens there is no longer any single straight line from the anchor that stays within the deviation of all the intervening points, so the corridor has collapsed. The point just before the crossing is archived as the new anchor, the doors reset around it, and the process begins again from the most recent sample.
The compression deviation is the single most important tuning parameter, because it sets how wide the corridor starts and therefore how far the data can drift before a store is forced. A wide deviation lets the doors stay open through large swings, so long ramps and gentle curves compress to just their endpoints, but small real excursions get flattened into the connecting line. A narrow deviation stores far more points and preserves fine detail, at the cost of a larger archive that can fill with instrument noise.
What swinging door stores is not the samples themselves at fixed intervals but the corners where the signal changes slope beyond tolerance. A steady ramp, no matter how long, needs only its two endpoints because a single straight line reconstructs everything between them. A noisy or rapidly turning signal produces many stored points because the corridor keeps collapsing. This is why the same deadband can compress a slow tank level a hundred to one and barely compress a chattering flow at all.
The guarantee swinging door gives is bounded error, not perfect fidelity. When the historian later reconstructs a value between two stored points by drawing a straight line, that reconstructed value is provably within the compression deviation of whatever the real signal was, because every discarded point had to lie inside the corridor to be discarded. That bound is what makes the compression trustworthy: you know the worst case, and you set it yourself by choosing the deviation.
Swinging door is the workhorse behind most process historians because it fits the shape of real plant data, which spends long stretches ramping or holding steady and only occasionally turns sharply. On those steady stretches it achieves dramatic compression with a guaranteed error bound, which is exactly what an oil and gas operation needs to keep years of tank levels, pressures, and flows affordable to store and quick to retrieve.
Choosing the compression deviation per tag is where the operator's judgement lives. A custody-transfer or allocation tag deserves a tight deviation so no meaningful movement is lost, while a routine ambient temperature can tolerate a wide one. Getting this wrong in either direction is costly: too wide erases small excursions that mattered, too narrow bloats the archive and slows the trends the algorithm was supposed to speed up.
Merobix applies configurable swinging door style compression per tag as field data streams into the cloud, so a remote wellsite reporting over cellular sends and stores only the points needed to reconstruct its trends within tolerance, not a reading every second forever. Operators still see smooth, faithful history in the browser, and engineers keep the deviation tight on the tags that feed reports while letting it breathe on the ones that only need to look right.
It holds the last stored point as an anchor and tracks two sloped tolerance lines, an upper and lower door, that bracket every incoming sample within the compression deviation. Each new point can only narrow the wedge between those doors. When the doors cross, no straight line from the anchor can still fit all the points within tolerance, so the point before the crossing is stored and the corridor resets.
It is the tolerance, set in engineering units per tag, that defines how wide the door corridor is and therefore how far the signal can drift before a point must be stored. A wide deviation compresses aggressively but loses small excursions, while a narrow one preserves detail at the cost of archive size. It also guarantees the reconstructed value never deviates from the real one by more than that amount.
Because a single straight line reconstructs every point on a steady ramp within tolerance, so the corridor never collapses and only the two endpoints need to be stored. Simple last-value deadband, by contrast, would store a new point at every deadband step up the ramp. This slope-aware behaviour is the main advantage of swinging door over comparing each sample to the previously stored value.
Merobix reads your field devices into a cloud SCADA - the real thing behind these terms, live in days from any browser.