#DIYPS Closed Loop – One month of data & it still works great

My name is Dana Lewis and I have a closed loop artificial pancreas (that I built) that I use every night. Also see: woot!

Tweet that says "I love you #DIYPS closed loop"

We closed the loop in December (click here for more details about the first week of data & basics on how the closed loop works; or here to learn more about the basic non-closed loop #DIYPS and how far we’ve come in a single year), and I’ve been using it almost nonstop since.

When to loop – or not

I’ve only been limited in using the closed loop for overnight when I inadvertently fried the SD card in the Raspberry Pi (a known issue that’s related to the number of times you plug/unplug it from power source). We promptly ordered a second Pi as a backup, and by the time it arrived, Scott managed to revive the first one, so I now have two ready to run at any time. (Because of course you need emergency backups of your essential organs!)

When I first started looping in December, I originally intended to only use it at night, but it was hard to not loop during the day, too. The idea that I could sit at my desk and work for 3-4 hours straight, and not worry about my BGs, is so appealing!

However, it’s not really practical for me to want to use 24/7 every day…yet. This is where the versions of APS that will come to market in 3+ years will be great, because it will be all-in-one (or at least limited in excess pieces you have to carry). To wear it 24/7, I have to have enough batteries to power the raspberry pi and keep it in range, which means constantly picking it up and moving it around, carrying it in my bag from meeting to meeting, etc. I’ve decided it’s not worth it for every day, but it is awesome to have the choice when sitting through an important interview to have it running and have more security and peace of mind.

Back to using the closed loop for overnights

When we first showed our closed loop efforts off, we had about a week’s worth of data that already showed improved overnight blood glucose (eAG) and time in range, plus reduced number of #DIYPS alarms.

After a month, the results of using a DIY closed loop artificial pancreas system overnight continue to look promising:


We also recently added another screen to #DIYPS so I could access and review “what happened last night”, or what was the output of the closed loop. I usually look at the net impact per hour (how much above or below my normal basal rates I ended up getting), but also at the individual numbers of how much above and how much below I ended up getting every hour. Here’s a visualization:

Tweet illustrating how DIYPS closed loop works overnight with micro corrections to keep blood glucose in range

Using closed loop activity to spot trends and change basal rates

We also built a 7 day and 30 day view of this closed loop activity history so I can look at trends by hour overnight (versus manually compiling and visualizing them, like I did in our first closed loop data post here).

When we first looked at the data for overnight closed loop net insulin activity, I could spot a trend easily – the loop temped low from midnight to 2am, leveled out, then increased with higher temps after 5am. I can easily see why it often ends up temping low after I go to sleep, because I often do a half unit or so if I’m riding “high” (130 – ha!), and feel safe doing so with the loop to catch any more drop than I desire. (This pattern was consistent at 7, 14, and 30 days, although the average net insulin amount varied slightly.)

However, when I first started looping overnight in December, I had rises around 2am that the loop had to handle by providing higher temporary basal rates than my scheduled basals. I upped my midnight basal rate as a result, but it looks like I upped it too far since the closed loop often temps low now during that time frame. My next step is to probably change my midnight basal to be lower by 0.1u, and see if that reduces the amount of low temps needed from 12-2am, without causing spikes. My theory is that this alone may also reduce the number of higher temps from 2-4am, because those may be a result of the lower temps earlier on. Thus, I am starting overnight basal tweaking with this one change and seeing how much of a ripple effect it has for the rest of the night as well.

In pursuit of…what? Or: what are we optimizing for?

My BG averages overnight (and during the day) are excellent (well within the “normal” range <120) and time in range is continuing to grow (85% & counting) with using the closed loop #DIYPS. So, beyond minute basal tweaking, what’s next?

At this point, I think the next goal is encouraging other independent researchers to get up and running on their own closed loop overnight APS.  Do we really need to wait another 3+ years for APS technology to come to market?  What exactly would #WeAreNotWaiting look like if we applied it to closed loop Artificial Pancreas technology research? What do you think?

How does a closed loop artificial pancreas work when you DIY? Or: #DIYPS closed loop is working!

We closed the loop with #DIYPS and now have a DIY closed loop artificial pancreas running right now (for me, aka n=1.)

Here’s what a closed loop #DIYPS artificial pancreas looks like:


(A raspberry pi powered with a battery (shown) or via an outlet; a Carelink USB plugged into the Pi and in close proximity to the pump; a Medtronic insulin pump (an older version, thanks to a family from CGM in the Cloud for sharing it!); and of course my CGM and Android uploader phone that’s sending my data into the cloud/#DIYPS)

Here’s how a closed loop artificial pancreas or “#DIYPS closed loop” works:

Over the past year, we’ve been using #DIYPS to process BG, insulin on board and carbohydrate decay in real time. This yields real-time predictive alerts of three kinds: more insulin needed (X.X units of bolus insulin); less insulin needed (temp basal to zero insulin for X minutes); or carbs needed. Using this algorithm and my data entered (insulin taken or reduced; carbs ingested); we’ve seen significant results not only for the first 100 days, but also sustained over an entire year for improved average glucose, improved a1c, and improved time in range.

Closing the loop with #DIYPS

Three weeks ago, we mentioned at D-Data Exchange 2014 that we were planning to close the loop with #DIYPS…by August 1 (our wedding date :)).

The FDA was even in the room.

Two weeks later…we closed the loop.

It was this simple:

  • Thanks to Ben West’s awesome work, we plugged the Carelink USB into the Raspberry Pi. Thanks to a generous family from the CGM in the Cloud Facebook group, we acquired an old 522 insulin pump that could talk to the Carelink USB. (My current pump is too modern to work with this setup.)
  • Once we established that the Pi/USB setup could read from the pump, we started connecting #DIYPS to the system to close the loop.
  • Normally, #DIYPS provides 3 types of recommendations (see above). We reconfigured it so that while “looping”, it only enables the pump to do temporary basal rates instead of boluses. If #DIYPS says I need more insulin, it tells the pump to begin a temporary basal rate for 30 minutes above my normal basal rate. If #DIYPS says I need less insulin, it tells the pump to begin a temporary basal rate lower than my normal basal rate for 30 minutes, effectively reducing my net insulin.
  • When something changes and I need to do more or less insulin, #DIYPS tells the pump to increase or decrease the temporary basal rate, or resume my normal basal rate.
  • Note: there is a maximum basal rate that the pump can provide. This is a safety check so that #DIYPS cannot recommend a seriously dangerous basal rate. In fact, if I need more insulin than #DIYPS closed loop can safely provide using a 30 minute temp basal, the system will alarm and alert me to that state (although I usually already know about it). Same for if I was dropping fast and needed carbs in addition to reducing insulin; it would alarm and recommend carbs above and beyond reducing insulin.

I’ve been ‘looping’ (using #DIYPS closed loop) for a little over a week. Here are some of my overnight results:

As you can see, the outcomes are awesome. In fact, they are better than I expected!

#DIYPS closed loop results are significant

Here’s a break down that shows on an example night (Sunday night, 12/14 through Monday morning, 12/15) of how #DIYPS performed:

You can see that around 10:30 (not pictured, but in the graph), I was running low and needed some temp basals to zero, then later some higher temp basals to accommodate the resulting rise in BG. Later, my normal basal rates sufficed until another point overnight when I needed less insulin to prevent a low.

While this is 1/9 or so example nights, this is pretty much how it works every night. BGs drift up? Temp basal higher (usually 1.6 or 1.8, which is <=.5u above my normal). BGs drifting low? Temp basal lower or in extreme cases to zero to prevent a low.

What happens if the closed loop artificial pancreas fails/stops working?

If the loop stops working*, #DIYPS continues to work normally (processing all data and pushing recommendations), and my pump goes back to my normal basal profiles after any existing temp basal rates expire (which would be a max of 30 minutes). No big deal and no more dangerous than I would be walking around with my pump acting normally.

*I’ve found numerous ways to make the system stop working: no battery power; being too far away from the USB stick so the pump can’t communicate; no cell signal to provide wifi as a hotspot to the Raspberry Pi; if the pump battery goes low, RF gets turned off and the USB can’t talk to the pump; if there’s no cell signal or wifi at all, I can’t upload CGM data to #DIYPS anyway; if the SD card gets corrupted inside the Raspberry Pi; etc.

So, there’s many points of failure. But it doesn’t matter. #DIYPS closed loop is safer for me (disclaimer: just me! I’m the only one doing this as a personal experiment to my own body) than if I just had a pump and a CGM, because it can reduce insulin and prevent lows. And it can increase insulin slightly and prevent rebounds.

After about a week’s worth of data, here’s the results of #DIYPS (what I’ve been using for the past year) versus the week of closed loop #DIYPS:


The target BG is especially awesome, because we have the closed loop targeting a BG of 115!

It’s also worth noting the reduction in alarms. Remember, I sleep through CGM alarms, so we built #DIYPS. #DIYPS makes a lot of alarms – sometimes upwards of 40 a night (those are really bad nights!). With the closed loop nights, there are very few alarms..and they’re usually alerts about things #DIYPS closed loop is taking care of on it’s own (see all of those no-hitters above!).


What’s next with #DIYPS closed loop

We’re going to continue and iterate on the closed loop and keep making it better. I’m definitely going to keep using it overnight – it’s like having a working pancreas, the kind where you can go to sleep without fear.

We’re also adding this to the ‘things we’ve learned while working on #DIYPS’ list:

  • Calculating the carbohydrate absorption rate for an individual – how many carbohydrates your body absorbs in an hour
  • Tracking “carbs on board” or “carb decay” – how many carbohydrates are still being digested in your body and impact BG levels
  • “Net” IOB – tracking net IOB by incorporating “negative” boluses from temporary basal rates to zero
  • Preventing post-meal BG spikes/drops with early meal boluses and better understanding of insulin activity
  • and you can control overnight BGs solely using simple adjustments of insulin rates.

Thanks to everyone who made it through a really long post, and for the MANY people who have contributed in various ways to helping us close the loop with #DIYPS! Also, let us know what questions come to mind that we haven’t managed to answer above about how the system works, results, etc.

Why #DIYPS N=1 data is significant (and #DIYPS is a year old!)

As I’ve said many times, last year we set out to create a louder CGM alarm system. By adding “snoozes” so I didn’t drive my co-investigator crazy, we realized I might as well enter what I was doing, and be precise about it (aided by some quick bolus and quick carb buttons that made data-entry not the chore that it sounds). Thus, we had the data and the brains to realize that this made for some great predictions; much better than what you usually see in diabetes tools because they rely only on your insulin sensitivity factor (ISF) and correction rate, but don’t take into account carbs on board and their impact over time, etc.

(If you’re new to #DIYPS, read about the beginnings of it here. For more on this idea of carbs on board and the carbohydrate absorption rate and how significant it is for people with diabetes, read about that here.)

After I had spent 100 days using #DIYPS, Scott and I stopped to look and see what the impact was. For the long version, read this post about the results and the direct comparison to the bionic pancreas trial data that was available then. The short version: #DIYPS reduced my eAG and a1c significantly, reduced lows, reduced highs – aka my time in range was improved from 50% to regularly 80+%.

I have asked myself (and others have asked), are these results sustainable? Are these improved outcomes truly because of #DIYPS? It’s definitely worth noting I never changed what or how I ate. (I ate 120 grams of pizza (for science! ;)) several times to test the system, but I didn’t eat less or any healthier or otherwise change my diet.)
I can’t attribute these outcomes directly to #DIYPS alone, but I do believe they’re highly correlated. It’s hard to separate other contributing factors like the fact that I have more boluses per day using #DIYPS (which other studies have shown decreases a1c); or the fact that I spend less time high/low because with #DIYPS I actually can wake up at night and take action before I’m high or low.
So, it’d be hard to study specific factors and say “it’s all #DIYPS”. But, I’m pretty sure it’s mostly #DIYPS. Regardless, here’s the updated data about the sustainability of the results I’ve seen with #DIYPS over the past year:
Why this is significant
#DIYPS is currently n=1 (meaning one person is the study’s subject). But what is significant is that I have year’s worth of data and actual lab-tested a1cs that shows the outcome of this type of artificial pancreas work. And it (to date, but coming soon  / OMG this week!) hasn’t even been closed loop – I’m still the “human in the loop” making decisions and pushing buttons on my pump.Compared to the bionic pancreas and other artificial pancreas study trials where they have a few days and a few more (usually n=20 or so) subjects; they can look at the decrease in lows and highs and improved eAG…but they can only project what the a1c improvement is going to be.We’ve shown the improvements in lab-tested a1cs – see my graph above?

It all adds up
Scott and I are not the only ones working on a closed loop. The community of developers connected to the Nightscout community has nearly two hands full of people who are working independently on device interoperability to close the loop by freeing our data from devices and enabling us to work with our own algorithms regardless of which hardware device we use to support our diabetes management.When all of these n=1 studies add up, it matters. At some point in the near future, after we’ve closed the loop with #DIYPS (ah! this week! :)) and others have as well, we may have more n=1 hours on closed loop artificial pancreas systems than the (traditional) “researchers”. Scott and I are hoping that we can not only show the world how open source innovation and new regulatory paradigms can deliver safe and effective results for people living with T1D faster than traditional medical device development and traditional regulation; but that we can also change how all successful medical device companies approach interoperability, and how traditional medical researchers do research – possibly in partnership with patient researchers like us.

What we’ve been up to lately – closing the loop with #DIYPS and open process work

We’ve been quiet on the blogging front (yes, I admit, I blogged!) because we’ve been busy closing the loop. (We’re always active on Twitter, though – make sure you watch #DIYPS on Twitter for more real-time updates in between blog posts, and you can follow @ScottLeibrand and @DanaMLewis.)

That’s right.

Closing the loop.

It feels good to say that :).

We’re submitting a research proposal to Medtronic to get access to their research device that will enable us to send commands to my insulin pump. These commands will be generated from #DIYPS. Because that would remove the “human in the loop” component that’s a current part of #DIYPS (i.e.  me pushing the pump buttons), that would move #DIYPS from being not an artificial pancreas to a closed loop artificial pancreas system.

This is not what we imagined we would do when we set off nearly a year ago to do this work (make a louder CGM alarm system, enable remote monitoring, etc.), but this is awesome!

And, in the true #wearenotwaiting spirit, we’re not waiting for the research device to start this phase of our work. We got started with this phase of our research by getting a Raspberry Pi and hooking it up to the Carelink USB and sending commands to a test Medtronic pump.

(Note: this pump is not hooked up to my body! There is no insulin in it! We’re just testing to see how data can be read off the pump & fed into #DIYPS. There will be many tests with a pump not connected to my body and many safety checks and stages before we would get anywhere near to allowing this to run under waking, close observation let alone under observed sleeping conditions. Stay tuned for more on this later.)

Where we are with #DIYPS and Nightscout

We’ve been having many discussions with the other developers of Nightscout, and end users in the CGM in the Cloud Facebook group around this topic. Scott and I are both passionate about the open source part of our project and being open and transparent every step of the way. We’ve been learning a lot from #DIYPS and have some key features that we’re putting back into the overall Nightscout platform as a result. We’re calling this “#DIYPS-Lite”, or the “wip/iob-cob” branch of Nightscout. (This is not what the main community is using, it’s still an advanced test branch, but enables more advanced users to implement and take advantage of some of these features, like net IOB and COB.) We’ve also been contributing to the roadmap of Nightscout; as of this past weekend, we helped map out the priority list to show what are priorities of some of the core developers (including Scott and I); what’s currently being worked on; and what’s on the ‘backlog’ as a project we’re all interested in and is important to the community, but no one’s had a chance to jump in and start it yet.

Back to the closed loop update

We won’t be releasing any closed-loop systems to the public any time soon, because that would mean distributing an untested medical device system that controls administration of a potentially lethal drug (insulin), which the FDA (and anyone in their right mind) would (rightly) frown on.

Instead, we want to open up our process of developing such systems, so that other researchers (including independent ones like us, and those inside traditional research labs and companies) have a roadmap to follow for how to safely put together and test an open-source artificial pancreas system.  The more people and companies we have developing such systems, sharing their results, and learning from each other’s work, the closer we’ll be to having a system that could indeed be proven safe and effective to the FDA’s satisfaction, and eventually released to the public.  In the end, we suspect the companies and research labs developing APS systems will be the ones to commercialize them, but we are confident that our efforts will accelerate those timelines and result in a more dynamic, innovative T1D medical device ecosystem that will provide a bridge to a true cure.

We are hoping that we can show the world how open source innovation and new regulatory paradigms can deliver safe and effective results for people living with T1D faster than traditional medical device development and traditional regulation.  By doing so, we can change how all successful medical device companies approach interoperability, and get to a world where the latest ideas, algorithms, and software can be made available to everyone with T1D, regardless of what hardware they’re using.


(More to come next week as we mark 1 full year of #DIYPS in action (!) and we have some new data to share!)

12 years & counting – are we there yet?

Today marks 12 years of living with diabetes. (Like everyone else, I wonder what to do on yet another diabetes anniversary – celebrate? Cry? Eat gluten-free cupcakes? All three things?) And interestingly, I’m almost at the one year mark of living with diabetes powered by #DIYPS.

When I was diagnosed, my blood glucose meter was bigger in all dimensions than the iPhone 6+.  Luckily, that’s changed, and my meter is now about the size of my Pebble smart watch – and that watch actually shows my my blood glucose readings from my CGM every 5 minutes.

Even better, in the last year, we’ve built a system that will not only give me a number, but help me track changes and push alerts so I can pay attention when needed…but otherwise live my life and not let diabetes get in the way of the things I actually want to be doing (running marathons, reading marathons, saving the world, etc.).

What hasn’t changed, though? My insulin pump. I’m pretty sure it’s a slightly different purple color than it was 11 or so years ago, but not much else has changed. For 11+ years I’ve been wanting:

  • To be able to see (on the pump) a HISTORY of any temporary basal rates
  • To be able to have “days of the week” programmable basal rates. (As you can imagine, my Tuesdays and Saturdays look a little different!)
  • To be able to have “net IOB” calculated and displayed to reflect the true amount of insulin in my body

For 11 years, I didn’t question the lack of progress, much, though. That’s just the way it was. I imagined it would probably be this way until we got a cure for diabetes in (5 or insert your magical number here) years.

I’m glad this is no longer the way it is and that I have tools like #DIYPS. But I hope that medical device companies will get out of their rut and the way they’ve been doing innovation and business for eons and do better. Because what they’re doing right now is not good enough. And #wearenotwaiting.

An artificial pancreas may not be good enough – #DIYPS perspective

I didn’t expect to end up with #DIYPS when Scott and I first started building a system that would make louder CGM alarms. (If you are new to #DIYPS, read this post to learn more about it!)

But, as we added ‘snooze’ features for the loud alarms; the ability to input carbohydrates and insulin into the system; figured out that knowing your carbohydrate absorption rate is critical for managing diabetes as is the timing of the insulin activity in your body during mealtimes; and realizing that net IOB (factoring in temporary basal rates) matters…we ended up with today’s version of #DIYPS.

After the first 100 days, we knew #DIYPS was as good as the bionic pancreas was performing in clinical trials. And after several more months, I’ve had sustained results that show the value and impact of this type of system.

But, as more news and attention lately is focused on the “bionic pancreas” and APS (artificial pancreas systems), I have started to wonder… will those be good enough (for me)?

APS/bionic pancreas will not be a cure – it will not take away diabetes. It will make managing diabetes easier for many people.

But since I have #DIYPS, those systems may not be good enough (initially, for me).

The big difference between #DIYPS and APS is automation. With #DIYPS, I make all decisions and push all buttons to add or reduce insulin. There is still a “human in the loop”.

My hope would be able to add the ability for DIYPS to automatically set basal rates to zero temporarily overnight in advance of predicted low BG, to help prevent lows without having to wake up from a deep sleep and take that action myself. (And as Medtronic’s Low Glucose Suspend (LGS) technology has shown to the world and FDA, the risk of stopping insulin delivery for up to two hours while someone is sleeping is lower than it would be to continue providing insulin to them if they are not waking up and are low.)

If we’re able to make that happen with #DIYPS, I may be one of those people who doesn’t want to jump on board for day 1 of the first market available artificial pancreas system or bionic pancreas. (Although I reserve the right to change my mind :D). After all, at this point it would be a battle of the algorithms to see what system might work best for the most people. (And since I have my own algorithms that Scott and I developed, they might be better than the alternative for me.)

I also can imagine that there will be many people who won’t implicitly trust the/a system to make decisions for them all the time. They’ll still want a “human in the loop”.

#DIYPS-type systems that are “decision assist systems” may play an important role as a stepping stone platform for people to get comfortable with this new generation of technology that can predict lows and highs and make recommendations for them to take action.

Eventually, maybe everyone will be on an APS or bionic pancreas. Even setting aside the difficult questions of cost, availability, and insurance coverage, I know that one technology will not fit every person with diabetes (like how CGM in the Cloud is not for everyone); one system will not meet the needs of everyone; and none of us will be ultimately satisfied until we’ve prevented and cured all types of diabetes and eradicated the impact of any complications from diabetes.

But until we get there, #wearenotwaiting.

How #DIYPS became a part of our engagement

Confession: I like to plan things. However, there’s one thing I can’t (won’t/wouldn’t) plan, which was our engagement.

Oh, did you hear? Scott and Dana are engaged! :)

Some time ago, I had joked that if/when we got to the point of making this decision, that he definitely couldn’t do it while I was low, because I would be feeling awful and I wouldn’t necessarily be able to remember every detail, etc.

Fast forward to this weekend

Scott and I hopped in a van on Thursday and drove down to Portland to get ready for Hood to Coast. Luckily, unlike my Ragnar run, our start time was a more civilized 9:30 am so we had time to see the sunrise before we started the race on Friday.

We headed up the mountain, and then I kicked off the race by running down the mountain (awesome). We then proceeded with the race, which like Ragnar, is completed by having 12 runners in 2 vans take turns covering the course until ultimately you end up in Seaside, Oregon to finish. There were some snafus on the course by the organizers, including an hour-long-plus backup on the road where you were supposed to be able to get to a field and be able to sleep in said field. However, by the time we had arrived, they closed the field, so we ended up getting less than an hour of sleep on the side of the road, smushed together in the van (7 people in one van!), before I had to crawl outside and force another few miles for my last run.

But, we finally finished, made it to Seaside on Saturday afternoon, and stood around waiting for our van 2 to fight through traffic and get there so we could cross the finish line together and be done! Everyone from our van (including Scott) ended up standing around in a crowd with a few thousand of our closest friends for more than an hour. Once they made it, we crossed, grabbed our medals…and were done.

Most of the team decided to head into the beer garden before splitting up for dinner and heading back to the hotel. I voted for heading back to dinner right away, because the sooner I ate, the sooner I got to finally go to sleep! Scott and I decided to head back.

Where I start unintentionally thwarting Scott’s plans

Scott suggested walking on the beach as we headed back, but as we skirted the finish line area, I realized how much it hurt to walk on the uneven sand with sore legs and hips from the run, and vetoed that idea. So we walked up off the beach to the esplanade/promenade, and walked down it instead. I called my parents to let them know we were alive after the race, and by the time I was off the phone, we were nearing the end of the esplanade. Scott asked one more time if I was sure I didn’t want to walk out to the beach. I think I said something along the lines of, “Fine, we can walk up to the beach, as long as we don’t have to walk up and down it!”

We walked over to the edge of the beach on the ridge, where you could see the fog and not much else, although there weren’t many people around. At that point, Scott was checking #DIYPS on his watch, and saw that I was dropping from the walk and projected to go low, so he suggested sitting down for a few minutes as a break before we walked the rest of the way back to the hotel for dinner, and starting a temp basal to help prevent a low. He told me to pick a spot, so I picked a comfortable looking log, and we sat down. Scott gave me a few Swedish fish to eat just to make sure I didn’t go low, and then while I was looking around at the fog, he started reaching into his pocket again and telling me he had another question for me.

I still had no idea what was going on (something about running a lot of miles and 1 hour of sleep), so I just looked at him. He pulled a box out of his pocket and opened it to another box, and I started to have an inkling of what MIGHT be happening, but my brain started to tell me that nope, wasn’t happening, what kind of person carries a ring in their bag/pocket all weekend around so many people without me noticing it, and didn’t we just run a race on one hour of sleep, and oh my gosh what is he doing?

By that point, he had flipped around and gotten down on one knee, asked me if I was ready to make it official, kissed me, and asked me to marry him. Thanks to #DIYPS I was *not* low, and despite the lack of sleep I had figured out what was going on at this point, and was able to say yes! :)

For those keeping track at home, despite my BGs starting to swing low which was supposed to be the reason we stopped to sit down…I later looked, and my BG never dropped below 99 during all of this! :)

My #DIYPS view is a little different now :)
My #DIYPS view is a little different now :)

 

 

“Micro” highs and lows (they’re not really all the same)

More thinking on what a snapshot of diabetes data means to me – this time on ‘micro’ highs or lows. @danamlewis #DIYPS http://bit.ly/1lt2ijE

I went to take a snapshot of my 24 hour CGM graph, because I was pleased with the outcome of the past 24 hours: no major lows or highs. According to the picture, it’s a “no hitter” (not hitting the high or low lines). However, I have the high alarm set to 170 right now, so to me knowing that I peaked around 150 overnight, including the slow crawl up to it, means it wasn’t a true no-hitter.

But, isn’t it still worth celebrating? No major overnight alarms to wake me up. No juicy juice or temp basals or reduced sleep or waking up feeling like I was dehydrated and apt to develop ketones. Diabetes, for a day, wasn’t a big deal. Isn’t this the ultimate goal of living with diabetes – living well, and not letting it stop us from living our lives and doing what we’re striving to do?

I tweeted the CGM picture with this caption:

Because it’s true. A 400 and 121 are both technically, medically speaking both “high” and “highs”. But are they the same? No.

(And same goes for any single data point – 121 could be flat, going up, or sliding down – the trend is what matters, regardless of what FDA has agreed to at this point in time. )

So, I’ve decided to categorize things as “micro” highs and lows when I’m sliding slightly below my comfortable range (like floating in low 80s or 70s and feeling low symptoms) or rising above what’s “normal” (80-120 is burned into my brain as normal), but may not warrant taking a picture as a “high”.

Semantics? Maybe. But as we talk about what these numbers represent, our ability and willingness to have a conversation about them online, including defeating data-shaming, I think it’s worth continually reframing and gaining more perspective on what diabetes data means to each of us.

“Letting go of things we can’t control” + remembering that sleep matters (#DIYPS)

Sleep + so many factors out of our control impacts BGs. (#DIYPS lessons learned from @danamlewis after #RagnarNWP): http://bit.ly/1AgTN4M

It’s been over a month since our last #DIYPS update. We haven’t made any significant changes in the system, and have been continuing to use it to successfully manage my BGs to (mostly) my satisfaction.

That is, until this past weekend.

There was a team of 12 people with diabetes that got together (thanks @ConnecT1D and @IN_events for sponsoring!) to run “Ragnar Northwest Passage”, which is a 196 mile long relay race from near the Canadian border (Blaine, Washington) to Langley, Washington.

Guess who was lucky runner #1 and woke up at 3am on Friday to run 6.3 miles at 6:15 am?
Guess who was lucky runner #1 and woke up at 3am on Friday to run 6.3 miles at 6:15 am?

Here’s how the relay works: you have two vans, each with 6 runners, that take turns on the course. Each runner runs three different times, for a total of 13-19 miles. Van 1 starts and the 6 runners hand off to each other; then Van 2 meets up as the 6th runner finishes, and runners 7-12 commence running. Meet up again and handoff back to Van 1. (I’d say “rinse and repeat”, except for there weren’t always showers involved after every single run). The race started for our team on Friday at 6:15 am (see note about 3am wakeup and running first), and continued until Saturday at 4pm-ish.

Why this became a #DIYPS post

I slept ~4 hours on Thursday night before the 3am wake up and early race start. During the actual race, I got about 3.5 hours of sleep overnight in Van 1 while Van 2 was out on the course. Normally I would have 16-20 hours of sleep under my belt for a half-marathon or longer race.

I also didn’t have #DIYPS running at full capacity during the race – my Moto G phone has taken some hard knocks and the cord that connects to my CGM was wonky. So, I pretty much went “old school” and just used my CGMs as-is.

During the race, even without #DIYPS running normally, my BGs were pretty good. I was great during my first run and only had a few lows in the afternoon after that (more from lack of protein/real food than anything else, which I fixed with a big lunch). During my 2nd run, I started my temp basal too soon, miscalculating when the runner before me was coming in, and was between 180-200 during my run. Not *that* big of a deal, but since my average BG is usually <120, I can feel it and it feels different to run. I managed to get it down after my run and in the overnight, and was fine during my 3rd run, and after that. All in all, I was very happy with my BGs during the race. (Oh – and my first run (6.3 miles) and my last run (3.1 miles) were both PRs, personal records, for me! So, yay for good running and good BGs at the same time.)

(Scott & I after the race! We look great on so little sleep and so many miles, right?)

However, once I finished the race and Scott and I headed out for dinner (real food!), despite the usual #DIYPS prebolus strategies, my BGs rocketed up pretty fast. I chalked it up to something related to my liver absorbing or dumping glucose or whatever, didn’t worry about it too much, and focused more on getting 12 hours of sleep that night. (Luckily I was running higher and not lower, so sleeping through a few alarms was ok for the night).

On Sunday, the same thing happened when I ate lunch. A few carbs and my BGs took off high. Same thing Sunday for dinner, and Monday after a breakfast that included carbs.

By Monday evening, I was puzzled and annoyed, because I had #DIYPS running but my body was not cooperating! I was also still feeling tired, above and beyond what Scott (who ran Ragnar on another team that had 12 members with functioning pancreases :) ) seemed to be feeling.

Remembering that sleep matters A LOT to your body, and the same goes for managing BGs

Overnight, my BGs settled down and were flat after 6am and all morning, including after a breakfast with lots of carbs (I ate a gluten-free cookie, it was delicious). My BGs had a slight uptick..and flattened out. Like they used to do last week and all the weeks prior with #DIYPS. I took a picture to send to Scott, and had the sudden realization that my body had probably caught up on sleep to it’s minimum levels, and that’s probably why it was handling things like “normal” again*.

This (knowing that sleep impacts your body’s function) is a lesson I’ve learned many times before, and has less to do with #DIYPS….except it helped remind me that there are SO many factors out of our control in dealing with diabetes. (Stressed? Excited? Sick? Sleep deprived? Are you a girl? Are you growing? Are you in puberty? Is the moon out? Is there a universal Diet Coke shortage?)

#DIYPS is great at helping you deal with BGs if you don’t know the exact carb count in a meal, or dealing with the chaos of running more than a half marathon over three legs in a 36 hour time period on less than 8 hours of sleep. Like I mentioned before, it also helps me keep perspective – this time to help me let the few days of higher than normal post-race BGs go and not beat myself up about it.

Final note

It’s probably a good idea to not try this kind of sleep deprivation at home (seriously – sleep is awesome, you should do as much of it as possible), and be aware that running Ragnar or another relay race** may throw off your BGs more so from lack of sleep than the actual exercise part.


*Yes, it’s normal to eat a gluten-free cookie for breakfast! The non-normal part is having to do math and bolus and watch BGs. Having diabetes is not normal!
**Scott and I are running on a Hood to Coast team in August. Gulp. Maybe I’ll manage more sleep this time around in the vans?

What is #DIYPS (Do-It-Yourself Pancreas System)?

#DIYPS (the Do-It-Yourself Pancreas System) was created by Dana Lewis and Scott Leibrand in the fall of 2013.

Curious about building a closed loop for yourself? Head to OpenAPS.org!

#DIYPS was originally developed with the goal of solving a well-known problem with an existing FDA-approved medical device. We originally set out to figure out a way to augment continuous glucose monitor (CGM) alerts, which aren’t loud enough to wake heavy sleepers, and to alert a loved one if the patient is not responding.

We were able to solve those problems and include additional features such as:

  •  Real-time processing of blood glucose (BG), insulin on board, and carbohydrate decay
  •  Customizable alerts based on CGM data and trends
  •  Real-time predictive alerts for future high or low BG states (hours in advance)
  •  Continually updated recommendations for required insulin or carbs
  • ..and as of December 2014, we ‘closed the loop’ and have #DIYPS running as a closed loop artificial pancreas.
  • (And, as of February 2015, we also launched #OpenAPS, an open and transparent effort to make safe and effective basic Artificial Pancreas System (APS) technology widely available. For more details, check out OpenAPS.org)

You can read this post for more details about how the #DIYPS system works.

While #DIYPS was invented for purposes of better using a continuous glucose monitor (CGM) and initially tailored for use with an insulin pump, what we discovered is that the concepts behind #DIYPS can actually be used with many types of diabetes technology. It can be utilized by those with:

  • CGM and insulin pump
  • CGM and multiple daily injections (MDI) of insulin
  • no CGM (fingerstick testing with BG meter) and insulin pump
  • no CGM (fingerstick testing with BG meter) and multiple daily injections (MDI) of insulin

Here are some frequently asked questions about #DIYPS:

  1. Q:I love it. How can I get it?A: #DIYPS is n=1, and because it is making recommendations based on CGM data, we previously have said that we can not publicly post the code to enable someone else to utilize #DIYPS as-is. There’s two things to know. 1) To get some of the same benefits from #DIYPS as an “open loop” system, with alerts and BG visualizations, you can get Nightscout, which includes all of the publicly-available components of #DIYPS, including the ability to upload Dexcom CGM data, view it on any web browser and on a Pebble watch, and get basic alarms for high and low BG – and depending on which features you enable, you can also get predictive alarms. Some of the other core #DIYPS features (“eating-soon mode“, and sensitivity/resistance/activity modes) are now available in Nightscout. 2) If you are interested in your own closed loop system, check out OpenAPS.org and review the available OpenAPS documentation on Github to help you determine if you have the necessary equipment and help you determine whether you want to do the work to build your own implementation.
  2. Q: “Does #DIYPS really work?”A: Yes! For N=1, using the “open loop” style system with predictive alerts and notifications, we’ve seen some great results. Click here to read a post about the results from #DIYPS after the first 100 days – it’s comparable to the bionic pancreas trial results. Or, click here to read our results after using #DIYPS for a full year. We should probably update this to talk about the second year of using #DIYPS, but the results from the first year have been sustained (yay!) and also augmented by the fact that we closed the loop and have the system auto-adjusting basal rates while I sleep.
  3. Q: “Why do you think #DIYPS works?”A: There could be some correlation with increased timed/energy spent thinking about diabetes compared to normal. (We’d love to do some small scale trials comparing people who use CGMs with easy access to time-in-range metrics and/or eAG data, to compare this effect). And, #DIYPS has also taught us some key lessons related to pre-bolusing for meals and the importance of having insulin activity in the body before a meal begins. You should read 1) this post that talks about our lessons learned from #DIYPS; 2) this post that gives a great example of how someone can eat 120 grams of carbohydrates of gluten-free pizza with minimal impact to blood glucose levels with the help of #DIYPS; 3) this post that will enable you to find out your own carbohydrate absorption rate that you can start using to help you decide when and how you bolus/inject insulin to handle large meals or 4) this post talking about how you can manually enact “eating-soon mode”. And of course, the key reason #DIYPS works (in open loop mode) is because it reduces the cognitive load for a person with diabetes by constantly providing push notifications and real time alerts and predictions about what actions a person with diabetes might need to consider taking. (Read more detail from this post about the background of the system.)
  4. Q:Awesome!  What’s next?A: If you haven’t read about #OpenAPS, we encourage you to check it out at OpenAPS.org. This is where we have taken the inspiration and lessons learned from using #DIYPS in manual mode (i.e. before we closed the loop), and from our first version of a closed loop and are paying it forward with a community of collaborators to make it possible for other people to close the loop! Some new features we wanted for #DIYPS that will likely still happen, but integrated with Nightscout and/or #OpenAPS include:
    • calculation of insulin activity and carb absorption curves (and from there, ISF & IC ratios, etc.) from historical data
    • better-calibrated BG predictions using those calculated absorption curves (with appropriate error bars representing predictive uncertainty)
    • recommendations for when to change basal rates, based on observed vs. predicted BG outcomes
    • integration with activity tracking and calendar data
    • closing the loop – done as of December 2014! :) and made possible for more than (n=1) with #OpenAPS as of February 2015

    We also are collaborating with medical technology and device companies, the FDA, and other projects and organizations like Tidepool, to make sure that the ideas, insights, and features inspired by our original work on #DIYPS get integrated as widely as possible. Stay tuned (follow the #DIYPS hashtagDana Lewis & Scott Leibrand on Twitter, and keep an eye on this blog) for more details about what we’re up to.

  5. Q: “I love it. What can I do to help the #DIYPS project? (or #openAPS)”A: #DIYPS is still a Dana-specific thing, but #OpenAPS is open source and a great place to contribute. First and foremost, if you have any ability to code (or a desire to learn), we need contributors to both the Nightscout project as well as #OpenAPS. There are many things to work on, so we need as many volunteers, with as many different types of skills, as we can get.  For those who are less technical, the CGM in the Cloud Facebook group is a great place to start. For those who are technical and/or want to close the loop for themselves, check out OpenAPS.org, join the openaps-dev google group, and hop on the #intend-to-bolus channel on Gitter. If you want to contact us directly, you can reach out to us on Twitter (@DanaMLewis @ScottLeibrand) or email us (dana@openAPS.org and scott@openAPS.org). We’d also love to know if you’re working on a similar project or if you’ve heard of something else that you think we should look into for a potential #OpenAPS feature or collaboration.

Dana Lewis & Scott Leibrand