OpenAPS SMB and Panda Express

Panda Express isn’t the first thing most type 1s call a “fun time”.  It’s a lot of carbs, both slow and fast.  BUT, oh how Anna loves their orange chicken.  It was the first meal that had made us cry after diagnosis.  We were fresh off our first endocrinologist visit only few days before.  They’d emphasized still living life and “just count carbs and dose, you’ll be fine.”  We desperately wanted to not live in fear and give her a small bit of her old life back after what had been a very tough week.  We picked up a plate of orange chicken, carefully weighed out the food and calculated the carbs.  We bolused 6 units, waited 15 minutes and she ate.  When she was 398 mg/dl not long later, we all started to cry.  She swore off food.  I swore at diabetes (and orange chicken).  And all the insulin shots later to bring her down…oh we were miserable.

Things got better though.  We learned that fats and proteins needed to be involved in all those dosing decisions  We learned that we needed to split the insulin up over time to keep her from going low early and high later.  We learned that weighing food was not going to happen very often for us and we needed to get better at eyeballing.  But, we also still ended up staying up late at night giving multiple corrections, usually to treat lingering high BGs and then eventually to treat a low BG when the food finally gave up.

So where do we stand on Panda now?  We do pretty well, but it takes about 16 units and the meal lasts close to 7 hours of impacts to BG.  We’ve learned through trial and error about how and when to split up the total needed bolus over time to help get smoother BGs.  But, there’s still some difficulty to that.  Mostly the first part is easy…we give about 8 units of insulin at least 30 minutes ahead.  Another 3-4 units about 5 minutes before eating.  And another 2-3 units usually just after she eats.

The hard part is knowing what to do nearly three hours later when the first boluses have lost their steam, but the chow mein noodles are still plugging away.  I always wonder when the right time to do that tailing bolus is.  And how much.  Of course, doing all this in the middle of the night adds to the fun.

Let’s cut to the chase…I wanted to see how Panda did using SMB and what I may (or may not) notice as a result.  Below is a comparison photo of Panda meals.  On the left is Panda on normal OpenAPS use.  On the right is Panda on SMB OpenAPS use.


Overall they don’t look THAT different, but there were some really notable difference in experience.

Early low on the left?  That was just my bad…too much early bolus.  We cut back on how much we gave up front…so that was human error.  After that though is the interesting part.  And probably the part that will be the hardest part for people to wrap their brains around in SMB use.  See that large long swath of suspended basal in the SMB side?  Yeah…traditionally it would be the opposite of what you’d want to see in a meal with large carbs that hits hard later.  BUT…bear with me as we talk through the math and logic (and safety).

The interesting part begins when OpenAPS first starts to see a significant carb impact.  It’s set its first SMB of 0.1 earlier. And maybe it was prepping to give more?

IMG_2898And now let’s see what the logic is for the looping decisions now by looking at the OpenAPS pill…


The loop has seen a positive “deviation” (Dev: 165) meaning BGs have gone up more than the rig had expected.  The Eventual BG is predicted to be 170 vs my normal target of 90.  The loop also predicts that an extra 1.58 units of insulin will be needed to bring Anna back to target eventually (HOW COOL IS THAT NUGGET OF INFO?!).

And here’s where the SMB logic absolutely caused me panic and confusion when I first saw it.  The loop sets a 90 min temp basal and only gives 0.4 units of super microbolus.  Myself thinking “OMG.  WHAT?!  Suspending in the middle of a Panda Express meal for 90 minutes?!  And ONLY 0.4 units when it knows it needs 1.58 units?”

So…these panic points need a little explanation and understanding of the SMB logic and safety points.  The key part is to remember that SMB is designed to give you reasonably SAFE amounts of bolus needed upfront and use suspensions to balance them out.  Suspensions will be part of the regular looping behavior in SMB mode.  Suspensions can vary in duration…all the way up to 120 mins long.  These suspensions are important safety factors because if the rig has been front-loading you with SMBs and the rig suddenly fails…you want that longer temp basal to help keep you safe.

Single SMB amounts are limited by several factors.  The largest a single SMB bolus can be is the SMALLEST value of:

  • 30 minutes of the current regular basal rate, or
  • 1/3 of the Insulin Required amount, or
  • the remaining portion of your max-iob setting in preferences.

For Anna, her regular basal rate is about 0.8 u/hour therefore we’d never see a SMB given greater than 0.4 units typically.

SMBs can be administered every 5 minutes.  If SMB thinks Anna is going high, it would be able to administer approximately 5 units in an hour of SMB use (assuming the other two factors were not limiting doses).  That’s a lot of insulin…more than enough to make up for the 0.8 units that would be suspended for safety-sake during that same period of time.  So, the suspension really isn’t that much of an issue in the overall math and loop ability to administer sufficient insulin.  But, if you really missed a whole bolus for a meal that needs nearly 16 units to control…yeah, you’re still gonna have a high BG before coming down.  Bolusing is still important in looping if you want to stay near target range.

The next part…why doesn’t the loop just turn the regular basal (or a high temp basal) on while it’s also giving SMBs to more quickly give the required insulin?  SAFETY.  This system still needs to keep safety in mind (and you want it to).  If the deviations and trends show a real need, those suspensions will be canceled…but only when they safely can be.  The loop needs to see the deviations and BG predictions and IOB all showing that it would be safe to do so.

If she needed 1.6 units of insulin extra, that could be delivered in just 12-15 minutes with SMB.  That’s not a long time to sacrifice for safety sake to make sure that all that insulin is still needed.  Makes sense to confirm the need by collecting a little bit of BG trend to confirm that need, rather than laying it all on at once.  Remember…this isn’t a rage bolus loop.  😉

Ok, so then what happens a little later?  Just as I suspected…chow mein noodles are really coming on now.  But, SMB had been adding to the IOB and helping out every 3 minutes.  I also knew that around this time is when I normally give the start of the 2-3 boluses that chase the Chinese Food effect.


