• Guest - w'd love to know what you think about the forum! Take the 2025 Survey »

Does anyone understand the nitty-gritty of looping?

mattrix

Well-Known Member
Messages
59
Type of diabetes
LADA
Treatment type
Insulin
Dislikes
Clock time
I've been sitting on this question for a while, but I cant think it out.

I really like the idea of an IV insulin pump that reads near IV plasma glucose and makes immediate adjustments accordingly - count me in.

However pumps are not IV, but inject into an infusion depot. Consequently they suffer the same vagaries that we all have to deal with.
"If I inject x units now, how much will it affect me and when?"
"What may change between now and then?"

Sure a loop can see your plasma glucose dropping and make a quick correction, but that correction is not going to do anything for some hours.

Also the infusion depot acts as a buffer, the insulin released from the buffer at a point in time is proportional to the amount of insulin in the buffer (half-time decay). So to double the insulin released you have to double the insulin stored in the buffer.

That is to say the insulin released into the body fluids is not proportional to the insulin entering the buffer at a given time. Think about MDI, if I inject 10 units at time 't' it does not release 10 units into my blood at time 't', but instead 10 units are released into the blood over the upcoming hours ( in my case about 4.5 hours).

Maybe I am underestimating the 'smarts' of the pump? If you set a pump to a basal of 1 unit an hour is that a) the amount of insulin released into your blood or b) is it the amount of insulin put into the infusion depot? These will be different things at different times.

*** deleted a lot here as it was repetitive **
 
I notice a difference according to where on my body I place my infusion set....

I don't think it's a magic bullet, but it is preferable to MDI (for me anyway).

Also, different pumps have different algorithms?

I get a lot less hypos now I am on a pump (tandem tslim)
 
By "insulin depot", do you mean the area of subcutanous fat where the infusion bit sits?

The pump is pretty straightforward - X amount of insulin comes out of the sharp bit. That's what it knows about. If it's giving you 1U/hour, it'll do that in drips over the hour. Eg Omnipod doses in multiples of 0.05u, every 5 minutes, so it'll give you .1, .1, .05, .1, .1, .05, .1, .1, .05, .1, .1, .05.

Yes, absorbtion rates from the body after it's come out of the pointy bit will vary and will be important. I think the pumps have an "Insulin on board" idea to help with that. So if you're dropping and you've got insulin on board, yes, it'll stop dripping in for a bit. Sometimes really quite a long time.

If you're dropping fast and you've got insulin in you, yes, the pump won't be able to do anything about that. If it's going too fast, isn't going to stop, and you don't already have food in you, you'll need to eat.

If you inject 10u and it takes 4.5 hours to release, consider why you're doing it. This will be a bolus dose for food - and the sugar from eating doesn't all come at once, it also spreads out over time. So it's not a problem, it's a feature that the delivery ends up being slow - the requirements aren't that it's instant.

Yes, if you're throwing a lump in as a correction, that will suffer from delay - but the hope is that the pump/sensor has noticed it going up higher sooner than you did, and has already been giving you slightly more, so it shouldn't need as much correction.

So everything you've written is correct - but the algorithms have been designed to cope with this, and they do generally work. Not perfectly, and probably not for everybody, but IME they're better than being on the fixed basal dose that slow acting injectable insulin gives you.
 
Thanks guys,
Please don't get me wrong, I am not saying that HCL doesn't work, just that I don't understand what it is doing. It is all too easy to forget that insulin while it is in the subcutaneous fat depot is not doing anything to lower your plasma glucose.

I have a mean dawn phenomena (equivalent to eating a meal) that I can't hit with long acting insulin. If I take enough basal to effect it, I go hypo earlier in the night, or after I wake up depending on when I take it.
IF I had a pump the first thing I would do is double or triple my plasma insulin for the 3 hours before I wake up. But how would I do that?

**maths alert** (sorry I have to put numbers on things to make sense of them)
With Detemir, 18U will release about 0.1U per 5 min into your body fluids.
A pump using Aspart will need to keep 1.35U in the infusion site to release 0.1U per 5 min into the body fluids.* To triple that it would need to keep ~4U in the infusion site.
**\maths**

Who is changing the insulin in the site, like this ^^? The pump, the algorithm, the user?

----------

I now have some isophane insulin, which I'm hoping will be 'peaky' enough to hit the DP but I have stuffed up the administration of this so far. Alternatively the Omnipod5 has just been approved here, but from what I have read I don't think it will be aggressive enough to triple my basal rate, the DP comes on quickly.

* calculated as,
I see BG drop for about 4.5 hours after a correction => a half-time of 45min => ~7.5% of the depot quantity each 5 min.
Sorry if I have stuffed up the maths, which is quite likely.
 
Last edited:
My short answer to this is it seems to work, so it's possible you might be overthinking things - if there is the option, just try it. But remember all pumps don't work instantly, they need a learning period.

