Demystify PID Controller Design

The PID controller design process, once a considered a complex task, can be implemented simply and directly from a PID block diagram to a working circuit with an FPAA (field programmable analog array) device and software tools—using the device itself to model physical processes. The silicon of the FPAA device is easily programmed with the use of CAD software tools and CAMs (configurable a...

By Chris Schene, Victor de la Torre and Mike Waters, Anadigm July 1, 2004

The PID controller design process, once a considered a complex task, can be implemented simply and directly from a PID block diagram to a working circuit with an FPAA (field programmable analog array) device and software tools—using the device itself to model physical processes.

The silicon of the FPAA device is easily programmed with the use of CAD software tools and CAMs (configurable analog modules). CAMs, which are modular FPAA engineering building blocks (such as filters, gain stages, rectifiers, and comparators), abstract the circuit design and let the design engineer concentrate on developing system controls without concern for the details of the underlying circuitry. Circuits designed using this new methodology can be changed and downloaded in a matter of seconds, facilitating rapid implementation and testing. Furthermore, dynamic control ‘C’ code can be generated automatically, allowing configuration and modification of the FPAA device via a microprocessor.

Creating a PID controller with CAMs is straightforward because the engineer designs at a system level, not a circuit level. Starting from the left in the ‘PID controller’ graphic, both the SP (set point) and PV (process variable) are fed through analog anti-alias filters into an offset-compensated sum-difference stage. This stage creates the error signal, e(s). Note that because SP is being fed through a 4:1 multiplexed input, the circuit can be programmed to switch between four pre-configured set points. The error signal is then fed through a differentiator, an integrator, and individually to a sum-difference amplifier that creates the P+I+D controloutput, u(s). Finally, the signal is fed into a two-pole, low-pass filter, which removes noise and spurious signals while damping the control action to avoid an abrupt u(s) move that can damage some physical systems. This circuit has, in fact, implemented a PID controller with a second-order filter where Kp is proportional gain, Td is derivative gain, 1/Ti is integrator gain, andë is the response-speed parameter (filter time constant):

PID controller tuning

To design a controller, the P, D, and I gain constants are set appropriately to achieve a desired response curve for the plant. The engineer might tune based on damping coefficient, decay ratio, settle time, frequency response, or other criteria that meet a project’s control requirement. Practical design and tuning techniques used in industrial process control include IMC, Cohen Coon, Ziegler-Nichols, and Ultimate gain. The PID controller must be tuned based on the mathematical characteristics of the process or plant being controlled.

As well as building the controller, FPAAs can be used to create a linear approximation of a process model, thereby saving the time needed to debug and tune a PID controller. Consequently, the engineer can tune the controller in simulation or simply download the plant and controller onto two separate FPAA chips. Having developed the PID control in this way using the FPAA plant model, it can be fine-tuned on the real plant.

PID controller implemented in an FPAA chip.

Various combinations of CAMs can create a wide variety of plant models. An integrator CAM, for example, can represent a pure capacity system. A negative voltage could represent an output flow from a tank, or a ‘disturbance.’ The ‘FPAA model’ graphic shows a simulated FPAA model of a tank filled by a control value with a sinusoidal varying outflow. The sinusoidal varying outflow could be changed to an on/off outflow by maximizing the gain in the rectifier and causing the sine wave to ‘rail.’ Using a periodic waveform generator to represent any arbitrary out- or inflow desired could vary the outflow further. These models can be run in simulation and then downloaded to the actual FPAA devices.

Filter Requirements

Filtering is an inevitable part of any control system, either for frequency band limiting or phase compensation.

The FPAA described here can be programmed with CAMs that will implement single-pole high-pass, low-pass, and all-pass filters and two-pole -high, -low, band-pass and band-stop filters. If more complex filters are required, the filter synthesis tool can both design and synthesize monolithic multi-pole filters of arbitrary complexity. An eight-pole filter can be created in a single FPAA device, and any number of these devices can be connected together.

Experiments have shown that these tool-generated filters are highly accurate and temperature-insensitive. These filters are directly synthesized from drag-and-place Bode plots or direct parameter entry with no need for the engineer to understand or work with components or filter mathematics.

Microprocessor control

An FPAA model of a tank with fill-valve and a periodic outflow.

An engineer can automatically generate ‘C’ code that will configure and control these FPAA devices. This ‘C’ code, which the engineer loads into a system as a library of custom-built ‘C’ subroutines, generates data segments to reconfigure and control an FPAA device. These data segments are uploaded into FPAA—a process which, depending on the size of the data segment and system clock frequency, can take just 10 microseconds or so per segment. They are then simultaneously applied at a system-designated instant without interrupting the operation of the device.

Any circuit configuration or parameter setting that the CAD tool can realize can be realized also from this embedded ‘C’ code. The FPAA can provide adaptive control, multiplex between several inputs and outputs, and perform multiple roles, saving engineering time and money.

Author Information

Chris Schene, Victor de la Torre and Mike Waters are software engineers with Anadigm.