So, I looked at the OpenAPS pill to see what the logic was offering up at this point in the game.


Now it’s showing an Eventual BG of 401 (probably not that far off for what Panda has shown us in the past).  The loop was still setting SMBs but now the Insulin Required had grown to 3.96 units.  That confirmed what I suspected.  This is the part in the meal that the tail bolusing needed to start.  And normally this is where I kick myself that I’d missed the rise.  I was going to be chasing this rise…ugh.  I chose to give 2 units of the 3.96 units it wanted.  I figured that was sort of split the middle and provide some help, but also give some wiggle room if the meal also suddenly stopped BG impacts.  After all, diabetes rarely does the same things exactly the same in repeated experiments.

It worked great…except it was about 11:30pm, and I was ready to stop watching the experiment and go to bed.  I still had (my old logic) in my head that I’d probably waited too long to give that last bolus.  So, i gave another unit absentmindedly and called it a night.


Except it turns out that was a mistake.  I’d underestimated (and not looked at) how much the SMBs had been doing before 11:30pm.  That last bolus was not necessary.  So I gave a little juice (hence the climb at midnight) and then really called it a night.  Lesson learned (again): SMB do an excellent job of fine tune fixing when the insulin required is less than about 2-3 units.  Not a good idea to give extra corrections when the insulin required is that little (I cannot believe how I’m even able to write that 2-3 units is a loop correctable within comfort zone amount now…freaking amazing).

As you can see, SMB and OpenAPS took care of the rest of that meal no problem at all.  In fact, it saved me an extra bolus AND a temp target in the middle of the night that I used to have to do.  Thumbs UP.  I’m all for more sleep and less manual bolusing in the middle of the night.  And we got to wake up to this:


Kind of funny to see that my error caused the worst BG of the night.

My lesson from this:  SMB is a good help to know WHEN to do later boluses in extended bolus-type meals.  The Insulin Required estimate is a good help for deciding when a manual correction is needed and to provide a rough estimate of how much to give.  If the Insulin Required is over about 2-3 units, we will use that as an indication that a manual bolus will help.  I will likely never give the whole amount (since large meals are prone to so much carb counting error), but giving about half the required amount and letting SMB pick up the sloppy edges worked really well.

There’s a couple other random lessons about see RAW data (did you notice that her CGM pooped out early in the meal?!) and using bolus menu while SMBs are enacted (might require some habit changes…we are thinking about how to handle that).  I’ll post those items separately when I have more time.  Now I need to prepare…Anna has a BOY coming over to the house tonight so we can meet him before we allow a “date”.  Can’t wait to see the BGs from that.

OpenAPS new feature

You may have heard that OpenAPS got a couple new features in development…super microbolus (SMB) and Unannounced meals (UAM).  I’m currently testing out SMB features this week…seeing how they work, trying to wrap my head around some new ways of thinking, finding out if we have to change anything in our patterns.  I thought I’d report in on how that’s going.

We started SMB just before going out of town for a wedding.  Not a big deal except…lots of “perfect storm” events conspired against us in the usual diabetes way.  Anna wore a dress (hard to access pump and we had some unbolused food as a result), the music was loud and I misheard her food choice (and therefore gave her a bad carb estimate to bolus for dinner…she ate a large brioche bun and pasta.  I heard chicken.  yeah…you know where that went.), we happened to be in the only cell dead spot near LAX for several hours where I wasn’t paying any attention (and therefore I can’t say how the system would’ve behaved because it was offline).  We even had a couple random pump resets that made us need to reset the pump time (which proved to be important learning lesson on smb…pump and rig time must be within 60 seconds of each other).

So, a rough start just for my mental preparedness (although BGs on Sunday after the wedding were great).  We went back to normal non-SMB use for Monday while I read some more details about SMB and UAM.  I needed to understand more about the decisions and actions because I was not so pleased at first glance (there’s a lot more “suspend” after meals than I was mentally prepared for…I needed to understand how those played a part).  After a lot more reading, we restarted with SMB.  We are not yet trying UAM features…one step at a time.  Plus, we don’t usually have many unannounced carbs (thankfully Anna is a pretty diligent bolus unless she is wearing a dress, at a wedding, in a cell dead spot, with large brioche buns around.)

We restarted SMB yesterday and have been running it since.  I am very pleased with it now.  The basic idea is that SMBs are given in little increments earlier to help control a rising BG, as opposed to waiting the whole 30 min temp basal to deliver a needed insulin amount.  The program only gives as much as it can safely temp suspend for later…like the idea of a traditional super bolus…just on a micro scale and with the aid of a computer doing all the math better than my brain or time can permit.

Want to see some examples?  How about last night…



Here’s her 15g dinner (yes, low carb for this one).  But, it nicely suspended and prevented a low early after the bolus…and then SMB picked up on the tail end of meal when it needed to come back online.  See those little tiny boluses of 0.1 and 0.4 units?  Those are SMBs…automatic little boluses of insulin.  The only time she touched her pump in the above graph was the 15g meal bolus.

You can also see an earlier SMB help with controlling a rebound from a low treatment at school.  Why did she go low?  She gave a correction after cheetos-involved lunch without noticing that SMB already had done so.  So, note to kids…no corrections with SMB.  She’s pretty happy with that instruction.

How about her school mornings?  Here’s this morning…


Before DIY closed looping, school mornings were such a cluster @#$%.  We had huge basal set from 5am-8am plus an extra (always a guess) bolus when she left the house to help control the school morning nerves.  And then, this year, she has PE second period…oh but wait…not always second period because it might be a block day schedule.  You parents know what I’m talking about…always having to stay on my toes about what day of the week it is and make sure the bolus/basal program is the right one.  We regularly battled 220s in the morning using that system.  Plus interrupted her school day with about 5 text messages to try to get things right.

