Distributed control#

Control can live in one central controller with a lot of I/O, or be spread across many smaller devices that each run part of it. Where it lives decides how much each controller is responsible for, and how much coordination has to happen between them.

Where control lives#

Control can live in two places:

  • Central. One controller with a lot of I/O points runs every loop. Its I/O can sit in one rack, or be spread around a machine on a fieldbus such as EtherCAT.

  • Distributed. Many smaller devices, such as PLCs, motor drives and embedded controllers, each run their own loops, and exchange values over a network.

The two can be mixed. At large physics facilities, control that needs a deterministic response runs in PLCs, FPGAs or front-end computers next to its I/O, and the network coordinates the parts. That way the fastest loops don’t depend on the network’s timing.[1][2] In the European XFEL’s RF control system, loops split by timescale:[3]

Timescale

What the loop does

Where it runs

Microseconds

Corrects within one cycle of the process

FPGA

Milliseconds

Adapts from one cycle to the next

CPU

Seconds

Compensates for long-term drift

External modules and slow feedback loops

An e-axle dyno mixes them too. A motor drives the e-axle under test, and a load motor on each side brakes it. One program runs the sequence for all three motors, while each motor controller closes its own speed and current loops. The software sets speed setpoints 10 times a second, and the motor controllers hold the speed in between. See Loop rates.

Responsibility and coordination#

Each controller is responsible for some of the system’s loops and actuators. Anything that crosses from one controller to another has to be coordinated over a link. So for each part of a system, decide how much one controller should own:

  • A controller that owns more needs less coordination, but has more to do in each cycle, and more I/O to reach in time.

  • A controller that owns less is simpler, but more of what it does has to be coordinated with others.

Draw each controller’s boundary around the actuators that have to act together.

Central control#

A central controller runs one program that reads every input and writes every output in each control cycle. That makes coordination simple. Two actuators commanded in the same cycle act on the same view of the stand, and no other controller’s command competes with them. Closing several motors’ position loops in one controller makes it easier to synchronize them.[4]

The cost is performance and timing. When one loop handles every device, a device that answers slowly delays all the others, and a computer that stalls stalls everything. Network performance shows how that played out on the dyno.

One limit on a central loop is the delay between the controller and its I/O, compared with the loop’s period. On a network that reserved a queue for one loop’s traffic, a delay below 300 µs was negligible for a loop at 25 Hz.[5] For a loop at 1 kHz, it’s almost a third of the period. ITER sized its real-time network for loops with a 500 µs cycle, assuming communication could use at most 10% of that time.[6] Delays inside the front-end computers that read the sensors and drive the actuators were an order of magnitude larger than the network’s,[5] so count them too. A deterministic fieldbus such as EtherCAT keeps the delay to the I/O short and predictable.[2] It can synchronize its devices’ clocks to within 100 ns, with bus cycles under 50 µs.[4]

Distributed control#

In a distributed system, many devices each run their own loops, and a supervisory layer coordinates them. Splitting a system into modules reduces the impact of a single fault on the whole.[7] The National Ignition Facility chose a distributed architecture to reduce complexity and risk, and it also lowered cost.[8]

The cost is coordination. When two devices have to act together, the link between them becomes part of the control system, and its latency and jitter limit how closely they can work. The software at each end can be the bottleneck as well as the network. At the SKA telescopes, running too many devices in one server process, with single-threaded event handling, delayed events severely.[9]

When actuators have to act together, keep them on one controller, give their separate controllers a shared clock, or accept loose timing.

Keep coupled actuators in one controller#

Two motors on separate controllers are hard to move together. Started over the network, they don’t start at exactly the same time.[10] Even on one controller, sending each motor its own command starts one slightly before the other.[11] Computing a shared path in software and sending each motor its part doesn’t keep them on the path while they move.[10]

Instead, put the axes that have to move together on one controller, which computes or follows their path itself.[12][10] Multi-axis motion controllers are built for this. Galil’s controllers, for example, interpolate straight-line paths across up to 8 axes,[13] and one IcePAP system drives up to 128 axes.[14]

Control software groups axes the same way. In the Sardana framework, one software controller handles several axes, and starts them all with one hardware command if the hardware supports it.[11] Synchronizing two separate controllers is harder. Sardana’s planned trajectory support leaves it out of scope.[15]

Axes wired to separate controllers can still move together closely if a dedicated real-time motion bus lets one controller run all of them.[16]

Share a clock#

When separate devices have to act at the same instant, set each one up ahead of time, and let a shared timing signal say when. A central timing system broadcasts events, and a receiver in each device turns them into hardware triggers.[17] One such system is designed to trigger 1,600 channels to 30 ps accuracy.[1] A device can also preload every waveform it might need, and play the right one when its clock event arrives.[18]

Over Ethernet, the Precision Time Protocol (PTP, IEEE 1588) synchronizes clocks to under a microsecond, and to under a nanosecond in a properly designed network.[19] With clocks that close, a message sent early enough can tell a device to act at a given absolute time, as in the White Rabbit timing system.[20]

Accept loose timing#

Where the process tolerates it, the ordinary network is enough. Two devices started over a network don’t start at exactly the same time, but the difference can be well within what the process needs. A dedicated trigger cable is the fallback.[10]

The dyno works this way. Its DUT and load motors have separate controllers on one CAN bus, and the software updates their setpoints 10 times a second. That’s close enough, because the sequence ramps slowly and waits for each test point to settle. See Ramps, limits and settling.

Choosing where control lives#

For each loop or action, compare its timing with the path it has to take:

If you need

Put the control in

Coordinate with

A loop whose period is less than about 10 times the network’s worst-case delay

The device, or a controller next to its I/O

Setpoints sent from above

Several axes on one path

One multi-axis controller

The controller’s coordinate system

Actions at the same instant on separate devices

Each device

A shared timing system

Parts that fail independently

Separate controllers

Supervision, with a watchdog in each part

Steps in order, seconds apart

A sequence or test executive

The network, waiting for each step to finish

Safety functions belong in a certified safety controller, not in ordinary control software. See Safety controllers. A safety signal that crosses a network uses a certified safety protocol, such as Safety over EtherCAT, which carries safety data on the same EtherCAT network as the standard data.[21]

Further reading#

References#