---
title: Cascaded PI Controllers Tuning
url: https://www.emergentmind.com/topics/cascaded-pi-controllers
type: topic
---

# Cascaded PI Controllers Tuning

A cascaded PI controller is a control scheme that serially nests two proportional-integral (PI) loops, typically implemented as an inner loop governing a system variable closer to actuation (e.g., speed) and an outer loop regulating a higher-level target (e.g., position). This architecture is routinely applied in mechanical systems where fast stabilization of an inner variable (such as velocity) supports precise outer-loop objectives (such as position tracking). Efficient automated tuning for these controllers is critical, especially after maintenance or changes in system dynamics, as suboptimal gain selection degrades overall system performance [2005.03970].

## 1. Cascaded PI Control Architecture

A canonical cascaded PI configuration comprises two primary control loops:

- **Outer Loop**: Regulates the primary reference input (e.g., position) via error $e_2(t) = r_p(t) - y(t)$ using a PI controller $C_2(s) = K_{p2} + K_{i2}/s$, producing a reference for the inner loop.
- **Inner Loop**: Receives the set-point from the outer loop (commonly a speed reference), computes $e_1(t) = v_\mathrm{ref,2}(t) - \dot{y}(t)$, and applies a PI controller $C_1(s) = K_{p1} + K_{i1}/s$ to generate the control input to the plant $G(s)$.

The respective closed-loop transfer functions are:

- Inner loop: $T_1(s) = \frac{C_1(s) G(s)}{1 + C_1(s) G(s)}$
- Outer loop: $T_2(s) = \frac{C_2(s) T_1(s)}{1 + C_2(s) T_1(s)}$

Standard implementations may simplify the structure; for example, the experimental realization used a pure-proportional outer loop ($K_{i2} = 0$), but the same principles extend to full PI outer controllers.

## 2. Performance Metrics and Cost Function Formulation

Tuning cascaded PI controllers requires quantitative performance evaluation at each candidate gain vector $\theta = (K_{p1}, K_{i1}, K_{p2}, K_{i2})$. The approach utilizes step-response-based metrics:

- Absolute maximum overshoot $M_p(\theta)$
- Settling time $T_s(\theta)$ (to a $\pm2\%$ band)
- Infinity-norm of tracking error $\|e\|_\infty$
- Integral of time-weighted absolute error $\mathsf{ITAE}(\theta) = \int_0^T t\,|e(t)|dt$

A custom scalar cost function $J(\theta)$ forms a weighted sum
$$
J(\theta) = \sum_{k=1}^K w_k\,\varphi_k(\theta)
$$
with $w_k$ reflecting the relative importance of each indicator (see Table 2 in [2005.03970]). The sequential tuning process first minimizes $J_1(K_{p1}, K_{i1})$ for the inner loop, then minimizes $J_2(K_{p2}, K_{i2})$ for the outer loop with the inner gains fixed.

## 3. Data-Driven Tuning via Bayesian Optimization

To automate and expedite gain selection, Bayesian optimization (BO) is employed:

- The cost landscape $J(\theta)$ is modeled as a Gaussian process (GP) surrogate,
$$
J(\cdot) \sim \mathcal{GP}(0, k(\cdot, \cdot))
$$
with a squared-exponential kernel and hyperparameters (signal variance $\sigma_f^2$, length-scales $\{\ell_j^2\}$, noise variance $\sigma_n^2$) estimated by maximizing the GP marginal likelihood.

- The BO procedure iteratively proposes gain settings by minimizing a Lower Confidence Bound (LCB) acquisition function,
$$
\theta_{n+1} = \arg\min_{\theta \in \Theta} \big[\mu_n(\theta) - \beta_n \sigma_n(\theta)\big]
$$
with $\mu_n$ and $\sigma_n$ being the GP posterior mean and standard deviation, and $\beta_n$ controlling the exploration-exploitation trade-off.

Termination criteria include repeated incumbent minima or a preset maximum number of iterations.

## 4. Sequential BO Algorithm for Cascaded PI Tuning

The full procedure, summarized for one loop, is as follows:

1. Define the feasible domain $\Theta$ for $(K_p, K_i)$, cost function $J(\cdot)$, maximal iterations $N_\mathrm{max}$, and initial sample size $N_0$.
2. Sample $N_0$ initial gain vectors, obtain corresponding $J$ from experiments, and store in dataset $D$.
3. Fit the GP surrogate to $D$.
4. Iterate:
    - Compute GP posterior $(\mu, \sigma)$.
    - Select next $\theta$ via LCB minimization.
    - Evaluate $J(\theta)$, augment $D$.
    - Update GP.
    - Terminate by stabilization or reaching $N_\mathrm{max}$.
5. Return minimizer $\theta^*$ of $J$ recorded in $D$.

In cascaded systems, this process first optimizes $(K_{p1}, K_{i1})$ (inner), then $(K_{p2}, K_{i2})$ (outer).

## 5. Empirical Comparison of Tuning Methods

Evaluations on a linear axis drive compared BO-based tuning to classical methods such as Ziegler–Nichols, relay autotuning, ITAE-optimal tuning, and exhaustive grid search.

| Method            | $K_{p1}$ (speed) | $K_{i1}$ (speed) | $K_{p2}$ (position) |
|-------------------|------------------|------------------|---------------------|
| Ziegler–Nichols   | 0.18             | 510              | 392                 |
| ITAE tuning       | 0.11             | 420              | 255                 |
| Relay tuning      | 0.05             | 130              | 115                 |
| Exhaustive grid   | 0.36             | 130              | 225                 |
| Sequential BO     | 0.37             | 130              | 225                 |

Bayesian optimization required 20–30 iterations for the inner loop and 3–6 iterations for the outer loop. BO tuning reduced speed-loop overshoot from approximately 12% (Ziegler–Nichols) to less than 1%, shortened settling time by about 30%, limited position-loop overshoot to under 2% (compared to $>$10% for classical rules), and lowered steady-state error by approximately 50%. Step responses (see Figure A in [2005.03970]) show that BO yields the fastest, least-oscillatory trajectories.

## 6. Influence of Initial Experimental Design

The number of initial random samples $N_0$ strongly affects BO convergence. A tabulation of its effect:

| Loop      | $N_0$ (train) | BO iterations | $\theta^*$             |
|-----------|---------------|--------------|------------------------|
| Speed     | 50            | 19           | (0.37, 130)            |
| Speed     | 30            | 27           | (0.345, 130)           |
| Speed     | 20            | 44           | (0.36, 110)            |
| Position  | 15            | 3            | 225                    |
| Position  | 10            | 6            | 240                    |
| Position  | 7             | 5            | 210                    |

A larger initial design provides a better prior, reducing the number of subsequent BO iterations, but entails higher up-front experimental cost. In practice, $N_0 \approx 30$ provides balanced performance, leading to convergence within a few dozen experiments overall.

## 7. Guidelines and Practical Considerations

- Select $\Theta$ (gain search space) to exclude grossly unstable combinations via basic loop-shaping or grid-testing.
- Choose $N_0 \approx 20$–$40$ samples to capture global cost structure.
- Use $\beta_n$ increasing slowly, encouraging exploration initially and exploitation later in BO cycles.
- Terminate optimization when the same lowest-$J$ gain is repeated three times or upon reaching maximum iterations.

This data-driven, sequential Bayesian optimization procedure yields fully automated, data-efficient tuning of cascaded PI controllers that surpasses classical tuning in both speed and accuracy, requiring only a limited number of experimental trials [2005.03970].

Source: https://www.emergentmind.com/topics/cascaded-pi-controllers