Then we got on Loop and OpenAPS…so much better.  We had to keep the basal patterns different for school days vs weekends when we used Loop…but that was ok.  When we went to OpenAPS, we’ve only used one basal pattern and autosens has taken care of our basal changes (magic?!).  But, we have still had about 75% of the mornings where she slowly climbs to 120s and even 130.  When her BG hits 130, Anna’s pebble will buzz and she mindlessly gives herself a set correction of 0.5 unit. (Parent note: Teens will not do math to check how much a loop has already given.  We finally told her to not give more than 0.5 unit for correction anymore, which equates to about a 15 point BG drop for her ISF.  That amount seemed to keep her from overcorrecting but also helped out on those days where she needed some help.)  We were pretty happy with this system because we no longer needed to text her, she wasn’t overdosing, and our basal switching around was no longer necessary.  Win-win-win.

And now two mornings on SMB have been flat-lines.  Like above.  It’s not a big sample set yet to draw conclusions, but I’m loving it.  I know SMB is playing a part (I can see the SMBs on my graph after all…none of those were administered by her or I.  She has been told to give no manual corrections while we test this SMB stuff.)

But also look…that 8g snack snuck in around 10am.  What is that?  I have no idea.  Fruit cup?  Likely.  Well she bolused for it but I have no idea what it is.  Here it comes…


I don’t interrupt with a text message asking what it was.  I don’t intervene.  But I do get to watch and that was fun.  So what was OpenAPS doing when that climb started?  It lowered her BG target. (This is a new feature, too.)  We normally have her BG target set for 90-90 mg/dl.  We have allowed OpenAPS now to temporarily lower her target when her BG rises like this to help get insulin in a bit faster.  Basically, it’s like having OpenAPS automatically set “eating soon” mode for me in these situations. That temp target adjustment also will be automatically stopped when not needed anymore.  Very nice.  (I will still need to watch how it behaves in other situations like exercise.)


OpenAPS also increased her basal reasonably and gave her a starting microbolus of 0.4 units based on this unexpected deviation up.

IMG_2796And then more BG data came in…and I could verify the 0.4 unit SMB had been given.


At that point, OpenAPS wanted to do a 0.1 unit SMB and lower that temp basal.  Things were slowing down, but not done yet.


So then we seemed to peak out about here…

IMG_2802Before starting a smooth decline…thanks to about 0.7 units of help from SMB, temp basals, AND suspended temp basals afterwards…because that’s how SMB works.  Able to give some reasonable part of the needed help up-front early and then suspend later.  Super nice.

IMG_2809But wait, that teen wasn’t done.  It’s lunch time now that I’ve spent all this time writing up the morning.  And so it begins for lunch…

IMG_2812OpenAPS will be there, helping with some SMBs and temp basals.







Note: I realize the BG control represented here is tight.  BUT, did you also notice that it was completely hands off?  I haven’t texted Anna.  She hasn’t done a correction.  I didn’t adjust a target, nor did I adjust a basal or ISF in over four weeks.  It’s been automated.  She has only done her usual bolus for carbs.

We will keep testing things out for awhile.  Keeping a close eye on things…looking if we need to change our habits, change our settings, or wear fewer dresses at weddings.  I’ll be back with a higher carb day (Panda Express anyone?) and more details on that (foreshadow though…she ate two Randy’s donuts for breakfast and in-n-out for lunch on the way home from wedding. And it was nice…I just didn’t grab screenshots.)

Remote monitoring of OpenAPS

My impression has always been that OpenAPS started with mostly adult t1d users.  (And mostly adult t1d users who have some sort of coding experience, too.)  However, as word has spread, the system is seeing more and more parents using OpenAPS with their t1d kids.  So…there didn’t seem to be a whole lot of discussions I could find about remotely operating the OpenAPS system as a parent. What tools could prove useful? How would I set them up?

I’m super happy to say that several people have stepped up and helped me understand some of those tools, and write-ups have been added to the OpenAPS docs so that these are more readily available to parents.  I guess the purpose of this post is that having the tools available is one thing…but concrete examples of how to use the tools is sometimes super helpful.


The first line of remote monitoring of OpenAPS is through a Nightscout site.  In fact, I cannot imagine Loop without a Nightscout site, either (although technically you don’t HAVE to have one for Loop).  Nightscout sites allow you to see so much of what your rig is doing.

Temp Basals

temp basal render

The little blue lines are wonderful easy visuals for what is going on for your temp basals.  Like the example above shows, you can see temp basal “buildings” growing above whatever the normally scheduled basal rate for that time of day is (indicated by a dashed blue line on the blue basal area). Visually, I can see in an instant that her OpenAPS loop is giving her a high temp basal rate in response to her rising blood sugar.

OpenAPS pill

openaps pill

The next really helpful tool is simply clicking on, or hovering over, the OpenAPS pill.  The pill contains information not just about what is being done, but even some insight about WHY those decisions are being made.  For example, in this screenshot, the OpenAPS pill shows that based on her rate of BG increase, the loop would like to provide a temp basal rate of 4.75 units/hour to help control the rise back to target.  You can see that it is predicting a BG of 150 mg/dl and that my target is 90 mg/dl.  And, even more, you can see that it is respecting my max temp basal setting of 2.4 units/hour.  You can also see, if you have autotune and/or autosens enabled, what ISF is being used in the calculations.

If the pump is suspended, you will also see a grey dot on the BG line with a hover over message that the pump was suspended.  The OpenAPS pill will display an “x” for the pill’s status and text to let you know it is not enacting temp basals while it is suspended.  SO helpful for teenagers who finish their morning showers and forget to resume or reattach their sites.

If you have multiple rigs, as I do, you can see the status of the various rigs in the OpenAPS pill too.  I have an “edison3” that stays at home in her room, so it is “waiting” for her to come home.  The “edison1” rig is at school with her.

System Status

system status

Also nice to see information about the pump’s reservoir and battery.  I have alerts set through Nightscout to let me know when her pump battery gets close to low, as well as the reservoir.

The battery icon (75% in this picture) is the rig’s battery level, so I can also keep an eye about when/if the rig needs charging.

Temp BG Targets

