Development and Simulation of an Automated Control Algorithm for Insulin Therapy of Hyperglycemic Emergencies in Diabetes


  • Jared Becerril Rico Universidad Autónoma Metropolitana, México



Insulin infusion system, closed-loop glucose control, diabetes complications, diabetic ketoacidosis, artificial pancreas


This paper describes the development and simulation of an algorithm for the automatic control of insulin infusion, in the glycemic management of patients with diabetic ketoacidosis (CAD) and hyperglycemic hyperosmolar state (EHH). An algorithm was programmed to calculate the requirement insulin for a glycemic decrease of 50 mg/dL/h until reach 250 mg/dL in blood glucose levels, and thus maintaining it at 220 mg/dL until the pathology remission. The software simulation was performed using glycemic records of 10 patients with CAD managed in the Hospital Juárez de México. The results of the simulation showed a lower incidence of hypoglycemia, as well as a lower insu-lin requirement within the treatment, without differences in the average glucose decreases per hour between real and simulated measurements. This software proposes an innovative use of the artificial pancreas in hyperglycemic emergencies, and also implementing the use of insulin sensitivity as a variable for their function. The results show that the algorithm could be able to achieve glycemic management attached to the treatment guidelines, generating lower insulin expenditure and avoiding hypoglycemia during therapy, with a possible application in autonomous biomedical devices.


Download data is not yet available.


Fayman M, Pasquel FJ, Umpierrez G. Management of hyperglycemic crises. Med Clin N Am. 2017; 103(3): 587-606.DOI: 10.1016/j.mcna.2016.12.011

Gosmanov AR, Gosmanova EO, Kitabchi AE. Hyperglycemic crises: Diabetic ketoacidosis (DKA), and hyperglycemic hyperosmolar state (HHS). Endotext [Internet]. 2018 May. Available from:

Escobedo J, Rico B. Incidencia y letalidad de las complicaciones agudas y crónicas de la diabetes mellitus en México. Salud Públ Méx. 1996; 38(4): 236-242.

Domínguez M, Calderón MA, Matías R. Características clínico epidemiológicas de las complicaciones agudas de la diabetes en el servicio de urgencias del Hospital General de Atizapán. Rev Fac Med. 2013; 56(2): 25-36.

Karslioglu-French E, Donihi AC, Korytkowski MT. Diabetic ketoacidosis and hyperosmolar hyperglycemic syndrome: review of acute decompensated diabetes in adult patients. BMJ. 2019; 365: I1114. DOI: 10.1136/bmj.l1114

Kibachi AE, Umpierrez GE, Miles JM, Fisher JN. Hyperglycemic crises in adult patients with diabetes. Diabetes Care. 2009; 32(7): 13 35 -13 45 . DOI: 10.2337/dc09-9032

Ghimire P, Dhamoon AS. Ketoacidosis. StatPearls [Internet]. Treasure Island (FL): StatPearls Publishing; 2020. Available from:

Dhatariya KK, Vellanki P. Treatment of diabetic ketoacidosis (DKA)/ Hyperglycemic hyperosmolar state (HHS): Novel advances in the management of hyperglycemic crises (UK versus USA). Curr Diab Rep. 2017; 17(5). DOI: 10.1007/s11892-017-0857-4

Goguen J, Gilbert J. Hyperglycemic emergencies in adults. Can J Diabetes. 2018; 42: S109-S114. DOI: 10.1016/j.jcjd.2017.10.013

Fernández J, Galindo C, Barbacho J, Luque A. Automatic control systems in biomedical engineering. 1a ed. Springer International Publishing; 2018. DOI: 10.1007/978-3-319-75717-9

Thabit H, Hovorka R. Closed-loop insulin delivery in type 1 diabetes. Endocrinol Metab Clin N Am. 2012; 41: 105-117.DOI: 10.1016/j.ecl.2011.12.003

Waugh N, Adler A, Craigie I, Omer T. Closed loop system in type 1 diabetes. BMJ. 2018; 361: K1613. DOI: 10.1136/BMJ.K1613

