Artificial Pancreas Algorithm Project
Advertisement

Bold text

My pancreas sucks

Help! My pancreas sucks.

Artificial Pancreas Algorithm Project

This is an unfunded public project for people who are highly motivated to realize the capability to control an insulin pump with blood glucose data from a continuous blood glucose sensor. It's being studies elsewhere, but this algorithm will use expert diabetes care standards of practice rather than a generic PID controller, and will use adaptive variables to learn the unique insulin delivery requirements of each user individually and apply them in daily care. It's all about building a better pancreas.

We are a very new organization. Please be patient as this project and wiki grows.

QUICKPICS


Seeking New Members[]

We are actively seeking new members, especially if they are:

  • diabetic persons with experience using insulin, amylin, glucagon, insulin pumps, and continuous sensors
  • parents of children with type 1 diabetes with those same skills as above
  • certified diabetes educators, or there equivalent outside of North America
  • endocrinologists
  • electrical and systems engineers with experience with modeling and simulation, or requirements generation and management
  • technical writers and wiki-editors
  • biomedical research and development organizations who may wish to use this technology for free
  • public and private sources of funding
  • anyone else who loves mankind in general and wants to participate!

Becoming a member is easy. Just follow these steps:

  1. Create an account to this wiki and log in. See links at top of page to do this.
  2. Go to your user page by clicking on your user name at the top of this wiki. Please be open and generous with information you share here, such as your real name, credentials or special skills, and an essay. Topics for the essay are open to your motivation to create this algorithm, what issues with diabetes care that you struggle with, how will an artificial pancreas impact your life, what is your vision of the algorithm, or any other discussion you might like to kick off.
  3. Learn how to edit a wiki (see below).
  4. Then go! Discuss changes to existing pages and make them. Discuss new content and add it.

Background[]

Endocrine physiology[]

Grays pancreas

The pancreas (below the stomach and above the duodenum) releases endocrine hormones (insulin, amylin, and glucagon) into the portal vein, where it flows directly to the liver.

The pancreas produces three hormones that are important to glycemic control:

  • insulin, which lowers blood glucose;
  • amylin, which slows digestion and slows the rate of glucose entering the bloodstream, and temporarily suppresses release of glucagon;
  • and glucagon, which raises the blood glucose.

Upon digestion of carbohydrates, glucose levels in the blood will begin to rise. As the blood and glucose flow into the pancreas, insulin and amylin are cosecreted by the pancreatic beta cells directly into the bloodstream in response to elevated blood glucose levels. Insulin causes blood glucose to be removed from the bloodstream and stored in the liver and muscle cells. Notice as the blood sugar goes higher, additional insulin will bring the blood sugar back down in a classic negative feedback loop. As insulin is released from the beta cells, amylin is also released into the bloodstream. Amylin slows gastric emptying, and also inhibits the release of glucagon from the pancreatic alpha cells. The effect of amylin is to spread out the blood glucose peak after eating, reducing the quantity of insulin needed. As the blood sugar level comes back toward normal, the beta cells will stop spurting insulin and amylin. As the glucose level approaches a low mark, the pancreatic alpha cells will release glucagon directly into the bloodstream. Glucagon causes the liver to release stored glucose back into the bloodstream. Notice that increased glucagon will increase blood glucose levels in a positive feedback loop. Together, the three endocrine hormones work as a system to control the blood glucose level between high and low boundaries.

When the beta cell produces insulin from proinsulin, a connecting peptide (or C-peptide) is also manufactured and released into the bloodstream. Absence of C-peptide in the blood indicates that insulin has not been released from the pancreas, and this fact confirms the diagnosis of diabetes type 1. C-peptide was believed to be only a by-product of natural insulin production, however recent studies suggest that C-peptide exerts beneficial therapeutic effects on diabetic nociceptive neuropathy.[1]

Ideally, to replicate the natural function of the pancreas as closely as possible, an artificial pancreas might someday replace all of the beneficial endocrine functions lost, including the delivery of insulin, amylin, glucagon, and C-peptide.

Insulin pump therapy[]

Insulin pump with infusion set