temp targetSetting temp BG targets to help adjust to changing situations like exercise or upcoming meal times is super easy using the care portal in Nightscout.  The site also will provide a grey line showing the range and duration of the temp BG target.  You can cancel the temp target and the line will end at the time the temp target was cancelled.  It leaves the grey bar on the graph so that you can scroll back in time to see if your actions might need modifying later.  For example, we are currently using temp targets to get our daughter to her after school track team workouts without carrying extra IOB.  We set a temp target at lunch time, 3 hours ahead of the start of her workout for 120-140 mg/dl.  As her lunch bolus wears off, the temp target helps keep loop from giving too much extra insulin between lunch and track workout.  We keep the temp target going all the way through her 2.5 hours of track workout.


So while all the Nightscout stuff is fantastic, it does not really help you figure out WHY your rig might not be looping while your kid is away at school or a friend’s house.  Most of the time, the troubleshooting for OpenAPS rig is as simple as a power button restart.  But, if you are setting up a new rig, or getting connected on new networks…or wondering about anything in your loop’s functions…Papertrail provides an INVALUABLE insight to the rig without needing to be near the rig.  Directions on setting up Papertrail for OpenAPS are here.


As you can see, both my rigs (edison1 and edison3 are uploading to Papertrail).  The blue words indicate where the information is coming from (in other words, what action in the rig is logging the activity).  Pump  loops, nightscout loops, CRON loops, etc. are all in there.

Super helpful is to set-up filters for activities that you may be interested in seeing more often.  Such as pump tuning.  If you come from Loop, and are familiar with the “tuning” as part of trouble shooting…sometimes you may not have been entirely sure whether the retuning was really affecting things or if it was the cause of the original problem anyways.  Well, OpenAPS has a similar tuning called mmtune.  If the loop detects that the pump is not establishing communications well, it will retune it’s radio automatically after failed tries and periodically during the day.  The working frequency is 916.  A failed tune will look like “916, 0, -99”.  The “-99” means a very weak signal.  Typically, if you are getting tuning results in the “-90s”, you are unlikely to keep a good loop going.  In the “-80s”, you may have sporadic problems.  Anything in the “-70s” or better, you should have pretty stable pump-to-rig communications.

Below is a filter for “edison1 916” which effectively shows her rig’s tuning results for the last several days.

pump tuningSome interesting things that you can learn about your kid’s habits and the rig’s behaviors by watching your papertrail.  My kid took a shower at about 6:55am today…she leaves her pump in the bathroom, fairly removed from her rig in the bedroom.  You can see the distance has caused pump comms to deteriorate to a “916, 1, -98” tune result.  When she finally gets dressed and puts her stuff all back together, around 7:25am, the pump tune picks up a nice “916, 5, -79″…and that was with the rig stuff in her purse, stuffed in her backpack.  Pretty good.  She arrives at school and the next pump comms failure is at about 11:39am with “916, 0, -99” just as she is finishing a PE change before lunch.  The loop picks back up and retunes by 11:43pm with “916, 5, -75”.

Why is all this info so important?  It means that I am not interrupting my kid at school nearly as much when the loop temporarily might stop.  I can see if it is likely a temporary stop based on her school patterns (PE changes for example where she may leave rig or pump somewhere separated for awhile).  I can also provide better troubleshooting advice.  If I see that the pump comms are poor…I would text “hey, can you move rig to better place?” vs. asking her to totally reboot the rig (which might not solve the problem if the rig is far away anyways).  I also know that a poor pump comms on the system are really handled quite well because I’ve been able to see how often the rig already does it’s own retuning efforts.  I am VERY supportive of keeping texts to my teen in school as short and sweet as possible.

Another extremely helpful Papertrail use is to watch how the rig is utilizing or moving between BT and wifi networks.  The screenshot below is a filter for “edison1 network.log -CRON” so that I can see just the internet connections the rig has used.wifi connectionsFor Anna’s morning, you can’t see it, but she got in the car at 7:35am to go to school and left our home wifi.  Her rig got onto her cell phone via BT connection by 7:43am.  She arrived at school and the rig got on the school’s wifi network at 7:54am.  How can you see all this…well the wifi networks have their name listed (like “Paso Schools”).  The cell phone BT connections for iPhones have local IP addresses that always start with 172.20.10.xx.  Papertrail has been so useful for figuring out if the rig is actually online while she is remotely moving around.  Especially useful for little kids who might not be the most helpful troubleshooters when you are trying to decide what network the rig is on.  So, if I see her loop is failing (yet has good pump communications), the next thing I do is usually to see if there might be a problem with wifi connections.

Papertrail is also super useful if you ever need to get on Facebook or Gitter to get troubleshooting help.  Being able to see these logs is key to know where to start in looking for a problem.

Sadly, there is no iPhone app for Papertrail, but you can easily setup a bookmark of each of the filters you use frequently and add the to your home screen.  I have one for pump loops filter and one for edison1 network logs, as I have described above.




So, there’s some tips about WHY you should take the effort to setup good remote logging/viewing of your rig.  Nightscout and Papertrail make things pretty easy as a parent using OpenAPS.


Profiles and closed-looping

Diabetes gives challenges in so many ways…and swinging basal/ISF adjustments during hormones is one of them.  We don’t just seem to have changing basal/ISF needs at one time of the month…it actually seems closer to twice a month (ovulation and menstruation both seem to have their own needs).

Prior to looping at all, we simply adjusted basal/ISF on the fly.  For ourselves, usually a simple basal change seemed to adequately compensate for what was needed and usually we could keep isf constant.  We eventually got tired of hand-typing in the profile changes, and we instead created profiles A and B to switch between.

Things got even more complicated when school vs weekends became an issue too.  With school stresses and team sports activities, school days would always bring a need for a large amount of extra insulin in the morning (“oh my gosh, what should i wear today?  am i going to be late to class? do i have everything i need this morning?” seems to make her BGs spike) and then a corresponding decrease in the end of school day (all the sports activity, walking around campus finally cause a BG drop just as the day ended).

