How Artificial Pancreas Systems Automate Insulin Delivery

The Organ That Never Stops Calculating

A healthy pancreas makes a decision about insulin roughly every few minutes, for your entire life, without ever consulting you. It reads the glucose in your blood, weighs how fast that number is moving, and releases a hormone dose measured in fractions of a unit. It does this while you sleep, while you run for a train, and while you are halfway through a plate of rice.

In type 1 diabetes, the immune system destroys the cells that do this — the beta cells scattered through the islets of Langerhans. The organ is still there. The calculation stops.

What replaces it is a person doing arithmetic. Someone living with type 1 diabetes makes an estimated 180 or more diabetes-related decisions a day: counting the carbohydrate in a meal, checking glucose, judging whether a walk after dinner means less insulin, waking at 3 a.m. to treat a low. Get it wrong in one direction and blood glucose climbs, with damage accumulating quietly across years — retinas, kidneys, nerves. Get it wrong in the other direction and it falls, which can go from confusion to unconsciousness in under an hour.

An artificial pancreas is an attempt to give the calculation back to a machine. Not a transplanted organ, and not an implant that makes insulin — three ordinary devices, wired into a loop: a sensor that measures glucose, an algorithm that decides, and a pump that delivers. The engineering interest is not in any one of the three. It is in the loop, and in a problem that turns out to be much harder than it first appears: the system cannot feel the effect of its own actions for well over an hour.

What the Body Does, and Why It Is Hard to Copy

Two hormones, opposing each other

The pancreas runs a push-pull control system. Beta cells release insulin, which moves glucose out of the bloodstream and into muscle, liver and fat. Alpha cells release glucagon, which does the reverse, telling the liver to release stored glucose. Healthy glucose control is not insulin alone; it is two hormones in continuous opposition, each correcting the other's overshoot.

That regulation is remarkably tight. In someone without diabetes, blood glucose stays roughly between 70 and 140 mg/dL almost all the time, including after a large meal.

Three things the real organ has that a machine does not

It sits in the right place. Beta cells release insulin into the portal vein, which goes directly to the liver — the organ that does most of the glucose storage. Roughly half the insulin is taken up on that first pass. An injection or a pump puts insulin under the skin instead, where it must be absorbed into general circulation and arrive at the liver diluted and late.

It measures the actual quantity. Beta cells are bathed in the blood they are regulating. They sense glucose directly and continuously, with no delay and no calibration drift.

It can push both ways. A healthy pancreas that has released too much insulin can answer with glucagon. Most artificial systems have only insulin — one actuator, able to push glucose down but never up. Once a dose is delivered under the skin, there is no recalling it.

That last asymmetry shapes every design decision that follows. A controller with one direction of authority, whose actions cannot be undone, must be conservative by construction.

The Three Parts of the Loop

1. The continuous glucose monitor

A CGM is a filament a few millimetres long sitting in the subcutaneous tissue, usually on the abdomen or upper arm. Most use an electrochemical reaction: the enzyme glucose oxidase reacts with glucose, and the resulting current is proportional to concentration. The transmitter reports a value every five minutes.

The critical detail is what it measures. The sensor is not in a blood vessel. It reads glucose in interstitial fluid, the liquid between cells, which glucose reaches by diffusing out of capillaries. That diffusion takes time, so the interstitial reading lags blood by roughly 5 to 15 minutes, and the lag is worst exactly when it matters most — when glucose is changing fast.

A CGM therefore does not tell the controller where glucose is. It tells the controller where glucose recently was.

2. The insulin pump

A small pump delivers rapid-acting insulin analogue — lispro, aspart or similar — through a cannula into subcutaneous tissue. It does two jobs: a slow continuous basal trickle covering background needs, and larger bolus doses for meals or corrections.

Pump precision is not the constraint. Modern pumps deliver in increments well below a tenth of a unit. The constraint is what happens after delivery.

3. The controller

Between them sits the algorithm, receiving a glucose value every five minutes and deciding how much insulin to deliver in the next interval. It runs on the pump, on a phone, or split between them.

The delay that defines the problem

Here is the loop, with its real timings:

Add these up and the controller is steering a system where the effect of the dose it gives now will not be fully visible for hours, using a measurement already a quarter-hour stale.

Control engineers have a name for this — dead time — and a well-known rule about it: a loop whose dead time is long relative to its response time cannot be controlled aggressively without oscillating. Push hard on a signal that is old, and by the time the correction lands the situation has changed. The system overshoots, then overcorrects the overshoot.

In glucose control, an oscillation is not an engineering inconvenience. The downswing is hypoglycaemia.

How the Algorithm Decides

Three families of controller

PID — proportional, integral, derivative. The classic industrial controller, and the easiest to reason about. It responds to three things: how far glucose is from target (proportional), how long it has been away (integral), and how fast it is moving (derivative). The derivative term is what lets it react to a rise before the rise becomes a problem.

MPC — model predictive control. Carries an internal model of how this particular body responds to insulin and carbohydrate, uses it to simulate the next few hours under different dosing choices, and picks the one with the best predicted outcome. It re-runs that simulation every cycle. MPC handles dead time far better than PID, because delay is represented explicitly in the model rather than being something the controller discovers by overshooting.

Fuzzy logic. Encodes clinician heuristics — "glucose is high and rising quickly, give a moderate correction" — as graded rules rather than a single equation. It is easier to make behave sensibly at the edges, and easier for a clinician to inspect.