The insulin pump is used to automatically deliver basal insulin continuously, and bolus insulin at meal times by pressing the buttons. Before meals, a blood glucose value is entered into the pump to calculate the correction bolus to bring the blood glucose level back to the target value.

In insulin-dependent persons, blood glucose levels have been roughly controlled using insulin alone. The number of grams of carbohydrate is estimated by measuring foods, and is then used to determine the amount of insulin necessary to cover the meal. A simple open-loop model is used: an insulin to carbohydrate ratio (adjusted based on past success) is multiplied by the grams of carbohydrates to calculate the units of insulin needed. That quantity of insulin is then adjusted based on a pre-meal blood glucose measurement (insulin added for a high blood sugar and insulin removed for a low blood sugar). Insulin is injected or infused under the skin, and enters the bloodstream in approximately 15 minutes. After the insulin has acted in the bloodstream, the blood glucose level can be tested again and then adjusted with injection of more insulin, or eating more carbohydrates, until balance is restored.

There are notable differences with insulin replacement compared to the function of pancreatic insulin delivery:

  1. the insulin dose is predicted based on measured food (where accuracy of measured carbohydrate is difficult) whereas pancreatic insulin is released in proportional response to actual blood glucose levels;
  2. pancreatic insulin is released into to the portal vein, where it flows almost directly to the liver, which is the major organ for storing glycogen (50% of insulin produced is used by the liver);
  3. pancreatic insulin is pulsatile which helps maintain the insulin sensitivity of hepatic tissues;
  4. injected insulin is delivered subcutaneously (under the skin) but not directly to the bloodstream, so there is a delay before injected insulin begins to reduce blood glucose (although this can be compensated by injecting insulin 15 minutes before eating);
  5. replacement insulin therapy does not include amylin (although Symlim is now available for use), which can reduce the insulin need by 50%;
  6. replacement insulin is dosed as a best compromise between aggressive use for lowering the blood sugar when eating but also conservative use to avoid a postprandial low blood sugar due to excess insulin, whereas pancreatic function releases insulin aggressively and later includes automatic release of glucagon at the end of an insulin cycle to manage the blood sugar level and avoid hypoglycemia.

An insulin pump to infuse a rapid-acting insulin is the first step in simulating the function of the pancreas. The pump can accurately deliver small increments of insulin compared to an injection, and its electronic controls permit shaping a bolus over time to match the insulin profile required for a given situation. However, the pump is still controlled manually by the pump user to bolus on command based on a snap shot of the recent blood glucose level and an estimate of the grams of carbohydrate consumed. This predictive approach is said to be open-loop. Once a bolus has been calculated and delivered, the pump continues to deliver its basal rate insulin in the manner that has been programmed into the pump controls based on the predicted insulin requirements of its user.

While insulin replacement is appreciated as a life saving therapy, its practical use in controlling blood glucose levels sufficiently to avoid the long term complications associated with hyperglycemia is not ideal.

Excellent books on diabetes care, insulin use, and insulin pumps[]

Diabetes care from Wikipedia[]


The 'closed-loop" concept for an Artificial Pancreas[]

The artificial pancreas is a technology in development to help diabetic persons automatically control their blood glucose level by providing the substitute endocrine functionality of a healthy pancreas.

There are several important exocrine (digestive) and endocrine (hormonal) functions of the pancreas, but it is the lack of insulin production which is the motivation to develop a substitute. While the current state of insulin replacement therapy is appreciated for its life-saving capability, the task of manually managing the blood sugar level with insulin alone is arduous and inadequate.

The goal of the artificial pancreas is twofold:

  1. to improve insulin replacement therapy until glycemic control is practically normal as evident by the avoidance of the complications of hyperglycemia, and
  2. to ease the burden of therapy for the insulin-dependent.

Development of Continuous Glucose Monitoring Systems (CGMS)[]

Minimed CGMS

This Minimed CGMS transmits continuous BG values to their insulin pump for logging and display but does not yet control the insulin delivery.

CGMS uses a sensor inserted under the skin for several days, and can measure the interstitial glucose value almost continuously. This is transmitted to a device for displaying data and trends. While not real time, this is a leap ahead of finger prick testing typically done 4 to 10 times per day.