Balancing out the various profile changes has been a minor juggling act.  School day with hormones?  Which hormones are we getting?  Will she even want to discuss where she is in her cycle with me?  If she doesn’t want to discuss with me…how am i going to help with basal adjustments going forward (because each month isn’t always exactly the same)?  This has been a real ongoing issue to tackle.

When we started Loop, we originally were about a month into the school year and that school morning spike was BRUTAL.  To deal with the difference between a school vs weekend profile, we had to set up two different Loop apps on the phone.  We gave each different icon photos and names so that we could tell them apart visually and quickly.  The weekend Loop has a big W for a logo and was named Weekend.  She got quite adept at knowing on Friday and Sunday nights to switch between the two loops…but there were definitely times we forgot and had some less than stellar looping as a result.  Nothing dangerous, just not optimal.

As school went on, her morning nerves lessened and we’ve actually grown to the point of not needing separate school vs. weekend profiles.  Loop app can handle the adjustments without a separate profile.  So, we started using a single Loop app again and things went well.

Until the hormones started to rage.  The periods are now regular, and the associated basal/isf changes with them became more pronounced.  We are definitely finding differences between times of month and basal adjustments needed.  And just as all this was coming along, we decided to try OpenAPS.  Because why not throw more complications in at once?

Now here is where things get complicated.  OpenAPS has two “advanced” features that are called autotune and autosens.  You can choose to run your closed loop with them, or without them.  Neither are mandatory parts of the closed loop.  They sound the same, but work subtly different.  We have had both of them enabled on our loop.

Autotune starts with your PUMP’s profile at midnight (technically 12:05am).  It looks at the previous day’s happenings (by pulling data from Nightscout).  Based on that analysis, autotune sets up a NEW autotune-adjusted profile for your day ahead.  Hour-by-hour for the whole day ahead, your rig has an adjusted set of basals and ISFs to use.  Autotune cannot change your new profile by any more than 20% of your pump’s profile that is has current at midnight (that’s hard-coded into the autotune code).  The thing to realize, therefore, when autotune is enabled in your closed loop…changing anything in your pump profile during the day WILL NOT result in changes to the profile that the loop is using to calculate your  needs.  Changes to your pump settings will only be read and considered at midnight and applied the next day as part of the new autotuned-profile.  So, if you have a sudden need for a significant increase in basal during the middle of the day (took a steroid medication?  on a dextrose drip?)…you may need to consider making changes to your autotune, as discussed later in this post.

Autosens will automatically adjust your basal and ISF settings, similar to autotune, by a certain multiplier you specify.  The defaults are no more than 1.2 increase, 0.7 decrease.  (These defaults can be changed in the preferences.json file pretty easily.)  The difference is that autosens runs all  the time, not just once per day.  Autosens goes back on the previous 24 hours of data, excluding times of food influence, and looks to see if basals or isf might need adjusting.  Autosens is a more immediately-acting impact on your closed loop’s settings than autotune, since autosens runs continously.

The question is why am I telling you all this?  Well, this week Anna got hit with her period and a vicious head cold all at the same time.  Things were going along just fine before the cold came.  In fact, I didn’t even see her period reflected in her BGs like I normally do to start with…OpenAPS seemed to be handling it just fine.  The problem became when the head cold hopped on board with it.  A couple nights ago, Anna’s BGs hung out around 120 mg/dl all night, just below our high alarm level (130 mg/dl), even though her target is set to 90 mg/dl.  She was carrying positive IOB the whole time with it.  A sure sign that her basals and/or ISF needed some adjusting.  We went into the next day, and I was making adjustments on her pump the whole time.  Things weren’t getting worse…but they weren’t changing like I expected.  Even though I was putting in much higher basal rates in the pump…openaps was seemingly ignoring my pump changes.  I could see in the openaps pills and loop functions, the higher basal rates just weren’t being considered.  I was stumped.

Finally, I realized something I hadn’t understood before.  Autotune basically was locking me into a basal/isf profile each day at 12:05am.  No matter what I did in the pump settings that day, my basal rates and ISF were only going to change if autosens decided to adjust them dynamically.  And those adjustments were capped at 20% increase and 30% decrease.  So…that explained it.  All my little button pushing all day wasn’t going to make an impact.

The good news is that last night at midnight, autotune took all of yesterday’s insulin resistance and higher basal needs and made some adjustments for us.  Last night, she didn’t hang out in the 120s.  She was near target the whole time and not holding IOB.  Today has been better, too…pretty much at target.  And we didn’t do any profile adjustments.

This whole experience presented me with some important what-if scenarios worth exploring:

  • “What about those times where you absolutely need to change your mid-day basals for some reason?”  Maybe you need to start a new BG-impacting medicine or you end up needing a dextrose drip?  Well, you can turn autotune off so that you can manually use your pump to adjust settings immediately for your loop.  But, you do need to know how to navigate your rig and openaps in the event you want to make immediate changes.  So, setting up a way to remotely login through your phone is a really good step.  You can also simply turn off your loop…that’s always an option.
  • “What can I do to help situations that normally require different basal profiles (like hormones or school)?”  Well, you can still use different profiles, but you just need to be aware that the change in profile won’t really become effective until the next day.  You can also allow autosens to make greater adjustments than the defaults (change your preferences.json accordingly).  That will help in situations like hormone surges hitting where the change might be greater than 20% increase needed in basals/ISF.
  • “What happens with a site failure or bad insulin?  Will that mess up my next day?”  Yes, that could cause problems.  Will they be horrible?  Probably not, but it may be worth turning off autotune and/or autosens when you have a bad site failure or bad insulin that causes your BGs to be artificially high.
  • “Do I even still need two profiles?”  The answer is probably “it depends.”  I’d use the Medtronic 670g pump as an example of where openaps’ autotune and autosens is headed.  User needs to provide very little input (really just a starting point once), and then all the subsequent adjustments are made based on data collected from the previous day(s).  Autotune and autosens seem capable of that to me…but they will need your help to provide sensible allowances (maybe more than 20%) to make those changes, good inputs (log carbs and doses accurately), and perhaps a little patience when a period AND head cold come at the same time.  🙂  I’ll report back later when we have more time under our belt with openaps running through these situations where we normally would have switched profiles.  But, so far, I’d say it handled the period and head cold situation pretty well.  The failing was in my lack of patience and my lack of understanding for how autotune was working.

