Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

Blood-glucose regulator design for diabetics based on LQIR-driven Sliding-Mode-Controller with self-adaptive reaching law

Abstract

Type I Diabetes is an endocrine disorder that prevents the pancreas from regulating the blood glucose (BG) levels in a patient’s body. The ubiquitous Linear-Quadratic-Integral-Regulator (LQIR) is an optimal glycemic regulation strategy; however, it is not resilient enough to withstand measurement noise and meal disruptions. The Sliding-Mode-Controller (SMC) yields robust BG regulation effort at the expense of a discontinuous insulin infusion rate that perturbs the BG concentrations. Hence, the novel contribution of this article is the formulation of a hybridized LQIR-driven SMC strategy that retrieves the benefits of the aforesaid control schemes while avoiding their inherent problems. The proposed control approach is realized by linearly combining a glycemic LQIR law with an innovative sign function sliding mode reaching law that is driven by a customized LQIR-driven sliding surface. The hybridized control scheme generates optimal control decisions yielded by the LQIR while mimicking the robustness characteristic of SMC against bounded exogenous disturbances. Additionally, the SMC reaching law in the proposed control scheme is augmented with a nonlinear adaptation mechanism that flexibly modulates the control activity to effectively compensate for the external perturbations while minimizing the chattering content. The controller parameters are numerically optimized offline. The efficacy of the prescribed hybrid control law is analyzed via customized MATLAB simulations that normalize the patient’s BG level to 80 mg/dL, under measurement noise and meal disruptions, from an initial hyperglycemic state. The results justify the improved BG regulation accuracy and disturbance-rejection capability of the proposed control procedure.

1. Introduction

Type-I Diabetes (TID) is a disorder of the endocrine system, which is characterized by the degeneration of the insulin-generating pancreatic T-cells caused by an autoimmune attack or genetic predisposition [1]. This disorder mitigates the body’s capacity to create the insulin required to maintain the blood glucose (BG) levels in the bloodstream at the desired reference, which subsequently induces metabolic dysregulation [2]. This metabolic disorder has affected the quality of life of millions of people all over the globe [3]. The TID patients rely upon well-postulated BG regulation control of the exogenous insulin administration to normalize their BG levels under every condition to prevent any diabetic complications [4]. Designing a reliable control law for the aforementioned biological endocrine system that maintains reasonable resilience against exogenous glycemic disturbances presents a challenging control problem [5].

1.1. Literature review

The Bergman Minimal Model (BMM) is a widely used mathematical representation of glucose-insulin dynamics in T1D patients [6]. This model is essential for understanding how insulin impacts glucose levels in the blood. The Cobelli model is an extension of the Bergman model that incorporates additional physiological processes such as insulin secretion, hepatic glucose production, and peripheral glucose uptake [7]. It is particularly useful for simulating the effects of different insulin therapies. The Hovorka model is a comprehensive mathematical model for glucose-insulin dynamics in TID patients [8]. This model is widely used in the design and testing of closed-loop insulin delivery systems (artificial pancreas). The Sorensen model is a detailed compartmental model that describes glucose and insulin kinetics, incorporating multiple compartments for insulin absorption, distribution, and degradation [9]. The Dalla Man model includes a detailed description of glucose absorption from the gut, insulin secretion, and glucose-insulin interaction [10]. This model accounts for both intravenous and oral glucose tolerance tests, making it suitable for a wide range of simulation scenarios.

In scientific literature, numerous closed-loop BG regulatory control techniques have been put forth to optimize the exogenous insulin administration for glycemic control of TID patients [11]. The pervasive Proportional Integral Derivative (PID) controllers are exceedingly popular for glycemic regulation due to their computational simplicity and reliable control yield [12, 13]. However, they are rendered ineffective against unmodeled nonlinear disturbances owing to their limited degrees of freedom. The augmentation of fractional-order and complex-order calculus tends to increase the resilience and adaptability of the PID control procedure by introducing new hyper-parameters in its structure [14, 15]. However, the offline optimization of these parameters is a laborious task. The neuro-fuzzy intelligent control procedures are known to deliver an agile BG control effort. However, the neural controller requires a large and reliable training data set to synthesize an accurate inverse control law [16]. The fuzzy logic controllers, on the other hand, require an elaborate set of well-postulated qualitative rules that are empirically derived as per the expert’s knowledge [17]. Dependence on an expert’s knowledge inevitably induces imprecision in the empirically derived set of rules. The computational requirements of the aforementioned intelligent control procedure put an excessive burden on the computer.

The Linear-Quadratic-Regulator (LQR) controller is a renowned state feedback compensator that minimizes a pre-configured quadratic performance index of state variables and control inputs to provide optimum control decisions [18]. However, despite its innate optimal behavior, the model-based nature incapacitates the LQR to robustly compensate for the identification errors, model changes, and parametric indeterminacies contributed by the bounded exogenous disturbances [19, 20]. Owing to its versatility and capacity to optimize performance over a prediction horizon, the Model Predictive Control (MPC) has become a robust method for glucose regulation [21]. However, resource-constrained situations may find it difficult to implement MPC since it can be computationally demanding and may require sophisticated algorithms for real-time realization [22].

The ubiquitous Sliding-Mode-Controller (SMC) is a variable-structure compensator that is well-known for its robust control yield [23]. It effectively rejects the parametric variations and external disturbances by efficiently transitioning between the sliding surfaces with the aid of a pre-configured switching function [24]. The SMC scheme, and its modified variants, have been extensively used in the scientific literature to regulate the BG concentration levels in TID patients, especially under meal-induced perturbations [25]. Modified variants of fast terminal sliding mode control strategies are particularly beneficial for under-actuated systems, where precise and rapid control is essential [26, 27]. Despite its inherent robustness, the repetitive switching in the SMC law leads to highly discontinuous control yield that induces chattering in the patient’s BG concentration levels [28]. The resulting ripples in the BG state response are detrimental to the health of the TID patient [29]. The control strategy proposed in [30] attempts to improve chattering in a conventional SMC technique. The integral sliding mode control (ISMC) introduces an integral component in the sliding surface that helps in smoothing the control action, whereas the adaptive backstepping can use the online parameter adaptation to reduce the chattering. Utilization of a high-gain, as well as variable-gain differentiator in the SMC variants, enhances the accuracy of state and derivative estimations under noisy conditions, which ensures superior trajectory tracking and stabilization for underactuated systems [31, 32]. However, the aforementioned approaches put unnecessary computational burdens on the computer.

The H-infinity control can robustly reject exogenous disturbances and parametric uncertainties and disturbances, which makes it an effective tool for glucose regulation applications where patient dynamics and meal disturbances tend to vary randomly [33]. However, it can also be excessively conservative while aiming to minimize the worst-case scenario, which often leads to sub-optimal performances. While backstepping control schemes work very effectively for smooth nonlinearities in BG regulation applications; however, unlike H-infinity, they lack the necessary resilience against large perturbations contributed by meal intake or stress conditions [34]. The ubiquitous adaptive control strategies self-tune the controller parameters online as per the changes in the patient’s state variations [35]. The complexity of adaptive algorithms, however, may potentially result in higher processing demands and possible instability when commuting between various control modes [36]. Recently, machine learning (ML) techniques have gained a lot of traction in enhancing glucose regulation through predictive modeling and clinical decision support [37]. However, despite their effectiveness, the aforementioned techniques necessitate large datasets and intensive training, which inevitably puts excessive recursive computational burden on the computer [38].

The LQR is ideal for applications where an optimal control yield is required while preserving the asymptotic stability of the system; whereas, the SMC laws are best suited for applications where the system is required to robustly nullify the impact of exogenous (bounded) disruptions [39]. The BG-level regulation system has all the aforementioned requirements [40]. It requires the control law to robustly and accurately track the reference BG level, even under the influence of meal disturbances, while guaranteeing an optimal insulin infusion rate (IIR) as well as the system’s closed-loop stability [41].

1.2. Proposed methodology

The novel contribution of this paper is to formulate and validate a hybrid robust-optimal BG regulation control procedure for TID patients to normalize their BG concentration levels while effectively rejecting the impact of bounded meal disruptions and sensor noise. The dynamics of the virtual patient are simulated via the well-known Bergman Minimal Model (BMM). The ubiquitous Linear-Quadratic-Integral Regulator (LQIR) is used as the benchmark control procedure for comparison with the proposed scheme. The proposed hybrid control procedure is realized by devising an LQIR-driven self-regulating SMC law. The LQIR’s nominal control input is used to formulate the SMC law that collaborates with the baseline optimal regulator to efficiently reject the bounded meal disruptions while maintaining an economical IIR. The SMC law’s switching gain is dynamically adjusted online via a pre-configured nonlinear hyperbolic adaptation function, which further enhances the reference BG-level tracking and disturbance attenuation ability of the prescribed hybrid control procedure. The innovative contributions of this research work are listed below:

  1. Design of a nominal LQIR using the BMM to regulate the BG levels in TID patients.
  2. Formulation of an SMC law that uses LQIR’s control input to develop the customized sliding surface.
  3. Linear combination of the LQIR with the proposed SMC law to constitute the proposed collaborative LQIR-driven SMC law that beneficially combines the optimality and robustness of its constituent controllers. The stability analysis of the prescribed control procedure is also presented.
  4. Self-regulation of the SMC’s switching gain through a customized nonlinear hyperbolic scaling function of the sliding surface.
  5. Investigation of the prescribed control procedure via software simulations that validate its setpoint regulation and disturbance rejection capacity.