This stream of data supports the mission of the artificial pancreas by:

  1. automatically providing a blood glucose reading every few minutes (the sampling rate dependent upon the particular design),
  2. recording and time-stamping blood glucose data for future download and analysis,
  3. monitoring trends pertaining to rising and falling blood sugars, which is helpful in the prediction of blood glucose levels in the immediate future,
  4. comparing blood sugar levels and predictions against a high blood sugar threshold, and then prompting the user that a correction bolus from an insulin pump is needed immediately,
  5. comparing blood sugar levels and predictions against a low blood sugar threshold, and then prompting the user to reduce the basal insulin from the pump or to eat something.

These capabilities suggest that a stream of real-time data of blood glucose levels can be used to "close the loop" and control the insulin pump directly. Closed loop control of the insulin pump in it's simplest form would be to correct immediate or pending hyperglycemia or hypoglycemia by adjusting the continuous basal rate to add or remove insulin as needed, automatically.

Some issues with the present performance of continuous sensing technology will require some study:

  1. continuous sensors require calibration a few times a day, by performing a manual blood glucose test with a finger stick, and then entering the blood glucose data into the continuous system for a sensor correction,
  2. continuous sensors are measuring interstitial glucose, so there is a time delay between the sensor data and the true blood glucose,
  3. automatic control removes the intellect of the user, which can be an additional safeguard when the data is subject to error and must be verified before taking action.

Feedback of real-time blood glucose data to an insulin pump for basal control[]

Artificial Pancreas

The medical equipment approach to an artificial pancreas: automatic control of an insulin pump with feedback from a continuous blood glucose sensor.

The first step in controlling an insulin pump based on continuous blood glucose data is to automatically control the basal rate of the insulin pump. When a bolus has not recently been performed, the pump can manage the blood glucose level by adjusting the basal rate as needed:

  • when the blood sugar is increasing, a small correction bolus can be automatically delivered and a higher basal rate can be set;
  • when the blood sugar is decreasing, the basal rate can be halted to deny the quantity of insulin needed to bring the blood glucose level back up until the basal rate can be continued at a new lower rate;
  • and with adaptive filtering techniques, the pump can "learn" the unique basal rates for the person as a function of the time of day.

When controlling the basal rate alone, the closed loop can still correct a meal bolus error that was too large or small for the food consumed by:

  • recognizing an imbalance between the bolus "insulin on board" and the level of blood glucose,
  • automatically bolusing to correct a shortage of insulin,
  • automatically reducing or interrupting the basal rate to correct an abundance of insulin,
  • and using adaptive filtering techniques to "learn" the carbohydrate to insulin ratios for each meal bolus.

Feedback of real-time blood glucose data to an insulin pump for bolus control[]

The ability of the electronic controls of the infusion pump, particularly in the bolus shaping capability, suggests that the control algorithm may replicate the function of the healthy pancreas in a more copycat fashion. At present, the insulin bolus is a predictive dose based on what is about to be eaten, and then infused completely. Even with the benefit of the closed-loop control of the basal insulin, the standard bolus is still a "guess and then fix it later" approach. Compare to the pancreatic physiology, where insulin and amylin are released from the beta cells in pulses almost directly to the liver in response to the immediate blood glucose level. The natural release from the beta cells is a closed loop response to sensed glucose, and the shape of the insulin delivery is adaptable and appropriate to the food eaten and the body's present metabolic capability.

There are two approaches to investigate. The first employs the proportional, integral, and derivative control algorithm.[2] This allows the control and adjustment of:

  • the rate of glucose increase (i.e the derivative function would deliver more insulin for a rapid increase in blood sugar);
  • the peak of the glucose curve (i.e. the proportional function would deliver more insulin for a higher peak in the blood sugar); and
  • the duration of elevated glucose (i.e. the integral function would deliver more insulin for a long duration of high blood sugar).

Insulin and amylin combination[]

When pramlintide (brand name Symlin or synthetic amylin) is used in combination with insulin, the benefits for post-prandial glycemic control are substantial.[3]