So, I am writing all this as kind of a learning lesson about how the different looping systems handle the information.  It caught me by surprise, so I thought it was worth noting.  Loop will allow you, within the app, to immediately change your basal and isf settings at any time.  And it will immediately use those new settings.  If you have autotune/autosens enabled, OpenAPS will dynamically be watching and adjusting 24-7 based on how your BG impacts have been happening (or not happening).  At times, that may mean a slight delay in seeing some of the larger changes to pump settings that you previously were used to being enacted immediately when you entered them (like Loop).  The plus side is that you won’t have to be the one calculating the needed change or pushing the buttons to make it happen.  OpenAPS will do that for you.  You can mitigate the effect of the delay by giving the default settings more room to make adjustments.

Am I scrapping autotune as a result of this experience?  Nope.  I’ve still liked the results I’ve gotten from the system.  I have widened my autosens allowances from default settings to help with the hormones and head colds more.  And, I also know that I’m not going to change basals/ISF on the pump during the day (because it won’t do anything anyways while autotune is enabled).  Instead, I’ll be more apt to look at my autotune results and make adjustments at the end of the day when I feel it is necessary.  Thus far, I don’t think that I need to.

I’ll keep tabs on this and report back.




Loop vs OpenAPS

Note:  This post is outdated because the features of Loop and OpenAPS have both been updated since this was originally published…The link to the updated post will be posted here shortly.


How do you choose the “best” DIY closed-loop system?  The answer is still a YDMV (your diabetes may vary) answer…but here’s some thoughts from a parent’s perspective.

I have a 14-year-old t1d daughter.  She is relatively independent and can count her own carbs fairly well.  After a little practice and gentle reminders, she can usually learn new things about her t1d management.  BUT, she’s not an independent adult.  She’s prone to forgetting things in the presence of her peers, getting distracted in busy environments, and not advocating for herself in the presence of authority figures.  She worries about fiddling with diabetes gear in class (“will the teacher think I’m playing on my phone if I need to text about diabetes?”).  So, as she goes out in the world with a system making automated decisions about insulin on her behalf, I have a different set of considerations about a system than an adult t1d closed-looper might.  (I’m going to try to keep the little kiddos in mind too as I walk through the differences between these two DIY closed loop systems; Loop and OpenAPS.)

In any comparison, it’s a good idea to know the person’s assumptions and priorities when they are doing the comparison.  Here’s my short list of the non-algorithm issues I considered in evaluating Loop life vs OpenAPS life.

  1. Size
  2. Cost
  3. Durability
  4. Ease of build
  5. Ease for caregivers/school nurses
  6. Troubleshooting
  7. Reliability
  8. Portability
  9. Ease of use
  10. Kid-specific features

I intentionally left BG control off the list is because either system is capable of achieving great BG results.  BUT, the ease/difficulty in the WAY you have to adjust your thinking, actions, or lifestyle to achieve the desired control was important to me.  And I’ll get to that shortly.

Size, Cost, and Durability (Advantage: Even)

These factors are virtually the same between the systems.  Both systems can be easily put in a box about the size of a tic-tac box.  The Loop system costs about $99 annually (Apple developer program), Heroku (for Nightscout) is free, and the RileyLink costs $135.  OpenAPS costs about $163 for the parts, and there are potentially some data costs depending on how you set up your system.  If you want to run multiple rigs, you may need to upgrade to the $7 per month Heroku “hobby” plan (for one rig you should be safe under the free Heroku plan still).

Both systems consist of a small circuit board and a rechargeable lipo battery…so the same care and durability should be expected between the systems.  We plug both systems in for recharge nightly and they last the whole day on the one charge.

OpenAPS Rig on the left, RileyLink on the right



Ease of build (Advantage Loop)

I had both systems built and operational within about 2 hours of getting all the parts together.  Am I some sort of mad genius with computers?  Absolutely not.  You can do this, too.  There are guides for both systems that tell you what to do and the order to do it.  Both systems have very helpful groups on Gitter where people will help you through the setup process…Loop and OpenAPS.

That said, Loop can initially seem like a more relaxing build for the people who are uncomfortable with “code” since much of it is done through the Apple interface (think, pictures and symbols).  OpenAPS is done through linux commands and scripts.  HOWEVER, do not let this deter you.  Both systems will take you into places on your computer you have likely never been before (Loop to Xcode, OpenAPS to Terminal), and you will live to tell the story.  I am actively involved in providing some updates to the OpenAPS docs that will hopefully help new, non-code people through the setup process…just as easily as Loop can be done.  To be honest, setting up an Apple developer account was probably the most frustrating part of the Loop setup and putting two tiny screws in the explorer board was probably the most frustrating part of the OpenAPS setup.  Notice, neither complaint is actually about the software building.

I’m here to say…don’t let your intimidation stop you from trying either or both systems. (Perhaps slight advantage to Loop here…but the gap is closing.)

Ease for Caregivers/Small Kids (Advantage OpenAPS)

