# Patent

## Title
Fully automated control system for type 1 diabetes

## Abstract

An augmented, adaptive algorithm utilizing model predictive control (MPC) is developed for closed-loop glucose control in type 1 diabetes. A linear empirical input-output subject model is used with an MPC algorithm to regulate blood glucose online, where the subject model is recursively adapted, and the control signal for delivery of insulin and a counter-regulatory agent such as glucagon is based solely on online glucose concentration measurements. The MPC signal is synthesized by optimizing an augmented objective function that minimizes local insulin accumulation in the subcutaneous depot and control signal aggressiveness, while simultaneously regulating glucose concentration to a preset reference set point. The mathematical formulation governing the subcutaneous accumulation of administered insulin is derived based on nominal temporal values pertaining to the pharmacokinetics (timecourse of activity) of insulin in human, in terms of its absorption rate, peak absorption time, and overall time of action.

## Background
BACKGROUND
Type 1 diabetes is a chronic, life-threatening disease that is caused by failure of the pancreas to deliver the hormone insulin, which is otherwise made and secreted by the beta cells of the pancreatic islets of Langerhans. Insulin opens receptors on the cell surfaces, thereby regulating inflow of blood glucose, an essential cell nutrient. With the resulting absence of endogenous insulin, people with type 1 diabetes cannot regulate their blood glucose to euglycemic range without exogenous insulin administration. However, it is critical to provide accurate insulin dosing, so as to minimize and whenever possible eliminate low or high blood glucose levels. Both high glucose levels, known as hyperglycemia, and low glucose levels, known as hypoglycemia, can have debilitating and deleterious consequences. Hypoglycemia may result in a coma and can cause acute complications, including brain damage and paralysis. While severe hyperglycemia can also result in a coma, mild chronic hyperglycemia potentially results in long-term, deleterious, and even life-threatening complications, such as vascular disease, renal complications, vision problems, nerve degeneration, and skin disorders.
In practice, it has been necessary for people with type 1 diabetes to monitor their blood glucose and administer exogenous insulin several times a day in a relentless effort to maintain their blood glucose near euglycemic range. This is a demanding, painstaking regimen. Even those who successfully adhere to the regimen are burdened by it to varying degrees and often still struggle with maintaining good glycemic control. Those who do not follow a regimen are at risk for severe complications.
SUMMARY
It would be desirable to reduce the burdens associated with monitoring blood glucose levels and administering exogenous insulin, as well as to better regulate blood glucose levels of those with type 1 diabetes and avoid the complications of hyper- and hypoglycemic conditions. A disclosed closed-loop control system automatically commands delivery of insulin based on glucose measurements. Since slight overdosing of insulin is possible during online operation of such a system, an agent having a counter-regulatory effect to insulin action, such as a hormone known as glucagon, is also made available for delivery by the system.
In a disclosed automated control system for type 1 diabetes, an adaptive algorithm utilizing model predictive control (MPC) is employed. An input-output subject model is used in conjunction with the MPC algorithm to regulate blood glucose online, where the subject model is recursively adapted, and the delivery of insulin is based solely on online glucose concentration measurements. An MPC signal is synthesized by optimizing an objective function that regulates glucose concentration to a preset reference set point while simultaneously minimizing both the control signal aggressiveness and local insulin accumulation in the subcutaneous space or “depot” that receives the infused insulin. A mathematical formulation describing the subcutaneous accumulation of administered insulin is derived based on nominal temporal values pertaining to the pharmacokinetics (time-course of activity) of insulin in human, in terms of its absorption rate, peak absorption time, and overall time of action. The MPC algorithm also provides control action with an integral effect, and in essence minimizes overall drug consumption. The control algorithm provides the automated glucose-control system with self-learning capability that enables it to operate under unrestricted activity of the subject.
The subject model may be an empirical subject model, which may initially be constructed based on a system identification process performed on input-output data obtained from open-loop glycemic control of the subject. The controller may be further operative to generate the insulin control signal to provide a basal rate of delivery of insulin when the model-predictive control algorithm reveals no need for a corrective dose of insulin.



BRIEF DESCRIPTION OF THE DRAWINGS
The foregoing and other objects, features and advantages of the invention will be apparent from the following description of particular embodiments of the invention, as illustrated in the accompanying drawings in which like reference characters refer to the same parts throughout the different views. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention.
FIG. 1 is a block diagram of a fully automated control system for type 1 diabetes in accordance with the present invention;
FIG. 2 is a functional block diagram of a controller in the system of FIG. 1;
FIG. 3 is a flow diagram depicting the operation of the system of FIG. 1, including details of the operation of the controller of FIG. 2; and
FIG. 4 is a flow diagram depicting a particular implementation of a control step of FIG. 3.



