Introduction

General overview

According to the International Diabetes Federation (IDF), an estimated 537 million people worldwide were living with diabetes as of 2021. The number of people affected is expected to grow to 745 million by 2045. People with type 1 diabetes must take insulin regularly. This is because their bodies don’t make insulin, and without it, their blood glucose can become dangerously high or low, leading to health problems. An artificial pancreas (AP), a crucial tool for managing type 1 diabetes, is comprised of three key elements: a sensor for real-time blood glucose monitoring, a controller that dictates insulin dosage, and a pump that administers the insulin. So far, several methods have been proposed for designing an artificial pancreas. Most existing approaches design controllers based on a specific model of the insulin-glucose dynamics in patients with type 1 diabetes, without accounting for potential sensor failures or faults. Fewer designs have been made in the field based on input-output information that is important in practice. The following will examine the common control methods for regulating blood glucose in type 1 diabetic patients1,2.

Literature review

Although numerous control methodologies are proposed in the literature, the robustness of these systems against sensor faults remains largely unexplored. The design of AP typically involves the use of two primary categories of control algorithms: those considered classical and those considered intelligent. For example, the PID presented in3 details a specific implementation of the classic approach. To regulate blood glucose levels based on the Bergman model, both sliding mode control and its fractional-order variant have been implemented, coupled with a nonlinear observer4. A model predictive control methodology, as demonstrated in5, was applied to manage blood glucose levels, specifically addressing hyperglycemic and hypoglycemic events, utilizing real data. A predictive control strategy, incorporating an estimator for the complete state vector, is developed in6. In the domain of intelligent controller design, the ability to adapt to system uncertainties is crucial. One approach, detailed in7, involves dynamically identifying these uncertainties and subsequently adapting the controller’s parameters based on the identified model. In8, a significant advancement in insulin-glucose control was achieved through online FLS-based identification, operating without reliance on a predefined model. This identification process enabled the creation of a type-2 FLS-based predictive controller, which outperformed conventional control techniques. In9, T3-FLS was employed for online identification, which was then integrated with a predictive controller designed around the steady-state behavior of the control signal. The study assessed the system’s effectiveness when subjected to disturbances, noise, and uncertainties. Hardware redundancy, as demonstrated in10, provides a method for identifying sensor faults within AP system design. A key benefit in hypoglycemia prevention was demonstrated in11, where researchers utilized a specialized dynamic time warping technique for signal synchronization, alongside a Savitzky-Golay filter to enable real-time derivative estimation during principal component analysis. In order to function reliably in noisy environments, the algorithm of12 includes methods for both fault identification and performance upkeep. To preserve the optimal operational state of control systems, contemporary studies have extensively explored methods for detecting sensor failures in fault-tolerant designs13. In14, a method based on T3-FLSs and predictive control has been designed to sensor fault detection, which focuses on online sensor fault identification. However, this method is highly sensitive to disturbances entering the system. Furthermore, in15, an active sensor fault compensation strategy based on Type-3 fuzzy predictive control is proposed. This approach utilizes a control term to actively compensate for sensor errors. However, the method exhibits sensitivity to external disturbances, and both the predictive controller and the adaptive compensator are prone to divergence, which can potentially lead to system instability.

Model Predictive Control (MPC) has evolved into a widely recognized advanced control technique applicable to diverse control challenges16. As a result, the design of fault-tolerant control (FTC) systems based on predictive strategies has emerged as a significant and rapidly evolving research focus17. MPC-based fault-tolerant control strategies are generally categorized into passive and active approaches. Passive techniques integrate anticipated faults as static constraints during the MPC design phase, neglecting online fault information18. Consequently, the necessity to accommodate a wide range of hypothetical faults renders these methods less effective for real-scenarios. In contrast to passive methods, active fault-tolerant predictive controllers explicitly utilize real-time fault data to modify the optimization problem inherent in model predictive control. In19, a multiple-model strategy is employed to develop active fault-tolerant nonlinear model predictive control. This method’s strength lies in its ability to decrease the online computational, however, its practical application is hindered by implementation difficulties. Addressing the constraints of practical implementation, researchers have proposed leveraging FLSs, as detailed in20,21. These techniques employ real-time control signal computation, with fault information supplied by an integrated fault detection and isolation system. In22, a predictive controller is utilized for the real-time detection and correction of sensor faults. This technique relies on the plant’s model. In23, a dynamic approach is proposed to microgrid reconfiguration that operates in real-time. This method employs a dual-controller strategy: an initial predictive controller guides the system’s outputs towards set-point targets, followed by a second controller dedicated to performing the reconfiguration. Researchers have increasingly focused on intelligent fault detection methodologies to the safety and reliability of systems24.

The integration of intelligent techniques based on fuzzy system concepts has gained significant traction in the design of acceleration control systems, as researchers increasingly seek flexible and model-independent approaches. For example, in25, optimized type 2 fuzzy models have been used through metaheuristic methods such as cuckoo search and flower pollination. This approach has shown significant performance improvement compared to conventional type 1 fuzzy methods in surface process control. In26, the actuator fault problem in a class of nonlinear systems was investigated using type 2 fuzzy logic controllers. The parameters of the fuzzy system were optimized through genetic metaheuristic techniques combined with a pollination algorithm. In27, for the development of fault detection structures in control systems, fuzzy type 1 and type 2 systems have been investigated. In this approach, the performance evaluation of fuzzy type 1 and type 2 controllers with the harmony search algorithm has been used for optimization. In28, the control problem of a two-level reservoir system under actuator error is studied using the harmonic search algorithm in combination with type 2 fuzzy logic. The results show that the performance of the control system with type 2 fuzzy systems is better than that of type 1 fuzzy systems. In29, fuzzy logic-based control has been used to manage multivariable nonlinear systems in the presence of actuator and sensor errors. The proposed approach has been validated on a four-tank control system. In30, the superior effectiveness of intelligent control methods compared to classical controllers is investigated. Also, in31, the design of fuzzy logic-based control systems using different metaheuristic algorithms was compared in terms of their performance.

This paper investigates the application of intelligent techniques for both control system design and sensor fault detection. A concise summary of prevalent control strategies employed in type-1 diabetes management is presented in Table 1 for clarity.

Research gap

Our Literature Review shows that many methods investigated for controlling type-1 diabetes utilize linear models, which may not accurately represent the complex, nonlinear dynamics of the insulin-glucose dynamics. Many existing techniques rely on comprehensive model data and access to all internal states. However, in real-world scenarios, we often only have access to the system’s output. Consequently, a methodology that functions solely on output measurements offers a significant practical benefit. Traditional control strategies often rely on pre-defined models for sensor fault detection, a process typically conducted offline. In the design of control systems in general and the insulin-glucose control system in type 1 diabetes, the use of low-order fuzzy systems has been shown to have less accuracy than T3-FLSs in the presence of uncertainty, noise, and disturbance. Therefore, the use of T3-FLSs can have greater improvements in design. This approach is vulnerable to inaccuracies stemming from real-world uncertainties. Implementing an online sensor fault identification method offers a significant advantage by adapting to these dynamic conditions. In this paper, a generalized approach to control structure design and sensor fault identification is developed, where implementation is not constrained by the particular system model or sensor dynamics. The increasing application of intelligent techniques in the modeling and control of nonlinear systems is a prominent trend in contemporary research. Building upon the preceding analysis, this study presents a control framework that utilizes a T3-FLS model for dynamic blood glucose level assessment, a steady-state control algorithm, a step-forward predictive strategy, an adaptive stabilizer to maintain closed-loop stability, and an auxiliary structure similar to the main structure. A concise summary of prevalent control strategies employed in type-1 diabetes management is presented in Table 1 for clarity.

Table 1 A review of control schemes and research gaps for controlling glucose in subjects with type 1 diabetes.

Main contributions

The superior capabilities and accuracy of T3-FLSs compared to lower-level FLSs are well documented. In this article, we consider a control structure that takes advantage of these advantages. The proposed control system is based on an online approximation of the nonlinear dynamic output of the insulin-glucose metabolism, which includes a steady-state controller, a proportional controller, a step-forward predictive controller to arrive at optimal performance, and an adaptive stabilizer for the closed-loop structure. Finally, a summary of the key contributions is:

  • This study proposes a novel artificial pancreas system that integrates a fuzzy identifier, a step-forward predictive controller, an adaptive compensator, and a dedicated sensor fault detection module within a unified control framework.

  • A new T3-FLS is introduced for the real-time estimation of blood glucose levels, enabling the system to handle higher levels of uncertainty and imprecision compared to conventional FLSs.

  • An auxiliary loop, mirroring the primary control structure, is designed for real-time detection and compensation of sensor faults using a T3-FLS based predictor, enhancing system robustness under faulty measurements.

  • Lyapunov-based stability analysis is conducted for the entire closed-loop system, including both the primary and auxiliary compensators, ensuring reliable and provably stable glucose regulation.

  • The proposed methodology is extensively tested against practical disturbances, including sensor faults, unknown and time-varying patient parameters, meal-induced glucose excursions, and other external perturbations.

  • The proposed control framework demonstrates potential for broader application to other systems with similar uncertainty characteristics, extending its utility beyond artificial pancreas design.

This paper proceeds with the following structure. Nonlinear and fuzzy modeling of insulin-glucose dynamics is presented in Section Nonlinear and fuzzy modeling of insulin-glucose dynamics in type 1 diabetes. This part encompasses the proposed model, the closed-loop control with structures, and the implementation of a T3-FLSs to represent the identification of the system. Following this, Section Design of the main and auxiliary step-forward model predictive controller (SF-MPC) puts forth a step-forward predictive controller derived from the model detailed in Section Nonlinear and fuzzy modeling of insulin-glucose dynamics in type 1 diabetes. Sensor fault diagnosis process, built upon a T3-FLS based predictor, is developed in Section Sensor fault detection unit design. Section Stability analysis presents the stability analysis of the integrated control framework. The corresponding simulation results are discussed in Section Simulations. Finally, the main conclusions are outlined in Section Conclusion.