Here’s one that adult t1ds probably don’t have to worry about.  Can a school staff member reliably dose your kid with insulin through the closed loop system?  Here is where I was surprised to see a large difference between the systems potentially.  Anna has operated her Loop inputs fairly independently and has gotten used to some of the quirks, so in many ways she’s more like an adult user.  However, for little kids relying on school staff for meal bolusing the differences between systems may be more important.  Loop uses the app to enter meal carbs and calculate/administer boluses; whereas OpenAPS uses the pump.  OpenAPS likely has an advantage for these considerations:

  • Failed boluses  – Every once in awhile, for whatever reason, a bolus command in the Loop app will not go through.  A notification pops up on the iPhone saying “Bolus may have Failed”.  If the caregiver/kid doesn’t notice the notification, it may be some time before the missed bolus is recognized.    And unfortunately, sometimes, the bolus actually will begin shortly after the notification pops up.  The caregiver/kid will have to be trust-worthy enough to recognize the need to look for the message and if the message appears, to first check the pump to ensure the bolus is not actually already in progress before attempting to re-enter the bolus command.  Since OpenAPS is bolusing directly from the pump, failed boluses would be immediately obvious to a caregiver/kid. (Advantage OpenAPS)
  • Bolus wizard guard – The default setting for Loop is that the app will not suggest a bolus if the t1d is below, or predicted to go below, their minimum BG target.  This feature, called the bolus wizard guard, can result in the carbs for a meal being entered but no bolus being offered.  The bolus wizard guard can be removed or modified by parents, but it is definitely something to be aware of.  Many new Loop users fail to modify this feature and find no bolus being given.  Parents should have a plan in place with the caregivers in the event no bolus is offered by the app.  OpenAPS does not have an analogous bolus wizard guard.  (Advantage OpenAPS)
  • Double Carb Entry – When a carb entry is entered in the Loop app, there is a “save” button to move you onto the bolus recommendation part (just like a pump’s bolus wizard).  In both Loop and OpenAPS, an entered carb is saved by default.  Backing out of a bolus wizard does not cancel the carb entry.  In Loop, the caregiver/kid can go into the app and cancel/edit the unwanted carb entry.  However, in OpenAPS you cannot edit the entry.  So both systems require a consistent method of carb entry to prevent unintentional double entries. (Advantage Loop)
  • Yellow/Red loop – Loop will not bolus if it is having trouble communicating with the pump or receiving BG readings.  The Loop will turn yellow or red, depending on how long it has had problems with communications.  If a caregiver/kid doesn’t resolve the issue, they can still enter a bolus through the pump directly as a backup.  However, the caregiver/kid will need to separately enter the carbs into the app (Loop does not read the pump’s carb entries).  Since OpenAPS boluses are directly from the pump, meal boluses can continue as normal even in the event the looping is not functional at the time of the meal.  No special considerations are needed.  (Advantage OpenAPS)
  • Carb Absorption Time – Loop has a unique feature called Carb Absorption Time for each carb entry.  Basically, it is akin to saying how fast or slow Loop should expect the food to absorb (and thus affect BG levels).  If you have new food or classroom treats, your caregiver/kid will need to estimate the carb abs time of the food.  Loop can tolerate some inaccuracy in those estimates, but if you are off by significant amount (like 60 minutes vs 120 minutes estimate) you may end up under- or over-corrected by Loop as the meal progresses.  Also, it’s important that your caregiver/kid respect the importance of entering in the correct carb absorption time for a meal…otherwise unwanted BG impacts can occur.  In OpenAPS, the absorption of carbs is tracked dynamically by the loop.  Therefore, the caregiver/kid does not need to estimate a carb absorption time as part of their mealtime entries.  (Advantage OpenAPS)
  • Emergency tube changes – If you child needs an emergency tubing change at school, there is a special consideration for Loop users to be aware of.  Priming new tubing, without a change of reservoir, will require the caregiver/kid to delete 30 minutes of reservoir history in order to not have the primed insulin count as delivered insulin (IOB).  Parents and adult t1d users of Loop get pretty used to this action, but trying to describe this step over the phone with school staff or young kids could get pretty difficult.  OpenAPS reads the pump’s actions and will not count primed insulin as IOB.  A notation is also made on the Nightscount site automatically when a prime event occurs.  (Advantage OpenAPS)
  • Net IOB – The Loop app tracks net IOB (IOB from both boluses and basals). As such every Loop bolus and correction is automatically consider net IOB. However, Medtronic pumps do not track IOB from temp basals. In OpenAPS, since there is no app, netIOB is usually seen in Nightscout (in fact, the IOB pill will even break down the basal IOB contribution). Caregivers/kids will need to be aware that the usual “take BG before a meal and add a correction adjustment to meal bolus using pump’s bolus wizard” should not happen. Most OpenAPS users will only bolus for their meals using straight carb ratio, and not use the pump to suggest a +/- correction bolus. (Advantage Loop)
  • Corrections – BG momentum in Loop has proved to be a difficult concept for my teen to watch for in Loop.  In times of rapidly increasing, BG momentum can tend to over-predict and thus offer too strong a bolus correction.  This can also affect meal boluses in Loop.  OpenAPS boluses using straight carb ratios seem slightly safer for small kids under remote care.  Plus the bolus snooze option helps corrections take effect without having the loop go to low-temping when you might be stuck on a stubborn high for whatever reason. (Advantage OpenAPS)

Troubleshooting (Advantage even)

Loop relies on the RileyLink for communications, OpenAPS relies on the explorer board.  Both feed information into Nightscout about the status of those communications and looping.  A remote parent can receive information about potential problems that may be causing the loop to stop running.

For both systems, the solution to getting looping started again is usually pretty straight-forward.  For Loop, it’s almost always a retune.  For OpenAPS, a power button push.  However, advantage goes slightly to OpenAPS because a power button push is a little faster and doesn’t require opening an app.  And if your kid isn’t capable of retuning the RileyLink themselves, explaining how to retune a RileyLink can be a little cumbersome over text messages or phone calls with school staff.  A power button is a more straight-forward explanation.

If a fatal program error happens on either system, they can both be rebuilt fairly quickly and easily following the original steps.

Reliability (Advantage OpenAPS)

How often does each system go down?  How far can your kid get from the rig before communications/looping quit?  The answer is “it depends”.  If you live in a “noisy” radio frequency environment, you may find yourself needing to retune RileyLink fairly often.  If you live in an area with no wifi or cell service, you will likely have a poor OpenAPS experience*.