DETAILED DESCRIPTION
FIG. 1 illustrates an automated control system 10 for regulating the blood glucose level of an animal subject (subject) 12, which may be a human. The subject 12 receives doses of insulin from a delivery device 14, which may be an infusion pump coupled by a catheter to a subcutaneous space of the subject 12 for example. As described below, the delivery device 14 may also deliver a counter-regulatory agent such as glucagon for more effective control of blood glucose level under certain circumstances. In the present description, reference is made to glucagon specifically, but it is to be understood that this is for convenience only and that other counter-regulatory agents may be used. For the delivery of both insulin and glucagon, the delivery device 14 is preferably a mechanically driven infusion mechanism having dual cartridges for insulin and glucagon respectively
A glucose sensor 16 is operatively coupled to the subject 12 to continually sample a glucose level of the subject 12. Sensing may be accomplished in a variety of ways. A controller 18 controls operation of the delivery device 14 as a function of a glucose level signal from the glucose sensor 16 and subject to user-provided parameters. One feature of the disclosed technique is its ability to perform without receiving explicit information regarding either meals that the subject 12 has ingested or any other “feedforward” information. One necessary user-provided initialization parameter is the weight of the subject 12. Another user-provided parameter is a “setpoint” which, as described below, establishes a target blood glucose level that the system 10 strives to maintain.
FIG. 2 shows a functional block diagram of the controller 18, specifically a high-level depiction of a control algorithm that is executed by software/firmware within the controller 18. As shown, a dose control signal u(t) is generated by an objective function optimizer 20 which receives as one input a setpoint signal r(t+k), which may be constant (independent of time). The dose control signal u(t) controls the operation of the insulin-glucagon delivery device (delivery device) 14 of FIG. 1. The input dose control signal u(t) is also provided to a subject model 22 which, as described in more detail below, explicitly models the response of the subject 12 to delivery of insulin and/or glucagon. The subject model 22 also receives an actual glucose level signal y(t) from sensor 16, and generates a predicted future glucose level signal ŷ(t+k|t) that is used in the operation of the objective function optimizer 18.
During operation, the dose control signal u(t) and actual glucose level signal y(t) are continually fed into the subject model 22, thereby internally updating the subject model 22 and generating updated output predictions ŷ(t+k|t). By comparison with desired future reference setpoint values r(t+k), the objective function optimizer 20 computes future error signals which are used to synthesize the dose control signal u(t) in an optimizing fashion based on a model predictive control (MPC) algorithm. An amount of insulin or glucagon corresponding to the input signal u(t) is physically administered to the subject 12 via the delivery device 14 and is also passed to the subject model 22. The glucose sensor 16 provides the latest measurement y(t) to complete the cycle, which is then executed anew.
The function of the subject model 22 is to predict future blood glucose levels based on current and past values of the signals u(t) and y(t). There are a variety of models that can be employed. The following describes one particular embodiment for the subject model.
An option for the subject model is one of an empirical form, which may be obtained by system identification performed on input-output data generated from open-loop glycemic control of the subject. The subject model could be of a single-Input single-output, auto-regressive moving average with exogenous input (ARMAX) structure, with the representation

A(z−1)yt=z−dB(z−1)ut+C(z−1)wt,   (1)

where ut denotes the (input) insulin-glucagon doses, yt denotes the (output) glucose concentration deviation from the reference set point, wt is a white Gaussian noise sequence, d is the inherent system time-delay (dead-time), z−1 plays the role of the unit delay shift operator, and the scalar polynomials A, B, C are given by

A(z−1)=1+a1z−1+a2z−2+ . . . +anz−n,

B(z−1)=b0+b1z−1+b2z−2+ . . . +bmz−m,

C(z−1)=1+c1z−1+c2z−2+ . . . +cpz−p,

The model's orders and delay may be determined beforehand from the offline system identification analysis. The identified model is then employed in the online integrated control system, except that the model parameters are not statically stipulated, but are dynamic (free), in the sense that they are recursively updated. Recursive (online) parameter estimation of a model such as (1) may be facilitated by re-writing the model in regressor form, namely as

yt=θTψt+wt,   (2)

where the the regressor ψt and θ are respectively given by

ψt:=[−yt−1 . . . −yt n ut d . . . ut d−mwt 1 . . . wt−p]T

θ:=[a1 . . . an b0 . . . bm c1 . . . cp]T.   (3)

With online parameter estimates packed in a time-varying version of vector θ, namely θt, and the estimate wt:=yt−ψtTθt used in ψt, one popular recursive estimation scheme is the Extended Least Squares [13, 14], which follows the scheme





  
    
      
        
          θ
          t
        
        =
        
          
            θ
            
              t
              -
              1
            
          
          +
          
            
              
                
                  P
                  
                    t
                    -
                    1
                  
                
                ⁢
                
                  ψ
                  t
                
              
              
                1
                +
                
                  
                    ψ
                    t
                    T
                  
                  ⁢
                  
                    P
                    
                      t
                      -
                      1
                    
                  
                  ⁢
                  
                    ψ
                    t
                  
                
              
            
            ⁢
            
              e
              t
            
          
        
      
    
    
      
        (
        4
        )
      
    
  
  
    
      
        
          P
          t
        
        =
        
          
            P
            
              t
              -
              1
            
          
          -
          
            
              
                P
                
                  t
                  -
                  1
                
              
              ⁢
              
                ψ
                t
              
              ⁢
              
                ψ
                t
                T
              
              ⁢
              
                P
                
                  t
                  -
                  1
                
              
            
            
              1
              +
              
                
                  ψ
                  t
                  T
                
                ⁢
                
                  P
                  
                    t
                    -
                    1
                  
                
                ⁢
                
                  ψ
                  t
                
              
            
          
        
      
    
    
      
        (
        5
        )
      
    
  




where et:=yt−ψtTθt−1, and P0 is taken to be a positive definite matrix. Another option for recursive parameter estimation is the Recursive Maximum Likelihood estimation method, which is similar to the Extended Least Squares, except that φt:=ψt/C(z−1) is used in lieu of ψt[14]. Other recursive (online) parameter-estimation schemes may also be used, such as the Instrumental Variable method, the Gradient estimation method, or alternate versions of these estimators that use a forgetting factor, to mention but a few options known to those skilled in the art [14]. Regardless of the scheme used, the adaptive subject model can be used to make online predictions of glucose concentrations and can be inherently employed by the controller block in generating the control signal.

The function of the objective function optimizer 20 is to generate the insulin and glucagon control signals u(t) in an optimized fashion based in part on the predicted blood glucose levels ŷ(t+k|t) from the subject model 22. There are a variety of optimization techniques that can be used. The following describes one particular embodiment of the objective function optimizer 20, which is also referred to as the “controller block” in the following description. The embodiment described below uses a model-predictive control (MPC) strategy.
The controller block may use one or more of the many MPC strategies, which all (1) make use of a mathematical model to predict the output at future time instants (horizon), (2) compute the control signal that optimizes an objective function at each step, and (3) employ a receding horizon strategy [5, 8]. The latter aspect refers to repeatedly displacing the prediction horizon towards the future, while only applying the first control signal in the calculated sequence at each step.
One popular MPC algorithm, compatible with an ARMAX subject model, is the Generalized Predictive Control (GPC) algorithm, which optimizes the multi-stage quadratic cost function given by




  
    
      
        
          
            J
            GPC
          
          =
          
            
              
                ∑
                
                  k
                  =
                  
                    N
                    d
                  
                
                
                  N
                  m
                
              
              ⁢
              
                
              
              ⁢
              
                
                  δ
                  k
                
                ⁢
                
                  
                    
                    
                      C
                      ⁡
                      
                        (
                        
                          
                            r
                            
                              t
                              +
                              k
                            
                          
                          -
                          
                            y
                            
                              t
                              +
                              k
                            
                          
                        
                        )
                      
                    
                    
                  
                  2
                
              
            
            +
            
              
                ∑
                
                  k
                  =
                  1
                
                
                  N
                  u
                
              
              ⁢
              
                
              
              ⁢
              
                
                  
                    λ
                    k
                  
                  ⁡
                  
                    (
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        u
                        
                          t
                          +
                          k
                        
                      
                    
                    )
                  
                
                2
              
            
          
        
        ,
      
    
    
      
        (
        6
        )
      
    
  