Nonlinear and fuzzy modeling of insulin-glucose dynamics in type 1 diabetes

This section presents nonlinear dynamics and fuzzy modelling of the insulin and glucose metabolism. Subsequently, it provides an overview of T3-FLS with applications. Finally, the problem formulation utilizing T3-FLSs and control structures is presented in general terms and with details of signals.

Glucose-insulin mathematical model in Type-1 diabetes

Bergman’s model is a well-accepted representation of insulin-glucose dynamics. To illustrate the effectiveness of the procedure presented in this article, we will use Bergman’s model, which is provided below33:

$$\begin{aligned} \nonumber \frac{dg(t)}{dt}= & -\left( {{p}_{1}}+x(t) \right) g(t)+{{p}_{2}}{{g}_{b}}+{{k}_{gr}}{{r}_{2}}(t) \\ \nonumber \frac{dx(t)}{dt}= & -{{p}_{2}}x(t)+{{p}_{3}}(I(t)-{{I}_{b}}) \\ \frac{dI(t)}{dt}= & {{k}_{f}}{{I}_{b}}+{{b}_{f}}{{U}_{1}}(t) \\ \nonumber \frac{d{{U}_{1}}(t)}{dt}= & -{{k}_{f}}{{U}_{1}}(t)+u(t) \\ \nonumber \frac{d{{r}_{1}}(t)}{dt}= & -{{c}_{1}}\left( {{r}_{1}}(t)-d \right) \\ \nonumber \frac{d{{r}_{2}}(t)}{dt}= & -{{c}_{2}}\left( {{r}_{2}}(t)-{{r}_{1}}(t) \right) \end{aligned}$$
(1)

This model includes patient-specific positive constants \(p_1\), \(p_2\), \(p_3\), \(g_b\), \(k_{gr}\), \(I_b\), \(k_f\), \(b_f\), \(k_s\), \(c_1\), and \(c_2\). The dynamic variables are: glucose level (gmg/dl), insulin level (ImU/L), remote insulin level (xmU/L), injected insulin (umU/min), glucose absorption and metabolism (r1, r2), meal glucose content (dmg), and subcutaneous insulin (U1, mU). Notably, g(t) is the output.

Problem formulation

Recognizing the limitations of lower-order FLSs, the development of T3-FLSs has emerged as a strategy for performance enhancement in recent literature34. The literature offers various examples, such as the modeling and control systems35, modelling of Hot Strip Mill system36, Modeling of nonlinear systems of the Takagi-Sugeno form37, modelling and control of nonlinear time delay systems38, modelling of mathematical functions39,40. Also in Robot control system, T3-FLSs play a significant role41. Due to the characteristics of T3-FLSs in dealing with uncertainty, this specific type of FLS is used in this paper for modeling, identifying, and diagnosing sensor faults. Figure 1 and Fig. 2 show the control structure in general and in detail. For fuzzy modeling of the uncertain and nonlinear of the insulin and glucose metabolism, the following model is considered:

$$\begin{aligned} & {{\dot{\hat{O}}}_{1}}(t)={G}_{1}\left( {{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t) \right) +{{u}_{1}}(t) \end{aligned}$$
(2)
$$\begin{aligned} & {{\dot{O}}_{1}}(t)={G}_{1}\left( {{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t) \right) +{{u}_{1}}(t)+{{M}_{1}}(t)={{{G}_{1}}^{*}}\left( {{z}_{1}}(t)|\Phi _{1}^{*}(t) \right) +{{u}_{1}}(t) \end{aligned}$$
(3)
$$\begin{aligned} & {{O}_{1}}(t)=\left( 1+F(t) \right) {{O}_{2}}(t) \end{aligned}$$
(4)
$$\begin{aligned} & {{\dot{\hat{O}}}_{2}}(t)={G}_{2}\left( {{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t) \right) +{{u}_{2}}(t) \end{aligned}$$
(5)
$$\begin{aligned} & {{\dot{O}}_{2}}(t)={G}_{2}\left( {{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t) \right) +{{u}_{2}}(t)+{{M}_{2}}(t)={{{G}_{2}}^{*}}\left( {{z}_{2}}(t)|\Phi _{2}^{*}(t) \right) +{{u}_{2}}(t) \end{aligned}$$
(6)

where \({{\hat{O}}_{1}}(t)\) and \({{\hat{O}}_{2}}(t)\) are the estimated value of the modified output and sensor output, \({{O}_{1}}(t)\) and \({{O}_{2}}(t)\) are the modified output and sensor output, F(t) is the coefficient proportional to sensor fault, \({G}_{1}\left( {{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t) \right)\) and \({G}_{2}\left( {{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t) \right)\) are the main and auxiliary IT3-FLS, \({{{G}_{1}}^{*}}\left( {{z}_{1}}(t)|\Phi _{1}^{*}(t) \right)\) and \({{{G}_{2}}^{*}}\left( {{z}_{2}}(t)|\Phi _{2}^{*}(t) \right)\) are the FLSs with real parameters \(\Phi _{1}^{*}(t)\) and \(\Phi _{2}^{*}(t)\), \({{M}_{1}}(t)\) and \({{M}_{2}}(t)\) are approximation error, \({{\hat{\Phi }}_{1}}(t)\) and \({{\hat{\Phi }}_{2}}(t)\) are the adjustable vectors of the \({G}_{1}\left( {{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t) \right)\) and \({G}_{2}\left( {{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t) \right)\), \({{z}_{1}}(t)\) and \({{z}_{2}}(t)\) are the inputs of \({G}_{1}\left( {{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t) \right)\) and \({G}_{2}\left( {{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t) \right)\) which are defined as below:

$$\begin{aligned} & {{z}_{1}}(t)={{[{{z}_{11}}(t),\,\,{{z}_{12}}(t),...,\,\,{{z}_{1n}}(t)]}^{T}} \end{aligned}$$
(7)
$$\begin{aligned} & {{z}_{2}}(t)={{[{{z}_{21}}(t),\,\,{{z}_{22}}(t),...,\,\,{{z}_{2n}}(t)]}^{T}} \end{aligned}$$
(8)

where, \({{z}_{1i}}={{[{{O}_{1}}(t-(i-1)\tau ),\,\,{{u}_{1}}(t-i\tau )]}^{T}}\), \({{z}_{2i}}={{[{{O}_{2}}(t-(i-1)\tau ),\,\,{{u}_{2}}(t-i\tau )]}^{T}}\), \(\tau\) and n are the sampling time and sample numbers, \({{u}_{1}}(t)\) and \({{u}_{2}}(t)\) are the control signals. The main and auxiliary controllers are assumed as follows:

$$\begin{aligned} {{u}_{1}}(t)= & {{u}_{ss1}}(t)+{{u}_{p1}}(t)+{{u}_{e1}}(t)+{{u}_{com1}}(t) \end{aligned}$$
(9)
$$\begin{aligned} {{u}_{2}}(t)= & {{u}_{ss2}}(t)+{{u}_{p2}}(t)+{{u}_{e2}}(t)+{{u}_{com2}}(t) \end{aligned}$$
(10)

The overall control inputs, denoted as \({{u}_{1}}(t)\) and \({{u}_{2}}(t)\), are formed by the summation of several distinct components. These include the steady-state control signals (\({{u}_{ss1}}(t)\) and \({{u}_{ss1}}(t)\)), the outputs of the proportional controllers (\({{u}_{e1}}(t)\) and \({{u}_{e2}}(t)\), the contributions from the step-forward predictive controllers (\({{u}_{p1}}(t)\) and \({{u}_{p2}}(t)\)), and the signals generated by the adaptive compensators (\({{u}_{com1}}(t)\) and \({{u}_{com2}}(t)\)). As depicted in Fig. 1 and Fig. 2, the presented structure integrates a suite of control and identification elements. This includes two steady-state controllers, a two-step forward predictive controller, two proportional controllers, two adaptive compensators, two T3-FLS based identifiers, and a sensor fault detection unit. A main identifier plays a crucial role in providing online estimates of the system’s true output. Following the fuzzification of input variables, a set of fuzzy rules is applied to classify them. Ultimately, this process yields a numerical output from the FLS, achieved through a three-step fuzzification procedure. Figure 3 illustrates the components of the main fuzzy identifier. Also, Fig. 4 shows the general structure of the T3-FLS. It’s important to recognize that the auxiliary control setup within the inner loop operates under similar conditions to the primary control structure. Controllers operating in steady-state and step-forward predictive controllers are developed utilizing the outputs of these FLSs. Furthermore, a T3-FLS is employed in the sensor fault detection unit, where its output serves as a step forward prediction for sensor fault estimation. Finally, two main and auxiliary adaptive compensators will be extracted by Lyapunov stability analysis to ensure the asymptotic stability of the inner and main loops. Following the definition of the inputs in (7) and (8), the domain of input variable is modeled using two Interval Type-3 Fuzzy Sets \(\tilde{A}_{i}^{j}\) \((i=1,...,n,j=1,2)\). Memberships for each input are determined to be14,15:

Fig. 1
Fig. 1The alternative text for this image may have been generated using AI.
Full size image

General diagram of the proposed structure.

Fig. 2
Fig. 2The alternative text for this image may have been generated using AI.
Full size image

Proposed structure diagram with signal details.

$$\begin{aligned} & {{\bar{\mu }}_{\tilde{A}_{i}^{j}}}=\exp \left( \frac{-{{({{z}_{1i}}-{{c}_{\tilde{A}_{i}^{j}}})}^{2}}}{\sigma _{u}^{2}} \right) \end{aligned}$$
(11)
$$\begin{aligned} & {{\underline{\mu }}_{\tilde{A}_{i}^{j}}}=\exp \left( \frac{-{{({{z}_{1i}}-{{c}_{\tilde{A}_{i}^{j}}})}^{2}}}{\sigma _{l}^{2}} \right) \end{aligned}$$
(12)

In which \({{\bar{\mu }}_{\tilde{A}_{i}^{j}}}\) and \({{\underline{\mu }}_{\tilde{A}_{i}^{j}}}\) are upper and lower membership functions, \({{\sigma }_{u}}\) and \({{\sigma }_{l}}\) are upper width and lower width of \(\tilde{A}_{i}^{j}\) . by defining:

$$\begin{aligned} \bar{m}=\frac{\left( {{{\bar{\mu }}}_{\tilde{A}_{i}^{j}}}+{{\underline{\mu }}_{\tilde{A}_{i}^{j}}} \right) }{2} \end{aligned}$$
(13)

and

$$\begin{aligned} \sigma =\frac{{{\left( {{{\bar{\mu }}}_{\tilde{A}_{i}^{j}}}-\bar{m} \right) }^{2}}}{\ln \left( {}^{1}/{}_{\varepsilon } \right) } \end{aligned}$$
(14)

The upper and lower membership functions at each level \({{\omega }_{k}}\) are calculated as follows:

$$\begin{aligned} & {{\bar{\mu }}_{\tilde{A}_{i}^{j}|{{{\bar{\omega }}}_{k}}}}=\bar{m}+\sigma \sqrt{\ln \left( {}^{1}/{}_{{{{\bar{\omega }}}_{k}}} \right) } \end{aligned}$$
(15)
$$\begin{aligned} & {{\underline{\mu }}_{\tilde{A}_{i}^{j}|{{{\bar{\omega }}}_{k}}}}=\bar{m}-\sigma \sqrt{\ln \left( {}^{1}/{}_{{{{\bar{\omega }}}_{k}}} \right) } \end{aligned}$$
(16)
$$\begin{aligned} & {{\bar{\mu }}_{\tilde{A}_{i}^{j}|{{\underline{\omega }}_{k}}}}=\bar{m}+\sigma \sqrt{\ln \left( {}^{1}/{}_{{{\underline{\omega }}_{k}}} \right) } \end{aligned}$$
(17)
$$\begin{aligned} & {{\underline{\mu }}_{\tilde{A}_{i}^{j}|{{\underline{\omega }}_{k}}}}=\bar{m}-\sigma \sqrt{\ln \left( {}^{1}/{}_{{{\underline{\omega }}_{k}}} \right) } \end{aligned}$$
(18)

In which \({{\bar{\omega }}_{k}}={{\left( {{\omega }_{k}} \right) }^{{}^{1}/{}_{\Delta }}}\), \({{\underline{\omega }}_{k}}={{\left( {{\omega }_{k}} \right) }^{\Delta }}\), and \(\Delta \ge 1\). Also, \({{\omega }_{k}}\) corresponds to membership functions at different levels, and \(\varepsilon\) is a small positive value. It is worth mentioning again that for the FLS of (5), the relations are similar to those of FLS (2). The fuzzy rules are considered as follows: \(if\,\,{{z}_{11}}\,\,is\,\,\tilde{A}_{1}^{l}\,\,and\,\,{{z}_{12}}\,\,is\,\,\tilde{A}_{2}^{l}\,\,and...\,\,{{z}_{1n}}\,\,is\,\,\tilde{A}_{n}^{l}\) then

$$\begin{aligned} {G}_{1}\in [{{\underline{{\hat{\Phi }}}}_{1l}},\,\,{{\bar{\hat{\Phi }}}_{1l}}],\,\,l=1,2,\,\,...,\,\,{{L}_{1}} \end{aligned}$$
(19)

where, \(\tilde{A}_{i}^{l}\) is the membership function of \({{z}_{1i}}\) and \({{\underline{{\hat{\Phi }}}}_{l}}\) and \({{\bar{\hat{\Phi }}}_{l}}\) are the parameter of rules. Figure 5 shows the type 3 membership function. The rule triggers in the \({{\bar{\omega }}_{k}}\) and \({{\underline{\omega }}_{k}}\) levels are:

$$\begin{aligned} & \bar{T}_{{{{\bar{\omega }}}_{k}}}^{l}={{\bar{\mu }}_{\tilde{A}_{1}^{l}|{{{\bar{\omega }}}_{k}}}}\times {{\bar{\mu }}_{\tilde{A}_{2}^{l}|{{{\bar{\omega }}}_{k}}}}\times ...\times {{\bar{\mu }}_{\tilde{A}_{1}^{l}|{{{\bar{\omega }}}_{k}}}} \end{aligned}$$
(20)
$$\begin{aligned} & \underline{T}_{{{{\bar{\omega }}}_{k}}}^{l}={{\underline{\mu }}_{\tilde{A}_{1}^{l}|{{{\bar{\omega }}}_{k}}}}\times {{\underline{\mu }}_{\tilde{A}_{2}^{l}|{{{\bar{\omega }}}_{k}}}}\times ...\times {{\underline{\mu }}_{\tilde{A}_{n}^{l}|{{{\bar{\omega }}}_{k}}}} \end{aligned}$$
(21)
$$\begin{aligned} & \bar{T}_{{{\underline{\omega }}_{k}}}^{l}={{\bar{\mu }}_{\tilde{A}_{1}^{l}|{{\underline{\omega }}_{k}}}}\times {{\bar{\mu }}_{\tilde{A}_{2}^{l}|{{\underline{\omega }}_{k}}}}\times ...\times {{\bar{\mu }}_{\tilde{A}_{n}^{l}|{{\underline{\omega }}_{k}}}} \end{aligned}$$
(22)
$$\begin{aligned} & \underline{T}_{{{\underline{\omega }}_{k}}}^{l}={{\underline{\mu }}_{\tilde{A}_{1}^{l}|{{\underline{\omega }}_{k}}}}\times {{\underline{\mu }}_{\tilde{A}_{2}^{l}|{{\underline{\omega }}_{k}}}}\times ...\times {{\underline{\mu }}_{\tilde{A}_{n}^{l}|{{\underline{\omega }}_{k}}}} \end{aligned}$$
(23)

Finally, the fuzzy output is calculated as:

$$\begin{aligned} {G}_{1}=\hat{\Phi }_{1}^{T}{{\Xi }_{1}}({{z}_{1}}) \end{aligned}$$
(24)

where \({{\hat{\Phi }}_{1}}={{[{{\underline{{\hat{\Phi }}}}_{11}},\,\,{{\underline{{\hat{\Phi }}}}_{12}},...,\,\,{{\underline{{\hat{\Phi }}}}_{1L}},\,\,{{\hat{\bar{\Phi }}}_{11}},\,\,{{\hat{\bar{\Phi }}}_{12}},...,\,{{\hat{\bar{\Phi }}}_{1L}}]}^{T}}\) and

\({{\Xi }_{1}}={{[{{\underline{\Xi }}_{1}},\,\,{{\underline{\Xi }}_{2}},...,\,\,{{\underline{\Xi }}_{L}},\,\,{{\bar{\Xi }}_{1}},\,\,{{\bar{\Xi }}_{2}},...,\,\,{{\bar{\Xi }}_{L}}]}^{T}}\). Also \({{\underline{\Xi }}_{l}}\) and \({{\bar{\Xi }}_{l}}\) are calculated as:

$$\begin{aligned} & {{\underline{\Xi }}_{l}}=\frac{\sum \limits _{k=1}^{K}{{{\underline{\omega }}_{k}}\underline{{G}_{1}}_{{{\underline{\omega }}_{k}}}^{l}}}{\sum \limits _{k=1}^{K}{\left( {{\underline{\omega }}_{k}}+{{{\bar{\omega }}}_{k}} \right) }}+\frac{\sum \limits _{k=1}^{K}{{{{\bar{\omega }}}_{k}}\underline{{G}_{1}}_{{{{\bar{\omega }}}_{k}}}^{l}}}{\sum \limits _{k=1}^{K}{\left( {{\underline{\omega }}_{k}}+{{{\bar{\omega }}}_{k}} \right) }} \end{aligned}$$
(25)
$$\begin{aligned} & {{\bar{\Xi }}_{l}}=\frac{\sum \limits _{k=1}^{K}{{{\underline{\omega }}_{k}}\bar{{G}_{1}}_{{{\underline{\omega }}_{k}}}^{l}}}{\sum \limits _{k=1}^{K}{\left( {{\underline{\omega }}_{k}}+{{{\bar{\omega }}}_{k}} \right) }}+\frac{\sum \limits _{k=1}^{K}{{{{\bar{\omega }}}_{k}}\bar{{G}_{1}}_{{{{\bar{\omega }}}_{k}}}^{l}}}{\sum \limits _{k=1}^{K}{\left( {{\underline{\omega }}_{k}}+{{{\bar{\omega }}}_{k}} \right) }} \end{aligned}$$
(26)

and:

$$\begin{aligned} & \bar{{G}_{1}}_{{{\underline{\omega }}_{k}}}^{l}=\frac{\bar{T}_{{{\underline{\omega }}_{k}}}^{l}}{\sum \limits _{l=1}^{N}{\left( \bar{T}_{{{\underline{\omega }}_{k}}}^{l}+\underline{T}_{{{\underline{\omega }}_{k}}}^{l} \right) }} \end{aligned}$$
(27)
$$\begin{aligned} & \bar{{G}_{1}}_{{{{\bar{\omega }}}_{k}}}^{l}=\frac{\bar{T}_{{{{\bar{\omega }}}_{k}}}^{l}}{\sum \limits _{l=1}^{N}{\left( \bar{T}_{{{\underline{\omega }}_{k}}}^{l}+\underline{T}_{{{\underline{\omega }}_{k}}}^{l} \right) }} \end{aligned}$$
(28)
$$\begin{aligned} & \underline{{G}_{1}}_{{{\underline{\omega }}_{k}}}^{l}=\frac{\underline{T}_{{{\underline{\omega }}_{k}}}^{l}}{\sum \limits _{l=1}^{N}{\left( \bar{T}_{{{\underline{\omega }}_{k}}}^{l}+\underline{T}_{{{\underline{\omega }}_{k}}}^{l} \right) }} \end{aligned}$$
(29)
$$\begin{aligned} & \underline{{G}_{1}}_{{{{\bar{\omega }}}_{k}}}^{l}=\frac{\underline{T}_{{{{\bar{\omega }}}_{k}}}^{l}}{\sum \limits _{l=1}^{N}{\left( \bar{T}_{{{\underline{\omega }}_{k}}}^{l}+\underline{T}_{{{\underline{\omega }}_{k}}}^{l} \right) }} \end{aligned}$$
(30)
Fig. 3
Fig. 3The alternative text for this image may have been generated using AI.
Full size image

Internal structure of the T3-FLS of the main identifier.

Fig. 4
Fig. 4The alternative text for this image may have been generated using AI.
Full size image

General structure of the T3-FLS.

Fig. 5
Fig. 5The alternative text for this image may have been generated using AI.
Full size image

Type 3 fuzzy membership.

So far, structural analysis and structural modeling have been discussed. The following sections will cover the design of the SF-MPC, a sensor fault detection component, and a stability assessment.

Design of the main and auxiliary step-forward model predictive controller (SF-MPC)

This section illustrates the proposed main and auxiliary SF-MPC scheme, focusing on the design of the predictive controller using the error between the fuzzy model output and the reference signal. Finally, Lyapunov methods will be considered to extract the compensatory control signals. According to 2 and 5, the discretization will be as follows:

$$\begin{aligned} & {{\hat{O}}_{1}}(t+1)={{\hat{O}}_{1}}(t)+{{u}_{p1}}(t)+{{u}_{e1}}(t) \end{aligned}$$
(31)
$$\begin{aligned} & {{\hat{O}}_{2}}(t+1)={{\hat{O}}_{2}}(t)+{{u}_{p2}}(t)+{{u}_{e2}}(t) \end{aligned}$$
(32)

To design the SF-MPC, the cost objective is assumed to be as follows:

$$\begin{aligned} J=\frac{1}{2}{{\left( {{O}_{d1}}(t)-{{{\hat{O}}}_{1}}(t+1) \right) }^{2}}+\frac{1}{2}{{\left( {{u}_{p1}}(t) \right) }^{2}}+\frac{1}{2}{{\left( {{O}_{d2}}(t)-{{{\hat{O}}}_{2}}(t+1) \right) }^{2}}+\frac{1}{2}{{\left( {{u}_{p2}}(t) \right) }^{2}} \end{aligned}$$
(33)

where \({{O}_{d1}}(t)\) is the main reference input and \({{O}_{d2}}(t)\) is the auxiliary reference. According to (31) and (32) by minimizing the objective function (33), the step-forward predictive control signals are obtained as follows:

$$\begin{aligned} & {{u}_{p1}}(t)=\frac{1}{2}\left( {{O}_{d1}}(t)-{{{\hat{O}}}_{1}}(t)-{{u}_{e1}}(t) \right) \end{aligned}$$
(34)
$$\begin{aligned} & {{u}_{p2}}(t)=\frac{1}{2}\left( {{O}_{d2}}(t)-{{{\hat{O}}}_{2}}(t)-{{u}_{e2}}(t) \right) \end{aligned}$$
(35)

Sensor fault detection unit design

The proposed sensor fault detection unit, detailed in this section, integrates an identification system for sensor output estimation, a T3-FLS for sensor fault coefficient estimation, and a predictor for obtaining the sensor fault value. The desired form of F(t) is:

$$\begin{aligned} {{F}^{*}}(t)=\frac{{{O}_{1}}(t)-{{O}_{2}}(t)}{{{O}_{2}}(t)} \end{aligned}$$
(36)

where \({{O}_{1}}(t)\) and \({{O}_{2}}(t)\) are mentioned in section Problem formulation. Since the value of F(t) is not accessible directly, we address the sensor fault estimation problem. For this purpose, a T3-FLS (\({{G}_{3}}(t)\)) with input vectors (37) is considered. where each element is characterized by a pair of interval type-3 fuzzy sets.

$$\begin{aligned} {{z}_{{{G}_{3}}}}(t)={{\left[ {{O}_{1}}(t-\tau ),\,\,{{{\hat{O}}}_{2}}(t-\tau ),...,\,\,{{O}_{1}}(t-m\tau ),\,\,{{{\hat{O}}}_{2}}(t-m\tau ) \right] }^{T}} \end{aligned}$$
(37)

The sampling interval is represented by \(\tau\), while the total number of collected samples is denoted by m. The FLS design procedure presented in this section follows a similar structure to the one described in Section Problem formulation. So, to calculate the sensor fault coefficient and to train the FLS \({{G}_{3}}(t)\), the desired output is defined as:

$$\begin{aligned} F(t-1)=\frac{{{{\hat{O}}}_{1}}(t-1)-{{{\hat{O}}}_{2}}(t-1)}{{{{\hat{O}}}_{2}}(t-1)} \end{aligned}$$
(38)

To adjust the parameters of the FLS \({{G}_{3}}(t)\), the Kalman filter algorithm developed in42 is used. Finally, \(\hat{F}(t)\) is estimated as follows:

$$\begin{aligned} \hat{F}(t)={{G}_{3}}\left( t+1|{{\Phi }_{h}}(t) \right) \end{aligned}$$
(39)

where \({{\Phi }_{h}}(t)\) is the FLS parameters. It should be noted that the reference input of the sensor fault detection subsystem will vary as follows:

$$\begin{aligned} {{O}_{d2}}=\frac{{{O}_{d1}}(t)}{\hat{F}(t)+1} \end{aligned}$$
(40)

Stability analysis

The subsequent sections introduce global and asymptotic stability, detailed in Theorems 1 and 2, respectively. Initially, Lyapunov stability theory is employed to establish global stability. Following this, asymptotic stability is demonstrated through the incorporation of adaptive compensators.

Global stability

Theorem 1

According to section Nonlinear and fuzzy modeling of insulin-glucose dynamics in type 1 diabetes, the closed-loop system (dynamic model (1), estimator model (2), estimator model (5), controller (9), and controller (10)) is globally stable, if the adaptation laws \({{\hat{\Phi }}_{1}}(t)\) and \({{\hat{\Phi }}_{2}}(t)\) chosen as follows:

$$\begin{aligned} & {{\dot{\hat{\Phi }}}_{1}}(t)={{\gamma }_{1}}{{\hat{e}}_{1}}(t){{\Xi }_{1}}(t) \end{aligned}$$
(41)
$$\begin{aligned} & {{\dot{\hat{\Phi }}}_{2}}(t)={{\gamma }_{2}}{{\hat{e}}_{2}}(t){{\Xi }_{2}}(t) \end{aligned}$$
(42)

Where \({{\Xi }_{1}}(t)\) introduced in section Problem formulation, \({{\Xi }_{2}}(t)\) calculated similarly to \({{\Xi }_{1}}(t)\), \({{\hat{e}}_{1}}(t)={{O}_{1}}(t)-{{\hat{O}}_{1}}(t)\), \({{\hat{e}}_{2}}(t)={{O}_{1}}(t)-{{\hat{O}}_{1}}(t)\), \(0<{{\gamma }_{1}}\le 1\), and \(0<{{\gamma }_{2}}\le 1\).

Proof

According to (2), (3), (5), and (6) we have:

$$\begin{aligned} & {{\dot{\hat{e}}}_{1}}(t)={{\dot{O}}_{1}}(t)-{{\dot{\hat{O}}}_{1}}(t)={G}_{1}\left( {{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t) \right) -{{{G}_{1}}^{*}}\left( {{z}_{1}}(t)|\Phi _{1}^{*}(t) \right) =\tilde{\Phi }_{1}^{T}(t){{\Xi }_{1}}(t) \end{aligned}$$
(43)
$$\begin{aligned} & {{\dot{\hat{e}}}_{2}}(t)={{\dot{O}}_{2}}(t)-{{\dot{\hat{O}}}_{2}}(t)={G}_{2}\left( {{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t) \right) -{{{G}_{2}}^{*}}\left( {{z}_{2}}(t)|\Phi _{2}^{*}(t) \right) =\tilde{\Phi }_{2}^{T}(t){{\Xi }_{2}}(t) \end{aligned}$$
(44)

Where \({{\tilde{\Phi }}_{1}}(t)={{\Phi }_{1}}(t)-{{\hat{\Phi }}_{1}}(t)\) and \({{\tilde{\Phi }}_{2}}(t)={{\Phi }_{2}}(t)-{{\hat{\Phi }}_{2}}(t)\). The controllers are defined as follows:

$$\begin{aligned} {{u}_{1}}(t)= & {{u}_{ss1}}(t)+{{u}_{p1}}(t)+{{u}_{e1}}(t) \end{aligned}$$
(45)
$$\begin{aligned} {{u}_{2}}(t)= & {{u}_{ss2}}(t)+{{u}_{p2}}(t)+{{u}_{e2}}(t) \end{aligned}$$
(46)

In fact, global stability is analyzed independently of the compensators. The steady-state control signals are calculated according to Eq. (2) and (5) as follows:

$$\begin{aligned} & {{\dot{\hat{O}}}_{1}}(t)=0 \end{aligned}$$
(47)
$$\begin{aligned} & {{\dot{\hat{O}}}_{2}}(t)=0 \end{aligned}$$
(48)

Based on the (2), (5), (47), and (48) the steady-state control signals can be expressed as:

$$\begin{aligned} & {{u}_{ss1}}(t)=-{G}_{1}\left( {{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t) \right) \end{aligned}$$
(49)
$$\begin{aligned} & {{u}_{ss2}}(t)=-{G}_{2}\left( {{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t) \right) \end{aligned}$$
(50)

Also, proportional controllers are considered as follows:

$$\begin{aligned} & {{u}_{e1}}(t)={{\rho }_{1}}{{e}_{1}}(t) \end{aligned}$$
(51)
$$\begin{aligned} & {{u}_{e2}}(t)={{\rho }_{2}}{{e}_{2}}(t) \end{aligned}$$
(52)

where \({{e}_{1}}(t)={{O}_{d1}}(t)-{{O}_{1}}(t)\) and \({{e}_{2}}(t)={{O}_{d2}}(t)-{{O}_{2}}(t)\) are the tracking error. Also \({{\rho }_{1}}\) and \({{\rho }_{2}}\) are positive gains. Based on (3) and (6) for tracking error we can write:

$$\begin{aligned} \nonumber {{{\dot{e}}}_{1}}(t)= & {{{\dot{O}}}_{d1}}(t)-{{{\dot{O}}}_{1}}(t) \\ \nonumber \,\,\,\,\,\,\,\,\,\,\,= & {{{\dot{O}}}_{d1}}(t)-{G}_{1}\left( {{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t) \right) -{{u}_{ss1}}(t)-{{u}_{p1}}(t)-{{u}_{e1}}(t)-{{M}_{1}}(t) \\ \,\,\,\,\,\,\,\,\,\,\,= & {{{\dot{O}}}_{d1}}(t)-{{u}_{p1}}(t)-{{u}_{e1}}(t)-{{M}_{1}}(t) \end{aligned}$$
(53)

and

$$\begin{aligned} \nonumber {{{\dot{e}}}_{2}}(t)= & {{{\dot{O}}}_{d2}}(t)-{{{\dot{O}}}_{2}}(t) \\ \nonumber \,\,\,\,\,\,\,\,\,\,\,= & {{{\dot{O}}}_{d2}}(t)-{G}_{2}\left( {{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t) \right) -{{u}_{ss2}}(t)-{{u}_{p2}}(t)-{{u}_{e2}}(t)-{{M}_{2}}(t) \\ \,\,\,\,\,\,\,\,\,\,\,= & {{{\dot{O}}}_{d2}}(t)-{{u}_{p2}}(t)-{{u}_{e2}}(t)-{{M}_{2}}(t) \end{aligned}$$
(54)

Then the following Lyapunov function is selected as follows:

$$\begin{aligned} V(t)=\frac{1}{2}\left( {{{\hat{e}}}_{1}}{{(t)}^{2}}+{{e}_{1}}{{(t)}^{2}}+\frac{1}{{{\gamma }_{1}}}{{{\tilde{\Phi }}}^{T}}_{1}(t){{{\tilde{\Phi }}}_{1}}(t)+{{{\hat{e}}}_{2}}{{(t)}^{2}}+{{e}_{2}}{{(t)}^{2}}+\frac{1}{{{\gamma }_{2}}}{{{\tilde{\Phi }}}^{T}}_{2}(t){{{\tilde{\Phi }}}_{2}}(t) \right) \end{aligned}$$
(55)

So, we will have

$$\begin{aligned} \dot{V}(t)={{\dot{\hat{e}}}_{1}}(t){{\hat{e}}_{1}}(t)+{{\dot{e}}_{1}}(t){{e}_{1}}(t)-\frac{1}{{{\gamma }_{1}}}\tilde{\Phi }_{1}^{T}(t){{\dot{\hat{\Phi }}}_{1}}(t)\,+{{\dot{\hat{e}}}_{2}}(t){{\hat{e}}_{2}}(t)+{{\dot{e}}_{2}}(t){{e}_{2}}(t)-\frac{1}{{{\gamma }_{2}}}\tilde{\Phi }_{2}^{T}(t){{\dot{\hat{\Phi }}}_{2}}(t) \end{aligned}$$
(56)

Substituting (43), (44), (53) and (54) yields to:

$$\begin{aligned} \nonumber&\dot{V}(t)={{{\hat{e}}}_{1}}(t)\left( {G}_{1}({{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t))-{{{G}_{1}}^{*}}({{z}_{1}}(t)|\Phi _{1}^{*}(t)) \right) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,-\frac{1}{{{\gamma }_{1}}}{{{\tilde{\Phi }}}_{1}}^{T}(t){{{\dot{\hat{\Phi }}}}_{1}}(t)+{{e}_{1}}(t)\left( {{{\dot{O}}}_{d1}}(t)-{{u}_{p1}}(t)-{{\rho }_{1}}{{e}_{1}}(t)-{{M}_{1}}(t) \right) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,+{{{\hat{e}}}_{2}}(t)\left( {G}_{2}({{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t))-{{{G}_{2}}^{*}}({{z}_{2}}(t)|\Phi _{2}^{*}(t)) \right) \\&\,\,\,\,\,\,\,\,\,\,-\frac{1}{{{\gamma }_{2}}}{{{\tilde{\Phi }}}_{2}}^{T}(t){{{\dot{\hat{\Phi }}}}_{2}}(t)+{{e}_{2}}(t)\left( {{{\dot{O}}}_{d2}}(t)-{{u}_{p2}}(t)-{{\rho }_{2}}{{e}_{2}}(t)-{{M}_{2}}(t) \right) \end{aligned}$$
(57)

According to (43) and (44) we have:

$$\begin{aligned} \nonumber&\dot{V}(t)={{{\hat{e}}}_{1}}(t)\left( \tilde{\Phi }_{1}^{T}(t){{\Xi }_{1}}(t)-\frac{1}{{{\gamma }_{1}}}\tilde{\Phi }_{1}^{T}(t){{{\dot{\hat{\Phi }}}}_{1}}(t) \right) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,\,+{{e}_{1}}(t)\left( {{{\dot{O}}}_{d1}}(t)-{{u}_{p1}}(t)-{{M}_{1}}(t) \right) -{{\rho }_{1}}{{e}_{1}}{{(t)}^{2}} \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,\,+{{{\hat{e}}}_{2}}(t)\left( \tilde{\Phi }_{2}^{T}(t){{\Xi }_{2}}(t)-\frac{1}{{{\gamma }_{2}}}\tilde{\Phi }_{2}^{T}(t){{{\dot{\hat{\Phi }}}}_{2}}(t) \right) \\&\,\,\,\,\,\,\,\,\,\,\,\,+{{e}_{2}}(t)\left( {{{\dot{O}}}_{d2}}(t)-{{u}_{p2}}(t)-{{M}_{2}}(t) \right) -{{\rho }_{2}}{{e}_{2}}{{(t)}^{2}} \end{aligned}$$
(58)

Now, according to (41) and (42) we have:

$$\begin{aligned} \nonumber&\dot{V}(t)={{e}_{1}}(t)\left( {{{\dot{O}}}_{d1}}(t)-{{u}_{p1}}(t)-{{M}_{1}}(t) \right) -{{\rho }_{1}}{{e}_{1}}{{(t)}^{2}} \\&\,\,\,\,\,\,\,\,\,\,\,+{{e}_{2}}(t)\left( {{{\dot{O}}}_{d2}}(t)-{{u}_{p2}}(t)-{{M}_{2}}(t) \right) -{{\rho }_{2}}{{e}_{2}}{{(t)}^{2}} \end{aligned}$$
(59)

Assuming \({{\delta }_{1}}<<1\) and \({{\delta }_{2}}<<1\), the Eq. (59) can be rewritten as follows:

$$\begin{aligned} \nonumber&\dot{V}(t)\le \frac{{{e}_{1}}{{(t)}^{2}}}{\left| {{e}_{1}}(t) \right| +{{\delta }_{1}}}\left( \left| {{{\dot{O}}}_{d1}}(t) \right| +\left| {{u}_{p1}}(t) \right| +\left| {{M}_{1}}(t) \right| \right) -{{\rho }_{1}}{{e}_{1}}{{(t)}^{2}} \\&\,\,\,\,\,\,\,\,\,\,\,+\frac{{{e}_{2}}{{(t)}^{2}}}{\left| {{e}_{2}}(t) \right| +{{\delta }_{2}}}\left( \left| {{{\dot{O}}}_{d2}}(t) \right| +\left| {{u}_{{{p}_{2}}}}(t) \right| +\left| {{M}_{2}}(t) \right| \right) -{{\rho }_{2}}{{e}_{2}}{{(t)}^{2}} \end{aligned}$$
(60)

Finally, according to (60) we have:

$$\begin{aligned} \nonumber&\dot{V}(t)\le {{e}_{1}}{{(t)}^{2}}\left( \frac{\left| {{{\dot{O}}}_{d1}}(t) \right| +\left| {{u}_{p1}}(t) \right| +\left| {{M}_{1}}(t) \right| }{\left| {{e}_{1}}(t) \right| +{{\delta }_{1}}}-{{\rho }_{1}} \right) \\&\,\,\,\,\,\,\,\,\,\,\,+{{e}_{2}}{{(t)}^{2}}\left( \frac{\left| {{{\dot{O}}}_{d2}}(t) \right| +\left| {{u}_{p2}}(t) \right| +\left| {{M}_{2}}(t) \right| }{\left| {{e}_{2}}(t) \right| +{{\delta }_{2}}}-{{\rho }_{2}} \right) \end{aligned}$$
(61)

Assuming we have:

$$\begin{aligned} {{\rho }_{1}}\ge \left( \frac{\left| {{{\dot{O}}}_{d1}}(t) \right| +\left| {{u}_{p1}}(t) \right| +\left| {{M}_{1}}(t) \right| }{\left| {{e}_{1}}(t) \right| +{{\delta }_{1}}} \right) \end{aligned}$$
(62)

and

$$\begin{aligned} {{\rho }_{2}}\ge \left( \frac{\left| {{{\dot{O}}}_{d2}}(t) \right| +\left| {{u}_{p2}}(t) \right| +\left| {{M}_{2}}(t) \right| }{\left| {{e}_{2}}(t) \right| +{{\delta }_{2}}} \right) \end{aligned}$$
(63)

we have:

$$\begin{aligned} \dot{V}(t)\le 0 \end{aligned}$$
(64)

In the assumptions (62) and (63), in the steady-state, the tracking error is zero, so the Lyapunov derivative of \(\dot{V}(t)=0\) . Moreover, with the external disturbance entering the system, the tracking error increases, which in turn increases the denominators in (62) and (63). As a result, the overall value of these terms decreases and becomes negative. Also, parameters \({\delta }_{1}\) and \({\delta }_{2}\) are chosen larger in practical applications than in the theoretical case, because they cause oscillatory behavior in the controller. Moreover, since the main component of the control laws are \({u}_{ss1}\) and \({u}_{ss2}\) the contribution of the multiplicative terms in (62) and (63) remains sufficiently small. Therefore, the condition of \(\dot{V}(t)\le 0\) is continuously satisfied, ensuring the global stability of the closed-loop system. Finally, it is demonstrated that the closed-loop system achieves global stability. Next, by adding the compensatory control signal, the asymptotic stability will also be proven.

Asymptotic stability

Theorem 2

As shown in Section Nonlinear and fuzzy modeling of insulin-glucose dynamics in type 1 diabetes, the control system, incorporating the dynamic model (1), the estimator model (2) , the estimator model (3), the controller (9) and the controller (10), is asymptotic stable, if the compensators \({{u}_{com1}}(t)\) and \({{u}_{com2}}(t)\), law of adaptations \({{\hat{\Phi }}_{1}}(t)\) and \({{\hat{\Phi }}_{2}}(t)\), \({{\hat{\bar{M}}}_{1}}\) and \({{\hat{\bar{M}}}_{2}}\) are considered as below:

$$\begin{aligned} & {{u}_{com1}}=\frac{{{e}_{1}}{{(t)}^{2}}}{\left| {{e}_{1}}(t) \right| +{{\delta }_{1}}}\left( \left| {{{\dot{O}}}_{d1}}(t) \right| +\left| {{u}_{p1}}(t) \right| +{{{\hat{\bar{M}}}}_{1}}(t) \right) \end{aligned}$$
(65)
$$\begin{aligned} & {{u}_{com2}}=\frac{{{e}_{2}}{{(t)}^{2}}}{\left| {{e}_{2}}(t) \right| +{{\delta }_{2}}}\left( \left| {{{\dot{O}}}_{d2}}(t) \right| +\left| {{u}_{p2}}(t) \right| +{{{\hat{\bar{M}}}}_{2}}(t) \right) \end{aligned}$$
(66)
$$\begin{aligned} & {{\dot{\hat{\Phi }}}_{1}}\left( t \right) ={{\gamma }_{1}}{{\hat{e}}_{1}}\left( t \right) {{\Xi }_{1}}\left( t \right) \end{aligned}$$
(67)
$$\begin{aligned} & {{\dot{\hat{\Phi }}}_{2}}\left( t \right) ={{\gamma }_{2}}{{\hat{e}}_{2}}\left( t \right) {{\Xi }_{2}}\left( t \right) \end{aligned}$$
(68)
$$\begin{aligned} & {{\dot{\hat{\bar{M}}}}_{1}}={{\gamma }_{3}}\left| {{e}_{1}}(t) \right| \end{aligned}$$
(69)
$$\begin{aligned} & {{\dot{\hat{\bar{M}}}}_{2}}={{\gamma }_{4}}\left| {{e}_{2}}(t) \right| \end{aligned}$$
(70)

Where \({{\Xi }_{1}}(t)\), \({{\Xi }_{2}}(t)\), \({{\hat{e}}_{1}}(t)\), \({{\hat{e}}_{2}}(t)\), \({{e}_{1}}(t)\), and \({{e}_{2}}(t)\) calculated similarly to section Global stability. Also \(0<{{\gamma }_{1}},\,{{\gamma }_{2}},\,{{\gamma }_{3}},\,{{\gamma }_{4}}\le 1\).

Proof

In this section, \({{\dot{\hat{e}}}_{1}}(t)\), \({{\dot{\hat{e}}}_{2}}(t)\), \({{u}_{ss1}}(t)\), \({{u}_{ss2}}(t)\), \({{u}_{e1}}(t)\), and \({{u}_{e2}}(t)\)are calculated similarly to section Global stability. Also, based on (3) and (6) for tracking error we can write:

$$\begin{aligned} \nonumber&{{{\dot{e}}}_{1}}(t)={{{\dot{O}}}_{d1}}(t)-{{{\dot{O}}}_{1}}(t) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,={{{\dot{O}}}_{d1}}(t)-{G}_{1}({{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t))-{{u}_{ss1}}(t)-{{u}_{e1}}(t)-{{u}_{p1}}(t)-{{u}_{com1}}(t)-{{M}_{1}}(t) \\&\,\,\,\,\,\,\,\,\,\,\,={{{\dot{O}}}_{d1}}(t)-{{u}_{e1}}(t)-{{u}_{p1}}(t)-{{u}_{com1}}(t)-{{M}_{1}}(t) \end{aligned}$$
(71)

and

$$\begin{aligned} \nonumber&{{{\dot{e}}}_{2}}(t)={{{\dot{O}}}_{d2}}(t)-{{{\dot{O}}}_{2}}(t) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,\,={{{\dot{O}}}_{d2}}(t)-{G}_{2}({{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t))-{{u}_{ss2}}(t)-{{u}_{e2}}(t)-{{u}_{p2}}(t)-{{u}_{com2}}(t)-{{M}_{2}}(t) \\&\,\,\,\,\,\,\,\,\,\,\,\,={{{\dot{O}}}_{d2}}(t)-{{u}_{e2}}(t)-{{u}_{p2}}(t)-{{u}_{com2}}(t)-{{M}_{2}}(t) \end{aligned}$$
(72)

By defining \({{\tilde{M}}_{1}}(t)={{\bar{M}}_{1}}(t)-{{\hat{\bar{M}}}_{1}}(t)\) and \({{\tilde{M}}_{2}}(t)={{\bar{M}}_{2}}(t)-{{\hat{\bar{M}}}_{2}}(t)\), the Lyapunov function is candidate as below:

$$\begin{aligned} \nonumber&V(t)=\frac{1}{2}\left( {{{\hat{e}}}_{1}}{{(t)}^{2}}+{{e}_{1}}{{(t)}^{2}}+\frac{1}{{{\gamma }_{1}}}{{{\tilde{\Phi }}}^{T}}_{1}(t){{{\tilde{\Phi }}}_{1}}(t)+\frac{1}{{{\gamma }_{3}}}{{{\tilde{M}}}_{1}}{{(t)}^{2}} \right) \\&\,\,\,\,\,\,\,\,\,\,\,+\frac{1}{2}\left( {{{\hat{e}}}_{2}}{{(t)}^{2}}+{{e}_{2}}{{(t)}^{2}}+\frac{1}{{{\gamma }_{2}}}{{{\tilde{\Phi }}}^{T}}_{2}(t){{{\tilde{\Phi }}}_{2}}(t)+\frac{1}{{{\gamma }_{4}}}{{{\tilde{M}}}_{2}}{{(t)}^{2}} \right) \end{aligned}$$
(73)

Then, we have:

$$\begin{aligned} \nonumber&\dot{V}(t)={{{\dot{\hat{e}}}}_{1}}(t){{{\hat{e}}}_{1}}(t)+{{{\dot{e}}}_{1}}(t){{e}_{1}}(t)+{{{\dot{\hat{e}}}}_{2}}(t){{{\hat{e}}}_{2}}(t)+{{{\dot{e}}}_{2}}(t){{e}_{2}}(t) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,-\frac{1}{{{\gamma }_{1}}}\tilde{\Phi }_{1}^{T}(t){{{\dot{\hat{\Phi }}}}_{1}}(t)\,-\frac{1}{{{\gamma }_{2}}}\tilde{\Phi }_{2}^{T}(t){{{\dot{\hat{\Phi }}}}_{2}}(t) \\&\,\,\,\,\,\,\,\,\,\,\,-\frac{1}{{{\gamma }_{3}}}{{{\tilde{M}}}_{1}}(t){{{\dot{\hat{\bar{M}}}}}_{1}}(t)-\frac{1}{{{\gamma }_{4}}}{{{\tilde{M}}}_{2}}(t){{{\dot{\hat{\bar{M}}}}}_{2}}(t) \end{aligned}$$
(74)

Substituting (43), (43), (71) and (72) yields to:

$$\begin{aligned} \nonumber&\dot{V}(t)={{{\hat{e}}}_{1}}(t)\left( {G}_{1}({{z}_{1}}(t)|{{{\hat{\Phi }}}_{1}}(t))-{{{G}_{1}}^{*}}({{z}_{1}}(t)|\Phi _{1}^{*}(t)) \right) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,-\frac{1}{{{\gamma }_{1}}}{{{\tilde{\Phi }}}_{1}}^{T}(t){{{\dot{\hat{\Phi }}}}_{1}}(t)+{{e}_{1}}(t)\left( {{{\dot{O}}}_{d1}}(t)-{{u}_{p1}}(t)-{{\rho }_{1}}{{e}_{1}}(t)-{{u}_{com1}}(t)-{{M}_{1}}(t) \right) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,+{{{\hat{e}}}_{2}}(t)\left( {G}_{2}({{z}_{2}}(t)|{{{\hat{\Phi }}}_{2}}(t))-{{{G}_{2}}^{*}}({{z}_{2}}(t)|\Phi _{2}^{*}(t)) \right) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,-\frac{1}{{{\gamma }_{2}}}{{{\tilde{\Phi }}}_{2}}^{T}(t){{{\dot{\hat{\Phi }}}}_{2}}(t)+{{e}_{2}}(t)\left( {{{\dot{O}}}_{d2}}(t)-{{u}_{p2}}(t)-{{\rho }_{2}}{{e}_{2}}(t)-{{u}_{com2}}(t)-{{M}_{2}}(t) \right) \\&\,\,\,\,\,\,\,\,\,\,-\frac{1}{{{\gamma }_{3}}}{{{\tilde{M}}}_{1}}(t){{{\dot{\hat{\bar{M}}}}}_{1}}(t)-\frac{1}{{{\gamma }_{4}}}{{{\tilde{M}}}_{2}}(t){{{\dot{\hat{\bar{M}}}}}_{2}}(t) \end{aligned}$$
(75)

According to (43) and (44) we have:

$$\begin{aligned} \nonumber&\dot{V}(t)={{{\hat{e}}}_{1}}(t)\left( \tilde{\Phi }_{1}^{T}(t){{\Xi }_{1}}(t)-\frac{1}{{{\gamma }_{1}}}\tilde{\Phi }_{1}^{T}(t){{{\dot{\hat{\Phi }}}}_{1}}(t) \right) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,\,+{{e}_{1}}(t)\left( {{{\dot{O}}}_{d1}}(t)-{{u}_{p1}}(t)-{{M}_{1}}(t) \right) -{{e}_{1}}(t){{u}_{com1}}(t)-{{\rho }_{1}}{{e}_{1}}{{(t)}^{2}} \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,\,+{{{\hat{e}}}_{2}}(t)\left( \tilde{\Phi }_{2}^{T}(t){{\Xi }_{2}}(t)-\frac{1}{{{\gamma }_{2}}}\tilde{\Phi }_{2}^{T}(t){{{\dot{\hat{\Phi }}}}_{2}}(t) \right) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,\,+{{e}_{2}}(t)\left( {{{\dot{O}}}_{d2}}(t)-{{u}_{p2}}(t)-{{M}_{2}}(t) \right) -{{e}_{2}}(t){{u}_{com2}}(t)-{{\rho }_{2}}{{e}_{2}}{{(t)}^{2}} \\&\,\,\,\,\,\,\,\,\,\,\,\,-\frac{1}{{{\gamma }_{3}}}{{{\tilde{M}}}_{1}}(t){{{\dot{\hat{\bar{M}}}}}_{1}}(t)-\frac{1}{{{\gamma }_{4}}}{{{\tilde{M}}}_{2}}(t){{{\dot{\hat{\bar{M}}}}}_{2}}(t) \end{aligned}$$
(76)

Now, according to (67), (68), (76) we have:

$$\begin{aligned} \nonumber&\dot{V}(t)={{e}_{1}}(t)\left( {{{\dot{O}}}_{d1}}(t)-{{u}_{p1}}(t)-{{M}_{1}}(t) \right) -\frac{1}{{{\gamma }_{3}}}{{{\tilde{M}}}_{1}}(t){{{\dot{\hat{\bar{M}}}}}_{1}}(t) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,-{{e}_{1}}(t){{u}_{com1}}(t)-{{\rho }_{1}}{{e}_{1}}{{(t)}^{2}} \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,+{{e}_{2}}(t)\left( {{{\dot{O}}}_{d2}}(t)-{{u}_{p2}}(t)-{{M}_{2}}(t) \right) -\frac{1}{{{\gamma }_{4}}}{{{\tilde{M}}}_{2}}(t){{{\dot{\hat{\bar{M}}}}}_{2}}(t) \\&\,\,\,\,\,\,\,\,\,\,\,-{{e}_{2}}(t){{u}_{com2}}(t)-{{\rho }_{2}}{{e}_{2}}{{(t)}^{2}} \end{aligned}$$
(77)

Assuming \({{\delta }_{1}}<<1\,\)and \({{\delta }_{2}}<<1\), based on (69) and (70) the Eq. (79) can be rewritten as follows:

$$\begin{aligned} \nonumber&\dot{V}(t)\le \frac{{{e}_{1}}{{(t)}^{2}}}{\left| {{e}_{1}}(t) \right| +{{\delta }_{1}}}\left( \left| {{{\dot{O}}}_{d1}}(t) \right| +\left| {{u}_{p1}}(t) \right| +{{{\hat{\bar{M}}}}_{1}}(t) \right) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,-{{e}_{1}}(t){{u}_{com1}}(t)-{{\rho }_{1}}{{e}_{1}}{{(t)}^{2}} \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,+\frac{{{e}_{2}}{{(t)}^{2}}}{\left| {{e}_{2}}(t) \right| +{{\delta }_{2}}}\left( \left| {{{\dot{O}}}_{d2}}(t) \right| +\left| {{u}_{{{p}_{2}}}}(t) \right| +{{{\hat{\bar{M}}}}_{2}}(t) \right) \\&\,\,\,\,\,\,\,\,\,\,\,-{{e}_{2}}(t){{u}_{com2}}(t)-{{\rho }_{2}}{{e}_{2}}{{(t)}^{2}} \end{aligned}$$
(78)

Finally, based on (65) and (66) we have:

$$\begin{aligned} \dot{V}(t)\le -{{\rho }_{1}}{{e}_{1}}{{(t)}^{2}}-{{\rho }_{2}}{{e}_{2}}{{(t)}^{2}} \end{aligned}$$
(79)

Then we have:

$$\begin{aligned} \dot{V}(t)\le 0 \end{aligned}$$
(80)

To show asymptotic stability, according to (71), (72), and (82) we have:

$$\begin{aligned} \nonumber&\ddot{V}(t)=-2{{\rho }_{1}}{{e}_{1}}(t){{{\dot{e}}}_{1}}(t)-2{{\rho }_{2}}{{e}_{2}}(t){{{\dot{e}}}_{2}}(t) \\ \nonumber&\,\,\,\,\,\,\,\,\,\,\,\,-2{{\rho }_{1}}{{e}_{1}}\left( {{{\dot{O}}}_{d1}}(t)-{{u}_{e1}}(t)-{{u}_{p1}}(t)-{{u}_{com1}}(t)-{{M}_{1}}(t) \right) \\&\,\,\,\,\,\,\,\,\,\,\,\,-2{{\rho }_{2}}{{e}_{2}}\left( {{{\dot{O}}}_{d2}}(t)-{{u}_{e2}}(t)-{{u}_{p2}}(t)-{{u}_{com2}}(t)-{{M}_{2}}(t) \right) \end{aligned}$$
(81)

From (81), we have:

$$\begin{aligned} \nonumber&\ddot{V}\le 2{{\rho }_{1}}\left| {{e}_{1}}(t) \right| \left( \left| {{{\dot{O}}}_{d1}} \right| +\left| {{u}_{e1}}(t) \right| +\left| {{u}_{p1}}(t) \right| +\left| {{u}_{com1}}(t) \right| +\left| {{M}_{1}}(t) \right| \right) \\&\,\,\,\,\,\,+2{{\rho }_{2}}\left| {{e}_{2}}(t) \right| \left( \left| {{{\dot{O}}}_{d2}} \right| +\left| {{u}_{e2}}(t) \right| +\left| {{u}_{p2}}(t) \right| +\left| {{u}_{com2}}(t) \right| +\left| {{M}_{2}}(t) \right| \right) \end{aligned}$$
(82)

Based on (82), the bounded nature of the second derivative of V is revealed with respect to time. Leveraging Barbalat’s lemma, we can deduce the negative definiteness of the derivative of V, thus confirming asymptotic stability. The demonstration of Theorem 2 is now complete.

Simulations

The proposed strategy’s efficiency is underscored by its application to the completely uncertain Bergman model involving six virtual subjects. Table 2 provides the parameter values for this model. Notably, as established by the Bergman model, the uncontrolled behavior of all six simulated individuals is unstable33. The parameters for the suggested control structure are outlined in Table 3.

Table 2 Bergman model parameters.
Table 3 Parameters of the control structure.

Scenario 1

In this scenario, the performance of the control system is checked assuming no sensor faults. The inherent uncertainty in the system’s behavior is acknowledged, leading to variations in the Bergman model’s parameters. For instance, the parameter \({{P}_{1}}\) fluctuates according to the equation \({{P}_{1}} ={{P}_{1nom}}(1+0.25sin(10t)+0.25sin(100t))\). Other parameters are similarly assumed to be undetermined. Furthermore, the system experiences disturbances over 24 hours, coinciding with meal times at \(t=2 (breakfast)\), \(t=8 (lunch)\), and \(t=14 (dinner)\), with each disturbance possessing a unique magnitude. Also, the reference input in this simulation is assumed to be 100(mg/dl). Given the considerable disparity between the data collection frequency (measured in minutes or hours) and the exceedingly swift information processing speed (a fraction of a microsecond), practical limitations are unlikely to arise. During the simulations, we considered a set of indices, detailed below:

$$\begin{aligned} RMSE=\sqrt{\frac{1}{S}\sum \limits _{s=1}^{S}{{{\left( {{O}_{t\arg eti}}-{{{\hat{O}}}_{t\arg eti}} \right) }^{2}}}} \end{aligned}$$
(83)

where S is the real data number, \({O}_{targeti}\) is the real data and \({{\hat{O}}_{t\arg eti}}\) is the estimation of the real data. Additionally, the percentage of time that blood glucose levels remain within the target range of [70–\(180]~\text {mg/dL}\) over a 24-hour period, as well as the minimum recorded glucose level \(({\text {Min}}_{G})\) during the same timeframe, are considered as supplementary performance metrics. Table 2 details the specific parameter values selected for virtual subject 1. Figure 6 and Fig. 7 illustrate the outcomes for virtual subject 1, demonstrating that tracking is well done. Furthermore, the estimator exhibits strong estimation accuracy. The initial value is considered as 200(mg/dl). The outcomes for additional virtual subjects are detailed in Table 4. This table shows the performance based on various indicators for the proposed scheme. It should be noted that in the simulations, the outputs are simulated according to Theorem 2, and for Theorem 1, the results can be seen in Table 4.

Fig. 6
Fig. 6The alternative text for this image may have been generated using AI.
Full size image

Output response of the closed-loop system based on Theorem 2 and Virtual Subject 1, considering parametric uncertainty and disturbance.

Fig. 7
Fig. 7The alternative text for this image may have been generated using AI.
Full size image

The main control signal entering the system based on Theorem 2, considering parametric uncertainty and disturbance for virtual subject 1.

Table 4 Simulation parameters without considering sensor faults.

Scenario 2

In scenario 2, the performance of the control system is investigated assuming a sensor failure. To evaluate the performance of the proposed approach, virtual subject 1 is utilized. It should be noted that other conditions, including initial conditions, disturbances entering the system, parameter uncertainties, etc., are assumed to be similar to scenario 1. Initially, the sensor’s efficiency degrades at a slow pace, losing up to 30 percent of its effectiveness at \(t= 6\). Subsequently, the rate of efficiency loss accelerates, reaching a 60 percent reduction at \(t= 13\). The results of this section in Fig. 8 and 9 show that despite the sensor fault, the actual output always tracks the reference input and remains within the normal range under disturbance conditions. Also, the fuzzy identification system gives us a good estimate of the real output, and the sensor fault identification system also estimates the sensor fault value well, which can be seen in Fig. 10. Figure 11 illustrates the convergence of the root mean squared error (RMSE) for the tracking error as the iterations progress. Additionally, it displays a histogram and box plot that summarize the distribution of RMSE values. The predicted output demonstrates a close alignment with the actual output, and the consistently small RMSE values suggest effective performance of both the closed-loop system and the fuzzy model. Notably, this simulation incorporates disturbances such as meals and random noise at every iteration to simulate physical activity and food intake. For other virtual subjects and considering similar conditions to virtual subject 1, it can be seen in Table 5. As observed, despite varying initial conditions and the presence of disturbances, the system consistently maintains stability concerning the defined indicators, and the output remains within the acceptable range. It should be noted that the graphical simulations are based on Theorem 2, and the results of Theorem 1 along with Theorem 2 are summarized in Table 5.

Fig. 8
Fig. 8The alternative text for this image may have been generated using AI.
Full size image

Output response of the closed-loop system based on Theorem 2 and Virtual Subject 1, considering sensor fault, parametric uncertainty, and disturbance.

Fig. 9
Fig. 9The alternative text for this image may have been generated using AI.
Full size image

The main control signal entering the system based on Theorem 2, considering sensor fault, parametric uncertainty, and disturbance for virtual subject 1.

Fig. 10
Fig. 10The alternative text for this image may have been generated using AI.
Full size image

Estimation of correction parameter \(\hat{F}(t)\) proportional to sensor fault.

Fig. 11
Fig. 11The alternative text for this image may have been generated using AI.
Full size image

The change in RMSE of tracking error across iterations; (b): Histogram plot of RMSE (e); (c): Box plot of RMSE(e)

Table 5 Simulation parameters considering sensor faults.

Scenario 3

In this scenario, we will first compare the proposed structure based on different FLSs. The outcomes of this comparative analysis are summarized in Table 6. The comparison criteria are also based on the RMSE of the tracking error based on Theorem 2. As can be seen, the design of the control structure using T3-FLSs has a more optimal performance. In addition, the system output responses are shown in Fig. 12 for a clearer comparison of the controllers designed using different types of fuzzy systems. As shown, the controller designed using the T3-FLSs framework has better tracking accuracy and disturbance rejection performance. Next, the proposed structure is compared using methods14 and15. The results of this comparison are summarized in Table 7. As can be seen, the proposed method has a better and more optimal performance with respect to the RMSE index of the tracking error. In this scenario, the initial condition is assumed to be 250(mg/dl), and the other parameters are similar to scenarios 2 and 3.

Table 6 Performance comparison of fuzzy control systems under disturbance and uncertainty for virtual subject 1.
Fig. 12
Fig. 12The alternative text for this image may have been generated using AI.
Full size image

Comparison of output response considering different fuzzy systems.

Table 7 RMSE comparison of tracking error: Proposed method with other methods.

Scenario 4

This section will evaluate the controller risk analysis with and without the sensor fault detection structure. In this context, the concept of “risk” refers to the possibility that a process will not achieve its intended results43. This notion of risk encompasses two key elements: the factors that lead to failure and the consequences or expenses resulting from such failures. Here, the tracking error and the control signal are considered as factors of the risk function, which is rewritten as follows:

$$\begin{aligned} Risk(t)={{e}_{1}}(t)\times \int \limits _{0}^{t}{u_{1}^{2}(\xi )d\xi } \end{aligned}$$
(84)

Where \({{e}_{1}}(t)\) and \({{u}_{1}}(t)\) are introduced in Sections Nonlinear and fuzzy modeling of insulin-glucose dynamics in type 1 diabetes and Stability analysis. It should be noted that the tracking error values and control signal are assumed to be normalized between 0 and 1. The simulation results in the case without the sensor fault compensation structure and considering the sensor fault compensation for virtual subject 1 can be seen in Fig. 13. As can be seen, in the presence of disturbance, the risk function tends to zero for a limited time, and for the case without considering the sensor fault compensation block, the risk function diverges, and over time, the risk caused by the controller increases, which in this system will lead to dangerous phenomena of hypoglycemia and hyperglycemia, which will also cause damage to other organs and the body.

Fig. 13
Fig. 13The alternative text for this image may have been generated using AI.
Full size image

Response risk of a closed-loop control system with and without sensor fault compensation.

Conclusion

This paper proposed a novel and robust control architecture for artificial pancreas systems aimed at managing blood glucose regulation in individuals with type-1 diabetes, particularly in the presence of significant uncertainties and sensor faults. The dual-loop control system-comprising a primary regulation loop and an auxiliary fault-handling loop-integrates key components such as step-forward predictive controllers, adaptive compensators, and real-time system identification via T3-FLSs. A dedicated sensor fault detection module further enhances reliability by dynamically estimating and correcting sensor degradation in real time. Theoretical guarantees of closed-loop stability are rigorously established through Lyapunov analysis, ensuring the reliability of the controller under uncertain, time-varying physiological conditions. Comprehensive simulations were conducted using the uncertain Bergman model across six virtual subjects with varying metabolic profiles. These included scenarios with no sensor faults, time-varying parameters, meal disturbances, and progressive sensor degradation. In Scenario 1, the controller demonstrated high tracking accuracy and effective glucose regulation under parametric uncertainties and external disturbances. The results demonstrated that, for all virtual subjects, more than 99% of the time was spent within the target glucose range of 70–180 mg/dL. Furthermore, the low RMSE values indicated high control accuracy. Scenario 2 introduced progressive sensor faults, yet the proposed controller maintained robust tracking behavior. The internal fault detection loop successfully identified and compensated for sensor degradation, preserving system performance and safety. In Scenario 3, various fuzzy logic systems were evaluated, demonstrating that the T3-FLS substantially exceeded the performance of both Type-1 and Type-2 FLS in reducing the root mean square error RMSE and enhancing adherence to the desired glucose range. The proposed approach also demonstrated superior performance when benchmarked against existing methods in the literature. Scenario 4 analyzed risk using a custom risk function combining tracking error and control effort. Results confirmed that the system equipped with sensor fault compensation minimized the risk index, while omitting the fault module led to divergent risk, posing safety threats such as hypo- and hyperglycemia. The simulation results highlight the superior performance, reliability, and fault tolerance of the proposed methodology. The architecture’s robustness under real-world constraints makes it a promising candidate for next-generation artificial pancreas systems. Future work will explore actuator fault detection, simultaneous sensor–actuator fault compensation, and the implementation of event-triggered control strategies to optimize energy usage and responsiveness.