The proposed innovative LQIR-driven SMC strategy innovatively retrieves the benefits of the aforesaid control schemes while avoiding the inherent problems. The hybridized control approach generates an optimal control yield (synonymous with LQR) while mimicking the robustness characteristic of SMC against bounded meal disruptions. Furthermore, the prescribed control procedure avoids the non-robust reachability phase associated with the ubiquitous SMC law while robustly compensating for matched uncertainties [39]. The stability proof of the prescribed control procedure is also presented. Additionally, the proposed control procedure is also augmented with a sliding surface-dependent nonlinear hyperbolic adaptation function that dynamically increases the SMC switching gain under the influence of meal-induced BG-level disruptions, and vice versa. The said modification also mitigates the chattering in the state responses by generating a relatively smoother control input while preserving its robustness. The formulation and simulation of the proposed LQIR-driven self-regulating SMC law for a BG regulation system has not been investigated in the open literature thus far. Hence, the idea presented in this paper is novel.

1.3. Innovative features of the proposed control law

The LQIR-driven SMC with adaptive switching gain offers a powerful combination of optimal control, robustness, and adaptability. It is especially suitable for dynamic environments with high uncertainty, such as the BG regulation problem. Table 1 presents a brief qualitative comparison of the proposed control law with MPC, backstepping, and other controllers. The proposed control scheme ensures fast response and safe insulin administration, with improved disturbance rejection (against meals and stress) due to adaptive gain tuning.

thumbnail
Table 1. Comparative analysis of the proposed scheme with other controllers.

https://doi.org/10.1371/journal.pone.0314479.t001

On the contrary, the MPC offers optimal glucose control but is computationally expensive and highly sensitive to model variations and prediction errors [21]. Due to ream-time gain optimization, it has a slower response time and high computation burden. Adaptive backstepping is effective for nonlinear systems but may struggle with meal disturbances [34]. It shows gradual adaptation to new and unpredictable disturbances (meals or stress activity). It involves recursive tuning and subsystem design, which makes the design complex and increases the computational load. The classical PID controller is easy to implement but lacks robustness [13]. The fuzzy controllers provide good disturbance handling but may not match the precision or the computational economy of LQIR-driven adaptive SMC [17]. Moreover, its robustness and computational burden depend on the number of rules used to implement the control law. Therefore, the LQIR-driven adaptive SMC is a strong candidate for personalized and robust blood glucose management, addressing the key challenges in maintaining safe and stable glycemic levels.

The remainder of the paper is arranged as follows: Section 2 presents the glucose-insulin model and the LQIR’s constitution for BG regulation. Section 3 presents the formation and stability analysis of the proposed LQIR-driven self-regulating SMC law. Section 4 presents the controller parameter tuning procedure. Section 5 examines the outcomes of the software simulations. Section 6 discusses the challenges presented by the practical implementation of the proposed control scheme along with potential future research directions. Section 7 concludes the work.

2. Glucose-insulin regulation mechanism

This section presents a closed-loop control procedure used for delivering insulin to prevent hyperglycaemia in TID patients [41]. As described earlier, an excessive (or insufficient) insulin infusion alters the patient’s BG concentration levels, which has a negative impact on their health. The BG levels can be normalized by continually infusing appropriate amounts of insulin into the bloodstream of the TID patient. The glucose-insulin regulation schematic is depicted in Fig 1 [15]. As the subcutaneous injection approach mimics the body’s natural insulin release, it is believed to be the safest way to give the body an insulin dose. The schematic comprises a glucose sensor that continuously monitors and compares the BG concentration levels with the setpoint reference (80mg/dL). Based on the instantaneous error in the BG levels, a feedback control procedure is used to actuate an insulin pump that variably modifies the IIR in the patient’s bloodstream. The infusion is stopped when the BG level approaches the setpoint.

thumbnail
Fig 1. Schematic of the closed-loop glucose-insulin regulation mechanism [15].

https://doi.org/10.1371/journal.pone.0314479.g001

2.1. Glucose-insulin dynamic model

The patient’s glucose-insulin dynamics are mathematically modeled by using the BMM approach [14]. This technique accurately assesses the functionality of the artificial pancreas and identifies its model while presenting very few biological complications.

While the Hovorka, Cobelli, or Sorensen models for simulating the dynamics of insulin delivery systems offer comprehensive physiological detail, the BMM is chosen in this study owing to its simplified and flexible structure, which allows for easier implementation, adaptation, and interpretation of results [610]. The BMM is an excellent tool for demonstrating fundamental glucose-insulin dynamics and developing a reliable control system design without the added complexity of the aforementioned models. For initial proof-of-concept studies, the BMM provides a straightforward framework to test hypotheses and develop BG regulation control algorithms before applying them to more complex models. This approach ensures that basic functionalities are correctly implemented and potential issues are identified early. The computational requirements of BMM aid in performing numerous iterations quickly, facilitating efficient optimization and sensitivity analyses. Additionally, parameter calibration in the BMM is more straightforward due to the smaller number of parameters involved as compared to other sophisticated models, making it suitable for scenarios with limited clinical data.

The glucose metabolism process dictated by the BMM is represented via the following set of differential equations [15, 42].

(1) where, G(t) is the BG concentration level, X(t) is the insulin concentration level in a “remote” compartment, I(t) is the blood-insulin concentration level, Gm(t) is the meal disruption input, v(t) is the modified IIR that serves as the system’s control input, Gss is the steady-state BG concentration and is treated as the set point (reference) BG-level, Ib is the steady-state concentration level of blood-insulin, n is the plasma insulin’s decay-rate, V1 is the blood volume, p1 is the rate parameter for glucose effectiveness that quantifies the effectiveness of glucose to be cleared from the bloodstream independent of insulin action, p2 is the insulin clearance rate that represents how quickly the effect of insulin diminishes after it is released into the bloodstream, and p3 is the rate parameter for insulin sensitivity that measures the response of glucose uptake by muscle cells to insulin, is the error between the patient’s actual and steady-state BG concentration levels, and ε(t) is the BG error integral variable. The pre-configured model parameters p1,p2, and p3 are associated with the blood specimen being analyzed. The error integral supplements the system’s setpoint-tracking accuracy and strengthens its damping against meal disturbances [43]. The state space representation of the glucose-insulin system model is shown below.

(2) where, x(t) is the state vector, y(t) is the output vector, u(t) is the control input, d(t) is the disturbance input, A is the system matrix, B is the control input matrix, F is the disturbance input matrix, C is the output matrix, and D is the feed-forward matrix. The state and input vectors of the said system are expressed in Eq 3.

(3)

The matrices associated with the system’s state space model are given by Eq 4 [15].

(4)

The state variable G(t) is also designated as the system’s output variable. Table 2 lists the model parameters utilized in this study for a healthy individual and three distinct patients [24].

thumbnail
Table 2. Model parameters for a healthy individual and three distinct patients [24].

https://doi.org/10.1371/journal.pone.0314479.t002

2.2. Baseline LQIR formulation

The LQIR is an optimal state space control strategy that includes an auxiliary integral error state variable to improve the setpoint-tracking accuracy and damping against overshoots and undershoots [44].

An energy-like quadratic performance index (QPI) of the input and state variables is minimized. The Hamilton-Jacobi-Bellman (HJB) equations are then solved to devise the aforementioned optimal state-compensator offline [45]. The QPI used here is expressed below. (5) where R ∈ ℝ is a preset positive definite control penalty matrix and Q ∈ ℝ4×4 is a preset positive semi-definite state penalty matrix. The Q and R matrices, respectively, govern input variations and penalize the state of the system. The following is a symbol representation of these matrices.

(6)

The coefficients of these matrices are denoted as qx≥0 and ρ>0. These coefficients are adjusted offline through the tuning process covered in Section 4. The following algebraic Riccati equation (ARE) uses the optimized set of aforementioned coefficients to calculate its solution, the P matrix. (7) where P is a positive definite symmetric matrix with dimensions of ℝ4×4. The state compensator gain vector K is computed as indicated in (8). (8) where, K = [kG kX kI kε]. The nominal LQIR law is expressed as follows.

(9)

Fig 2 displays the block diagram of the LQIR scheme.

thumbnail
Fig 2. Block diagram of the nominal LQIR law.

https://doi.org/10.1371/journal.pone.0314479.g002

The LQIR’s convergence is investigated via the following Lyapunov function [46].

(10)

The first derivative of W(t) is derived, as shown below.

(11)

By substituting Eq (7) in (11), is simplified as shown in (12).

(12)

If R = RT>0 and Q = QT≥0, then is a negative-definite function. The designed LQIR law’s asymptotic stability can thus be preserved by meeting the aforementioned conditions.