where Nd and Nm are respectively the minimum and maximum (output) prediction costing horizon limits, Nu the control horizon bound, δm the weighting on prediction error, and λn the weighting on control signals. Some general guidelines in GPC implementation include (1) Nd≧ d, since earlier outputs are not influenced by the current input signal, (2) the output horizon, Ny:=Nm−Nd, covering a substantial portion of the response rise time due to u(t|t), and (3) Ny≧Nu, with Nu=0 or square horizons, i.e Ny=Nu, popularly enforced.

For control action with integral effect, predictor and control design are based on

A(z−1)yt=z−kB(z−1)ut+C(z−1)wt/Δ,   (7)

with the corresponding Diophantine separation identity given by





  
    
      
        
          
            C
            
              A
              ⁢
              
                
              
              ⁢
              Δ
            
          
          =
          
            
              E
              k
            
            +
            
              
                z
                
                  -
                  k
                
              
              ⁢
              
                
                  F
                  k
                
                
                  A
                  ⁢
                  
                    
                  
                  ⁢
                  Δ
                
              
            
          
        
        ,
      
    
    
      
        (
        8
        )
      
    
  




where Fk is the remainder polynomial corresponding to the monic quotient polynomial Ek, the former and latter of respective orders n and k−1 in z−1, or specifically, Fk=f0+f1z−1+ . . . +fnz−n and Ek=1+c1z−1+ . . . +ek−1z−(k−1). The best predictor ŷt|t−k is then defined to satisfy

yt=ŷt|t−k+Ekwt,   (9)

which yields

Cŷt+k|t=GkΔut+k−d+Fktt,   (10)

where Gk:=EkB. Note that Gk is order (m+k−1) in z−1, and can be written as Gk=g0+g1z−1+ . . . +gm+k−1z−(m+k−1), with g0=b0, since Ek is monic ∀k. To implement the GPC algorithm, we re-write (10) as





  
    
      
        
          
            C
            ⁢
            
              
                y
                ^
              
              
                t
                +
                
                  k
                  ⁢
                  
                    
                    t
                  
                
              
            
          
          =
          
            
              
                ∑
                
                  i
                  =
                  0
                
                
                  k
                  -
                  d
                
              
              ⁢
              
                
              
              ⁢
              
                
                  g
                  i
                
                ⁢
                
                  z
                  
                    
                      -
                      i
                    
                    ,
                  
                
                ⁢
                Δ
                ⁢
                
                  
                
                ⁢
                
                  u
                  
                    t
                    +
                    k
                    -
                    d
                  
                
              
            
            +
            
              
                (
                
                  
                    G
                    k
                  
                  -
                  
                    
                      ∑
                      
                        i
                        =
                        0
                      
                      
                        k
                        -
                        d
                      
                    
                    ⁢
                    
                      
                    
                    ⁢
                    
                      
                        g
                        i
                      
                      ⁢
                      
                        z
                        
                          -
                          i
                        
                      
                    
                  
                
                )
              
              ⁢
              Δ
              ⁢
              
                
              
              ⁢
              
                u
                
                  i
                  +
                  k
                  -
                  d
                
              
            
            +
            
              
                F
                k
              
              ⁢
              
                y
                t
              
            
          
        
        ;
      
    
    
      
        (
        11
        )
      
    
  




where the first term on the right-hand side contains the only k−d future-terms (containing the sought control signal) for any k. Taking Nd=d and Ny+1=Nu+1=:N, i.e. square prediction and control horizons of N steps, we apply (11) over k=d→(Ny+d), and pack term contributions in the matrix-form equation given by

y=Gu+G′u+Fyt,   (12)

