LoopKit / Loop

An automated insulin delivery app for iOS, built on LoopKit
https://loopdocs.org
Other
1.51k stars 1.3k forks source link

Dynamic Carb Absorption: End carb absorption early or dynamically extend it. #679

Closed trixing closed 11 months ago

trixing commented 6 years ago

I have been testing the current Loop version with DCA and have a fundamental issue with this:

If there is sport after food (or a sensor change without glucose values for 2 hours), the observed carb amount is low to very low and the carbs are just linearly written of for 4.5 hours (in the default case). This causes after 2 hours still half the carbs being considered unabsorbed and Loop will accordingly high temp (because Fiasp has actually 80%+ worn off at this point). This consistently causes lows 2-3 hours after the meal.

To safe guard against this I'd suggest that if there is no carb absorption observed for 30 minutes Loop should mark the carb entry as fully absorbed and remove it from any prediction.

Now as a workaround I've set the overrun time to 1.0 and also reduced my default absorption times by 20%. DCA still helps in this case with faster absorption.

As a correlate to that if there is still a lot of absorption ongoing at the end of the window it might be nice to extend the prediction by 30+ minutes to help counteract a high from underestimating carbs.

Examples:

image

image

scottleibrand commented 6 years ago

To deal with this situation in OpenAPS, we use a min_5m_carbimpact variable that ensures that a minimum level of carb absorption will occur every 5m even if no carb impact is observed from the BG deviations.

trixing commented 6 years ago

Loop as well. The minimum rate is calculated as total_carbs / (absorption_time * 1.5). Which is generally fine if you actually absorb the amount of carbs entered. But if sports, or wrong data entry, or no sensor data leads to less carb absorption observed, there is a pretty big lingering amount of carbs left. How would OpenAPS deal with this situation?

scottleibrand commented 6 years ago

Another thing we do is to dynamically extend the assumed remaining absorption time as a 2x function of how long ago the carb entry was. So if the initials assumption at the time of carbs entry is that carbs will absorb over 3 hours, then an hour later we'll assume that, if no carbs are being absorbed, that the remaining carbs will now take 5 hours to absorb. That sounds backwards, bit works well, since that minimum only kicks in when something is preventing BG from rising as much as would be expected.

francesc0-cgm commented 6 years ago

@trixing in Kids if they practice activities After a meal digestion Will stop and Will restart After they stop. I think It could be a valid option for adults bit not a rule

mbieweng commented 6 years ago

I am currently handling this with the addition of a sensitivity factor that adjusts over time based on the past forecast error. That helps a little automatically. More importantly, the sensitivity factor is available in the settings and can be adjusted as needed. So, for the case of exercise after meals, I'd set it manually to, say, 1.5x before bolusing for the meal. That cuts down on the bolus, and also reduces the amount of high temping afterwards. Some additional description is here

eyim commented 6 years ago

This is an issue for my son as well. Especially as trixing mentions after he exercises. We reduced the absorption time significantly compared to before which has helped some. But the main way we deal with this is by giving him unannounced carbs or deleted or reducing the early carb entry completely.

github-actions[bot] commented 12 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 11 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.