There are also two ways a pump can handle DP. One is the one we're talking about, which is reactive - sugar goes up, insulin goes in. But they're also quite good at monitoring what has happened to you, and they will learn that eg at 6am, your sugar seems to go up, so maybe putting a bit more in round about then would be a good thing.

Re "Who is changing the insulin in the site, like this ^^? The pump, the algorithm, the user?" - the pump is the algorithm. There's no point in separating them for the purposes of this discussion. If you're asleep, you're not going to be bolusing, so yes, the pump is in charge of changing the amount of insulin in your body using the means it has available to it, which is throwing it out of a sharp pipe. It will use the knowledge it has - this could be a pre-programmed change of basal rate, it could be a detected change in blood sugar, it could be a learned knowledge of basal rate requirements, and it will include a knowledge that it seems to take your body X time to respond to injection of Y - to determine how much it is going to pump in.
 
Thanks @evilclive, I'm not good at 'blind faith'. I like to know what things are doing.
I think it is worth separating things, a pump without loop vs with a loop, etc.
I don't know enough about either.

The algorithm being preemptive is scary. It would have to start putting in insulin well before it sees a significant rise. My DP happens while I'm asleep, but if my sleep cycle gets disrupted and I get up the DP doesn't happen. Though, I guess then I'd be awake to handle any subsequent hypo.
 
Last edited:
It's not blind faith. You've got the monitoring, so you can see what your sugars have done, and you can see what the pump has done. There's an experimentation and learning phase, for both the pump and for you. But ultimately a pump is a really simple device - little doses of insulin come out, that's it. The closed loop control isn't massively more complex.

If you can get a pump with closed loop, I'd give it a go. No point in getting one without the loop (though I think they all have a few days where they run without to start with). At the beginning, if things go high, tell it to put some more in. If things go low, eat something. Use the alarms for that to help you. But it should start learning, and should improve. (I've been through that cycle twice now).

Obviously it might simply not work for you. Your body might just have reactions to insulin which they can't cope with. But the only way to find out is to try it.