Insulin on board: the safeguard that matters most

Whatever the controller family, one piece of bookkeeping is essential. Insulin on board (IOB) is the running estimate of insulin already delivered but not yet finished acting.

Without it, a controller sees glucose still high 20 minutes after a correction and gives another. Then another. Each dose is individually reasonable and the total is dangerous — insulin stacking, and it is the classic way to cause a severe low. Every safe controller subtracts IOB before deciding, which means most of the time the correct answer to "glucose is high, should I dose?" is no, because I already did.

Why meals are still announced

Most systems in use are hybrid closed loop, not fully closed. The user still tells the system when they eat, usually by entering carbohydrate grams.

The reason is the timing table above. A meal raises glucose within about 15 minutes. Insulin given at that moment does not peak for 60 to 90. A controller that waits to see the meal in the CGM data has already lost the race — it will spend the next two hours chasing a spike it can no longer prevent, and the aggressive dosing needed to catch up is what causes a low three hours later.

Announcing the meal lets insulin start early. It is the single biggest reason these systems are not yet fully automatic.

Safety, layered

Real systems wrap the controller in constraints that can override it: maximum delivery limits, predictive low-glucose suspend that stops basal insulin when a low is forecast, and hard ceilings on total delivery per hour. The controller proposes; the safety layer disposes.

What These Systems Achieve in Practice

The measure that replaced the old one

For decades, control was judged by HbA1c — a blood test reflecting average glucose over roughly three months. It is useful and it is blunt: two people with identical HbA1c can have completely different lives, one steady, the other swinging between highs and lows that average out.

CGM data made a better measure possible. Time in range (TIR) is the percentage of time glucose sits between 70 and 180 mg/dL. International consensus targets are typically above 70% time in range, with time below 70 mg/dL held under 4%.

TIR is the metric closed-loop systems are built to move, and the one on which they clearly perform: the consistent finding across trials is more time in range, with the largest gains overnight, and without the increase in hypoglycaemia that tighter control historically brought.

Where the benefit concentrates

Overnight is where these systems are most transformative, and the reason is structural. Sleep is eight uninterrupted hours with no meals, no exercise, and no decisions — exactly the conditions a controller handles well. It is also when hypoglycaemia is most dangerous, because nobody is awake to notice it.

The clinical result is more time in range by morning. The human result is different and harder to measure: people sleep through the night, and so do their parents.

Systems in use

Commercial hybrid closed-loop systems from several manufacturers are now widely prescribed, pairing a CGM with a pump and an approved control algorithm. Alongside them sits something unusual in medical devices — a DIY movement. Communities built open source closed-loop systems, notably OpenAPS and Loop, from existing pumps and CGMs, and were running automated insulin delivery years before regulators approved commercial equivalents. Their slogan, #WeAreNotWaiting, is a fair summary of the sentiment. That work demonstrably influenced the commercial designs that followed.

What It Still Cannot Do

Exercise breaks the model

Exercise increases insulin sensitivity — sometimes for many hours afterwards. The same dose that was correct this morning may be too much this evening. Worse, the effect direction is not even consistent: sustained aerobic exercise tends to lower glucose, while short intense anaerobic effort can raise it through stress hormones.

Most systems handle this with a user-set activity mode that raises the target and reduces delivery in advance. That is a reasonable workaround and it is still, unavoidably, a manual decision.

Meals remain announced

As above — the physics of subcutaneous absorption, not a software shortcoming. Faster insulin analogues shrink the gap but have not closed it.

One hormone, one direction

Most systems can only reduce insulin, not add glucose. Suspending delivery takes effect slowly, because the insulin already absorbed continues acting.

Dual-hormone systems add a glucagon pump, giving the controller genuine two-sided authority and letting it dose insulin more assertively knowing it can push back. The costs are real: a second hormone, a second reservoir, a second failure mode, and the practical difficulty that glucagon has historically been unstable in solution.

The site is not the organ

Everything here happens under the skin rather than in the portal vein. Absorption varies with the infusion site, its age, temperature, and local blood flow. A cannula can kink or scar. The controller assumes delivered insulin was absorbed, and cannot directly detect when it was not.

Where the Engineering Goes Next

Removing the meal announcement

Fully closed loop is the obvious target, and it is being attacked from two directions: faster insulin, so a controller reacting to a detected rise is no longer hopelessly behind, and meal detection, using the shape of the CGM curve to recognise that eating has begun and start dosing without being told. Neither is solved, and the second carries an asymmetric risk — a false positive means insulin for a meal that never happened.

Better models of a specific person

MPC is only as good as its model, and insulin sensitivity varies between people, across a day, and with illness, sleep and hormones. Adaptive systems that continuously re-fit their model to the individual are an active area, and a natural application for machine learning — constrained, in this domain, by the requirement that behaviour stay explainable and bounded. A controller that cannot be reasoned about is difficult to approve and harder to trust.

Different hardware entirely

Implantable pumps delivering into the peritoneal cavity get closer to portal delivery, with faster absorption. Dual-hormone systems continue in trials. And running alongside all of it is the biological route — encapsulated beta cells derived from stem cells, which would not be an artificial pancreas at all, but a replacement for the cells that were lost. If that succeeds, everything described here becomes a bridge technology.

That is not a criticism of it. Bridges matter when the far bank is decades away.

Key Takeaways

Related stories

More from Gear Gang

All stories from Gear Gang