In the video chat today John Mastrototaro mentioned that the medtronic artificial pancreas prototype is using a PID (proportional-integral-derivative) type control. What does that mean? How good is it? Read on!
The PID algorithm has been used for decades in the process control industry. It is used in all types of industrial processes throughout the world. Some of the pros of PID:
- Can be tuned (adjusted to act faster or slower) to match a specific need
- Extremely well understood; everybody uses it, so a lot is known about how it works.
- Can respond to the the rate at which change is occurring (e.g. could see how fast you're dropping or climbing)
How it works:
- The controller is given a setpoint (SP, or target value). In this case that would be the target glucose concentration. For example, you might set the SP to 100 mg/dl or 5.5 mmol/l.
- The controller reads a process variable (PV, or actual value). In this case that would be the glucose measurement from the CGM.
- The controller continuously changes the output (OP) up or down, depending on whether the measured glucose is above or below the setpoint. In this case the output goes to the pump to adjust the infusion rate.
In simple terms, if your glucose (PV) is above your target (SP) then the controller would increase the rate at which the pump is delivering insulin. How much depends on how high you are.
The tricky part is that the formulas start changing the output before the PV reaches the SP. In other words, it doesn't keep dumping in insulin until you're low and then try to fix it. Instead, it is always trying to achieve a "soft landing" by gradually bringing your glucose closer to your target. So by the time you reach your ideal glucose, the infusion rate is hardly changing at all.
Of course nothing is perfect. Cons of PID:
- It can be very sensitive to delays in response (dead time). In other words, it has to be tuned carefully because your glucose doesn't respond immediately to changes in infusion rate. The delays are cumulative and caused by lag time in the sensor (around 15 minutes) and the time it takes for the insulin to affect your glucose.
- Doesn't handle noise very well. With any measurement there is a bit of randomness. You can see this if you take several measurements with your glucose meter all at once. They don't all come out exactly the same. The PID can see these differences as changes in your actual glucose, and try to correct for them by changing your insulin infusion rate.
The basic solution to these issues is to make the control act slower. The downside of slower action is that it will not respond as quickly to real changes such as your glucose going up rapidly from eating sugar. Slower action would translate into a wider range of glucose, i.e. your control wouldn't be as tight.
Hopefully we don't have too many glazed-over eyes out there now! I'll save further details and comparison to other control methods for a different post, if there's interest.