Automated Synthesis of Safe and Robust PID Controllers for Stochastic Hybrid Systems

Fedor Shmarov, Nicola Paoletti, Ezio Bartocci, Shan Lin, Scott A. Smolka, Paolo Zuliani

Abstract

We present a new method for the automated synthesis of safe and robust Proportional-Integral-Derivative (PID) controllers for stochastic hybrid systems. Despite their widespread use in industry, no automated method currently exists for deriving a PID controller with safety and performance guarantees for such a general class of systems. In particular, we consider hybrid systems with nonlinear dynamics (Lipschitz-continuous ordinary differential equations) and random parameters, and we synthesize PID controllers such that the resulting closed-loop systems satisfy safety and performance constraints given as probabilistic bounded reachability properties. Our technique leverages SMT solvers over the reals and nonlinear differential equations to provide formal guarantees that the synthesized controllers satisfy such properties. These controllers are also robust by design since they minimize the probability of reaching an unsafe state in the presence of random disturbances. We apply our approach to the problem of insulin regulation for type 1 diabetes, synthesizing controllers with robust responses to large random meal disturbances, thereby enabling them to maintain blood glucose levels within healthy, safe ranges.

Introduction

Proportional-Integral-Derivative (PID) controllers are the workhorses of modern industry, found in everything from drones to medical devices. However, designing them for Cyber-Physical Systems (CPS) is notoriously difficult. These systems are often hybrid (mixing discrete logic with continuous motion), nonlinear (governed by complex physics), and stochastic (subject to random disturbances).

Traditionally, PID tuning relies on heuristics or manual trial-and-error, which offers no formal guarantees that the system won't enter a "bad state"—such as a robot crashing or a medical pump overdosing a patient. This paper addresses this gap by introducing a method to automatically find PID parameters that minimize the probability of safety violations while meeting performance targets.

Methodology

The authors model the system as a Stochastic Parametric Hybrid System (SPHS). Their approach centers on two main problems:

  1. Controller Synthesis: Finding the optimal gains ($K_p, K_i, K_d$) to minimize the probability of reaching an unsafe state.
  2. Maximum Disturbance Synthesis: Determining the largest external shock (e.g., a massive meal for a diabetic patient) a given controller can handle without failing.
Block diagram of a PID controller applied to a Stochastic Parametric Hybrid System (SPHS).

To solve these, the framework utilizes Satisfiability Modulo Theories (SMT) solvers, specifically dReal and iSAT-ODE, which are capable of handling nonlinear ordinary differential equations (ODEs). Because exact reachability for such systems is mathematically undecidable, the method employs $δ$-satisfiability, providing numerical guarantees up to an arbitrary user-defined precision. The heavy lifting is performed by a tool called ProbReach, which combines these SMT solvers with statistical methods like Cross Entropy to navigate the high-dimensional parameter space and identify optimal controller gains.

Case Study: Insulin Regulation

The researchers evaluated their method using a high-fidelity, 8-dimensional nonlinear ODE model of the human glucose-insulin system (the Hovorka model).

  • Disturbances: The simulation involved a "one-day scenario" featuring three random meals (breakfast, lunch, and dinner) with normally distributed carbohydrate amounts and timings.
  • Baseline: Synthesized PID controllers were compared against a standard "basal-only" insulin delivery strategy ($C_0$).

Key Results and Insights

The method was tested on an "Artificial Pancreas" case study with the following results:

  • Hyperglycemia Reduction: The baseline controller ($C_0$) left patients in a state of severe high blood sugar (hyperglycemia) about 23.6% of the time. The best synthesized PID controller ($C_4$) reduced this to just 0.35%.
  • Disturbance Tolerance: The synthesized controllers increased the "safe" meal size from approximately 69g (basal only) to 88g.
  • Safety vs. Performance Trade-off: A critical finding is that making performance requirements stricter (e.g., demanding a faster return to setpoint) can increase the probability of safety violations. Aggressive controllers may push the system toward unsafe boundaries when faced with random noise.
  • Robustness by Design: By framing synthesis as the minimization of failure probability, robustness is inherently integrated into the controller rather than checked as an afterthought.

Limitations and Conclusion

While the method provides formal guarantees, the primary drawback is computational speed. Synthesizing these controllers took between 25 and 43 hours on a 32-core machine, reflecting the PSPACE-complete complexity of solving guaranteed ODEs. Furthermore, the statistical search approach provides a high-confidence estimate rather than a strict global optimum.

Future work will explore more advanced PID variants, such as nonlinear PIDs, and the integration of standard tuning heuristics to prune the search space and accelerate the synthesis process. This research represents a significant step toward provably safe automated control for complex, life-critical stochastic systems.

Summary updated

Abstract

We present a new method for the automated synthesis of safe and robust Proportional-Integral-Derivative (PID) controllers for stochastic hybrid systems. Despite their widespread use in industry, no automated method currently exists for deriving a PID controller (or any other type of controller, for that matter) with safety and performance guarantees for such a general class of systems. In particular, we consider hybrid systems with nonlinear dynamics (Lipschitz-continuous ordinary differential equations) and random parameters, and we synthesize PID controllers such that the resulting closed-loop systems satisfy safety and performance constraints given as probabilistic bounded reachability properties. Our technique leverages SMT solvers over the reals and nonlinear differential equations to provide formal guarantees that the synthesized controllers satisfy such properties. These controllers are also robust by design since they minimize the probability of reaching an unsafe state in the presence of random disturbances. We apply our approach to the problem of insulin regulation for type 1 diabetes, synthesizing controllers with robust responses to large random meal disturbances, thereby enabling them to maintain blood glucose levels within healthy, safe ranges.
BibTeX
@inproceedings{shmarov2017automated,
  author = {Fedor Shmarov and Nicola Paoletti and Ezio Bartocci and Shan Lin and Scott A. Smolka and Paolo Zuliani},
  title = {{Automated Synthesis of Safe and Robust PID Controllers for Stochastic Hybrid Systems}},
  booktitle = {Haifa Verification Conference},
  year = {2017},
  doi = {10.1007/978-3-319-70389-3\_9},
}
Figure