control//digital control
Digital control is the implementation of a controller as periodic code on a processor that samples the measurement, computes the command and holds it until the next tick, and nearly every controller built today is one: a PID block in a PLC called every hundred milliseconds, a drone's rate loop running a few thousand times a second on a microcontroller, the current loop inside a servo drive at tens of kilohertz. Between two ticks the controller sees nothing and changes nothing, and the members of this family are the decisions that follow from that one fact.
Digital control is the implementation of a controller as periodic code on a processor that samples the measurement, computes the command and holds it until the next tick, and nearly every controller built today is one: a PID block in a PLC called every hundred milliseconds, a drone's rate loop running a few thousand times a second on a microcontroller, the current loop inside a servo drive at tens of kilohertz. Between two ticks the controller sees nothing and changes nothing, and the members of this family are the decisions that follow from that one fact.
Four of them matter more than the control law itself. The rate, chosen as a multiple of the bandwidth the loop must reach (sampling rate selection). The hold, the staircase the command becomes on its way to the actuator, which delays it by half a period on average (zero-order hold). The translation of a continuous design into a difference equation, or a design done directly in discrete time (discretization). And the arithmetic: a float32 keeps about seven significant digits, so a tiny increment added to a large integral accumulator can vanish, and on a processor without a floating-point unit the controller runs in fixed-point arithmetic, where scaling every variable becomes part of the design.
A sampled controller is a different system from the continuous one it imitates.
It answers late by half a period plus its computation time, it sees a quantized measurement and writes a quantized command, and it is only as regular as its timer. A design that had comfortable margins on paper loses part of them in the translation, and that loss is fixed by the rate and the code, never by retuning alone.
The period comes from a hardware timer, never from a loop that sleeps. A loop that runs whenever the processor is free has a varying Δt\Delta tΔt, and that jitter enters the integral and the derivative as noise; a real-time system runs each loop as a periodic task with a deadline checked on its worst case.
Quantization bites at both ends. A 12-bit encoder has steps of 1.53 mrad, and read at 1 kHz one step looks like 88 degrees per second, so the faster a naive derivative runs the worse it gets (quantization); on the output side a drone's ESC protocol offers about 2,000 throttle levels and a valve positioner has a finite resolution (actuator).
The loop lives where its dynamics are. A PID step costs under a microsecond on a Cortex-M processor at a few hundred megahertz; what is expensive is reading the gyroscope over SPI, filtering and estimating. The faster the dynamics, the closer to the metal the loop runs: current loops inside the drive, rate loops on the flight controller, temperature loops in the PLC.
The code itself, with its filtered derivative and anti-windup, is PID implementation.