But, the advantage here goes to OpenAPS’s rig because it’s communications has a longer reach and seem more stable.  Kids don’t have to be quite as close to their rig as they do to the RileyLink.  On average, I’d estimate we retuned the RileyLink about 2-3 times per day.  On OpenAPS, we have had to power cycle the rig only once in 12 days (and I think that actually was just my impatience rather than truly a problem).

Portability (Advantage even)

The portability of Loop is pretty great.  You could take it to the middle of nowhere and still be able to run a closed-loop…no internet, wifi or cell needed.  HOWEVER, I’m a remotely-monitoring parent and I like to check Nightscout to see how things are going.  So, even Loop needs internet connection for the parent to monitor things.  (If I were reviewing portability as an adult t1d, Loop would be an easy advantage.)

The newest release of OpenAPS also has made the system truly “portable” in my eyes.  Before this update, kids might have to remember to turn on their phone hotspots when leaving a known wifi network.  That’s not practical for kids.  But, the new release is a very stable handoff between known wifi networks and iPhone hotspot.  So, as your kid leaves home to go to school, the rig will automatically connect with the kid’s iPhone via bluetooth hotspot tether.  When your kid gets to school, it can pick up on the school’s wifi automatically…thus saving you on cellular data and hassle.

*There are options for running OpenAPS without internet like Loop (aka “camping mode”).  I’m just not setup like that.  You could directly plug-in the dexcom receiver to the rig.  Or you could use X-drip to upload locally to the rig.

For summer diabetes camp in the woods…we will likely use Loop.  I think.  Maybe.

Ease of Use (Advantage OpenAPS)

Oooph.  This one is tough.  The iPhone screen is soooo sexy.  Kids LOVE the iPhone.  And they love not bolusing from the pump sometimes.  Since the iPhone is already glued to her hands, Loop gets a lot of love from my 14 year old.

But, the ease of entering a meal bolus from OpenAPS is just heaps easier than Loop.  Kids (heck, even adults) can have a hard time estimating what a proper carb absorption time for a food should be.

There’s also a really sweet feature that you can find in OpenAPS that you can’t get in Loop.  As a parent, you can remotely set a temp BG target using Nightscout’s careportal.  When my daughter goes to track practice, I can set a temp BG target ahead of time to help keep her in a slightly higher target range.  I can also easily cancel the temp target if practice gets out early or situations change.


I love both systems…but I do think the OpenAPS is easier to “use” if you are a parent sending your kid to a slumber party or school dance where they will have new foods and perhaps harder bolusing than they might be used to under your care.  Also nice to have some ability to remotely help nudge loop behavior “up or down” through the use of temp BG targets.  It definitely has saved me quite a few text messages as a result.

Kid-specific features (Advantage OpenAPS)

There are some feature that OpenAPS specifically designed to adapt for kid t1ds.  We haven’t used or tested these, but they may be of interest to some of you reading here.

  • Override High Target with Low: “Defaults to false, but can be turned on if you have a situation where you want someone (a school caregiver, for example) to use the bolus wizard for meal boluses. If set to “True”, then the bolus wizard will calculate boluses with the high end of the BG target, but OpenAPS will target the low end of that range. So if you have a target range of 100-120; and set this to true; bolus wizard will adjust to 120 and the loop will target 100. If you have this on, you probably also want a wide range target, rather than a narrow (i.e. 100-100) target.”
  • Carb Ratio Adjustment: “This is another safety setting that may be useful for those with secondary caregivers who aren’t dedicated to looking up net IOB and being aware of the status of the closed loop system. The default is 1 (i.e. do not adjust the carb ratio; off). However, in the secondary caregiver situation you may want to set a higher carb ratio to reduce the size of a manual bolus given at any time. With this ratio set to 1.1, for example, the loop would multiple the carb inputs by 10%, and use that number to calculate additional insulin. This can also be used by OpenAPS users who rely on the bolus wizard to calculate their meal bolus, but who want to only bolus for a fraction of the meal, and allow advanced meal assist to high-temp for the rest.”

Conclusions (Advantage OpenAPS)

I feel like I’m cheating on my best friend Loop by saying that I’ve really enjoyed OpenAPS.  All the technical stuff above spelled out…here’s the short version of the parts I’ve noticed the most.

Fewer texts to Anna during school:  Through the use of temp BG targets, I don’t have to text her to remind her to prepare the two hours ahead for track workout.  I don’t text her anymore to ask her to retune the Loop.  I don’t get texts from her asking for carb absorption times for food from classroom parties.  I spend less time asking her if she got too far from her RileyLink.

Easier mental at meal time:  I have enjoyed not thinking about carb absorption times.  Now I’m back to my regular thoughts about whether a meal would do well to split bolus…and that thought is the same with both systems regardless.  (Anna says this part never really bothered her.)

OpenAPS pill:  I get a little more information from the OpenAPS pill.  I have enjoyed that.  I also enjoy seeing the Basal IOB using the Nightscout IOB pill.

Auto-tune:  I haven’t really touched on it here much…but there’s a newly unveiled feature called auto-tune which looks back on the previous day’s data and can adjust ISF and basals automatically where it sees the values may be slightly off.  I think that needs a special post of it’s own.

Loop enacted:  I have REALLY enjoyed never seeing that the loop is stalled out or needs retuning when I open the Nightscout app.  I have pretty much gotten used to seeing the OpenAPS rig always functioning.

Easier to switch between patterns:  Anna has definite differences between school days and non-school days.  On school days, she needs about 6 hours of a lower basal rate during the day and through track practice.  Switching between patterns on the pump has been just a little easier than switching between the two different Loop apps that I had setup.  It’s just one little less thing to do.

If I were an adult t1d, my metrics would probably weigh the various considerations quite differently.  But as a parent of a t1d, I’ve really enjoyed OpenAPS.  We have great BG control on both systems…I’m just trying to find ways that we talk less about diabetes and more about everything else.