## CONTROLLERS

Figure 2(a) shows the block diagram of the proposed system to control the opening rate of the arterial occluder \({O}_{cc}\left(s\right)\) that regulates the arterial flow rate \(Q\left(s\right)\). The input and output relationship of this control target was described using the combination of a linear dynamic model and a nonlinear static model (hereafter referred to as the nonlinear controlled system). The linear dynamic model describes the dynamic characteristics for regulating the occluder, and The nonlinear static model generates the arterial flow rate \(Q\left(t\right)\) from \({O}_{cc}^{{\prime }}\left(t\right)\) yielded by the linear dynamic model, as shown in the following equations:

\(Q\left(t\right)={K}_{g}\left\{{O}_{cc}^{{\prime }}\left(t\right)\right\}\)\(=\frac{{\left(1+\frac{\varDelta {R}_{0}}{R}\right)Q}_{0}RA\left\{{exp}\left(K\cdot {O}_{cc}^{{\prime }}\left(t\right)\right)-1\right\}}{1+RA\left\{{exp}\left(K\cdot {O}_{cc}^{{\prime }}\left(t\right)\right)-1\right\}+\varDelta {R}_{0}A\left\{{exp}\left(K\cdot {O}_{cc}^{{\prime }}\left(t\right)\right)-1\right\} },\)(1)

$${O}_{cc}^{{\prime }}\left(s\right)=\frac{{e}^{-Ls }}{1+Ts} {O}_{cc}\left(s\right),$$

2

where \({O}_{cc}\left(t\right)\) represents the opening rate of the occluder, R is the resistance of the entire CPB channel excluding that of the occluder channel, \({\Delta }{R}_{0}\) is the resistance of the occluder channel, \({Q}_{0}\) is the blood flow rate at 100% occlusion opening, and \(A\) and \(K\) are parameters that express the relationship between the ratio of the crushed tube diameter to the opening rate of the arterial occluder, L is the parameter of dead time, and \(T\) is the first-order time constant. These parameters were determined by the nonlinear least square method using premeasured opening rates of the occluder and arterial flow rates.

Because the control target involves nonlinearity, a nonlinear feedforward (FF) controller was designed based on the nonlinear static model and the linear dynamic model included in the nonlinear controlled system as follows:

$${O}_{cc,m}\left(s\right)=\frac{\left(1+Ts\right)\left(1+Ls\right)}{{\left(1+{T}_{f}s\right)}^{2}}{Q}_{m}{\prime }\left(s\right) ,$$

3

\({Q}_{m}^{{\prime }}\left(t\right)={K}_{g}^{-1}\left\{{Q}_{m}\left(t\right)\right\}\) \(=\frac{1}{K}{ln}\left\{\frac{A{Q}_{m}\left(t\right)}{\left({Q}_{0}^{{\prime }}-{Q}_{m}\left(t\right)\right)R-\varDelta {R}_{0}{Q}_{m}\left(t\right)}+1\right\},\) (4)

where \({O}_{cc,m}\left(s\right)\) is the reference opening rate of the occluder and \({Q}_{m}\left(t\right)\) is the reference flow rate. Two first-order filters (\(1+{T}_{f}s\)) were introduced to generate a proper transfer function, and the dead time was approximated by a first-order delay \(1/\left(1+Ls\right)\) to enable the pole placement method at the optimization phase. The reference trajectory \({Q}_{m}\left(s\right)\) inputted to the arterial flow rate control unit was generated using the following transfer function.

$${G}_{m}\left(s\right) = \frac{1}{{\left(1+\sigma s\right)}^{3}} ,$$

5

where \({G}_{m}\left(s\right)\) modeled a skilled perfusionist controlling the arterial occluder, and its behavior was specified using an arbitrary time constant \(\sigma\).

To achieve automatic control of \({O}_{cc}\left(s\right)\), the proposed system was composed of an arterial flow rate control unit and a reservoir level control unit. The arterial flow rate control unit was nested in the reservoir level control unit to enable simultaneous modulation of reservoir level and arterial flow rates. Specifically, the reservoir level control unit modulated the opening rate of the arterial occluder, \({O}_{cc}\left(s\right)\), so that the reservoir level, \({Y}_{L}\left(s\right)\), matched the target reservoir level, \({R}_{L}\left(s\right)\). The arterial flow rate control unit modulated \({O}_{cc}\left(s\right)\) so that the arterial flow rate, \(Q\left(s\right)\), tracked the reference flow rate, \({Q}_{m}\left(s\right)\). The arterial flow rate control unit is a two-degrees-of-freedom model matching controller consisting of the FF controller and feedback (FB) PID controller, \({C}_{e}\left(s\right)\), defined by the following transfer function:

$${C}_{e}\left(s\right)={K}_{P,e}+\frac{{K}_{I,e}}{s}+{K}_{D,e}s ,$$

6

where \({K}_{P,e},{K}_{I,e},{K}_{D,e}\) are the proportional, integral, and derivative gains of the arterial occluder control unit, respectively.

The reservoir level control unit employs an I-PD controller\({ C}_{eL}\left(s\right)\) composed of an I controller \({C}_{eL,I}\left(s\right)\) and a PD controller \({C}_{eL,PD}\left(s\right)\) given by the following transfer functions:

$${C}_{eL,I}\left(s\right)=\frac{{K}_{I,L}}{s} ,$$

7

$${C}_{eL,PD}\left(s\right)=-{K}_{P,L}+{K}_{D,L}s ,$$

8

where \({K}_{P,L},{K}_{I,L},{K}_{D,L}\) are the proportional, integral, and derivative gains of the arterial occluder control unit, respectively. The output of the I-PD controller is then given by

$$Y\left(s\right)={C}_{eL,I}\left(s\right)\left\{{R}_{L}\left(s\right)-{Y}_{L}\left(s\right)\right\}+{C}_{eL,PD}\left(s\right){Y}_{L}\left(s\right)$$

9

,

where \({R}_{L}\left(s\right)\) is the target reservoir level, and \({Y}_{L}\left(s\right)\) is determined by integrating the difference between venous and arterial flow rates (\(1/s\) element on the right side of Fig. 2(a)).

There are two types of disturbances caused by surgeries: the suction of blood from the surgical field \(D\left(s\right)\) that increases the venous flow rate, and the fluctuation of the afterload \({D}_{y}\left(s\right)\), which is the resistance as the blood returns to the patient’s body that increases the reservoir level. It is theoretically provable by the final value theorem that the effect of disturbances such as suction flow rate \(D\left(s\right)\) and afterload fluctuation \({D}_{y}\left(s\right)\) approaches zero over time (see Supplementary information A2 for the proof).