where





  y
  =
  
    
      
        
          [
          
            
              
                
                  C
                  ⁢
                  
                    
                      y
                      ^
                    
                    
                      t
                      +
                      
                        d
                        ⁢
                        
                          
                          t
                        
                      
                    
                  
                
              
            
            
              
                
                  C
                  ⁢
                  
                    
                      y
                      ^
                    
                    
                      t
                      +
                      d
                      +
                      
                        1
                        ⁢
                        
                          
                          t
                        
                      
                    
                  
                
              
            
            
              
                ·
              
            
            
              
                ·
              
            
            
              
                ·
              
            
            
              
                
                  C
                  ⁢
                  
                    
                      y
                      ^
                    
                    
                      t
                      +
                      N
                      +
                      d
                      -
                      
                        1
                        ⁢
                        
                          
                          t
                        
                      
                    
                  
                
              
            
          
          ]
        
        
          N
          ×
          1
        
      
      ⁢
      G
    
    =
    
      
        
          
            [
            
              
                
                  
                    g
                    0
                  
                
                
                  0
                
                
                  0
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
              
              
                
                  
                    g
                    1
                  
                
                
                  
                    g
                    0
                  
                
                
                  0
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
              
              
                
                  ·
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
              
              
                
                  ·
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
              
              
                
                  ·
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
                
                  0
                
              
              
                
                  
                    g
                    
                      N
                      -
                      1
                    
                  
                
                
                  
                    g
                    
                      N
                      -
                      2
                    
                  
                
                
                  ·
                
                
                  ·
                
                
                  ·
                
                
                  
                    g
                    0
                  
                
              
            
            ]
          
          
            N
            ×
            N
          
        
        ⁢
        u
      
      =
      
        
          
            
              [
              
                
                  
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        u
                        t
                      
                    
                  
                
                
                  
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        u
                        
                          t
                          +
                          1
                        
                      
                    
                  
                
                
                  
                    ·
                  
                
                
                  
                    ·
                  
                
                
                  
                    ·
                  
                
                
                  
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        u
                        
                          t
                          +
                          
                            1
                            ⁢
                            N
                          
                          -
                          1
                        
                      
                    
                  
                
              
              ]
            
            
              N
              ×
              1
            
          
          ⁢
          
            G
            ′
          
          ⁢
          u
        
        =
        
          
            
              
                [
                
                  
                    
                      
                        
                          (
                          
                            
                              G
                              d
                            
                            -
                            
                              
                                ∑
                                
                                  i
                                  =
                                  0
                                
                                U
                              
                              ⁢
                              
                                
                              
                              ⁢
                              
                                
                                  g
                                  i
                                
                                ⁢
                                
                                  z
                                  
                                    -
                                    i
                                  
                                
                              
                            
                          
                          )
                        
                        ⁢
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        
                          u
                          t
                        
                      
                    
                  
                  
                    
                      
                        
                          (
                          
                            
                              G
                              
                                d
                                +
                                1
                              
                            
                            -
                            
                              
                                ∑
                                
                                  i
                                  =
                                  0
                                
                                1
                              
                              ⁢
                              
                                
                              
                              ⁢
                              
                                
                                  g
                                  i
                                
                                ⁢
                                
                                  z
                                  
                                    -
                                    i
                                  
                                
                              
                            
                          
                          )
                        
                        ⁢
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        
                          u
                          
                            t
                            +
                            1
                          
                        
                      
                    
                  
                  
                    
                      ·
                    
                  
                  
                    
                      ·
                    
                  
                  
                    
                      ·
                    
                  
                  
                    
                      
                        
                          (
                          
                            
                              G
                              
                                N
                                +
                                d
                                -
                                1
                              
                            
                            -
                            
                              
                                ∑
                                
                                  i
                                  =
                                  0
                                
                                
                                  N
                                  -
                                  1
                                
                              
                              ⁢
                              
                                
                              
                              ⁢
                              
                                
                                  g
                                  i
                                
                                ⁢
                                
                                  z
                                  
                                    -
                                    i
                                  
                                
                              
                            
                          
                          )
                        
                        ⁢
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        
                          u
                          
                            t
                            =
                            
                              
                                +
                                N
                              
                              -
                              1
                            
                          
                        
                      
                    
                  
                
                ]
              
              
                N
                ×
                1
              
            
            ⁢
            F
          
          =
          
            
              
                [
                
                  
                    
                      
                        F
                        d
                      
                    
                  
                  
                    
                      
                        F
                        
                          d
                          +
                          1
                        
                      
                    
                  
                  
                    
                      ·
                    
                  
                  
                    
                      ·
                    
                  
                  
                    
                      ·
                    
                  
                  
                    
                      
                        F
                        
                          N
                          +
                          d
                          -
                          1
                        
                      
                    
                  
                
                ]
              
              
                N
                ×
                1
              
            
            .
          
        
      
    
  




The last two quantities in (12) are available at time t, as they are either directly measurable or depend only on past measurements, and can be grouped into a vector f, leading to:

y=Gu+f,   (13)

With δm=1 and λn=λ, (6) can be re-written as

JGPC=(G+f−r)T(G+f−r)+λuTu,   (14)

where r is the vector holding future set points as r=[Crt+d Crt+d+1 . . . Crt+N+d−1]T. Further manipulation of (14) leads to

JGPC=1⁄2uTHu+bTu+f0,   (15)

where

H=2(GTG+λI); bT=2(f−r)TG; f0=(f−r)T(f−r).

The unconstrained vector u minimizing JGPC can be found by inspection of (15), and is given by

uGPC=−H−1b=(GTG+λI)−1GT(r−f).   (16)

Since GTG≧0, (16) gives a unique solution, provided λ>0. Only the first control move is of interest at t, namely

Δut=[1 0 0 . . . 0](GTG+λI)−1GT(r−f).   (17)

The control increment or move in (17) is thus zero if the current situation and desired outcome coincide, that is if r−f=0, as it should. Finally, to deal with non-square horizons, which would only be permissible for Nu<Ny, G is replaced GNu, where GNu is composed of the first Nu+1 columns of G, and u is replaced by uNu, which contains the first Nu+1 elements of u, with everything else kept the same. Note that the Generalized Minimum Variance (GMV) control, with Ny=Nu=N−1=0, is a special instance of GPC with square horizons.

In the case of subcutaneous drug administration, drug accumulation in the subcutaneous depot (typically that of insulin) can be augmented to the raw control cost function of (6), and viewed as an additional control objective in the optimization process. The resultant online control signal simultaneously (1) optimizes the controller's aggressiveness, (2) minimizes insulin accumulation in the subcutaneous depot, and (3) regulates glucose concentration to a preset set point target value. The mathematical formulation governing the subcutaneous accumulation of administered insulin can be derived based on nominal temporal values pertaining to its pharmacokinetics (time-course of activity), in terms of its absorption rate, peak absorption time, and overall time of action (perfusion into plasma). If p(t) is the concentration, in mU/dl, of the drug in plasma as it is absorbed from the subcutaneous depot, its evolution can be taken to be governed by

p(t)=KU0(e−α1t−e−α2t).   (18)

