Top 10 Tips for Optimizing Your PID Controller
Achieving optimal performance in control systems often hinges on mastering the properties of PID (Proportional-Integral-Derivative) controllers. These types of control systems are central to maintaining stability in a wide variety of applications, from industrial automation to advanced scientific research.
Zurich Instruments offers PID controllers as an add-on option for all lock-in amplifiers, enabling closed-loop control up to the GHz frequency range. In this blog, similar to what we presented for lock-in measurements and boxcar averager measurements, we share a compact compilation of ten tips to help you make the best out of the PID controllers on Zurich Instruments lock-in amplifiers.
1. Maximize the signal-to-noise ratio (SNR) of the input signal to the PID controller thanks to lock-in amplification.
A clean and properly conditioned signal as the input to the controller lays the foundation for a robust yet sensitive control loop. Lock-in amplification effectively isolates the desired signal from noise and interference, enhancing stability and performance. Additionally, by amplifying weak signals, it also improves the PID controller's sensitivity, enabling it to respond to subtle changes.
Another key advantage of feeding demodulated signals into a PID controller is the improved ability to control periodic signals. Demodulation effectively "rectifies" an oscillating input into a DC signal, simplifying the processing task for the PID controller.
2. Characterize the open loop response of your system with the Sweeper Tool.
Proper open-loop characterization of the device under test (DUT) is a key prerequisite for an effective closed-loop control. The LabOne Sweeper module allows you to directly perform open loop measurements and frequency response analysis (FRA) of your resonator or DUT. This is because our instruments can simultaneously provide the stimulus to the DUT and measure its response as a function of frequency or other parameters. Furthermore, FRA coupled with lock-in detection is extremely beneficial, as it provides the user with both amplitude and phase values of the response within a single measurement, together with noise analysis for a thorough overall understanding of the system properties.
3. Determine optimal PID setpoint, resonant frequency, slope sign, gain, Q-factor and other parameters with the LabOne fitting routines.
The Sweeper tool is equipped with a fitting routine that facilitates the extraction of the relevant parameters of the open loop measurement. This works both for a resonance fit (i.e. Lorentzian) and also for linear fits, e.g. around the setpoint for a more generic case of control loop. The extracted parameters can then be used to further speed up and optimize the initial tuning process, e.g. by copy-pasting them directly in the PID Advisor module.
4. Simplify the initial tuning procedure with the PID Advisor by selecting the most appropriate DUT model.
For many experimental situations, the DUT can be well approximated by a simple model. The LabOne PID Advisor allows you to simulate the behavior of several different DUT types in a feedback loop and choose initial feedback gain parameters based on the simulation. A wide range of starting conditions can be implemented, facilitating significantly the initial tuning procedure and saving precious implementation time. If you are not sure which model to choose, then experiment with multiple models within the Advisor to compare their performance, or simply contact us for guidance in selecting the most suitable model for your specific application.
5. Carefully evaluate the trade-off between speed and precision when choosing closed-loop bandwidth.
The closed-loop bandwidth is essentially the only user-defined parameter, strictly linked to the specific type of control loop one wants to implement. It is therefore crucial to understand the requirements of the considered application to select the appropriate loop bandwidth. A wide-bandwidth loop may be preferred in applications where a rapid response is required, such as in the control of mechanical systems or fast scanning applications. Conversely, a narrow-bandwidth loop may be best in applications where stability is more important, such as in the control of chemical processes or for other systems with long time delays.
The most important aspect is to avoid the PID controller acting as a filter that smooths out important information. To this end, one can typically consider an equivalent “pixel dwell-time” T, i.e. the time required to wait for each data acquisition point with the PID controller.
For the control loop to be effective, the closed-loop bandwidth of the controller \(BW_{PID}\) should be set such that \(BW_{PID} > 1/(2\cdot\pi\cdot T)\).
6. Measure the step response of your closed-loop transfer function with the Data Acquisition Module (DAQ).
Thanks to the integrated DAQ module on our lock-in amplifiers, once the initial tuning is in place, the corresponding transfer function of the control loop can be measured directly. This gives a direct visualization of the initial operation and facilitates the tweak of the parameters to achieve the desired closed-loop performance. Furthermore, the step response analysis enabled by the DAQ facilitates ringdown measurements to extract exceptionally high Q-factors.
7. Employ Multiple PID Controllers for advanced control loops.
The digital implementation of the PID controllers on Zurich Instruments lock-in amplifiers makes it possible to embed multiple PID controllers on the same instrument, whose inputs and outputs can be either cascaded in a sequential fashion or used in a parallel configuration, that is, independently of one another. A typical example of the employment of multiple PID controllers is the Automatic Gain Control (AGC) routine applied to resonators, requiring a phase-locked-loop (PLL) to lock to the resonator phase cascaded with a PID control loop to stabilize the oscillation amplitude of the resonator.
With up to 4 PID controllers per instrument, more advanced schemes (e.g. Pound-Drever-Hall technique) are also possible.
8. Monitor in real-time and record the status of the control loop thanks to the PID error, PID shift and other status signals.
Live monitoring of the PID status signals is crucial to evaluating the performance and health of the control loop. Measuring and inferring trends of such status signals can help tweak and adjust parameters to steer the loop toward a better and more effective control of the system. Signals like the PID error (i.e. PID Setpoint - Input) and PID shift can be easily visualized in the Plotter Module of LabOne and, by performing fitting and statistical analysis, conscious decisions can be made for optimizations and modifications of the control loop.
9. Minimize the PID error signal with the Auto Tune routine.
Each Zurich Instruments lock-in amplifier equipped with the PID option includes the Auto Tune routine. This routine varies the feedback gain parameters, in order to minimize the root mean square of the PID error signal. Being based on a real measurement, the Auto Tune can often improve on the results of the model-based PID Advisor because it takes into account the real experimental noise and device transfer function.
10. Directly stream the desired controller outputs to your PC.
Direct data stream to the host PC removes the need for an additional signal acquisition system, reduces your complexity, and makes your setup more robust. While the PID outputs certainly need to be sent out from the instruments in the analog domain, signals monitoring the status of the control loop (as the PID error, setpoint, etc.) don’t need to undergo any digital-to-analog conversion and therefore can live in the digital domain and be visualized directly on the embedded LabOne tools like the Plotter, with the additional benefit of simplifying any post-processing analysis.