3. Proposed control methodology

To counteract the effects of parametric uncertainties and input disturbance, the designed LQIR is integrated with a discontinuous SMC to constitute the proposed hybrid control procedure. The sliding surface of the SMC is thus formulated as a function of the LQIR control input ulq(t). Once designed, the LQIR-driven SMC is augmented with an online adaptive function that dynamically adjusts its switching gain as an even-symmetric hyperbolic scaling function of the BG-level error, . The formulation of the prescribed hybrid BG controller and its stability study are presented in the following section.

3.1. Hybrid LQIR-based SMC law

The system’s linear state space equation provides information regarding meal disturbance and reference BG concentration. To derive the proposed SMC law, the following state equation is considered. (13) where d(t) is the disturbance input with some known maximum value. The hybrid (collaborative) control law is expressed as follows [39]. (14) where uS(t) represents the sliding-mode control input and m is a real-numbered scaling factor. Inserting the aforementioned control input in the system’s state equation yields the following expression.

(15)

The SMC law thus utilizes the following sliding surface [25].

(16)

where G is an empirically-defined positive state-weighting vector of the form G = [g1 g2 g3 g4], and z(t) is new variable that depends on the system dynamics. The coefficients of the G vector are adjusted offline through the tuning process covered in Section 4. The derivative of s(t) is presented as follows.

(17)

It is desired for during sliding operation. The substitution of Eq (15) in (17) delivers the following expression.

(18)

The equation can be simplified as follows.

(19)

It is to be noted that and . Hence, if the value of , then can be written as shown in (20).

(20)

During the sliding phase, the SMC signal uS(t) = −d(t) eliminates the bounded exogenous disturbance(s). Thus, the variable is expressed as shown below. (21) where x(0) = [200 0 50 0]T as listed in Table 1. As a result of the substitution, , it can be concluded that the effect of matched uncertainty has been eliminated and, thus, the system is directed by the nominal control input ulq(t) provided by the LQIR. The insertion of in (19) guarantees the following simplification of [39].

(22)

The integration of delivers the following expression.

(23)

Hence, the final expression of the sliding surface s(t) is expressed in (24), [39].

(24)

a. Lyapunov stability proof.

Once the sliding surface s(t) is evaluated, the SMC law uS(t) is derived using the Lyapunov theorem. The following positive Lyapunov function is utilized for this purpose.

(25)

The Lyapunov function’s first derivative is expressed in (26).

(26)

The substitution of Eq (32) in (36) yields the following expression.

(27)

The SMC law in (28) is used to fulfill the Lyapunov stability criteria, , [39]. (28) where β is the switching gain of the control law, and sgn(.) is the signum function expressed in (29).

(29)

Inserting the SMC law in (27) delivers the modified expression of .

(30)

As discussed earlier, the for system to be asymptotically stable. This stability criterion implies that, (31)

The substitutions , and in (31), deliver the following condition.

(32)

The condition in (32) preserves the closed-loop stability of the SMC scheme. If the vector G and the parameters m and β are selected such that the conditions , and β>d(t) are satisfied, the time derivative of the Lyapunov function becomes negative definite, that is, . This guarantees that the system will converge to the sliding surface asymptotically, ensuring robust stability.

In lieu of the stability condition in (40), the value of β is adjusted offline through the tuning process discussed in Section 4. The aforementioned condition states that the modulation gain β must be chosen larger than the maximum bound of the disturbance d(t) to maintain stability. In this study, the control input disturbances are bounded in the range 0 to 4 mU/min. This range is empirically selected based on the pilot simulations. The objective is to avoid abrupt large IIR requirements, which may cause discomfort to patients due to the switching behavior of the controller’s SMC component. This range can be altered by the users as per the requirement of the application. Consequently, the value of β is chosen from the range 4 and 10 mU/min. The upper limit of β is set at10 mU/min to avoid an aggressive control approach, which may eventually lead to hypoglycemia or constantly fluctuating BG levels.

b. Control law formulation.

The hybrid LQIR-driven SMC law, as suggested in (14), is formulated as follows. (33) where, Mo = . The said control law is referred to as the LQ-SMC law in the following sections. Fig 3 displays the block diagram of the LQ-SMC scheme.

thumbnail
Fig 3. Block diagram of the nominal LQ-SMC law.

https://doi.org/10.1371/journal.pone.0314479.g003

3.2. Hybrid LQIR-based self-adaptive SMC law

To minimize the chatter in the state response, imposed by the hard limiter, the sgn(s(t)) function is replaced by a relatively smoother nonlinear function tanh(s(t)) [47]. The modified hybrid control law is expressed, as shown in (34).

(34)

It is to be noted that the SMC law is majorly needed under external disturbances and parametric disturbances [48]. However, chattering is inexorably introduced into the state response due to the disruptive control input contributed by the SMC scheme. Therefore, the control law in (33) is also augmented with an error-dependent adaptation tool that increases the SMC’s adaptability by dynamically adjusting its switching gain as the BG levels vary. The following rationale is thus adopted:

  1. Under large BG concentration level errors (hyperglycemia state), the SMC’s switching gain is inflated to strongly damp the overshoots in the BG level and quickly restore it to the steady-state value.
  2. Under small BG concentration level errors (equilibrium state), the SMC’s switching gain is reduced to maintain the BG level at the steady-state value with minimal fluctuations.

These properties speed up the transition of the BG level from the state of hyperglycemia to the normal level and strengthen the closed-loop system’s damping against meal disturbances while economizing the application of the control input (the IIR) [49]. The aforesaid adaptation strategy is realized by augmenting the said control law with a nonlinear gain scaling function. The rationale requires the scaling function to be bounded, differentiable, smooth, and even symmetric.

The hyperbolic secant function (HSF) yield a smooth and gradual gain adjustment which aids in stabilizing the state behavior with minimal chattering [50]. However, it requires calculation of exponentials in both directions. This can be computationally demanding, though modern processors handle these efficiently. The hyperbolic tangent functions exhibit smooth yet faster transitions, leading to a good chattering suppression with a risk of overshoot [47]. However, it can be realized by evaluating a single exponential, making it relatively faster than HSF. The sigmoid functions yield smooth gain adaptation but can introduce slower convergence compared to HSF, causing residual chattering [51]. Its computational complexity is at par with HSF. The exponential functions, although simplest to compute, but its fast decay risks under-damping the system if not tuned properly, causing loss of control effectiveness [52]. Hence, based on the qualitative analysis, the HSF driven by the BG-level error is chosen for gain adjustment in this study. The HSF offers a balanced gain adjustment that avoids saturation issues and smoothly regulates the gain under disturbances, enhancing stability for complex systems, without sacrificing control authority. The merits of each of the aforementioned nonlinear functions are summarized in Table 3.

thumbnail
Table 3. Comparative analysis of HSF with other nonlinear functions.

https://doi.org/10.1371/journal.pone.0314479.t003

The comparative analysis in the Table 3 suggests that HSF offers a compelling trade-off between stability, chattering reduction, and computational cost. Hence, in this study, the HSF is adopted to adjust the switching gain M(t) as a nonlinear function of the BG-level error . The formulation is shown in (35), [50]. (35) where, sech(.) Represent the HSF, and γ represent the variation rate of the HSF. The proposed hybrid LQIR-driven self-adaptive SMC law is expressed in (36).

(36)

The proposed hybrid control law mentioned above is referred to as LQ-ASMC in the article. Fig 4 displays the block diagram of the LQ-ASMC scheme.

thumbnail
Fig 4. Block diagram of the nominal LQ-ASMC law.

https://doi.org/10.1371/journal.pone.0314479.g004

The proposed controller, and its variants, detect the disturbance by monitoring deviations of the system state G(t) (patient’s BG level) from the desired setpoint BG level, denoted as . These measurements are fed to both the LQIR and SMC controllers. A significant deviation suggests that the nominal LQIR controller might be insufficient, requiring the SMC to take over.