where U0 is the subcutaneous-drug impulse dose in units (U), and K, α1, and α2 are positive constants. A measure of the pending effect of the accumulated amount of insulin in the SC depot can be taken to be the difference between the total area (ƒ0∞p(t) dt, i.e. a measure of the total, action over time due to close U0) and ƒ0tp(t) dt, i.e. a measure of the expended portion of U0. With the measure of the lingering effect of the outstanding quantity of insulin in the SC depot denoted by q(t), we arrive at





  
    
      
        
          
            q
            ⁡
            
              (
              t
              )
            
          
          :=
          
            
              
                
                  ∫
                  0
                  ∞
                
                ⁢
                
                  
                    p
                    ⁡
                    
                      (
                      t
                      )
                    
                  
                  ⁢
                  
                    
                  
                  ⁢
                  
                    d
                    t
                  
                
              
              -
              
                
                  ∫
                  0
                  t
                
                ⁢
                
                  
                    p
                    ⁡
                    
                      (
                      t
                      )
                    
                  
                  ⁢
                  
                    
                  
                  ⁢
                  
                    d
                    t
                  
                
              
            
            =
            
              
                
                  KU
                  0
                
                
                  
                    α
                    1
                  
                  ⁢
                  
                    α
                    2
                  
                
              
              ⁢
              
                (
                
                  
                    
                      α
                      2
                    
                    ⁢
                    
                      e
                      
                        
                          -
                          
                            α
                            1
                          
                        
                        ⁢
                        t
                      
                    
                  
                  -
                  
                    
                      α
                      1
                    
                    ⁢
                    
                      e
                      
                        
                          -
                          
                            α
                            2
                          
                        
                        ⁢
                        t
                      
                    
                  
                
                )
              
            
          
        
        ;
      
    
    
      
        (
        19
        )
      
    
  