Pramlintide is a relatively new treatment for diabetes. The treatment involves:

  • a separate injection of pramlintide before a meal,
  • a reduction in insulin bolus by 50% for that meal.[4]

Pramlintide can be infused using an insulin pump. At the present time, the mixing of pramlintide and insulin in the same cartridge is not an approved practice, so two infusion pumps are used simultaneously. Since insulin and amylin are co-secreted by the pancreatic beta cells in response to raising blood glucose levels, using pramlintide and insulin together more closely duplicates the function of the pancreas.

Symlin has potential to support the artificial pancreas project because:

  • Insulin and pramlintide may in the future be automatically infused together
    • at a mixture from a single automatic insulin pump, or
    • two infusion pumps could be used automatically with the insulin pump acting as master and the simlin pump acting as slave, or
    • a dual system in one pump machine (two cartridges, a dual infusion set tube, and two subcutaneous insertions);
  • because it improves post prandial glycemic excursions relative to insulin alone, this supports the possible use of an automatic bolus with less impact due to the delay of the insulin bolus;
  • and because it simply duplicates the natural pancreas function, the full benefits of which are not fully understood.

Glucagon combination[]

The purpose of glucagon is to raise blood sugar, primarily by promoting release of stored glucose in the liver. Human glucagon has been synthesized by recombinant DNA technology and is available in a dry powder form in the glucagon rescue kit. This is useful for rescue of unconscious diabetics from a severe state of hypoglycemia.[5]

In healthy pancreatic function, glucagon production is initially suppressed by beta cell production of insulin and amylin when blood sugar is high, and then is later produced by low or falling blood sugar. The natural pancreatic function uses glucagon at the end of an insulin cycle to release glucose from the liver, with two advantages:

  1. to prevent low blood sugar, and
  2. to speed the overall insulin action by cancelling the insulin tail.[6]

If an artificial pancreas was to simulate the natural endocrine pancreas to the maximum extent, then insulin and amylin would be used at the beginning of an insulin cycle and glucagon would be used at the end of the insulin cycle. While the copycat function of using glucagon seems desirable, the trade-off in cost and complexity relative to a gain, if any, beyond an artificial pancreas without glucagon is not known.

References[]

What is "Expert Control?"[]

Good day

When the basal rate profile and meal bolus ratios are accurately established, an insulin pump can be extremely effective in controlling the blood sugar level, even under flexible situations such as a late breakfast, second helpings at lunch, and bolus on bolus snacking. However even for an expert, consistent success is difficult without more help from a continuous glucose monitoring system and an expert algorithm to utilize that data to the fullest.

Managing diabetes with insulin is a tricky business. A custom approach to implement intensive insulin therapy for each diabetic person is derived with the goal of finding balance between the best possible control of blood sugar levels and an agreeable lifestyle for that individual. Once accomplished, a system is established of testing blood glucose levels, measuring carbohydrates, bolusing insulin, anticipating physical activities, covering basal insulin needs, and maintaining a logbook of it all. Many decisions are needed each day which must take into account blood glucose data trends and past experience observed in the logbook. Given a population of diabetic persons, it seems there is a wide range of abilities and effectiveness in achieving "good control" from novice to expert. Even among experts, consistency is a surmountable challenge. For our purposes here, expert control will be defined as the delivery of insulin from an insulin pump that an expert has set up specifically after reviewing recent trends in performance of the regimen and tuning the pump parameters to maximize performance of the pump therapy.

The practice now is for diabetic persons to receive the training for intensive insulinotherapy as necessary to adjust their own insulin regimen, thus giving them the choice to live a dynamic lifestyle. Patients with diabetes see their endocrinologists or diabetes care team 4 times a year. In the old days, an insulin plan and a coordinated meal plan was given to the patients, and they were evaluated at the next office visit to see if the plan required an update. For example patients who were hungry were given more food in their diet plan and the insulin plan was adjusted to match. If an office visit were to show that blood sugars were consistently high, then the insulin regimen was tailored to address the issue. Now in modern times, a patient is taught to measure the carbohydrates in a meal they wish to eat, then calculate the insulin dose needed to cover that meal, increase or decrease the dose to compensate for high or low blood sugars, and then inject the appropriate dose of insulin. The flexibility is highly valued, and is a cornerstone in insulin pump therapy. The insulin pump delivers only rapid acting insulin, which is used both for the basal insulin need at a low continuous rate, and also to bolus as needed at mealtimes. This gives the pump user the flexibility to turn down the pump to react to impending low blood sugar, or else in anticipation of less insulin need due to intensive physical activities. The point is: waiting for several months between clinic appointments is not the way to manage your insulin delivery profile. You must learn to do it yourself for the best result, and this is clearly not suitable for everyone.

