Fuzzy Model Predictive Controller for Artificial Pancreas

Received Oct 2, 2017 Revised Apr 19, 2018 Accepted Jul 1, 2018 This work consists on new tuning of Model Predictive Controllers using Fuzzy Logic method. Tree relevant parameters are automatically adjusted the prediction horizon Np, the input weight R and the output weight Q. The proposed controller is implemented in an Artificial Pancreas and tested under realistic conditions in a commercial platform of simulation. The result of the simulations revealed the success of such a method to improve the controller’s performances compared to the previous ones. Keyword:


INTRODUCTION
Model predictive control (MPC) is one of the most successful techniques of advanced control in industry due to its explicit consideration of hard constraint in the optimization, the optimal character of its solution and its capacity to predict future evolution of the system [1]. Until now, just a few guidelines related to MPC parameters tuning exist in literatures. Indeed, these parameters are frequently determined via trial and error procedure. This parameters can be input and output weights in the objective function, prediction and control horizons and constraints. Instead of using an auto-tuning which still a limited technique, it is more interesting to apply an external optimization algorithm. An appropriate automatic tuning of MPC parameters can remarkably ameliorate the performance of control. Many works dealing with automatic tuning of MPC are available in the literature. The paper of Garigga presents a general review of different tuning methods [2]. Trierweiler and Farinab [3] developed an algorithm to tune MPC based on the system degree of directionality and the attainable performance, but the method is complex and requires special competences for implementation and an easier adjustment method is required. Ali et al. [4] applied the concept of fuzzy logic to optimize the parameters of the predictive control. They measure the performance violations and establish the fuzzy rules which constitute the general regulation directives available in the literature for determining the new values of the parameters. Vega et al. [5] presents a nominal model of the process to solve a mixed sensitivity problem with constraints using a frequency domain methods. Despite the significant progress realized in this domain, the development of a general method is still a challenge due the difficulty to perform analytical studies and complexity of methods. The purpose of this paper is to design a control algorithm that can overcomes actual challenges in the automatic glucose control. The principle of the new method is to introduce a new formulation of the cost function of MPC that gives a fast controller capable to reject rapidly the effect of meal intake and avoid hypoglycemia. An automatic tuning of Model Predictive Control using Fuzzy Logic algorithm is presented. The proposed tuning adjust online tree parameters of MPC to ameliorate control performances.

RESEARCH METHOD 2.1. Model
The proposed tuning is implemented in an Artificial Pancreas (AP) witch is one of the most challenging control problems. Difficult dynamics, interaction between process variables, and the presence of disturbances contribute to the complexity of the blood glucose control, AP is an automated system that manages blood glucose and reduce T1DM risks like, hypo/hyperglycemia, and it mimics the glucose regulating function of a healthy pancreas. AP Device System consists of three components: A continuous glucose monitoring system (CGM), an insulin infusion pump and a control algorithm that connect the CGM and the insulin infusion pump, it determines and injects the right amount of insulin over time. Figure 1 shows components of the AP.

Figure 1 Components of an Artificial Pancreas
The model used in this study [6] is linearized around a steady-state that has been reached by applying the basal rate specific to the subject UBASAL U/h, and lead to a steady-state output ys = 110 mg/dL, the transfer function of the system is: With U(Z -1 ) and Y(Z -1 ) are the z-transform of the time-domain signals of the input Ui and the output Yi, respectively. Z -1 is the backwards shift operator, c:= -60 (1-p1) (1-p2) 2 is a constant employed to set the correct gain, to covert the unit, F:=1.5 (unitless ) is a safety factor, p1 = 0.98, p2 = 0.965 are poles of the transfer function and UTDI [U] is the subject specific total daily insulin amount.

Controller Design
Model Predictive Control (MPC) is a class of computer control algorithms that solves an online optimization problem at each sampling point. The concept of MPC is shown in Figure 2. MPC utilizes predictive outputs which is estimated within Np steps (prediction horizon) in the future using an internal model. It minimize an objective function, which consists of weighted sum of tracking error of predictive outputs to set points , manipulated signals uk, penalized with the input weight R and the output weight Q. MPC problem can be formulated as an optimization problem, which determine input signals u(k), ..., u(k+Nu-1) within Nu steps (control horizon) in the future so that the objective function is minimized considering constraints in [7]. The formulation of the optimization problem is: With cost function:

MPC Tuning method 2.3.1. Fuzzy logic concept
Fuzzy systems allow to prevail a relative truth as membership function that takes values between 0 and 1. The concept of fuzzy theory was introduced by Zadeh (1965). FL can handle uncertainties, imprecision and incomplete data. Indeed it can model non-linear systems and complex functions [8]. A Fuzzy Logic System (FLS) is generally composed of three parts: fuzzification, inference engine and defuzzification. • The fuzzification part corresponds to the definition of linguistic variables of inputs and outputs. • The inference part corresponds to the definition of rules describing the system working. • The defuzzification part computes outputs command. The block diagram of an FLC is shown in Figure 3.