(of course the other way is to go a couple of years back in technology and get one of the open source closed loop pumping control systems. Before it was normal for manufacturers to do closed loop, there were people doing it for themselves, and the software is there for you to play with. Obviously it needs compatible hardware, and if you're doing any tinkering with software you really ought to know what you're doing both from a technology and a biology perspective, but it should be possible - I'd be happy doing something like that.)
 
Who is changing the insulin in the site, like this ^^? The pump, the algorithm, the user?
Not sure if your maths is right but it depends what kind of pump you have. If you have one that sets rates by "learning your levels" (eg minimed 780g) then I believe the pump will eventually work your dawn phenomena out after it has had enough days of seeing your levels. (Tagging @Nicola M who is on this pump).

If you use a more manual pump, such as my tandem tslim, then you have to set your basal profiles yourself, but you can have multiple profiles to correspond to different insulin needs (eg for days when you are very inactive or active, or ill). The profiles you set also allow you to set your insulin to carb ratios to be different amounts at different times of day. The profiles specify the amount of basal to be injected per hour and it releases 1/12 of the hourly amount every 5 min, but the closed loop aspect means it adjusts it up and down if it thinks it needs to. When you eat you specify the carbs, and it gives you a single hit of insulin (though there is an extended dose facility to make that be applied over a longer period).

Some pumps allow you to specify how long the algorithm thinks your insulin lasts in your system, but the tandem insists it is 5 hours, which might not be good for some people.

And the pump algorithms really are different, and that is just one reason why the best pump for one person isn't necessarily the best for another.

I have a ferocious dawn phenomena and if I don't eat breakfast but just have a couple of cups of coffee with milk, then I have an insulin ratio of 1 unit to 2g. If I have 10g or more of carbs though, I use a profile I call bigbrekkie, which has 1 unit to 5g of carbs.... And I also have my basal insulin set to increase for a couple of hours before breakfast.


So if you know that you have a regular dawn phenomena happening at a set time each day, then either you or your pump algorithm will learn to drastically increase your basal rates before it hits in....

That is my understanding of it, anyway, from my 15 months with the tandem, happy to be corrected by more experienced pump users.
 
Thank you so much everyone.
I think DP is worthy of its own thread.

And I also have my basal insulin set to increase for a couple of hours before breakfast.
that is the crux of this thread.

Is that increase just in the insulin put into your subcutaneous fat OR does the pump/algorithm do some fancy calculations so that that is the increase into your blood?
 
Is that increase just in the insulin put into your subcutaneous fat OR does the pump/algorithm do some fancy calculations so that that is the increase into your blood?
The numbers the pump deals with and the numbers it shows you are the related to the amount it pumps. It will tell you how much has been pumped, when, and how much insulin it currently thinks is in your body based on a lifetime of a few hours.

That latter number is related to what you're concerned with, the release rate from the fat. But that release rate isn't presented to the end user.

If you're in manual mode, and you program your pump to increase the amount of insulin, you get more coming out of the sharp bit into your body. Eg if you say "Give me 2U/hr rather than 1U/hr between 0500 and 0600", it'll give you 1U extra during that time - nothing more complex than that.

Yes, in automatic mode, it will take account of how much insulin is already in your body, and how fast it'll come out of the fat into the bloodstream, but it won't tell you about doing that. It probably isn't programmed to think about it in the way you're trying to think about it - most control algorithms are rather simpler.

For example, if you've determined that you need 2U/hr from 0500-0600, that could be for many reasons - but those reasons don't matter, what does matter is that the end result is you need that much putting into you at that time. And that end result is determined mostly by trial and error. The closed loop just speeds up the trial and error part - it's constantly checking and correcting.
 
Last edited:
Hi @evilclive, I really do appreciate your input. However I do find it a bit ambiguous.
and how much insulin it currently thinks is in your body

That latter number is related to what you're concerned with
Confused.
So does "currently thinks is in your body" include or exclude the insulin in the subcutaneous fat?
Does it include or exclude the insulin that is no longer in the subcutaneous fat?

It probably isn't programmed to think about it in the way you're trying to think about it
Yeah, I'm thinking about it as a biological process that can be verified from medical studies.
Not as a bunch of inputs that get processed to a result. Which is why I'd like to know what that processing is.
 
If you're in manual mode, and you program your pump to increase the amount of insulin, you get more coming out of the sharp bit into your body. Eg if you say "Give me 2U/hr rather than 1U/hr between 0500 and 0600", it'll give you 1U extra during that time - nothing more complex than that.
Still trying to get my head around that.
Lets say I start at 1.2U/Hr and absolutely want 2.4U/Hr between 5:00 and 6:00
Then in manual mode where the pump only knows its pointy end, I came up with this schedule:

3:30pump supplying 0.1U/5min, 0.1U/5min of insulin will be released into the body fluids
request 0.2U/5min insulin
3:30-5:00pump supplying 0.2U/5min, insulin being released: ramping up to 0.2U/5min
5:00-6:00pump supplying 0.2U/5min, 0.2U/5min of insulin will be released into the body fluids
request 0.1U/5min insulin
6:00-10:30pump supplying 0.1U/5min, insulin being released: decaying down to 0.1U/5min
10:30pump supplying 0.1U/5min, 0.1U/5min of insulin will be released into the body fluids

I could speed up the end of this by requesting 0 basal for a period of time.
This also supplies more than 1.2U extra insulin over the 7 hours.

In loop mode does the algorithm sort all this so that you only need to specify 2.4U/Hr from 5:00-6:00?
 
Last edited:
I can't speak much on the math side of things or how pumps do what they do but I am on the Medtronic 780g which as EllieM said it does learn from you. Initially, it learns over a week what your levels do at any given time of any given day and then it continuously learns from then on and will update as necessary each midnight. Pre-Insulin pump I had horrendous DP, we're talking I'd wake up with normal levels of around 6.0 and jump up to 20+. These days I'm fairly steady and wake up usually around 6-9 and don't ever go much above 10 if at all.
 
In loop mode does the algorithm sort all this so that you only need to specify 2.4U/Hr from 5:00-6:00?
We're now talking about two different things - loop mode and manual mode, and we're also getting a bit into pump-specific things.

Specifying a rate per hour is manual, not loop. And some pumps won't let you specify a rate per hour while in loop mode - you set up a basal schedule as a starting point, but over time it modifies that schedule to fit what it observes. That's the learning.

With a pump in loop mode with no manual correction, it will observe that your blood sugar goes up at 0500 every day. For the first few days, the reactive part will see it going up, and will give you some more right then. The learning part will then recognise that it always needs to give that to you, and starts planning the dose rather than reacting.

The amount it gives you will eventually be the amount required to keep your sugar in range. That's what closed loop is, that's the feedback. It's not going to be thinking "I need to give 2.4U to blood", it's thinking "I give whatever is required to keep the sugar level right".

Some pumps might not be as sophisticated as that and might need a hint - but I know Omnipod for example doesn't do that. In loop mode you don't need to specify anything to get the right amount of insulin in to cover regular periods of higher insulin requirement - it works it out for you. It genuinely is automatic.

Now, if as you say, you "absolutely want 2.4U/Hr between 5:00 and 6:00" - and presumably that's your desired insulin in blood amount rather than what everybody else thinks about, which is insulin out of pump amount. You're going to have to go fully manual to do that, and don't let it do anything automatic. And yes, your proposed schedule might work. Obviously if you want it to be accurate you're going to have to do blood sampling and measurement, because otherwise it's all guesswork - you don't know how fast that insulin leaks in. And then there's the question of why you do want that precise amount - if you've determined that that level works that's good.
But you could stop thinking about the value you can't measure, and instead start thinking about what you can measure and can control. You're saying "My body needs 2.4/H in the blood at that time". Instead you could do what the pump does, which is "My body needs X delivered to it at that slightly earlier time". A feedback loop enables that to happen quicker. Before closed loops, that feedback loop was "Try a schedule, does it work, adjust it manually next time". Now that feedback loop means it's "Try a schedule, notice it's not quite working and apply corrections immediately, and if I keep having to correct, tweak the schedule"

The other great thing a closed loop pump does is copes with the fact that our bodies are random. Well, mine certainly is, and I expect most people's are. There's huge amounts of things going on - a monk or prisoner might have close to a consistent environment, but even then things change - a slightly different cut of meat, a thinner slice of bread, a late night discussion with a colleague, can't find your toothbrush one morning, it's a warmer day, etc etc. These all change the requirements for insulin, and the pancreas is a closed loop system - sugar goes up, insulin goes out in response. It doesn't plan (doesn't need to because its feedback loop is really quick). We don't have a working pancreas, so the next best thing at the moment is to do the same with pumps and sensors - sugar goes up, insulin goes out in response. Slower feedback, so the algorithm is a bit more complex, but ultimately we're heading in the same direction. Thinking "I always want X amount of insulin at this time" isn't useful. The useful thing is "I want my sugar level to be Y", and the amount of insulin to achieve that can change from day to day - and closed loop allows that to happen automatically.
 
