My AP History
It’s been a year since I first discovered OpenAPS. It took me a couple months to get my CGM and hardware set up and I began looping using the oref0 algorithm on a Raspberry Pi. I ran oref0 for 3 months on various sets of Linux-based hardware and radios.
In Feb (2016) I found out about other algorithms that people had been using. There is an OpenAPS algorithm called openaps-predict that was created by @loudnate that used the model described in Think Like a Pancreas. It was around this time that I also learned a bit about a couple of other algorithms used in Simpancreas and pingrf created for their own personal use (not Open Source).
My interest in the different approaches really began to blossom when I saw this..
I am very curious to learn more about how other closed-loop systems will work including commercial systems from Medtronic, Bigfoot and others. Time will tell if we get any insight or if they will simply be a black box.
Loop for iOS!
In late April (2016) I made the switch to Loop. Loop is an algorithm that sits on top of LoopKit. LoopKit contains all of the communications to talk with my pump (via RileyLink_ios), my CGM (via xDripG5) and Apple’s HealthKit to keep track of Carbs.
The reason I switched from OpenAPS to LoopKit was because LoopKit worked with iOS (I am an Apple guy) and I would not have a carry a Linux machine around in a murse. I spent a huge amount of time keeping my OpenAPS rigs up and running and I am not a big fan of man purses’.
Along the way that meant that I was going to use the Loop algorithm rather than oref0 I had been accustomed to. oref0 worked well for me.
Tuning for an AP
The most important thing I found was getting my pump and core diabetes management settings right. After being on a Medtronic pump for 15 years I thought my settings were correct. Boy was I WRONG!
I am not a doctor, nor do I pretend to be on the internet. There is a term YDMV. It stands for Your Diabetes May Vary. Talk with your doctor, question everything, test test test. Do not take anything I have said or written here as something that will work for you.
Getting ready for Loop
Spending at least a few days on each step is my suggestion. It is sooo easy to want to plug in your AP and press go. I have waited for 30 years to have a closed-loop. Do you think I plugged it in and pressed go? You bet I did. And it took me 2 months instead of 2 weeks to get in nailed. I know I sound like your mom, but go slow and you will get where you want to be faster.
After many months of testing and talking with other Loopers on Gitter, I think this is a good order to approach getting your settings tuned, especially if you are on a new brand of pump (or any new pump to you at all). Turns out settings can change. If you have not taken a pass since you got your pump 3.5 years ago…now is the time.
- Basal Rates — This is the first setting you should optimize for. If this one is off then you are very likely to have inaccuracies will all of the settings that follow. If you are new to a Medtronic pump — your Basal rates may be different vs what you used on an Omnipod for example. As I mentioned, I’d been on a Medtronic for 15 years and OpenAPS for 3mo, but I still had to make adjustments. Turns out that weather changes and my body weight changes (among other things). As we’re taught when we get on pump therapy for the first time. Get those basals tuned! Note: the basal rates in Loop have to match those in the pump itself, so be sure to make the edits in both places!
- DIA —Insulin Action Duration. This feels like the easiest one, but it can be the most deceptive. The goal here is to figure out how long the insulin stays in your system. This is particularly important for combating carbs with a Bolus. The value should be accurate to how long the insulin lasts in your body and nothing else. I tried to shorten this value because I wanted to get my insulin to work faster. Nice try, but it does not work! As I like to say #FasterInsulinPlease, but for now put in how long the insulin actually lasts! For me that is 3 hours and 45 minutes. You can get yours set by waiting until your BG is flat (which is easier when you have not eaten recently and your Basal Rates are accurate) at a number your are comfortable with taking a couple units for (for me that is 160 mg/dl). Then watch how long it takes for your BG to stop dropping.
- ISF-Insulin Sensitivities. This represents how many points (I use mg/dl) your BG will drop from 1 unit of insulin. The good news is you will have your answer to this after you have done your test for DIA in the step above. The only tricky part is that your ISF may vary by time of day. I would suggest running the DIA test a half dozen times — that way you get it sorted out for all times of the day/night.
Note: I personally believe that my ISF changes depending on how high my BG is. If I am over 200, I think my body becomes more resistant. There is no algorithm that is currently available publicly that takes into account different ISF for BG value, but it is something I am considering adding as a test in my own Loop.
4. CR-Carb Ratios. This is the ratio you are probably already familiar with. How many carbs can you consume per 1u of rapid acting insulin in order for your BG to end up where you started after DIA hours. This is another case of doing a few days worth of testing. What did I find out when I took a step back at doing this? I found that I could tune these values way closer than I ever did in the past. I have a different ratio during the day vs at night (6am — 6pm and the opposite). Now — I know you will probably say that the meal composition has an impact. Some people have to take insulin for protein (I don’t, but I know that because I tested this several times). I also know that I do not have to take any insulin for black beans due to things like fiber and Glycemic Index. Over time I expect AP systems like these to be smarter than the primitive carb counting swag. Fat certainly makes a difference. But, if you get these number close from a handful of tests by time of day and meal type you will be in pretty good shape. Later, as you advance further you can figure out ways to enter 2 meals in Loop to combat those pesky pizza nights.
5. Carb Absorption Time- A lot of people have taken carb absorption time into account when they do “square wave” or “dual wave” boluses. There is currently no way to sent a remote square wave or dual wave bolus to Medtronic pumps, so there is no way to enter one in Loop. But, it is worth having a good idea on how long you believe your meal will absorb when you enter it. The good news is it does not need to be perfect. Loop will check every 5 minutes to see how it’s 30 minute out projections did that it sent 30 mins ago. If things are off you can enable retrospective correction and that will make temp basal adjustments on the fly to compensate for anything that seems off in your settings (including carb absorption time). Whatever you do, do not adjust carb absorption time because you want your insulin to work faster! Any bolus you give up front will work as fast as rapid acting insulin does. No way to change that until #FasterInsulinPlease.Feedback welcome! Update: many people I have spoke with are using 2 hours absorption time. I would not recommend starting with something that short for a normal meal. If you are not sure where to start, I’d suggest starting with 3 hours.