As a discrete-time model, this can be written as





  
    
      
        
          
            
              
                q
                k
              
              =
              
              ⁢
              
                
                  
                    (
                    
                      
                        e
                        
                          
                            -
                            
                              α
                              1
                            
                          
                          ⁢
                          
                            T
                            g
                          
                        
                      
                      +
                      
                        e
                        
                          
                            -
                            
                              a
                              2
                            
                          
                          ⁢
                          Tg
                        
                      
                    
                    )
                  
                  ⁢
                  
                    q
                    
                      k
                      -
                      1
                    
                  
                
                -
                
                  
                    e
                    
                      
                        -
                        
                          (
                          
                            
                              α
                              1
                            
                            +
                            
                              α
                              2
                            
                          
                          )
                        
                      
                      ⁢
                      
                        T
                        g
                      
                    
                  
                  ⁢
                  
                    q
                    
                      k
                      -
                      2
                    
                  
                
                +
              
            
          
        
        
          
            
              
              ⁢
              
                
                  
                    K
                    
                      
                        α
                        1
                      
                      ⁢
                      
                        α
                        2
                      
                    
                  
                  ⁢
                  
                    (
                    
                      
                        α
                        2
                      
                      -
                      
                        α
                        1
                      
                    
                    )
                  
                  ⁢
                  
                    u
                    
                      k
                      -
                      
                        d
                        g
                      
                    
                  
                
                +
                
                  K
                  
                    
                      α
                      1
                    
                    ⁢
                    
                      α
                      2
                    
                  
                
              
            
          
        
        
          
            
              
              ⁢
              
                
                  (
                  
                    
                      
                        α
                        1
                      
                      ⁢
                      
                        e
                        
                          
                            -
                            
                              α
                              1
                            
                          
                          ⁢
                          Tg
                        
                      
                    
                    -
                    
                      
                        α
                        2
                      
                      ⁢
                      
                        e
                        
                          -
                          
                            (
                            
                              
                                α
                                2
                              
                              ⁢
                              
                                T
                                g
                              
                            
                          
                        
                      
                    
                  
                  )
                
                ⁢
                
                  u
                  
                    k
                    -
                    
                      d
                      g
                    
                    -
                    1
                  
                
              
            
          
        
        
          
            
              
                =
                
                ⁢
                
                  :
                  
                    
                      
                        -
                        
                          α
                          
                            1
                            q
                          
                        
                      
                      ⁢
                      
                        q
                        
                          k
                          -
                          1
                        
                      
                    
                    -
                    
                      
                        α
                        
                          2
                          q
                        
                      
                      ⁢
                      
                        q
                        
                          k
                          -
                          2
                        
                      
                    
                    +
                    
                      
                        b
                        
                          1
                          q
                        
                      
                      ⁢
                      
                        u
                        
                          k
                          -
                          
                            d
                            q
                          
                        
                      
                    
                    +
                    
                      
                        
                          b
                          2
                        
                        q
                      
                      ⁢
                      
                        u
                        
                          k
                          -
                          
                            d
                            q
                          
                          -
                          1
                        
                      
                    
                  
                
              
              ,
            
          
        
      
    
    
      
        (
        20
        )
      
    
  




where Ts is the sampling period. Incidently, IV dosing may be perceived as bypassing the SC depot, i.e. for an IV drug dose, q(t)=0 in (19) and qk=0 in (20), as if there were zero peak (α2→∞) and zero depletion or consumption times (α1→∞) from the SC depot into plasma, with coinciding values for α1 and α2. Before augmenting (20) to the original discrete-time model of (1), whose inherent units are mg/dl, we non-dimensionalize (20) and re-scale it to switch its inherent units from mU min/dl to mg/dl, so that control signal computation (optimization) is performed on an overall homogenous (augmented) system. An overall scaling factor to operate on (20) can be obtained from the steady-state effect of an impulse dose on blood glucose, taken to vary as per a scaled integration of (18). As such, the scaling factor,





  
    
      s
      f
    
    =
    
      
        
          
            y
            ∞
          
          ⁢
          
            α
            1
          
          ⁢
          
            α
            2
          
        
        
          
            U
            0
          
          ⁢
          
            K
            ⁡
            
              (
              
                
                  α
                  2
                
                -
                
                  α
                  1
                
              
              )
            
          
        
      
      ⁢
      
         
        1
      
    
  
  ,
  
    

  
  ⁢
  
    
      
         
        1
      
      ⁢
      Scaling
    
    ⁢
    
      
    
    ⁢
    factor
    ⁢
    
      
    
    ⁢
    
      s
      f
    
    ⁢
    
      
    
    ⁢
    provides
    ⁢
    
      
    
    ⁢
    the
    ⁢
    
      
    
    ⁢
    proper
    ⁢
    
      
    
    ⁢
    unit
    ⁢
    
      
    
    ⁢
    conversion
  
  ,
  
    

  
  ⁢
  
    but
    ⁢
    
      
    
    ⁢
    can
    ⁢
    
      
    
    ⁢
    be
    ⁢
    
      
    
    ⁢
    scaled
    ⁢
    
      
    
    ⁢
    further
    ⁢
    
      
    
    ⁢
    by
    ⁢
    
      
    
    ⁢
    a
    ⁢
    
      
    
    ⁢
    unitless
    ⁢
    
      
    
    ⁢
    
      factor
      .
    
  




in mg/(mU min), where y∞ is the steady-state exclusion (offset from reference) in blood glucose per unit impulse dose U0, can be used. The steady-state blood-glucose value, y∞, can be approximated from the pharmacodynamics of insulin, which is available in the literature. Augmenting the scaled qk-system of (20) to the original yk-system of (1), we obtain the single-input multiple-output model given by

A(z−1)yk=z−dB(z−1)uk+C(z−1)wk,   (21)

where yk=[yksfqk]T, wk is a vector of two white-noise sequences, and

A(z−1)=I2x2+A1z−1+A2z−2+ . . . +Anz−n,

B(z−1)=B0+B1z−1+B2z−2+ . . . +Bmz−m,

C(z−1)=I2x2+C1z−1+C2z−2+ . . . +Cpz−p,

with





  
    
      A
      1
    
    =
    
      [
      
        
          
            
              a
              1
            
          
          
            0
          
        
        
          
            0
          
          
            
              a
              
                1
                q
              
            
          
        
      
      ]
    
  
  ,
  
    
      A
      2
    
    =
    
      
        
          [
          
            
              
                
                  a
                  i
                
              
              
                0
              
            
            
              
                0
              
              
                
                  a
                  
                    2
                    q
                  
                
              
            
          
          ]
        
        ⁢
        
          A
          i
        
      
      =
      
        
          [
          
            
              
                
                  a
                  i
                
              
              
                0
              
            
            
              
                0
              
              
                0
              
            
          
          ]
        
        ⁢
        
          
            ∀
            i
          
          ⁢
          
            >
            2
          
        
      
    
  
  ,








  
    
      B
      0
    
    =
    
      [
      
        
          
            
              b
              0
            
          
        
        
          
            
              
                s
                f
              
              ⁢
              
                b
                
                  1
                  q
                
              
            
          
        
      
      ]
    
  
  ,
  
    
      B
      1
    
    =
    
      [
      
        
          
            
              b
              0
            
          
        
        
          
            
              
                s
                f
              
              ⁢
              
                b
                
                  2
                  q
                
              
            
          
        
      
      ]
    
  
  ,
  
    
      B
      i
    
    =
    
      [
      
        
          
            
              b
              i
            
          
        
        
          
            0
          
        
      
      ]
    
  
  ,
  
    ∀
    
      i
      >
      1
    
  
  ,
  
    

  
  ⁢
  
    
      C
      i
    
    =
    
      
        [
        
          
            
              
                c
                i
              
            
            
              0
            
          
          
            
              0
            
            
              0
            
          
        
        ]
      
      ⁢
      
        ∀
        
          i
          >
          0
        
      
    
  
  ,




where, for simplicity, the same system delay d of (1) can be assumed between qk and uk. Coupling between the two systems, via the same input signal, is relevant when solving for the optimal control signal [5], whereby matrix G is merely extended to give an analogous matrix, Ge, for the new system, the latter constructed as:





  
    
      G
      e
    
    =
    
      
        [
        
          
            
              
                g
                0
              
            
            
              0
            
            
              0
            
            
              ·
            
            
              ·
            
            
              ·
            
          
          
            
              
                g
                
                  0
                  q
                
              
            
            
              0
            
            
              0
            
            
              ·
            
            
              ·
            
            
              ·
            
          
          
            
              
                g
                1
              
            
            
              
                g
                0
              
            
            
              0
            
            
              ·
            
            
              ·
            
            
              ·
            
          
          
            
              
                g
                
                  1
                  q
                
              
            
            
              
                g
                
                  0
                  q
                
              
            
            
              0
            
            
              ·
            
            
              ·
            
            
              ·
            
          
          
            
              ·
            
            
              ·
            
            
              ·
            
            
              ·
            
            
              ·
            
            
              ·
            
          
          
            
              ·
            
            
              ·
            
            
              ·
            
            
              ·
            
            
              ·
            
            
              ·
            
          
          
            
              ·
            
            
              ·
            
            
              ·
            
            
              ·
            
            
              ·
            
            
              0
            
          
          
            
              
                g
                
                  N
                  -
                  1
                
              
            
            
              
                g
                
                  N
                  -
                  2
                
              
            
            
              ·
            
            
              ·
            
            
              ·
            
            
              
                g
                0
              
            
          
          
            
              
                g
                
                  
                    (
                    
                      N
                      -
                      1
                    
                    )
                  
                  ⁢
                  q
                
              
            
            
              
                g
                
                  
                    (
                    
                      N
                      -
                      2
                    
                    )
                  
                  ⁢
                  q
                
              
            
            
              ·
            
            
              ·
            
            
              ·
            
            
              
                g
                
                  0
                  q
                
              
            
          
        
        ]
      
      
        2
        ⁢
        
          
        
        ⁢
        N
        ×
        N
      
    
  
  ,




where the giq-entries pertain to the qk-system and are the analogues of the gi-entries in the yk-system. Vector f is also adjusted accordingly to yield an extended version, fe, which is twice in length. The GPC signal is again given by (17), except that Ge (or its first Nu+1 columns for non-square horizons) and fe are used in lieu of G and f respectively, in addition to using a trivially extended version, re, for r. The GMV control is recovered by setting Ny=Nu=N−1=0.

The following describes the use of constraints on the control signals u(t):
Constraints on input-output signals may be enforced to limit them to allowable, possibly subjective, fields of action. The output constraints are not usually explicitly contemplated, but rather implicitly enforced via optimizing the cost function [5]. In general, the input constraints can be described by

umin≦ut≦umax 

Δumin≦Δut≦Δumax.

Input constraints, such as minimum (basal) and maximum (bolus) doses, or their respective rate of change, may be explicitly enforced, possibly by saturation or clipping. The input constraints may be left for the user to initialize, but may at the same time be stipulated to be less than (and occasionally clipped or overridden by) a maximum allowable value, possibly based on the subject's weight.

FIG. 3 illustrates the overall process by which the system 10 of FIG. 1 operates. In step 24, the glucose level of the subject 12 is continually sensed by the glucose sensor 16, which generates a corresponding actual glucose level signal y(t). In step 26, the delivery device 14 operates in response to the insulin/glucagon dose control signal u(t) to deliver corresponding doses of insulin and glucagon to a subcutaneous space of the subject 12.
In step 28, the controller 18 generates the insulin/glucagon dose control signal u(t) as a function of the weight of the subject 12, the setpoint r(t+k), and time-varying glucose levels of the subject 12 as represented by the actual glucose level signal y(t) over time. Specifically, the controller 18 employs a control algorithm including steps 30 and 32 as shown.
In step 30, a subject model 16 is utilized to explicitly model response of the subject 12 to delivered doses of insulin and glucagon and thereby generate, based on time-varying values of the actual glucose level signal y(t) and the insulin/glucagon dose control signal u(t), a predicted glucose level signal ŷ(t+k|t) representing a predicted glucose level of the subject.
In step 32, the insulin and glucagon dose control signals u(t) are generated based on (a) a difference between the predicted glucose level signal ŷ(t+k|t) and the setpoint signal r(t+k) representing desired future levels of the glucose level of the subject 12, and (b) local accumulation of insulin in the subcutaneous space of the subject 12. This latter value is tracked according to the pharmacokinetics of insulin as described above.
FIG. 4 illustrates a particular implementation of the general step 32 of FIG. 3. In particular, the illustrated embodiment utilizes an MPC control strategy as described above. In step 34, the insulin/glucagon control signal u(t) is generated as optimizing an objective function with objectives of (a) a weighted integration of a difference between the actual glucose level signal y(t) and a predetermined setpoint value over a time horizon, and (b) a weighted integration of the insulin/glucagon control signal u(t) over the time horizon.
In step 36, the model parameters of the subject model 22 are recursively and continually updated to dynamically adapt the subject model 22 to variations in the response of the subject 12 to the delivered doses of insulin and glucagon.
It will be appreciated that the present invention may be embodied as an overall system such as shown in FIG. 1, as an overall method, as a controller such as shown in FIG. 2, and as a method performed by a controller such as shown in FIG. 4. With respect to the method performed by a controller, the method may be performed by computer program instructions executed by generic controller hardware including memory, a processing or execution unit, and input/output circuitry. The instructions may be provided to the controller from a computer-readable medium such as semiconductor memory, magnetic memory (e.g. magnetic disk), optical memory (e.g. optical disk such as CD, DVD), etc.
While this invention has been particularly shown and described with references to preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

## Claims

1. A system for automatic control of blood glucose level of a subject, comprising:
a glucose sensor operative to continually sense a glucose level of the subject and generate a corresponding glucose level signal;
a delivery device operative to deliver doses of insulin to the subject in response to an insulin dose control signal; and
a controller operative to generate the insulin dose control signal as a function of the weight of the subject and time-varying glucose levels of the subject as represented by the glucose level signal over time, the controller employing a control algorithm including:
generating the insulin dose control signal based on (a) the glucose level signal, and (b) accumulation of insulin in the subject due to finite rate of utilization,

wherein the controller employs a model-predictive control algorithm by which the insulin dose control signal is generated as a value optimizing an objective function with objectives of (a) a weighted integration of a difference between a predicted glucose level signal and a setpoint signal over a time horizon, and (b) a weighted integration of the insulin dose control signal over the time horizon.

2. A system according to claim 1, wherein the model-predictive control algorithm is an adaptive model-predictive control algorithm which includes recursively and continually updating model parameters to dynamically adapt the subject model to variations in the response of the subject to the delivered doses of insulin.

3. A system according to claim 1, wherein the objective function is augmented to also have an objective of (c) minimizing the accumulation of insulin in the subject due to finite rate of utilization.

4. A system according to claim 1, wherein:
(1) the control algorithm includes a subject model to explicitly model response of the subject to delivered doses of insulin and thereby generate, based on time-varying values of the glucose level signal and the insulin dose control signal, the predicted glucose level signal representing a predicted glucose level of the subject; and
(2) the insulin dose control signal is generated based on a difference between the predicted glucose level signal and the setpoint signal representing a desired glucose level of the subject.

5. A system according to claim 4 wherein the subject model is an empirical subject model.

6. A system according to claim 5, wherein the empirical subject model is of a type initially constructed based on a system identification process performed on input-output data obtained from open-loop glycemic control of the subject.

7. A system according to claim 1 wherein the controller is further operative to generate the insulin dose control signal to provide a basal rate of delivery of insulin when the control algorithm reveals no need for a dose of insulin that exceeds a basal rate of delivery.

8. A system according to claim 7 wherein the basal rate is determined by a user-provided basal-rate value.

9. A system according to claim 8 wherein the controller employs a default basal-rate value based on the weight of the subject when the user-provided basal-rate value is either absent or greater than a predetermined maximum allowable value.

10. A system according to claim 9 wherein the controller adapts the basal rate online based on the glucose level signal over time.

11. A system according to claim 10 wherein the controller is operative to automatically impose respective constraints on the insulin dose control signal corresponding to a maximum allowable dose of insulin.

12. A system according to claim 1 wherein the glucose sensor is integrated with the delivery device.

13. A system according to claim 12 wherein the delivery device comprises a mechanically driven infusion mechanism and a cartridge for insulin.

14. A system according to claim 1, wherein:
the delivery device is further operative to deliver doses of a counter-regulatory agent to the subject in response to a counter-regulatory-agent dose control signal; and
the controller is further operative to generate the counter-regulatory-agent dose control signal as a function of the weight of the subject and the time-varying glucose levels of the subject as represented by the glucose level signal over time.

15. A system according to claim 14 wherein the counter-regulatory agent comprises glucagon.

16. A system according to claim 14 wherein generating the counter-regulatory-agent dose control signal accounts for accumulation in the subject from past doses of the counter-regulatory agent.

17. A system according to claim 1, wherein delivery by the delivery device is to a subcutaneous space in the subject.

18. A system according to claim 1 wherein the generating of the insulin dose control signal based on the accumulation of insulin in the subject provides a controlling effect on aggressiveness of the control algorithm.

19. A system according to claim 1 wherein generating the insulin dose control signal is performed based on a combination of one or more first mathematical expressions of a relationship between the insulin dose control signal and the glucose level signal and one or more second mathematical expressions of an estimation of the accumulation of insulin in the subject based on the insulin dose control signal.

20. A system according to claim 19 wherein generating the insulin dose control signal based on the glucose level signal includes scaled summations of past and ongoing components of the insulin dose control signal and the glucose level signal, and wherein the estimation of the accumulation of insulin in the subject is obtained based on a scaled summation of accumulation contributions based on the insulin dose control signal, including past, ongoing, and/or future components of the insulin dose control signal.

21. A system according to claim 19 wherein the estimation of the accumulation of insulin in the subject is obtained by feedback of the insulin dose control signal.

22. A system according to claim 19 wherein the first and second mathematical expressions are used to obtain a control objective.

23. A method for automatic control of the blood glucose level of a subject, comprising:
continually sensing a glucose level of the subject and generating a corresponding glucose level signal;
operating a delivery device to deliver doses of insulin to the subject in response to an insulin dose control signal; and
generating the insulin dose control signal as a function of the weight of the subject and time-varying glucose levels of the subject as represented by the glucose level signal over time, by a control algorithm including:
generating the insulin dose control signal based on (a) the glucose level signal, and (b) accumulation of insulin in the subject due to finite rate of utilization,

wherein the control algorithm includes a model-predictive control algorithm by which the insulin dose control signal is generated as a value optimizing an objective function with objectives of (a) a weighted integration of a difference between a predicted glucose level signal and a setpoint signal over a time horizon, and (b) a weighted integration of the insulin dose control signal over the time horizon.

24. A method according to claim 23, wherein the model-predictive control algorithm is an adaptive model-predictive control algorithm which includes recursively and continually updating model parameters to dynamically adapt the subject model to variations in the response of the subject to the delivered doses of insulin.

25. A method according to claim 23, wherein the objective function is augmented to also have an objective of (c) minimizing the accumulation of insulin in the subject due to finite rate of utilization.

26. A method according to claim 23, wherein:
(1) the control algorithm includes utilizing a subject model to explicitly model response of the subject to delivered doses of insulin and thereby generate, based on time-varying values of the glucose level signal and the insulin dose control signal, the predicted glucose level signal representing a predicted glucose level of the subject; and
(2) the insulin dose control signal is generated based on a difference between the predicted glucose level signal and the setpoint signal representing a desired glucose level of the subject.

27. A method according to claim 26 wherein the subject model is an empirical subject model.

28. A method according to claim 27, wherein the empirical subject model is initially constructed based on a system identification process performed on input-output data obtained from open-loop glycemic control of the subject.

29. A method according to claim 23 further comprising generating the insulin dose control signal to provide a basal rate of delivery of insulin when the control algorithm reveals no need for a dose of insulin that exceeds a basal rate of delivery.

30. A method according to claim 29 wherein the basal rate is determined by a user-provided basal-rate value.

31. A method according to claim 30 wherein a default basal-rate value based on the weight of the subject is employed when the user-provided basal-rate value is either absent or greater than a predetermined maximum allowable value.

32. A method according to claim 31 wherein the basal rate is adapted online based on the glucose level signal over time.

33. A method according to claim 32 further comprising automatically imposing constraints on the insulin dose control signal corresponding to a maximum allowable dose of insulin.

34. A method according to claim 23, further comprising:
operating the delivery device to deliver doses of a counter-regulatory agent to the subject in response to a counter-regulatory-agent dose control signal; and
generating the counter-regulatory-agent dose control signal as a function of the weight of the subject and the time-varying glucose levels of the subject as represented by the glucose level signal over time.

35. A method according to claim 34 wherein the counter-regulatory agent comprises glucagon.

36. A method according to claim 34 wherein generating the counter-regulatory-agent dose control signal accounts for accumulation in the subject from past doses of the counter-regulatory agent.

37. A method according to claim 23, wherein delivery by the delivery device is to a subcutaneous space in the subject.

38. A method according to claim 23 wherein the generating of the insulin dose control signal based on (b) accumulation of insulin in the subject provides a controlling effect on aggressiveness of the control algorithm.

39. A method according to claim 23 wherein generating the insulin dose control signal is performed based on a combination of one or more first mathematical expressions of a relationship between the insulin dose control signal and the glucose level signal and one or more second mathematical expressions of an estimation of the accumulation of insulin in the subject based on the insulin dose control signal.

40. A method according to claim 39 wherein the relationship between the insulin dose control signal and the glucose level signal includes scaled summations of past and ongoing components of the insulin dose control signal and the glucose level signal, and wherein the estimation of the accumulation of insulin in the subject is obtained based on a scaled summation of accumulation contributions based on the insulin dose control signal, including past, ongoing, and/or future components of the insulin dose control signal.

41. A method according to claim 39 wherein the estimation of the accumulation of insulin in the subject is obtained by feedback of the insulin dose control signal.

42. A method according to claim 39 wherein the first and second mathematical expressions are used to obtain a control objective.

43. A controller for use in a system for automatic control of blood glucose level of a subject, the controller being operative to generate an insulin dose control signal as a function of the weight of the subject and time-varying glucose levels of the subject as represented by an glucose level signal over time, the glucose level signal being generated by a glucose sensor operative to continually sense a glucose level of the subject, the insulin dose control signal controlling the delivery of doses of insulin to the subject by a delivery device, the controller employing a control algorithm including:
generating the insulin dose control signal based on (a) the glucose level signal, and (b) accumulation of insulin in the subject due to finite rate of utilization,
wherein the control algorithm includes a model-predictive control algorithm by which the insulin dose control signal is generated as a value optimizing an objective function with objectives of (a) a weighted integration of a difference between a predicted glucose level signal and a setpoint signal over a time horizon, and (b) a weighted integration of the insulin dose control signal over the time horizon.

44. A controller according to claim 43, wherein the model-predictive control algorithm is an adaptive model-predictive control algorithm which includes recursively and continually updating model parameters to dynamically adapt the subject model to variations in the response of the subject to the delivered doses of insulin.

45. A controller according to claim 43, wherein the objective function is augmented to also have an objective of (c) minimizing the accumulation of insulin in the subject due to finite rate of utilization.