LoopKit / Loop

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

variable ISF based on BSL #656

Closed spikebeecroft closed 5 years ago

spikebeecroft commented 6 years ago

was having fun enjoying a period where I had total miscalculated my carbs and ended up high, 17 mol, loop tried hard to drop me down but it was not happening fast enough and the recommended bolus was not going to be enough it did very little to change my BSL, I waited 4 hours just to see who loop could handle it ( I could have increased my basal max rate as well but I',m already at quite a higher rate relative to my normal basal rates x5), I'm far more resistant to insulin when higher, and similarly also more sensitive when lower but this is less of an issue, other things are happening when your low.

in order to make loop more effective wonder if it could take the current BSL into account and use a variant ISF into account, so if above a user set point then a more aggressive ISF could be enabled to help for correcting highs, currently only ISF is variable based on time, while experience tells us that BSL is also a factor in ISF. the change may provide a better guide to predicting highs and lows but obviously changes to becoming a stepwise function and much more complicated code

scottleibrand commented 6 years ago

From what I’ve heard from those who’ve studied the physiology in detail, there is very little reason to believe that high BG causes insulin resistance (lower ISF), nor any known mechanism by which it could do so. Rather, it seems that the causation is usually in the other direction: insulin resistance often causes high BG. If that is the case, then it would be somewhat dangerous to assume that all high BG situations correspond to insulin resistance and lower the ISF used for closed looping, as that may cause insulin overdoses in cases where the high BG is caused by something like miscounted carbs rather than by the body’s changing response to insulin.

We experimented with a somewhat similar approach in OpenAPS, lowering the BG target when BG is high, and found it even that to be somewhat problematic. Instead, we’ve recently settled on a combination of two things. First, autosens automatically detects insulin resistance over 24h, and adjusts ISF accordingly. And secondly, we calculate a BG prediction based on what would happen if all insulin counteraction effects ceases and we ran a zero temp until BG rose above the BG target. This gives us the ability to determine when it’s safe for the oref0 SMB algorithm to dose a bit more insulin to bring down a high BG more quickly while still leaving enough safety buffer to ensure a smooth landing if BG starts to fall and we have to zero temp the whole way down.

Lueddeke commented 6 years ago

Greetings to all. First, I am a diabetes professional from Germany and I am not affected. Together with a german engineer we developed a bihormonal MPC Algo ( avoiding some problems of the Damiano Algo) based on the Virginia model. For big pharmaceutical companies this was "too futuristic". I have a long experience ( 40 y) with CSII and contributed to some scientific diabetes projects. I think I have some literature -based knowledge of physiology of type 1. A small group of my patients are loopers ( with dana) but I have some hundred Patient with CSII. I learn from them and they learn from me. I (try to) follow your project with deep respect and I am astonished how much of my own experience and thoughts are matching those of this community. Several years ago Yki-Jarvinen from Finnland published a paper with a simple eperiment : she asked well controlled CSII patients to try to elevate blood glucose to a mean level of 200 mg/dl for 24 h. Thereafter ( the day later) they should try to match again their mean bg level: they needed around 50% more insulin for a short period. From type 2 Diabetes, we know ( Hans Haring from Germany) that the insulin signal transduction chain is affected (worsened)by elevated blood glucose levels. It is not known, but it seams reasonable, that this not very different in healthy persons or type 1. Richard Bergman from California published a paper, demonstrating in an experimental animal model that the extracellular transport of insulin is dramatically worsened with only lightly elevated bg levels. Taken together, there is some evidence, that at least 24 hs of high(er) BG affect insulin sensitivity. With very high values and with the development of ketone-bodies insulin action is dramatically worsened and you will need much more insulin. With very high values and with the development of ketone-bodies insulin action is dramatically worsened and you will need much more insulin. Scott is right, that there is no clear knowledge about the effect of short times of hyperglycemia. In my experience it is a standard situation, that patient with type 1 correct a high BG value - but it does not work - they correct it again - does not work - again correction and then hypo. This archetypical situation refects from my point of view that insulin sensitivity is affected by an integral of BG values of around 4-6 hours. Interestingly, this is the same for low BG values. It is known, that one clinical hypo increases the risk for a hypo in the next 24 hours. There are a lot of reasons for this, eg a diminished counterregulatory response, but taken together it means only, that in this situation insulin action is increased and a function of BG level.

Kdisimone commented 5 years ago

Closing this issue as it would be better tracked as a topic under https://github.com/LoopKit/Loop/issues/431