Steil GM, Rebrin K, Darwin C, Hariri F, Saad MF. Feasibility of automating insulin delivery for the treatment of type 1 diabetes. Diabetes. 2006; 55(12): 3344-3350. DOI: 10.2337/db06-0419

Huyett LM, Dassau E, Zisser HC, Doyle FJ. Design and evaluation of a robust PID controller for a fully implantable artificial pancreas. Ind Eng Chem Res. 2015; 54(42): 10311-10321.DOI: 10.1021/acs.iecr.5b01237

Hu R, Li C. An improved PID algorithm based in insulin-on-board estimate for blood glucose control with type 1 diabetes. Comput Math Method M. 2015; 2015: 281589. DOI: 10.1155/2015/281589

Pisker JE, Lee JB, Daussau E, Seborg DE, Bradley PK, Gondhalekar R, et al. Randomized crossover comparison of personalized MPC and PID control algotihms for the artificial pancreas. Diabetes Care. 2016; 39(7): 1135-1142. DOI: 10.2337/dc15-2344

Kitabchi AE, Umpierrez GE, Murphy MB, Barrett EJ, Kreisberg RA, Malone JI, Wall BM. Management of hyperglycemic crisis in patients with diabetes. Diabetes Care. 2001; 24(1): 131-153.DOI: 10.2337/diacare.24.1.131

Luzi L, Barrett FJ Groop LC, Ferrannini F, DeFronzo RA. Metabolic effects of low-dose insulin therapy on glucose metabolism in diabetic ketoacidosis. Diabetes. 1988; 37(11): 1470.DOI: 10.2337/diab.37.11.1470

Davidson PC, Hebblewhite HR, Steed RD, Bode BW. Analysis of guidelines for basal-bolus insulin dosing: basal insulin, correction factor, and carbohydrate to insulin ratio. Endocr Pract. 2008; 14(9): 1095-1101. DOI: 10.4158/EP.14.9.1095

Steil GM, Palerm CC, Kurtz N, Voskanyan G, Roy A, Paz S, Kandeel FR. The effect of insulin feedback on closed loop glucose control. J Clin Endocrinol Metab. 2011; 96(5): 1402-1408.DOI: 10.1210/jc.2010-2578

Rasmussen CH, Roge RM, Ma Z, Thomsen M, Thorisdottir RL, Chen J-W, et al. Insulin aspart pharmacokinetics: An assessment of its variability and underlying mechanisms. Eur J Pharm Sci. 2014; 62: 65-75 . DOI: 10.1016/j.ejps.2014.05.010

Soeborg T, Rasmussen CH, Mosekilde E, Colding-Jorgensen M. Absorption kinetics of insulin after subcutaneous administration. Eur J Pharm Sci. 2009; 36(1): 78-90.DOI: 10.1016/j.ejps.2008.10.018

Mosekilde E, Jensen KS, Binder C, Pramming S, Thorsteinsson B. Modeling absorption kinetics of subcutaneous injected soluble insulin. J Pharm Biopharm. 1989; 17(1): 67-87.DOI: 10.1007/bf01059088

Flores E, Miranda MG, Villasís MA. El protocol de investigación VI: cómo elegir la prueba estadística adecuada. Estadística inferencial. Rev Alerg Mex. 2017; 64(3): 364-370.DOI: 10.29262/ram.v64i3.304

Jacobs PG, Youssef JE, Castle JR, Engle JM, Branigan DL, Johnson P, el al. Development of a fully automated closed loop artificial pancreas control system with dual pump delivery of insulin and glucagon. 33rd Annual International Conference of the IEEE EMBS; 2011 Aug 30 – Sep 03; Massachusetts, USA: IEEE; 2011.DOI: 10.1109/iembs.2011.6090127

Raghupathy P. Diabetic ketoacidosis in children and adolescents. Indian J Endocrinol Metab. 2015 (Suppl 1); S55-S57.DOI: 10.4103/2230-8210.155403



How to Cite

Becerril Rico, J. (2020). Development and Simulation of an Automated Control Algorithm for Insulin Therapy of Hyperglycemic Emergencies in Diabetes. Revista Mexicana De Ingenieria Biomedica, 41(2), 8–21.



Research Articles

Share on:

Dimensions Citation