Specifying a rate per hour is manual, not loop.
Fair enough. I assumed Ellie was looping, and she said she increased the basal.

I use numbers as examples because I can think in them and do calculations with them. 2.4= 2*1.2=12*0.2 nothing special about those numbers just easy to work with. I bet the algorithm is using numbers to do its calculations.
The interesting thing for me was that to double my basal for a specific hour the basal will be elevated for 7 hours, and you will have to start that cycle 90 minutes before the hour. That is from properties of the insulin, so the loop will have to do the same thing.

... because otherwise it's all guesswork - you don't know how ...
Everything diabetes is guesswork, at least it is for me. My carb ratio varies with the size of the meal and my BG before the meal, it is not a linear carbs*ratio etc. Bolus insulin affects my BG for 4.5Hr* give or take, but I don't know if that is true when I'm asleep.
* I'm not sure about that, I think it is faster if I take a larger dose.

I don't know how 'learning' would work, my DP starts about 5-6 hours after I fall asleep, not at a clock time. Though if I can tell the algorithm when I go to bed, it could use that as a reference.
But who am I to talk, at the present time everything is out of whack with me, it cant do any worse.
 
Last edited:
I had horrendous DP, we're talking I'd wake up with normal levels of around 6.0 and jump up to 20+.
Thats interesting.
My DP strikes 2-3 hours before I wake up. My BG will sit level all night and suddenly it will start to climb, often up to 12 by the time I wake up. I always take insulin after I wake. If I'm not eating I take a correction.
 
Last edited:
Fair enough. I assumed Ellie was looping, and she said she increased the basal.

Different pump to mine - some are a bit more manual still.

But who am I to talk, at the present time everything is out of whack with me, it cant do any worse.

:-) That's why I suggest just trying it. The pump definitely adds flexibility - you can just put more in yourself when you want, it's a lot less hassle and pointy than another injection. And I think after the learning period, they are also pretty good at knowing what you need.

Obvious downsides - cost (don't know if that's relevant where you are, but it is a thing). Tedium of having the pump - pipe + pump, or pod stuck to you. More faff when travelling, because you still need the old kit too in case things go wrong.

For me, it's working and worth it. I suspect the only way to find out though is to suck it and see.

(omnipod do free non-functional samples so you can see if you can cope with the lump stuck to you - another thing worth a look)
 
The interesting thing for me was that to double my basal for a specific hour the basal will be elevated for 7 hours, and you will have to start that cycle 90 minutes before the hour. That is from properties of the insulin, so the loop will have to do the same thing.
This is one of the big things that pumps do well - no using slow acting insulin, they only use fast. With slow insulin, if your requirements don't match the flattish curve that they supply, it's not going to work. No adding a little peak or dip. With the pump, you just add the little peak or dip by using more or less at that time.
This was the case before closed loop - closed loop just makes it better.
 
Different pump to mine - some are a bit more manual still.
Yes, tandem is relatively manual, the closed loop aspect is reactive, and although it'll give you more or less insulin if your bg is high or low, it wont change your basal rates for the next day.
 
@EllieM ,
can you see what insulin the pump has added, and use that to update the basal profile that it will use the next day?
Is the algorithm aggressive enough to temporarily double or triple the basal rate?
 
Back
Top