Perhaps in the future, amylin and glucagon as well as insulin can be delivered in accordance with the experts expectation.

The term expert control will also be used to contrast specifically with the approach in mainstream research of the artificial pancreas, where we see plans for generic control by a PID controller. Not that a PID controller is a bad thing -- on the contrary it is a fantastic general purpose tool that is capable of controlling most anything. There are off-the-shelf PID controllers out there in industry successfully controlling such industrial systems as sewage processing, power generation, and manufacturing plants. There are new applications with PID loops built into modern digital electronics, giving a modern feel to the old approach. It would be natural for a medical researcher limited in experience with control theory to study the use of a PID controller in the closed-loop control of the insulin pump with feedback of blood glucose data from a continuous blood glucose monitoring system. In contrast to this general approach, systems engineers with a background in modern control systems suggest developing a customized control application specifically for an artificial pancreas by combining the expertise in making diabetes decisions from some of our best certified diabetes educators and caregivers and then implementing that expertise in a modern feedback control system to maximize performance synonymously with user friendliness.

Several concepts in expert diabetes control will need to be defined. By writing them up for peer review, discussing them in forum, and maintaining detailed functional requirements, we will capture the expertise. Systems engineers call this "requirements generation." Some of these topics include:

  • determination of a continuous rate of basal insulin which keeps blood glucose levels steady between insulin boluses, based both on continuous BG feedback as well as predictions of upcoming BG excursions such as nighttime hypoglycemia, growth hormone related insulin resistance, and the dawn factor.
  • determination of a bolus quantity based on estimated or measured carbohydrate about to be eaten an a carbohydrate to insulin ratio evaluated over many days to predict the response to insulin about to be delivered.
  • determination of a bolus shape based on protein, fat, and carbohydrate percentages of the food about to be eaten
  • correction of high and low blood sugar levels based on the dynamic insulin sensitivity and carbohydrate factors of each person
  • and the management of records from insulin delivery, blood glucose levels, and personal patterns for exercise, stress, illness that are necessary to continuously evaluate the effectiveness of all of these things above and adjust them to best future performance.

Simply put, expert control is a concept of emulating the decision making of an expert diabetes caregiver and applying it in the automatic control of insulin delivery as part of an artificial pancreas control system.

Motivation to Develop an Algorithm[]

A vision for an Adaptive Algorithm for Expert Control[]

his will make it feasible to infuse an adaptive bolus that changes its shape and integral dose based on the measured performance of the bolus in progress

The adaptive bolus could start with an assumption of a typical proportions and a bolus shape like the combination bolus. This could include:

  1. a prebolus of pramlintide (optional perhaps, but resolves issue with insulin timing)
  2. initiation of a combination bolus with the initial spike sized in proportion to the present blood glucose level and trends in the change of blood glucose level,
  3. modification to the square wave portion of the bolus, increasing or extending if blood sugar is increasing, and decreasing or limiting in duration when blood sugar is decreasing.

The benefits of an automatic bolus delivery might include:

  • increased accuracy in the total insulin delivered relative to what was needed,
  • freedom to the user of the artificial pancreas,
  • elimination of glycemic excursions due to user error (such as forgetting to bolus in conventional pump therapy),
  • adaptability to changes in digestion of carbohydrates based on food choices,
  • adaptability to variable metabolic needs due to stress, illness, or exercise.

Requirements Generation and Decomposition[]

Modeling and Simulation[]

Wiki Editing[]

Consult the User's Guide for information on using the wiki software.

References[]

Advertisement