The system uses nominal LQIR inputs in tandem with the SMC’s corrective actions. The LQIR is used for optimal control during nominal conditions, ensuring minimal energy consumption and smooth system behavior. Under disturbance conditions, as the error magnitude continues to inflate, the SMC action is activated and progressively strengthened. Hence, instead of abrupt switching, the proposed LQ-ASMC ensures continuous blending of control effort via a smooth nonlinear scaling function driven by the magnitude of state error (. The modulation gain M(t) of the control law in (36) is dynamically adjusted, ensuring that the SMC contribution only activates and amplifies when needed to counteract disturbances without causing overcompensation or oscillations (chattering). Hence, the LQIR continues operating to maintain performance in every condition, whereas, the SMC compensates for uncertainties by providing corrective control inputs based on the sliding surface. The SMC component cancels out disturbances by compensating with an input equal to the disturbance but opposite in direction.

By initializing the sliding surface from the start (s(t) = 0), the SMC avoids the unstable reachability phase, ensuring stability from t = 0. The discontinuous signum function with a smoother approximation function of the form tanh(s(t)), as shown in (34) and (36). This softens the switching action, reducing high-frequency oscillations (chattering) while maintaining robustness.

3.3. Implementation scheme of the proposed control law

The methodological steps used for the execution and implementation of the LQ-ASMC law are given as follows:

1. Identify Model.

  1. Define the state variables, x(t).
  2. Define the differential equations dictating the glucose-insulin dynamics.
  3. Define the state space matrices (A,B,C,D) of the glucose-insulin model.

2. Design LQR.

  1. Define state and control weighting matrices (Q and R).
  2. Solve the Riccati equation to find the optimal feedback gain matrix K.
  3. Compute the control input using the LQR.

3. Design ASMC.

  1. Compute the sliding surface s(t) using the current states, desired states, and LQR control input.
  2. Define the sliding mode reaching law, M(t) tanh(s(t)).
  3. Formulate a nonlinear scaling function to online adapt the scaling gain, M(t).
  4. Calculate the SMC input.
  1. 4. Formulate the LQ-ASMC law by combining LQR and ASMC law.
  2. 5. Implement the control algorithm
  1. Continuously acquire the system’s current states.
  2. Compute the updated LQR control input.
  3. Compute the sliding surface, s(t)
  4. Modify the sliding-mode gain, M(t).
  5. Calculate the final control input using the LQ-ASMC law.
  6. Apply the control input to the system.
  7. Update the system state variables based on dynamics.

The flow chart depicting the algorithm implementation of the LQ-ASMC is shown in Fig 5.

thumbnail
Fig 5. Flow chart of the proposed control scheme.

https://doi.org/10.1371/journal.pone.0314479.g005

4. Parameter tuning procedure

The LQIR design is dependent on the state of the system and changes in control input. To guarantee an optimal control effort, it is crucial to allocate the proper weights to the control input and state variables [53]. In lieu of these conditions, the empirical settings of the Q matrix, R matrix, G vector, and other parameters (β,m, and γ) are limited by the designer’s knowledge and thus, accurate reference tracking and optimal transient recovery behavior might not always be achieved [54, 55].

As derived in (12), the state weighting and control weighting matrices are selected such R = RT>0 and Q = QT≥0 to ensure the Lyapunov stability of the LQIR law. Similarly, as derived in (32), the value of β is selected as β>d(t) to ensure the Lyapunov stability of the proposed SMC law.

4.1. Offline tuning procedure

The aforementioned parameters are optimized offline by minimizing a new objective function that captures the variations in BG concentration level error and control input u(t). This objective function is expressed in (37). (37) where, Tset is the time taken by the BG level to stabilize within ±5% of Gref. To deliver optimum control decisions, the function J imposes equal weight on the two minimization criteria. The initial values of these parameters can be chosen at random from the aforementioned search space. The algorithm then coordinates the exploration in the direction of the descending slope of J [56]. The parameter optimization scheme is demonstrated in Fig 6 [15]. The BMM parameters of Patient 1 (See Table 1) serve as the benchmark for the tuning purpose. The simulations discussed in Section 4 are used for parameter tuning. In every tuning attempt, the controller parameters are adjusted based on pre-defined increments. Upon the re-adjustment of the parameters, the control law is commissioned to normalize the virtual patient’s BG concentration levels at 80 mg/dL from an initial value of 200 mg/dL for 300 min using the refined set of parameters. Once the trial is concluded, the cost Jn is calculated; where, n is the trial number. In the event that the current trial’s cost (Jn) turns out to be less than the previous trial’s cost (Jn−1), the local minimum cost Jmin is modified. This configuration guarantees that the search is moving in the descending gradient direction of J. The exploration for the optimum parameter values is concluded if either Jmin reaches a predetermined setpoint cost or the algorithm has completed the maximum number of trials (nmax) permitted [56]. The setpoint for Jmin is set at 1×107 in this work [10]. Because each simulation takes a long time, the value of nmax is fixed at 8. The selected parameters are further refined by manually adjusting their values.

thumbnail
Fig 6. Flow chart of the parameter tuning algorithm [10].

https://doi.org/10.1371/journal.pone.0314479.g006

4.2. Parametrization of control law

For designing the baseline LQIR, the coefficients of Q and R matrices are tuned from the range [0, 1]. The tuning process begins with R = 1 and Q = diag(1 1 1 1). The coefficients thus tuned via the afore-described tuning procedure are , and ρ = 1.05. The gain vector K = [kG kX kI kε], linked with the LQIR law ulq(t) = −Kx(t), is computed using the tuned set of Q and R matrices. The state-compensator gains thus evaluated are , and kε = 1.12×10−4.

For designing the LQ-SMC law, the coefficients of the G vector are picked from the range [0, 0.01]. The tuning process begins with G = [0.01 0.01 0.01 0.01]. The coefficients of the vector G = [g1 g2 g3 g4] thus chosen are . Consequently, the value of m is computed as 1.59. As discussed in Section 3.1 (a), the value of β>d(t) is selected from the range [4, 10]. The initial value of β is 4.0. The value of β yielded by the tuning procedure for this study is 4.48. Hence, the value of Mo = is computed as 7.12. The LQ-SMC law is given as follows.

(38)

For designing the LQ-ASMC law, the variation rate of the HSF is picked from the range [0, 1]. The tuning process begins with an initial value of γ = 0.1. The value of γ thus chosen for this research is 0.06. The LQ-ASMC law is given as follows.

(39)

5. Simulations and analysis

Clinical trials are avoided at this stage because conducting experiments involving human subjects requires extensive ethical approval processes, significant financial resources, and logistical resources. Instead, this article outlines a phased approach, where successful simulation results will serve as the basis for experimental validation in future works. The focus of this paper on establishing the effectiveness and reliability of the controller through rigorous simulation studies is both appropriate and necessary given the preliminary nature of this study. The simulations allow to iteratively refine and optimize the controller design, which validates the framework before committing to the more resource-intensive process of human trials, thereby ensuring a higher likelihood of success in subsequent phases. This approach aligns with standard research methodologies, where simulation results guide the design and implementation of human trials.

The test simulations undertaken to verify the time optimality and robustness of the prescribed BG control strategies are presented in this section, along with a comparative analysis of the attained results.

5.1. Simulation setup

The time-domain behavior of the LQIR, LQ-SMC, and LQ-ASMC schemes are compared through customized simulations that test the controller’s behavior under hyperglycaemia state, transient meal disturbance, and Gaussian noise. The MATLAB/Simulink R2020b software tool is used to implement the control application and run the simulations [57]. A 64-bit embedded computer with a 2.1 GHz CPU and 12.0 GB RAM is used to run the software. The samples are acquired after every 60 seconds. As mentioned in Section 2, three distinct BMMs are used to simulate the virtual TID patients (See Table 1) to validate the efficacies of designed control laws in effectively regulating the BG concentration levels from an initial state of hyperglycaemia as well as rejecting the transient meal disturbance and measurement (Gaussian) noise. To avoid hypoglycemia in the patients due to a significant drop in BG levels, the IIR signal u(t) is limited between 0 mU/min and 100 mU/min.

5.2. Simulation results

The following two testing scenarios are employed to benchmark the proposed LQ-ASMC against the nominal LQIR and the LQ-SMC. The simulations are used to test the behavior of the three controllers individually on each patient. The closed-loop system is responsible for continuously tracking the patient’s BG level to 80 mg/dL setpoint under every operating condition. In every test case, white Gaussian noise is added to G(t) to observe the impact of random sensor noise on the reference tracking behavior.

A. BG regulation under hyperglycaemia.

The purpose of this simulation is to test the control law’s ability to bring the patients’ BG concentration levels down from an initial state of hyperglycaemia (200 mg/dL) to 80 mg/dL. At the start of every trial, a white Gaussian noise signal with a mean of zero and variance of 0.2 is added to G(t) to simulate the effects of measurement noise from the glucose sensor. Figs 79 show the BG level and IIR (control input) profiles under LQIR, LQ-SMC, and LQ-ASMC for Patients 1, 2, and 3, respectively.

thumbnail
Fig 7.

(a) BG levels of Patient 1 under hyperglycaemia, (b) IIR (control input) for Patient 1 under hyperglycaemia.

https://doi.org/10.1371/journal.pone.0314479.g007

thumbnail
Fig 8.

(a) BG levels of Patient 2 under hyperglycaemia, (b) IIR (control input) for Patient 2 under hyperglycaemia.

https://doi.org/10.1371/journal.pone.0314479.g008

thumbnail
Fig 9.

(a) BG levels of Patient 3 under hyperglycaemia, (b) IIR (control input) for Patient 3 under hyperglycaemia.

https://doi.org/10.1371/journal.pone.0314479.g009

B. BG regulation under transient meal disruption.

The purpose of this simulation is to evaluate the control law’s robustness against bounded exogenous disturbances, which are typically brought on by the consumption of food. A simulated impulse signal in d(t) and a white Gaussian noise signal in G(t) are used to simulate the effects of meal disruption and sensor noise, respectively. The closed-loop system operates to recover from the transient perturbation and normalizes the patient’s BG levels back to 80 mg/dL baseline after the said disruption. A white noise signal with a mean of zero and variance of 0.2 is introduced into the system at the start of the trial, while a simulated impulse signal with an amplitude of 80 mg/dL is injected into the system at t ≈ 500 min. Figs 1012 show the BG level and IIR (control input) profiles under LQIR, LQ-SMC, and LQ-ASMC for Patients 1, 2, and 3, respectively.

thumbnail
Fig 10.

(a) BG levels of Patient 1 under meal disturbance, (b) IIR (control input) for Patient 1 under meal disturbance.

https://doi.org/10.1371/journal.pone.0314479.g010

thumbnail
Fig 11.

(a) BG levels of Patient 2 under meal disturbance, (b) IIR (control input) for Patient 2 under meal disturbance.

https://doi.org/10.1371/journal.pone.0314479.g011

thumbnail
Fig 12.

(a) BG levels of Patient 3 under meal disturbance, (b) IIR (control input) for Patient 3 under meal disturbance.

https://doi.org/10.1371/journal.pone.0314479.g012

C. BG regulation under physical or mental stress.

The purpose of this simulation is to assess the controller’s robustness against unprecedented variations in physiological model parameters, which are typically brought on by physical or mental stress. To emulate stress conditions, the parameter p1 is decreased to reflect reduced glucose uptake by muscles, parameter p2 is increased to simulate increased hepatic glucose output triggered by stress hormones, and parameter p3 is decreased to account for reduced insulin effectiveness due to the release of the counter-regulatory hormones like cortisol and adrenaline into the blood. These hormones typically cause the BG levels to rise. To carry out this simulation, the values of p1,p2, and p3 are changed to , and 2.5×10−6min−1 at t ≈ 500 min, respectively. This modification changes the coefficients of the system matrix A presented in (4), which causes the BG levels to rise. Figs 1315 show the BG level and IIR (control input) profiles under LQIR, LQ-SMC, and LQ-ASMC for Patients 1, 2, and 3, respectively.

thumbnail
Fig 13.

(a) BG levels of Patient 1 under stress, (b) IIR (control input) for Patient 1 under stress.

https://doi.org/10.1371/journal.pone.0314479.g013

thumbnail
Fig 14.

(a) BG levels of Patient 2 under stress, (b) IIR (control input) for Patient 2 under stress.

https://doi.org/10.1371/journal.pone.0314479.g014

thumbnail
Fig 15.

(a) BG levels of Patient 3 under stress, (b) IIR (control input) for Patient 3 under stress.

https://doi.org/10.1371/journal.pone.0314479.g015

5.3. Analysis and discussions

The following Critical Performance Measures (CPMs) are employed to analyze the simulation results.

  • Erms: Root-mean-squared magnitude of the BG-level error .
  • Esa: Sum of the absolute magnitudes of the BG-level errors .
  • Tfall: Time needed by the BG level to fall to +10% of Gref from the hyperglycaemia.
  • Tset: Time needed by the BG level to stabilize within ±5% of Gref.
  • Trec: Time needed by the BG level to stabilize after a transient disturbance.
  • OS: The magnitude of overshoot observed in BG level after a transient disturbance.
  • Ums: Mean-squared magnitude of the IIR input, u(t).
  • Up,start: Peak magnitude of IIR input during the initial hyperglycemic state.
  • Up,dist: Peak magnitude of IIR input during meal disturbance.

The Erms is calculated as shown below. (40) where, N is the total number of samples and n is the number of measurements. The value of N is 500 for simulation A and 1000 for simulation B in this article. The Esa is calculated, as shown below.

(41)

The UMS is calculated, as shown below.

(42)

A quantitative analysis of the robustness and performance of the prescribed BG control strategies is conducted using the afore-described CPMs. Table 4 summarizes the simulation outcomes of all test cases for Patient 1. Table 5 presents the simulation outcomes of all test cases for Patient 2. Table 6 summarizes the simulation outcomes for Patient 3. The outcomes confirm the enhanced response speed and disturbance compensation ability of the LQ-ASMC law over the LQIR and LQ-SMC laws.

In Simulation A, every controller displays a distinct transient reaction to bring every patient’s BG levels to the setpoint BG concentration level. The LQIR exhibits a comparatively longer settling time to converge to Gss and a mediocre reference tracking accuracy. The LQ-SMC shows a significant improvement in reference-tracking behavior over the LQIR due to its faster response time and more accurate regulation. The LQ-ASMC law exhibits an improved setpoint-tracking accuracy and the fastest transient response. It efficiently suppresses the steady-state fluctuations and promptly stabilizes the BG concentration levels at the intended setpoint, all the while subsidizing the IIR expenditure.

In Simulation B, each control law applies appropriate resources to normalize the BG concentration levels after the simulated meal disturbance has induced a state of hyperglycaemia in the virtual patient. The LQIR lacks the resilience to withstand sensor noise and meal disturbances. The time domain profile under LQIR manifests a slower transient recovery time and comparatively more chattering is displayed in the response. Moreover, the LQIR injects insulin for a longer time period, which is not practical from a therapeutic standpoint for the patients.

The LQ-SMC exhibits a significantly improved disturbance rejection capacity and a relatively faster error convergence rate. However, it also results in a substantial requirement for insulin infusion. With a notable increase in resilience against meal disturbances and measurement noise, the LQ-ASMC law exhibits the most time-optimal behavior. It displays minimum-time transient recovery, minimal setpoint-tracking error, and comparatively faster response speed. Finally, it reduces the unnecessary ripples in state responses by generating a relatively cheaper and smoother control input (IIR) profile.

In Simulation C, the patient experiences hyperglycemia due to the stress conditions simulated by appropriately varying the model parameters. The LQIR exhibits fragile control behavior against the stress-induced perturbations, exhibiting a large overshoot and slowest transient recovery period. The LQ-SMC manifests a comparatively faster error convergence rate together with a markedly enhanced capacity to reject disturbances. However, it achieves this behavior at the expense of a sustainable amount of insulin infusion. The LQ-ASMC law demonstrates the fastest transient reaction and robust setpoint tracking. It quickly stabilizes the BG levels at the desired setpoint and effectively attenuates the stress-induced overshoot in the response, all while offsetting the IIR consumption.

The LQ-ASMC yields a mean improvement of 20.5%, 40.4%, 30.1%, 15.2%, 30.6%, 26.1%, and 2.5%, in the Erms, Esa, Tfall, Trec, Tset, Ums, and Up, in comparison to the LQIR. The enhanced flexibility of the proposed LQ-ASMC, resulting from the augmentation of the LQIR with the self-adaptive SMC law, is credited with significantly improving the transient reaction speed and the control input efficiency. Finally, the LQ-ASMC yields a mean improvement of 13.6% and 18.8% in the root-mean-square value of the steady state fluctuations (chattering content), in comparison to the LQIR and LQ-SMC, respectively.

The proposed modifications systematically enhance the controller’s self-reasoning to quickly adapt and, thus, execute better setpoint-tracking and disturbance compensation capacity. Moreover, the LQ-ASMC configuration accomplishes the prescribed BG regulation objectives without sacrificing the control input (IIR) economy, which is indeed a noteworthy achievement. While the offline adjustment of a multitude of parameters associated with the LQ-ASMC is a cumbersome process, the procedure’s improved time optimality outweighs this drawback.

5.4. Statistical analysis of simulation results

In this section, the data acquired via the simulations is statistically analyzed to justify the aforementioned claims of performance improvement. The BG regulation data of each patient for each distinct control scheme under simulations A, B, and C is examined via the following two data analysis techniques:

  1. Confidence Interval (CI)
  2. Hypothesis Testing

a. Confidence Interval (CI).

The CIs are used to analyze the BG regulation data to attain an intuitive understanding of the variability and reliability of the results. It helps quantify the degree of uncertainty in the estimated BG levels. A 95% CI, as used in this study, indicates that there is a 95% chance that the true average BG level falls within the determined range. The statistical analysis of the BG regulation data of each patient for each distinct control scheme under simulations A, B, and C, is presented in Table 7. The statistical analysis validates the enhanced performance improvement contributed by LQ-ASMC in normalizing the virtual patient’s BG levels under every testing scenario.

b. Hypothesis testing.

The hypothesis testing is done to analyze the effectiveness of the proposed LQ-ASMC procedure in regulating the BG levels, as compared to LQIR and LQ-SMC schemes. It involves testing an assumption (the hypothesis) about the BG levels of patients under the influence of the proposed control law. In this study, two cases of hypothesis testing are carried out to compare the performance of LQ-ASMC against LQIR as well as the performance of LQ-ASMC against LQ-SMC.

Case 1: Null hypothesis (H0). The LQ-ASMC procedure does not significantly affect BG regulation compared to the LQIR.

Alternative hypothesis (H1). The LQ-ASMC procedure significantly improves BG regulation compared to the LQIR. The hypothesis examination for Case 1 is done via t-test using the sample data sets of LQIR and LQ-ASMC. The value of significance-level is set to 0.05 for this test. The t-test results are quantified in Table 8. In every patient’s case, the value of the t-stat is larger than the corresponding t-critical value. Hence, hypothesis H0 is rejected, and it is concluded that LQ-ASMC is comprehensively better than LQIR. Additionally, it is to be noted that the p-value is lesser than the significance level (0.05) in every case, which supports the decision to reject H0 and support H1.

thumbnail
Table 8. Results of t-test conducted on sample data of LQ-ASMC against LQIR.

https://doi.org/10.1371/journal.pone.0314479.t008

Case 2: Null hypothesis (H0). The LQ-ASMC procedure does not significantly affect BG regulation compared to the LQ-SMC procedure.

Alternative hypothesis (H1). The LQ-ASMC procedure significantly improves BG regulation compared to the LQ-SMC procedure.

The hypothesis testing is done via t-test using the data sets of LQ-SMC and LQ-ASMC. The value of significance-level is set to 0.05. The consequent t-test results are quantified in Table 9. In every patient’s case, the value of the t-stat is larger than the corresponding t-critical value. Hence, hypothesis H0 is rejected, and it is concluded that LQ-ASMC is significantly better than LQ-SMC under stress. The p-value < significance level in every case, supporting the decision to reject H0 in favor of H1.

thumbnail
Table 9. Results of t-test conducted on sample data of LQ-ASMC against LQIR.

https://doi.org/10.1371/journal.pone.0314479.t009

5.5. Comparison with modern controllers

To verify the efficacy of the recommended LQ-ASMC controller in handling the BG regulation problems, its performance is also benchmarked against the modern controllers proposed in [15, 24]. These modern control techniques include the complex-order PID (CO-PID) controller [15], fractional-order SMC (FOSMC) [24], adaptive fractional-order SMC (AFOSMC) [24], higher-order SMC (HOSMC) [24], and super-twisting sliding-mode-controller (STSMC) [24]. The simulations A and B in [15, 24] were conducted using the afore-said controllers on the identical trio of patient models, as indicated in Table 2. The performance comparison of the simulation outcomes of each controller is quantified in terms of Esa in Table 10.

thumbnail
Table 10. Comparison with modern control techniques.

https://doi.org/10.1371/journal.pone.0314479.t010

The findings in [15] show that the CO-PID controller is designated as the best choice for BG regulation applications. In Simulation A, the LQ-ASMC improves the Esa measure of Patients 1, 2, and 3 by 3.6%, -2.2%, and 4.9%, respectively, in comparison to the CO-PID controller. In Simulation B, the LQ-ASMC improves the Esa measure of Patients 1, 2, and 3 by 0.4%, 3.6%, and 8.3%, respectively, in comparison to the CO-PID controller.

5.6. Sensitivity and robustness analysis of LQ-ASMC

This section discusses additional test cases to analyze the sensitivity of LQ-ASMC under the parameter variations as well as its robustness under sensor noise models.

a. Sensitivity analysis of LQ-ASMC under variations of all parameters.

To quantify the robustness of the system regulated by LQ-ASMC to parameter variations and to ascertain the effectiveness of the tuning process in Section 4.1, a detailed sensitivity analysis is performed by introducing a 10.0% increment as well as a 10.0% decrement in the tuned parameter set (Q,R,G,m,β and γ) that is presented in Section 4.2. For each modified parameter set, simulations are conducted to normalize the virtual patient’s BG concentration levels at 80 mg/dL from an initial value of 200 mg/dL for 500 min. The resulting performance metrics are recorded and the consequent results are statistically analyzed to quantify the impact of each parameter on the system’s time-domain performance. Figs 1618 show the BG level and IIR (control input) profiles with LQ-ASMC under different parameter sets for Patients 1, 2, and 3, respectively. The analysis of the simulation outcomes is quantified in Table 11.

thumbnail
Fig 16.

(a) BG levels of Patient 1 under different parameter settings, (b) IIR (control input) for Patient 1 under different parameter settings.

https://doi.org/10.1371/journal.pone.0314479.g016

thumbnail
Fig 17.

(a) BG levels of Patient 2 under different parameter settings, (b) IIR (control input) for Patient 2 under different parameter settings.

https://doi.org/10.1371/journal.pone.0314479.g017

thumbnail
Fig 18.

(a) BG levels of Patient 3 under different parameter settings, (b) IIR (control input) for Patient 3 under different parameter settings.

https://doi.org/10.1371/journal.pone.0314479.g018

thumbnail
Table 11. Sensitivity analysis of LQ-ASMC under different parameter settings.

https://doi.org/10.1371/journal.pone.0314479.t011

The parameter settings with a 10.0% increment yield a faster response speed but also inject chattering in the response. The amount of insulin consumed is also relatively higher than the other parameter settings. The parameter settings with a 10.0% decrement yield a relatively slower response speed. The amount of insulin consumed is relatively lesser than the other parameter settings.

The results suggest that the nominal set of parameters (as prescribed in Section 4.2) manifests the best performance and insulin consumption rate. It yields a time-optimal response and accurate reference tracking ability. The nominal set of parameters also avoids causing hypoglycemia in the patients while preserving the IIR efficiency.

b. Sensitivity analysis of LQ-ASMC under variations of β.

An additional sensitivity analysis is carried out by introducing a 10.0% increment and a 10.0% decrement in the tuned value of β only. This simulation is done to measure the resilience of the LQ-ASMC to changes in the β. For each modified parameter setting, simulations are conducted to normalize the BG levels of Patient 1 (See Table 2) at 80 mg/dL from an initial value of 200 mg/dL for 500 min. The BG level profiles are recorded and the results are examined to quantify the impact of changes in β on the system’s time-domain performance. Fig 19 shows the BG profiles with LQ-ASMC under different settings of β for Patient 1. The simulation results are summarized in Table 12. The parameter setting with a 10.0% increment (β = 4.93) delivers a relatively aggressive control effort, causing a faster BG convergence rate with a constant offset below the BG setpoint. The parameter settings with a 10.0% decrement (β = 4.03) yield an over-damped response. The results suggest that the nominal value of β yields a reasonable convergence while damping the steady state fluctuations.

thumbnail
Fig 19. BG levels of Patient 1 under different settings of β.

https://doi.org/10.1371/journal.pone.0314479.g019

thumbnail
Table 12. Sensitivity analysis of LQ-ASMC under different settings of β.

https://doi.org/10.1371/journal.pone.0314479.t012

c. Robustness analysis of LQ-ASMC under sensor drift and bias.

This customized simulation is performed to test the impact of sensor drift and bias in the proposed BG regulation control system. The sensor’s constant bias refers to a persistent offset in sensor measurements, causing a systematic error in glucose readings. It typically models the calibration errors or misalignment of a sensor. The sensor’s drift is a gradual deviation in sensor readings over time. This phenomenon typically misleads the controller about the actual BG levels. The sensor bias is simulated by adding a fixed offset of 5 mg/dL in the BG measurements. The long-term degradation in the sensor’s accuracy (drift) is simulated by adding a low-frequency sinusoidal signal, having an amplitude of 2 mg/dL and a frequency of 0.2 rad/s, in the BG measurements. The noise signal, presented in (43), is injected into the BG measurements G(t) to conduct this simulation.

(43)

The BG profiles of patients 1, 2, and 3 for LQ-ASMC and LQ-SMC controllers, under the influence of the noise signal Gn(t), are shown in Fig 20. The consequent simulation results are quantified in Table 13.

thumbnail
Fig 20.

BG levels of (a) Patient 1 under sensor drift and bias, (b) Patient 2 under sensor drift and bias, (c) Patient 3 under sensor drift and bias.

https://doi.org/10.1371/journal.pone.0314479.g020

thumbnail
Table 13. Robustness analysis controllers under sensor drift and bias.

https://doi.org/10.1371/journal.pone.0314479.t013

5.7. Computational requirements

The proposed control algorithm requires dedicated computational resources for the offline calculation of the LQIR gain vector as well as the online computation of the proposed SMC signal at each time step. The latter includes computational resources needed for the online modification of the SMC gain via the hyperbolic function as well. The computation time for each of these control laws is calculated using the built-in ‘tic’ and ‘toc’ commands of MATLAB.

In this study, the LQR gain K is calculated offline and stored in memory. This reduces the real-time computations to matrix-vector multiplication, ulq(t) = −Kx(t), which has a computational complexity of O(n2), where n is the number of state variables. The LQIR gain computation took ~122 μs and used 1.5 MB. However, this computation is done offline and does not contribute to real-time processing. While implementing the self-adaptive SMC component of the proposed control law, the overall complexity of matrix-vector multiplications and numerical integration involved in computing the sliding surface s(t) is also O(n2). The computation of the adaptive gain function renders a complexity O(1) and a computation time of 55.6 μs. The complexity of tanh(.) limiter function is O(1) and its computation took 48.6 μs. The average computation time per step taken to calculate the signal generated by the proposed LQIR-ASMC scheme was 45.2 μs with minimal memory overhead. The complexity of this scalar operation is O(1).

The memory usage analysis indicates that the proposed control algorithm’s memory footprint is within acceptable limits for real-time applications. The aforementioned profiling results also validate the efficient computation times and low memory overhead for both the LQR computation and the proposed SMC control law. This makes the algorithm suitable for practical implementation in resource-constrained environments.

The real-time implementation of the proposed control scheme can be potentially optimized via the following techniques:

  1. To simplify the system while maintaining its fundamental dynamics, model order reduction through balanced truncation can be implemented.
  2. The system’s order can be reduced by using fewer state variables and targeting only the essential ones. This will in turn reduce the overall complexity of the system.
  3. An even symmetric nonlinear scaling function with a relatively lower computational complexity can used. However, this arrangement may require a trade-off with other performance metrics.

6. Possible challenges and future directions

This section comprehensively discusses the possible challenges in the practical implementation of the proposed control scheme along with potential future research directions.

6.1. Possible challenges in practical implementation

Although the practical realization of the LQ-ASMC law was not attempted in this research due to a lack of hardware resources and human subjects. However, implementing the said control procedures on a real system can present a few challenges.

  • Real-world sensors are prone to noise. Noisy state measurements can cause erroneous control actions, affecting the overall system performance. Filtering techniques are necessary to handle sensor noise.
  • Integrating the controller with existing hardware and software systems can lead to communication delays and unprecedented compatibility problems. Thorough testing and incremental integration approaches can help mitigate these issues.
  • The computational tasks associated with the execution of the control procedure are bound to consume significant power. Thermal management is crucial to ensure safe and reliable functionality of the system under all operating conditions.
  • Patients exhibit significant variability in insulin sensitivity, glucose metabolism, and response to insulin due to their lifestyle factors (such as stress, exercise, and diet). Hence, identifying personalized physiological models for each patient based on their specific characteristics is a challenging problem. The said variability also makes it quite difficult to develop a one-design-fits-all control strategy.

6.2. Future research directions

There is plenty of room for future enhancements in the proposed control scheme.

  • In the future, the proposed hybrid control law can be further robustified by introducing power-rate SMC reaching laws in it.
  • The switching gain can be adaptively modulated by using adaptive immune feedback.
  • Machine learning techniques can be investigated to predict patient’s glucose trends and detect anomalies (or deviations) from expected glucose patterns to adjust the control strategy accordingly.
  • Reinforcement learning can be explored to improve the adaptive tuning and performance of the control system.
  • In recognition of the value of clinical trials, thorough and ethical experimental validations can be conducted in future phases of this study. In this regard, pilot studies with a small group of patients should be carried out to test the feasibility and initial performance of the controller in a clinical environment.
  • The proposed control law proposed can be extended and applied to more comprehensive glucose-insulin dynamic models to investigate the controller’s efficacy and ensure its broader applicability.
  • Future research could also attempt to extend this framework to include auxiliary adaptive or predictive elements to supplement the real-time flexibility of the controller design. The exploration of online parameter adaptation of weighting matrices in LQIR is a promising direction in this regard. This arrangement would obviate the necessity of extensive manual tuning.
  • Replacing LQIR with the elements of MPC in the proposed framework could also offer better adaptability to external disturbances.
  • The controller’s usability in practical scenarios can be further enhanced by including adaptive estimating methods like observers or Kalman filters for the sake of addressing the sensor delays and biased noise.
  • Finally, the functionality and convenience of the proposed glucose regulation system can be enhanced by integrating it with wearable technology. For this purpose, the use of non-invasive glucose monitoring technologies, combined with the proposed control algorithm, mechanical insulin delivery, and an interactive user interface in a seamless manner, can be developed to improve patients’ comfort and help them manage their BG levels proactively.

7. Conclusion

This article contributes to formulating a robust-optimal regulation technique that employs an LQIR-driven self-adaptive SMC procedure to normalize the BG concentration levels under the influence of meal disruptions and measurement noise. The proposed control procedure beneficially combines the inherent optimal yield of the LQIR with the innate robustness of the SMC. This collaboration is achieved by designing the SMC reaching law using a new sliding surface that depends on the nominal control input of the LQIR. Furthermore, the control law is retrofitted with a simple adaptive framework that dynamically adjusts the switching gain. The self-adjusting gain increases the controller’s adaptability to flexibility modulate the control signal as the BG concentration levels change in the patient’s body. These augmentations significantly improve the controller’s robust tracking against bounded exogenous disturbance while effectively curbing the large IIR demands and upholding the system’s closed-loop stability as the operating conditions change. The LQ-ASMC’s performance assessment is done by conducting customized numerical simulations on the BMM (virtual patient) that examine the system’s BG regulation capacity in the presence of transient meal disturbances, initial hyperglycemic conditions, and measurement noise.

The in-silico analysis of the simulation outcomes validates the enhanced setpoint-tracking ability, time optimality, disturbance compensation capacity, and control input efficiency of the proposed LQ-ASMC law. Despite its robustness and optimal control capabilities, the proposed approach has a few limitations. Firstly, the said control strategy heavily relies on an accurate model of the glucose-insulin system, which can vary significantly between individuals. Secondly, implementing this control law in real-time on hardware systems could face challenges related to computational demands and the need for fast, accurate, and noise-free sensor feedback. However, most of these challenges can be addressed by extending the proposed control scheme as per the research directions proposed earlier in this article.

References

  1. 1. Sharma A, Singh HP, Nilam. A methodical survey of mathematical model-based control techniques based on open and closed loop control approach for diabetes management. Int. J. Biomath. 2022; 15: 2250051.
  2. 2. Nath A, Deb D, Dey R, Das S. Blood glucose regulation in type 1 diabetic patients: an adaptive parametric compensation control‐based approach. IET Syst. Biol. 2018; 12: 219–225. pmid:30259867
  3. 3. Grasman J, Callender HL, Mensink M. Proportional Insulin Infusion in Closed-Loop Control of Blood Glucose. Plos One. 2017; 12: e0169135. pmid:28060898
  4. 4. Yasini S, Karimpour A, Naghibi Sistani MB. Knowledge-based closed-loop control of blood glucose concentration in diabetic patients and comparison with H∞ control technique. IETE J. Res. 2012; 58: 328–336.
  5. 5. Hassan SM, Riaz RA. Closed loop blood glucose control in diabetics. Biomed. Res. 2017; 28: 7230–7236.
  6. 6. Babar SA, Rana IA, Arslan M, Zafar MW. Integral backstepping based automated control of blood glucose in diabetes mellitus type 1 patients. IEEE Access. 2019; 7: 173286–173293.
  7. 7. Li P, Yu L, Fang Q, Lee SY. A simplification of Cobelli’s glucose–insulin model for type 1 diabetes mellitus and its FPGA implementation. Med. Biol. Eng. Comput. 2016; 54: 1563–1577. pmid:26718555
  8. 8. binti Mohd Yusof NF, Som AM, Ali SA, binti Abdul Halim Anuar AL. Simulation work for the control of blood glucose level in type 1 diabetes using Hovorka equations. Adv. Mater. Res. 2015; 12: 739–744.
  9. 9. Panunzi S, Pompa M, Borri A, Piemonte V, De Gaetano A. A revised Sorensen model: Simulating glycemic and insulinemic response to oral and intra-venous glucose load. PLoS One. 2020; 15: e0237215. pmid:32797106
  10. 10. Dalla Man C, Rizza RA, Cobelli C. Meal simulation model of the glucose-insulin system. IEEE Transactions on biomedical engineering. 2007; 54: 1740–1749. pmid:17926672
  11. 11. Lunze K, Singh T, Walter M, Brendel MD, Leonhardt S. Blood glucose control algorithms for type 1 diabetic patients: A methodological review. Biomed. Sig. Proc. Control. 2013; 8: 107–119.
  12. 12. Iqbal U, Samad A, Nissa Z, Iqbal J. Embedded control system for AUTAREP—a novel autonomous articulated robotic educational platform. Teh Vjesn. 2014; 21: 1255–1261.
  13. 13. Hu R, Li C. An Improved PID Algorithm Based on Insulin-on-Board Estimate for Blood Glucose Control with Type 1 Diabetes. Comput. Math. Method. Med. 2015; 2015: 281589. pmid:26550021
  14. 14. Paiva HM, Keller WS, da Cunha LGR. Blood-glucose regulation using fractional-order PID control. J. Control. Automat. Elect. Syst. 2020; 31: 1–9.
  15. 15. Saleem O, Iqbal J. Complex-order PID controller design for enhanced blood-glucose regulation in Type-I diabetes patients. Meas. Control. 2023; 56: 1811–1825.
  16. 16. de Farias JL, Bessa WM. Intelligent control with artificial neural networks for automated insulin delivery systems. Bioeng. 2022; 9: 664. pmid:36354574
  17. 17. Yan S, Chu LL, Cai Y. Robust H∞ control of T–S fuzzy blood glucose regulation system via adaptive event-triggered scheme. Biomed. Sig. Proc. Control. 2023; 83: 104643.
  18. 18. Patra AK, Nanda A, Mishra AK, Satapathy LM. The Linear Quadratic Regulator Design for BG Control in Type-I Diabetes Patient. In: Pradhan G, Morris S, and Nayak N (eds) Advances in Electrical Control and Signal Systems: Select Proceedings of AECSS 2019. Singapore: Springer; 2020. pp. 57–71.
  19. 19. Ali SF, Padhi R. Optimal blood glucose regulation of diabetic patients using single network adaptive critics. Optim. Control. Appl. Method. 2011; 32: 196–214.
  20. 20. Khan O, Pervaiz M, Ahmad E, Iqbal J. On the derivation of novel model and sophisticated control of flexible joint manipulator. Revue Roumaine des Sciences Techniques-Serie Electrotechnique et Energetique. 2017; 62: 103–108.
  21. 21. Abedini Najafabadi H, Shahrokhi M. Model predictive control of blood sugar in patients with type‐1 diabetes. Optim. Control Appl. Method. 2016; 37: 559–573.
  22. 22. Lee JB, Dassau E, Gondhalekar R, Seborg DE, Pinsker JE, Doyle FJ III. Enhanced model predictive control (eMPC) strategy for automated glucose control. Ind. Eng. Chem. Res. 2016; 55: 11857–11868. pmid:27942106
  23. 23. Ebrahimi N, Ozgoli S, Ramezani A. Model free sliding mode controller for blood glucose control: Towards artificial pancreas without need to mathematical model of the system. Comput. Method. Prog. Biomed. 2020; 195: 105663. pmid:32750632
  24. 24. Delavari H, Heydarinejad H, Baleanu D. Adaptive fractional‐order blood glucose regulator based on high‐order sliding mode observer. IET Syst. Biol. 2019; 13: 43–54. pmid:33444478
  25. 25. Abu-Rmileh A, Garcia-Gabin W, Zambrano D. Internal model sliding mode control approach for glucose regulation in type 1 diabetes. Biomed. Sig. Proc. Control. 2010; 5: 94–102.
  26. 26. Ullah S, Khan Q, Zaidi MM, Hua LG. Neuro-adaptive non-singular terminal sliding mode control for distributed fixed-time synchronization of higher-order uncertain multi-agent nonlinear systems. Informat. Sci. 2024; 659: 120087.
  27. 27. Ullah S, Khan Q, Mehmood A. Neuro-adaptive fixed-time non-singular fast terminal sliding mode control design for a class of under-actuated nonlinear systems. Int. J. Control. 2023; 96: 1529–1542.
  28. 28. Ullah MI, Ajwad SA, Irfan M, Iqbal J. Non-linear control law for articulated serial manipulators: Simulation augmented with hardware implementation. Elektronika ir Elektrotechnika. 2016; 22: 3–7.
  29. 29. Iqbal J, Ullah MI, Khan AA, Irfan M. Towards sophisticated control of robotic manipulators: An experimental study on a pseudo-industrial arm. Strojniški vestnik-J. Mech. Eng. 2015; 61: 465–470.
  30. 30. Ul Islam R, Iqbal J, Qudrat K. Design and comparison of two control strategies for multi-DOF articulated robotic arm manipulator. Control Eng. Appl. Inf. 2014; 16: 28–39.
  31. 31. Ullah S, Khan Q, Mehmood A, Kirmani SA, Mechali O. Neuro-adaptive fast integral terminal sliding mode control design with variable gain robust exact differentiator for under-actuated quadcopter UAV. ISA Trans. 2022; 120: 293–304. pmid:33771347
  32. 32. Ali A, Khan Q, Ullah S, Waqar A, Hua LG, Bouazzi I, Jun LJ. High gain differentiator based neuro-adaptive arbitrary order sliding mode control design for MPE of standalone wind power system. Plos one. 2024; 19: e0293878. pmid:38236831
  33. 33. Rigatos G, Siano P, Melkikh A. A nonlinear optimal control approach of insulin infusion for blood glucose levels regulation. Intell. Ind. Syst. 2017; 3: 91–102.
  34. 34. Sepasi S, Kalat AA, Seyedabadi M. An adaptive back-stepping control for blood glucose regulation in type 1 diabetes. Biomed. Sig. Proc. Control. 2021; 66: 102498.
  35. 35. Turksoy K, Cinar A. Adaptive Control of Artificial Pancreas Systems‐A Review. J. Healthc. Eng. 2014; 5: 1–22. pmid:24691384
  36. 36. Hovorka R. Management of diabetes using adaptive control. Int. J. Adapt. Control Sig. Proc. 2005; 19: 309–325.
  37. 37. Afsaneh E, Sharifdini A, Ghazzaghi H, Ghobadi MZ. Recent applications of machine learning and deep learning models in the prediction, diagnosis, and management of diabetes: a comprehensive review. Diabetol. Metab. Syndr. 2022; 14: 196.
  38. 38. Yau KL, Chong YW, Fan X, Wu C, Saleem Y, Lim PC. Reinforcement learning models and algorithms for diabetes management. IEEE Access. 2023; 11: 28391–28415.
  39. 39. Chawla I, Singla A. Real-time stabilization control of a rotary inverted pendulum using LQR-based sliding mode controller. Arab. J. Sci. Eng. 2021; 46: 2589–2596.
  40. 40. Khaqan A, Nauman A, Shuja S, Khurshaid T, Kim KC. An Intelligent Model-Based Effective Approach for Glycemic Control in Type-1 Diabetes. Sensors. 2022; 22: 7773.
  41. 41. Chee F, Fernando T. Closed-loop control of blood glucose, Vol. 368; Springer: Singapore, 2007.
  42. 42. Bequette B.W. Process Control: Modeling, Design, and Simulation. New Jersey, USA: Prentice Hall; 2003. pp. 694–697.
  43. 43. Ibbini M. A PI-fuzzy logic controller for the regulation of blood glucose level in diabetic patients. J. Med. Eng. Technol. 2006; 30: 83–92. pmid:16531347
  44. 44. Saleem O, Iqbal J, Afzal MS. A robust variable-structure LQI controller for under-actuated systems via flexible online adaptation of performance-index weights. Plos One. 2023; 18: e0283079. pmid:36928525
  45. 45. Doodnath A, Kong A, Sastry MK. Optimal linear control of blood glucose. In: Proceedings of 2009 WRI World Congress on Computer Science and Information Engineering. 2009; Los Angeles, CA, USA: pp. 377–381.
  46. 46. Saleem O, Iqbal J. Fuzzy-Immune-Regulated Adaptive Degree-of-Stability LQR for a Self-Balancing Robotic Mechanism: Design and HIL Realization. IEEE Robot. Autom. Letters. 2023; 8: 4577–4584.
  47. 47. Su Din, Fu Rehman, Khan Q. Smooth super-twisting sliding mode control for the class of underactuated systems. Plos One. 2018; 13: e0203667. pmid:30281586
  48. 48. Nasim U, Bhatti AR, Farhan M, Rasool A, Butt AD (2023) Finite-time robust speed control of synchronous reluctance motor using disturbance rejection sliding mode control with advanced reaching law. PLOS ONE 18(9): e0291042. pmid:37695775
  49. 49. Sun C, Gong G, Yang H. Sliding mode control with adaptive fuzzy immune feedback reaching law. Int. J. Control. Autom. Syst. 2020; 18: 363–373.
  50. 50. Saleem O, Rizwan M, Mahmood-ul-Hasan K. Self-tuning state-feedback control of a rotary pendulum system using adjustable degree-of-stability design. Automatika. 2021; 62: 84–97.
  51. 51. Seraji H. A new class of nonlinear PID controllers with robotic applications. J. Robot. Syst. 1998; 15: 161–181.
  52. 52. Saleem O, Awan FG, Mahmood‐ul‐Hasan K, Ahmad M. Self‐adaptive fractional‐order LQ‐PID voltage controller for robust disturbance compensation in DC‐DC buck converters. Int. J. Numer. Model. 2020; 33: e2718.
  53. 53. Choi D, Kim D, Turner JD. Optimization of Weight Matrices for the Linear Quadratic Regulator Problem Using Algebraic Closed-Form Solutions. Electronics. 2023; 12: 4526.
  54. 54. Ghosh S, Gude S. A genetic algorithm tuned optimal controller for glucose regulation in type 1 diabetic subjects. Int. J. Numer. Method. Biomed. Eng. 2012; 28: 877–889. pmid:25099568
  55. 55. Saleem O, Rizwan M, Iqbal J. Adaptive optimal control of under-actuated robotic systems using a self-regulating nonlinear weight-adjustment scheme: Formulation and experimental verification. PLOS ONE. 2023; 18: e0295153. pmid:38064492
  56. 56. Saleem O, Rizwan M. Performance optimization of LQR‐based PID controller for DC‐DC buck converter via iterative‐learning‐tuning of state‐weighting matrix. Int. J. Numer. Model. 2019; 32: e2572.
  57. 57. Ahmed J, Alvi BA, Khan ZA. Blood glucose-insulin regulation and management system using MATLAB/SIMULINK. In: Proceedings of 4th International Conference on Emerging Technologies. 2008; Rawalpindi, Pakistan: pp. 304–308.