Synthesis of the fuzzy controller
A new tuning technique is presented in this section. This method adapts online the parameters of MPC in order to ameliorate closed loop performance by a rapid rejection of disturbance and avoid overshoot causing hypoglycemia and big peak with long duration of hyperglycemia. In general the desired performances in glycemic control are maintaining proper speed of the response, reducing overshoot and rejecting disturbances. Two different input fuzzy sets and one output fuzzy set are used. Figure 4 shows the first input set. We define the scaled bound violation if lower bound is violated as: If upper bound is violated as: Equations above define A and B as negative value if the corresponding bound is not violated and positive otherwise.  Figure 5 shows the second input fuzzy set. The set is composed of three functions called positive (P), zero (Z) and Negative (N), these functions are denoted by , and , respectively. The scaled violation rate is the second input to the fuzzy, it is defined as:  Figure 6 shows the output fuzzy sets for , and Np symbolized by LN, SN, Z, SP and LP. The membership functions 5 , 4 , 3 , 2 , and 1 represent respectively these sets. The general understanding of the role of , and Np on the closed-loop is given by the rules in Table 1.  Table 1 shows the basic rules governing the tuning guidelines. , and are the rules output for R, Q and Np respectively.
If B is G and C is N Then is Z Then is Z Then is Z After transforming the rule into mathematical expressions, the center of area (COA) method can be applied to find the MPC parameters R and Q as follows: The argument Z can represent R or Q, for the output of the prediction horizon Np is determined as follows: Where nf is the number of output membership functions, nR is the number of rules equals to 10 in this paper and δi is value for the location of the center of μi. i is fixed and pre-assigned, the MPC parameters can be changed by at the most ±50%, therefore the arbitrary values for δ are selected taking in consideration this variation. Then set MPC parameters as: ( ) = ( ) ( + ( ) ) , = , … , ;

RESULTS AND DISCUSSION
The FZ-MPC algorithm was tested under the UVa/Padova simulator in order to evaluate their performances. The simulator was approved by the U.S. Food and Drug Administration (FDA) [9] for verification of control algorithms for AP before doing clinical trials on T1DM subjects, this trials are equivalent to animal test. A comparison to non adapted MPC used in [10] is done under a realistic scenario, this controller uses a fixe and a manual tuning of the controller with R=500, Q=0.9, Np=8 and Nu=5 while the FZ-MPC parameters are in the intervals 14 ≤ R ≤ 7000, 0 ≤ Q ≤ 1, 3 ≤ Np ≤ 10.
The simulator contains a set of different virtual patients with varying parameters, such as weight, age, gender, 30 in silico subjects of the commercial version (v3) of the UVa/Padova simulator are used in this study to evaluate the control performance of the FL tuning of MPC, this subjects are composed from 10 adults, 10 children and 10 adolescents. Simulations started at 6:00 pm and took 28 hours to be concluded. Every simulation included three meals during the day: Dinner 60 gram carbohydrate (gCHO), breakfast 60 (gCHO), lungh 70 (gCHO) meals consumed at 8:00PM, 07:00AM, and 1:00PM, respectively. Figure 7 depicts the mean of the blood-glucose and insulin delivery trajectories for the 30 subjects during time of simulations under a realistic scenario. From the resulting plot it can be seen that the evolution of glycemia after the meal intake reaches values near to 400 mg/dl in the case of non-adapted MPC, however it doesn't exceed the 300 mg/dl for the proposed tuning. Referring to Figures 7 we can confirm that the duration of hyperglycemia in the case of FZ-MPC is shorter, this will eliminate long term complication of diabetes. The proposed method success in reducing the amount of insulin injected comparing to non-adaptive controller this due to the acceleration of command action. Furthermore the post-prandial peak of glycemia is dropped compared to the classical controller. The secret behind the success of the fuzzy tuning is the intelligent management of decisive MPC parameters. This one manages to reduce the value of R greatly in order to accelerate the tracking of reference without inducing overshoots. For the second parameter the automatic tuning tends to increase the value of at the beginning of change in blood glucose. Then, it is minimized to make the response more conservative thus avoiding hypoglycemia and taking into consideration the delay in insulin absorption. The horizon of prediction is extended when the glycemia change to predict precisely the future evolution and it is reduced elsewhere to reduce computational time.
To conclude discussion of results, performance of the finding method has been clearly demonstrated. The proposed method can overcome limit of the compared algorithm. The non-adapted approach fail to maintain blood glucose in a safe range due to delay in rejection, in addition to some hypoglycemia related to excess in insulin injection. The proposed controller achieves good performance by making the response conservative when the system is stable and accelerating control when a change in blood glucose level happens.

CONCLUSION
In this paper, we presented new tuning of MPC using fuzzy logic method. Tree MPC parameters are automatically adjusted the prediction horizon Np, the input weight R and the output weight Q. The attractive feature of the proposed tuning algorithm is the minimal computation time required because it requires no solution of optimization problems or complex mathematical analysis. The simulation of the FZ-MPC applied to Artificial Pancreas demonstrates the capability of the tuning algorithm to ameliorate performance of the closed loop by rapid rejection of disturbance and an avoidance of overshoot causing hypoglycemia and big peak of hyperglycemia.