diff --git a/dev-requirements.in b/dev-requirements.in new file mode 100644 index 0000000..2c2a9f3 --- /dev/null +++ b/dev-requirements.in @@ -0,0 +1 @@ +pip-tools diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000..76bfa83 --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,24 @@ +# +# This file is autogenerated by pip-compile with Python 3.12 +# by the following command: +# +# pip-compile --output-file=dev-requirements.txt dev-requirements.in +# +build==1.2.2.post1 + # via pip-tools +click==8.1.7 + # via pip-tools +packaging==24.1 + # via build +pip-tools==7.4.1 + # via -r dev-requirements.in +pyproject-hooks==1.2.0 + # via + # build + # pip-tools +wheel==0.44.0 + # via pip-tools + +# The following packages are considered to be unsafe in a requirements file: +# pip +# setuptools diff --git a/docs/data/nightscout.md b/docs/data/nightscout.md index 5a71e96..d7f184e 100644 --- a/docs/data/nightscout.md +++ b/docs/data/nightscout.md @@ -57,7 +57,7 @@ The day-to-day report will show a detailed overlay of boluses, basal rates, carb ### Daily Stats report -The daily stats report is a pie chart showing the daily breakdown of your low, in-range, and high time in target, as well as other statistical analysis of your BG trends. +The daily stats report is a pie chart showing the daily breakdown of your low, in-range, and high time in target, as well as other statistical analysis of your glucose trends. ![Daily Stats](img/daily-stats.png){width="700"} {align="center"} diff --git a/docs/data/overview.md b/docs/data/overview.md index 0dd5152..8fcf3cc 100644 --- a/docs/data/overview.md +++ b/docs/data/overview.md @@ -11,10 +11,28 @@ When you go to your endocrinology office, they need to have a method to view all ## Available solutions for DIY apps -The good news is that the community has some very useful tools to help address the shortcomings in the traditional data aggregation for Loop users. There are several tools available to help you and/or your endocrinologist evaluate your Loop data. Specifically, this section covers: +The good news is that the community has some very useful tools to help address the shortcomings in the traditional data aggregation for Loop users. There are several tools available to help you and/or your endocrinologist evaluate your Loop data. -* *Apple* Health app -* *Nightscout* -* *Tidepool* -* *Perceptus* +### Comparison of Data Tools + +| Tool | Best For | Data Retention | Cost | Setup Complexity | +|------|----------|----------------|------|------------------| +| **Apple Health** | Quick daily review, on-device access | Indefinite (on device) | Free | None (built-in) | +| **Nightscout** | Remote monitoring, real-time troubleshooting, detailed Loop data | Varies by hosting plan | Low ($0-12/month) | Moderate | +| **Tidepool** | Endo appointments, professional reports, long-term trends | Indefinite (cloud) | Free | Low | +| **Perceptus** | Advanced algorithm analysis, deep insights | As long as you maintain account | Free | Low | + +### Which Tool Should You Use? + +- **Start with Apple Health** - It's already there and requires no setup +- **Add Nightscout** if you need remote monitoring or want detailed troubleshooting capabilities +- **Use Tidepool** for sharing data with your healthcare team and generating reports +- **Try Perceptus** when you want advanced analysis of how Loop's algorithm is performing + +This section covers each tool in detail: + +* Apple Health app +* Nightscout +* Tidepool +* Perceptus diff --git a/docs/data/tidepool.md b/docs/data/tidepool.md index fd5a5e8..39a9b65 100644 --- a/docs/data/tidepool.md +++ b/docs/data/tidepool.md @@ -101,7 +101,7 @@ If you hover over an item on the *Tidepool* web display, information is revealed * details about a manual bolus: * the recommended value with notation if this recommendation was modified (override or underride) * if this was a meal entry: Carbs and IC (insulin to carb ratio, called CR in Loop) are shown - * in all manual bolus, the Glucose, IOB, ISF and correction target range are shown + * in all manual bolus, the Glucose, IOB, ISF and correction range are shown * in the graphic below, the left image is from meal entry and the right from a bolus added after the meal ![meal entry details](img/tidepool-hover-meal-postmeal.png) diff --git a/docs/how-to/cgm.md b/docs/how-to/cgm.md index 98cf078..96d8177 100644 --- a/docs/how-to/cgm.md +++ b/docs/how-to/cgm.md @@ -3,15 +3,18 @@ Obviously, without CGM data your Loop will not function. With the stability that Looping brings, many people are looking for ways to minimize their Loop downtime due to avoidable factors. Factors that make CGMs a potential problem include sensor failure, transmitter signal loss, poor calibrations, and the warmup period. ## Sensor warmup -One of the obvious downtimes is during new sensor warmup. Unfortunately, the only way to avoid the 2-hour warmup (in the case of Dexcom's system) is to overlap your sensor sessions and this just isn't feasible for most people. +One of the obvious downtimes is during new sensor warmup. -* Insurance doesn't provide adequate supplies to overlap sensor supplies; you would need two active transmitters and enough sensors to allow for overlap of use. -* Sometimes sensors fail before a session was due to expire, making a planned overlap impossible. -* Some people just don't want to wear two sensors at once. +### Dexcom G7 CGM +One of the nice things about the Dexcom G7 is that many people begin the warm-up of the new sensor while the current sensor is in the grace period. Amazing - no gap in CGM coverage. + +### CGM that cannot be overlapped + +Unfortunately, many sensors cannot be overlapped, so there will be a period without CGM data between sensors. Since warmups are an important part of stabilizing CGM values and decreasing sensor noise, they are just going to continue to be a no-Loop time period for the foreseeable future. Most people simply cancel a currently running temporary basal, or let it run its course, when they start a new sensor session. For the two hours of warmup, the Loop will revert to the basal schedule programmed into the pump. -Some people have opted to keep looping during sensor warmups by manually entering blood glucose checks through the Apple Health app for Loop to read. While technically Loop can use those values, the entries would have to be sufficiently frequent to be meaningful. If a person is willing to test 8-12 times in a two hour span, then looping through sensor warmup could be feasible through this method. +Some people have opted to keep looping during sensor warmups by manually entering blood glucose checks, either through the *Loop* app (with version 3 and newer) or through the Apple Health app. While technically Loop can use those values, the entries would have to be sufficiently frequent to be meaningful. If a person is willing to test 8-12 times in a two hour span, then looping through sensor warmup could be feasible through this method. ## Sensor noise Depending on which CGM device you use, you may observe a sweet spot of data accuracy in the middle of your sensor's session but have sensor "noise" at the beginning and end of the session. Generally speaking, Loop does fairly well despite these times of sensor noise, although having a reasonable maximum basal rate does help mitigate the risk due to a noisy sensor. diff --git a/docs/how-to/disconnect.md b/docs/how-to/disconnect.md index 9186203..69ce8c2 100644 --- a/docs/how-to/disconnect.md +++ b/docs/how-to/disconnect.md @@ -1,8 +1,8 @@ # Disconnecting from Pump -For Medtronic pump users, you will have times where you need to disconnect from your insulin infusion site. Showers, some sports activities, swimming, and medical exams are some of the common reasons when disconnections are unavoidable. +For tubed pump users, you will have times where you need to disconnect from your insulin infusion site. Showers, some sports activities, swimming, and medical exams are some of the common reasons when disconnections are unavoidable. -The simplest way to deal with periods of disconnect is to suspend the Medtronic pump so that Loop knows no insulin was being delivered while you were disconnected. This will let Loop know that there is missing basal insulin that may need to be considered as part of the blood glucose prediction. Typically when disconnected from insulin delivery and negative insulin on board has developed, blood glucose will start to rise so Loop will expect to need to make up the missed insulin from disconnections. +The simplest way to deal with periods of disconnect is to suspend the pump so that Loop knows no insulin was being delivered while you were disconnected. This will let Loop know that there is missing basal insulin that may need to be considered as part of the blood glucose prediction. Typically when disconnected from insulin delivery and negative insulin on board has developed, blood glucose will start to rise so Loop will expect to need to make up the missed insulin from disconnections. Some users are prone to forget to resume insulin delivery after suspending for disconnects. One option is to use Siri by simply saying "Hey Siri, set a timer for 30 minutes" and that can serve as a reminder alarm to resume the pump after the shower is over. Other users may want to consider canceling any running temporary basal, setting a 30 minute zero temporary basal, and then setting Loop to open loop. This will keep IOB fairly accurate while at the same time providing an automatic restart of normal basals if the user forgets to resume delivery. The user will then have to close loop again when ready to resume looping. Find what option works for you (or your child) the best; there are a number of ways to deal with disconnects. diff --git a/docs/how-to/exercise.md b/docs/how-to/exercise.md index 578b781..e0aecde 100644 --- a/docs/how-to/exercise.md +++ b/docs/how-to/exercise.md @@ -1,62 +1,99 @@ # Exercise -Hands-down, exercise is the most commonly discussed topic of long-term Loop users. Exercise is highly specific to an individual and its impact on blood sugar is not always equal. For example, many people find anaerobic exercise such as weight lifting will raise blood glucose, and aerobic exercise such as running will lower blood glucose. The degree to which impacts are observed also depends on the insulin and carbohydrates on board going into the exercise. Blood glucose response in competition can be quite different than a regular training session due to the added adrenaline. Exercising with T1D does require extra preparation, but with preparation, things should go much easier. +Hands-down, exercise is the most commonly discussed topic of long-term Loop users. Exercise is highly specific to an individual and its impact on blood sugar is not always equal. For example, many people find anaerobic exercise such as weight lifting will raise blood glucose (BG), and aerobic exercise such as running will lower BG. The degree to which impacts are observed also depends on the insulin and carbohydrates on board going into the exercise. Blood glucose response in competition can be quite different than a regular training session due to the added adrenaline. Exercising with T1D does require extra preparation, but with preparation, things should go much easier. -## Exercise Basics -A 2013 JDRF survey found that 36 percent of T1D patients, caregivers and healthcare professionals view exercise as a challenge and would like to learn more about exercising safely. The JDRF PEAK (T!D Performance in Exercise and Knowledge) education curriculum explores the environmental, dietary, physiological and psychosocial elements that impact physical activity with T1D ([source](https://www.jdrf.org/t1d-resources/peak/){: target="_blank" }). As part of JDRF's PEAK resources, they have published a helpful [article about exercise and T1D for athletes](https://www.jdrf.org/t1d-resources/living-with-t1d/exercise/){: target="_blank" }. Below is an excerpt from that article. There are a couple key considerations (highlighted in orange) that be different in Loop use. Those considerations are discussed further below. +If you exercise consistently, you will figure out a pattern and can plan ahead. -*********************** -**With great exercise, comes great responsibility** +If you are just starting an exercise progam, it will take time to become accustomed to the new routine. After your body is used to regular exercise, the impacts on your glucose and insulin regimen are likely to change again. -It goes both ways: exercise affects glucose control; glucose control affects exercise. Consistent physical activity produces consistent insulin sensitivity, which helps the body process glucose more evenly (avoid spikes), maybe even improving HbA1c. +## Loop-Specific Exercise Tips (Start Here!) -Some considerations: +### Key Strategy: Use Override Targets Ahead of Time -* Risk for hypoglycemia can be reduced by avoiding too much insulin on board (IOB) during and after exercise. -* Continuous glucose monitors (CGMs) or regular blood glucose testing provides critical information to preemptively minimize blood-sugar highs and lows. -* Plan ahead! Reduce insulin and add carbs for aerobic (longer duration, lower intensity) exercise, which causes blood sugar to drop, or increase for anaerobic (short duration, high intensity), which may cause spikes. -* After most exercise, insulin sensitivity is higher for 24 hours. Carbohydrates needed to replace liver glycogen levels must be balanced with decreased insulin levels. +**Reduce insulin on board (IOB) before exercise** by setting an override with a higher target: -**Intensity. Speed. Environment. Duration… all affect the body’s reaction** +- **When**: Start 1-2 hours BEFORE exercise (not when you start) +- **Target increase**: Usually 50 mg/dL higher than normal (adjust based on your needs) +- **Why**: Loop needs time to decrease basal insulin before aerobic exercise begins -There are three types of exercise: +**Example**: If your normal target is 100 mg/dL, set an exercise override to 150 mg/dL. -* Aerobic - * Aerobic exercise is usually continuous, light-to moderate intensity exercise and includes activities like running, walking, long-distance swimming, biking or tennis. Aerobic exercise typically tends to lower blood glucose levels. -* Anaerobic - * Anaerobic exercise is generally shorter in duration, of maximal to super max intensity and includes activities like sprinting, gymnastic, ice hockey, or weight training. Anaerobic exercise typically tends to raise blood glucose levels. -* Mixed - * Mixed exercise is combination of the aerobic and anaerobic activity such as basketball or soccer. Managing blood glucose levels with mixed exercise is difficult, but using a tool like a continuous glucose monitor can help greatly. +### After Exercise: Continue the Override -![3 Types of Exercise Chart](img/3-types-of-exercise-chart.png){width="750"} -{align="center"} +**Insulin sensitivity stays elevated for up to 24 hours** after exercise: -Glucose levels during sports affect performance in many ways: strength, stamina, speed, agility, flexibility, safety and mental sharpness. +- Keep your override active for hours after you finish +- Duration depends on exercise intensity and length +- Prevents post-exercise lows from increased insulin sensitivity -* Insulin resistance, which is when the body requires more insulin to process glucose, is a problem. Exercise combats this by increasing insulin sensitivity and glucose uptake by muscles. Muscles are better able to absorb glucose when contracted. -* Exercise thwarts postprandial (after-meal) hyperglycemia by slowing carbohydrate absorption, increasing glucose utilization and accelerating insulin action. -* Practice vs game day – each can have dramatically different effects on your T1D. Adrenaline and stress both raise blood glucose levels and are typically present on the day of your game or event. +See the [Override Targets](overrides.md){: target="_blank" } page for detailed instructions on setting up and using overrides. -**Balancing Act: Finding your blood glucose zone and peak fitness zone** +### Pre-Exercise Meal Timing -Caution: Delayed Onset Hypoglycemia can occur 6 to 12 hours (sometimes 24 hours) after exhaustive exercise, due to replenishment of muscle glycogen stores and enhanced insulin sensitivity. It is possible to prevent this by: +- Minimize heavy carb meals in the 3 hours before intense exercise +- Large boluses create high IOB that increases low risk during exercise +- Consider partial boluses and slower, lower-carb snacks if eating beforehand +- Loop automatically recommends smaller boluses when override targets are active -* keeping records of your fitness regimen and the effects it has on your body -* using a CGM or frequent blood testing to monitor your body’s response to activity -* decreasing basal insulin or meal boluses after activity -* consuming slow-acting carbohydrates after activity +## Exercise Basics and Background -Similar recording and monitoring tactics can be used to prevent hyperglycemia (blood-sugar highs). Some other options include: +For more comprehensive background on exercise and Type 1 diabetes, JDRF's PEAK (T1D Performance in Exercise and Knowledge) education curriculum provides excellent resources ([source](https://www.jdrf.org/t1d-resources/peak/){: target="_blank" }), including this [article about exercise and T1D for athletes](https://www.jdrf.org/t1d-resources/living-with-t1d/exercise/){: target="_blank" }). -* bolusing (at a half dose) 30 to 60 minutes prior to activity to offset rise of blood glucose, delayed bolusing or adding post-workout cool-down (depending on conditions of rise) -* incorporating relaxation, breathing, visualization tools to address pre-workout emotional stress -* limiting pump disconnection time -* hydrating -* administering rapid-acting insulin (only under certain conditions) +??? abstract "Click to expand: Detailed JDRF Exercise Guidelines" + **With great exercise, comes great responsibility** -## Loop Considerations -With all of that background laid out, your Loop can help with some of the techniques described above. Highlighted in orange above are parts of those recommendations and considerations that we should explore a little more for Loop in particular: + It goes both ways: exercise affects glucose control; glucose control affects exercise. Consistent physical activity produces consistent insulin sensitivity, which helps the body process glucose more evenly (avoid spikes), maybe even improving HbA1c. -Risk for hypoglycemia can be reduced by avoiding too much insulin on board (IOB) during and after exercise. -- In Loop use, we can accomplish this through setting a workout target far enough ahead of the exercise to help decrease basal insulin on board going into exercise. Typically this means setting a workout target at least 1, if not 2, hours prior to exercise. Setting a workout target just as you begin a workout will not allow sufficient time to decrease IOB ahead of an aerobic workout. Loop workout targets are usually 50 mg/dL higher than your usual correction target, although that is a guide. Practice and observation of your typical exercise needs will help refine your optimal settings. And while not Loop specific, minimize heavy carb meals in the 3 hours before intense exercise that would require large boluses. If eating during that time, consider partial boluses and slower, lower carbohydrate snacks. If bolusing while workout targets are enacted, Loop will automatically recommend a smaller bolus than you would get with your normal correction target. + Some considerations: -After most exercise, insulin sensitivity is higher for up to 24 hours. Carbohydrates needed to replace liver glycogen levels must be balanced with decreased insulin levels.-- For Loop use, this period of increased insulin sensitivity may require continuing or setting a workout target for some period of time after exercise is finished. This will help manage increased sensitivity by providing smaller boluses and less basal delivery to prevent hypoglycemia that could result from unadjusted settings under traditional therapy. The length of time to run a continued post-workout target will depend on the duration and intensity of exercise. + * **Risk for hypoglycemia can be reduced by avoiding too much insulin on board (IOB) during and after exercise.** + * Continuous glucose monitors (CGMs) or regular blood glucose testing provides critical information to preemptively minimize blood-sugar highs and lows. + * Plan ahead! Reduce insulin and add carbs for aerobic (longer duration, lower intensity) exercise, which causes blood sugar to drop, or increase for anaerobic (short duration, high intensity), which may cause spikes. + * **After most exercise, insulin sensitivity is higher for 24 hours. Carbohydrates needed to replace liver glycogen levels must be balanced with decreased insulin levels.** + + **Intensity. Speed. Environment. Duration** . . . all affect the body’s reaction + + There are three types of exercise: + + * **Aerobic** + * Aerobic exercise is usually continuous, light-to moderate intensity exercise and includes activities like running, walking, long-distance swimming, biking or tennis. Aerobic exercise typically tends to lower blood glucose levels. + * **Anaerobic** + * Anaerobic exercise is generally shorter in duration, of maximal to super max intensity and includes activities like sprinting, gymnastic, ice hockey, or weight training. Anaerobic exercise typically tends to raise blood glucose levels. + * **Mixed** + * Mixed exercise is combination of the aerobic and anaerobic activity such as basketball or soccer. Managing blood glucose levels with mixed exercise is difficult, but using a tool like a continuous glucose monitor can help greatly. + + ![3 Types of Exercise Chart](img/3-types-of-exercise-chart.png){width="750"} + {align="center"} + + Glucose levels during sports affect performance in many ways: strength, stamina, speed, agility, flexibility, safety and mental sharpness. + + * Insulin resistance, which is when the body requires more insulin to process glucose, is a problem. Exercise combats this by increasing insulin sensitivity and glucose uptake by muscles. Muscles are better able to absorb glucose when contracted. + * Exercise thwarts postprandial (after-meal) hyperglycemia by slowing carbohydrate absorption, increasing glucose utilization and accelerating insulin action. + * Practice vs game day – each can have dramatically different effects on your T1D. Adrenaline and stress both raise blood glucose levels and are typically present on the day of your game or event. + + **Balancing Act: Finding your blood glucose zone and peak fitness zone** + + Caution: Delayed Onset Hypoglycemia can occur 6 to 12 hours (sometimes 24 hours) after exhaustive exercise, due to replenishment of muscle glycogen stores and enhanced insulin sensitivity. It is possible to prevent this by: + + * keeping records of your fitness regimen and the effects it has on your body + * using a CGM or frequent blood testing to monitor your body’s response to activity + * decreasing basal insulin or meal boluses after activity + * consuming slow-acting carbohydrates after activity + + Similar recording and monitoring tactics can be used to prevent hyperglycemia (blood-sugar highs). Some other options include: + + * bolusing (at a half dose) 30 to 60 minutes prior to activity to offset rise of blood glucose, delayed bolusing or adding post-workout cool-down (depending on conditions of rise) + * incorporating relaxation, breathing, visualization tools to address pre-workout emotional stress + * limiting pump disconnection time + * hydrating + * administering rapid-acting insulin (only under certain conditions) + +## Summary + +Exercise with Loop requires planning ahead: + +1. **Before**: Set override target 1-2 hours early to reduce IOB +2. **During**: Monitor CGM and adjust carbs/override as needed +3. **After**: Keep override active to manage increased insulin sensitivity + * Depending on the type of exercise, how accustomed your body is to exercise, and whether the Insulin Needs setting is adjusted in the override - you may need to turn off the override when you stop the exercise +4. **Learn**: Track what works for your specific exercise types and intensity levels diff --git a/docs/how-to/high-bg.md b/docs/how-to/high-bg.md index 3aacc4c..ee3b522 100644 --- a/docs/how-to/high-bg.md +++ b/docs/how-to/high-bg.md @@ -1,37 +1,74 @@ -# Stuck on High BG +# Stuck on High (Glucose) !!! info "Safety consideration" - If the continued delivery of corrective insulin fails to bring down high blood glucose, remember to follow your doctor's recommendations for ketone testing, hydration, and/or more frequent blood glucose monitoring. Check for equipment failure (infected pump site? blocked cannula?). Try fresh insulin. Contact your doctor immediately if you are experiencing sustained high blood glucose despite continued insulin delivery and corrections. + If the continued delivery of corrective insulin fails to bring down high glucose, remember to follow your doctor's recommendations for ketone testing, hydration, and/or more frequent glucose monitoring. Check for equipment failure (infected pump site? blocked cannula?). Try fresh insulin. Contact your doctor immediately if you are experiencing sustained high glucose despite continued insulin delivery and corrections. -*"How do I deal with high blood glucose that seems to be stuck?"* When you and your *Loop* are disagreeing about the effectiveness of high temporary basals to bring down blood glucose, take a deep breath. Unfortunately, most of the time our disagreement is rooted in the impatience that the pump's insulin works so dang slow. We get tired of waiting another 4-6 hours until blood glucose will be back in range after a correction. So before we start overriding Loop's predictions with manual actions, it may be useful to ask yourself some questions first to help guide potential corrective actions: +*"How do I deal with high glucose that seems to be stuck?"* -* Is this temporary or has this been going on for a long time? -* Is this consistently only after meals? -* Have you open loop tested your settings? -* Are you sick or stressed? -* Are you hormonal? -* Are you taking medication? -* Could this be caused by site failure or bad insulin? +> When you and your *Loop* are disagreeing about how much insulin you need to bring down a high glucose value, take a deep breath. Unfortunately, most of the time the disagreement is rooted in the impatience that the pump's insulin works so dang slow. We get tired of waiting another 4-6 hours until glucose will be back in range after a correction. -Based on the answers to those questions, you may want to choose on of the potential solutions for delivering extra insulin to help: +## Decision Guide: What to Try First -* Setting lower temporary blood glucose targets -* Providing the "pending" insulin upfront via correction bolus -* Adjusting meal entries -* Fake carbohydrates -* Priming in insulin -* Open loop and correct manually -* Adjust settings +Before we start overriding Loop's predictions with manual actions, ask yourself these questions to help guide potential corrective actions: + +### 1. First, Rule Out Equipment Issues + +**Could this be caused by site failure or bad insulin?** + +- ✅ **Try first**: Check pump site, replace if needed, try fresh insulin +- See [Site Failure](site-fail.md){: target="_blank" } for details + +### 2. Is This Meal-Related? + +**Is this consistently only after meals? Did I underestimate carbs?** + +- ✅ **Try first**: [Adjust meal entries](#adjusting-meal-entries) to reflect actual carbs +- Alternative: [Provide pending insulin as bolus](#pending-insulin-as-bolus) to speed correction +- Alternative 2: If this happens frequently, you may need to [adjust your settings](../settings/adjust.md){: target="_blank" } + +### 3. Is This Short-Term? (Hours to 1-2 days) + +**Are you sick or stressed? Acute illness? Anaerobic exercise?** + +- ✅ **Try first**: [Set lower temporary override targets](#lower-temporary-targets) +- Alternative: [Provide pending insulin as bolus](#pending-insulin-as-bolus) to speed correction +- Alternative 2: [Use an override](overrides.md){: target="_blank" } for the current situation + +### 4. Is This Medium-Term? (Several days) + +**Are you hormonal? Taking medication (like steroids)?** + +- ✅ **Try first**: [Adjust settings](#adjust-settings) - increase basal rates by ~10% +- Can use overrides temporarily while testing new settings + +### 5. Is This Long-Term or Unexplained? + +**Has this been going on for a long time? Happens even overnight? Have you open loop tested your settings?** + +- ✅ **Try first**: [Adjust settings](#adjust-settings) - likely need basal increase +- Consider: you may need to [adjust your settings](../settings/adjust.md){: target="_blank" } + +### 6. Is IRC Enabled? + +**The Integral Retrospective Correction (IRC) option can handle some glucose excursions.** + +- ✅ **Safety first**: [LoopDocs IRC](https://loopkit.github.io/loopdocs//loop-3/features/#integral-retrospective-correction-irc) - if you have never used IRC, please read up on it in LoopDocs +- It is likely you will need to modify your settings - in general, the ISF folks need when IRC is enabled tends to be about 10% larger (weaker) of a number than when IRC is disabled + + +--- + +## Solutions in Detail (Ordered by Common Usage) ## Lower temporary targets -If you to believe the high blood glucose is a short-term issue, due to acute stress or anaerobic exercise for example, then using temporary lower override targets will help *Loop* be more aggressive at providing additional insulin. The pre-meal target would be a quick, easy implementation of this tool. +If you to believe the high glucose is a short-term issue, due to acute stress or anaerobic exercise for example, then using temporary lower override targets will help *Loop* be more aggressive at providing additional insulin. The pre-meal target would be a quick, easy implementation of this tool. -This technique, and the delivery pending insulin as a bolus (described below), are good to help control the urge to "rage" bolusing which often yields an overcorrection and subsequent low blood glucose. These two techniques used in combination are often successful for most short-term situations or meals that are just taking a long time to "burn out". +This technique, and the deliver [pending insulin as a bolus](#pending-insulin-as-bolus), are good to help control the urge to "rage" bolus which often yields an overcorrection and subsequent low blood glucose. These two techniques used in combination are often successful for most short-term situations or meals that are just taking a long time to "burn out". ## Pending insulin as bolus -To help correct a high blood glucose, *Loop* will apply a high temporary basal set to deliver over 30 minutes time. If you are stuck on a high blood glucose and want to speed up the correction, you can try to "hurry" along the correction by opening Loop's bolus tool. Within the information screen, you will see a "pending insulin" amount. That amount represents the amount of corrective insulin *Loop* plans on delivering with the currently running 30-minute temporary basal. You can choose to manually enter in that amount on the bolus deliver line as an upfront correction bolus rather than waiting for it to be delivered over the next 30 minutes. This generally represents a pretty easy, safe way to help reasonably speed up a correction. +To help correct a high glucose, *Loop* will apply a high temporary basal set to deliver the recommended dose over 30 minutes time when using `Temp Basal Only` strategy or a fraction of the recommended dose every 5 minutes when using Automatic Bolus strategy. If you are stuck on a high glucose and want to speed up the correction, you can try to "hurry" along the correction by opening Loop's bolus tool. Within the information screen, you will see a "pending insulin" amount. That amount represents the amount of corrective insulin *Loop* plans on delivering. You can choose to manually enter in that amount on the bolus deliver line as an upfront correction bolus rather than waiting for it to be delivered. This generally represents a pretty easy, safe way to help reasonably speed up a correction. The safety consideration for this is that you do not want to unintentionally stack insulin by using this technique repeatedly in a short period of time. Wait a reasonable amount of time, such as an hour or two, to give insulin a chance to start to affect blood glucose. If the correction still hasn't helped, you may want to consider another technique to help bring down blood glucose. @@ -41,32 +78,45 @@ Carbohydrate, fat, and protein estimations for bolusing are frequently a guessin ## Fake Carbohydrates -Some people use "fake" carbohydrate entries to push *Loop* to be more aggressive with correcting a high blood glucose. This can be effective for hyperglycemia due to short-term causes but is not the recommended way of repeatedly dealing with high blood glucose. If you find yourself regularly using fake carbohydrates often, you may want to consider whether one of your underlying settings needs adjusting. +Some people use "fake" carbohydrate entries to push *Loop* to be more aggressive with correcting a high glucose. This can be effective for hyperglycemia due to short-term causes but is not the recommended way of repeatedly dealing with high glucose. If you find yourself regularly using fake carbohydrates often, you may want to consider whether one of your underlying settings needs adjusting. -## Prime insulin +## Inject or Use Afrezza -If your Preferred Data Source is left on the default "Event History", *Loop* will not count insulin delivered from "prime" commands in the Medtronic pump. This means that any insulin you deliver through your infusion set while using the prime delivery will not count towards active insulin or insulin on board (IOB). +You can always take an injection. Or if you use Afrezza, take that. -If you think that you are being affected by a short-term influence that will last for at least 4-6 hours, a conservative amount of primed insulin may help control high blood sugar more aggressively than *Loop* would have otherwise provided during the stressful event. +Typically you want to tell [Loop system about the extra insulin](https://loopkit.github.io/loopdocs//loop-3/features/#non-pump-insulin). But that is a personal choice. -**If you choose to deliver insulin via prime command, remember that your active insulin or IOB will not be accurate for 6 hours after the delivery.** Caution should be taken using this method because if the short-term stress suddenly ends and blood glucose begins to drop again, the drop may be more pronounced than *Loop* predicts due to the untracked primed insulin. +## Prime insulin (Medtronic pumps only) -Note: For Omnipod users, *Loop* does not allow you to prime insulin in. +!!! warning "Medtronic-Specific Technique" + This technique only applies to Medtronic pump users. Omnipod users cannot use this method. + + For others, see [Inject or Use Afrezza](#inject-or-use-afrezza) + +If your Preferred Data Source is left on the default "Event History", *Loop* will not count insulin delivered from "prime" commands in the Medtronic pump. This means that any insulin you deliver through your infusion set while using the prime delivery will not count towards active insulin or insulin on board (IOB). + +If you think that you are being affected by a short-term influence that will last for at least 4-6 hours, a conservative amount of primed insulin may help control high glucose more aggressively than *Loop* would have otherwise provided during the stressful event. + +**If you choose to deliver insulin via prime command, remember that your active insulin or IOB will not be accurate for 6 hours after the delivery.** Caution should be taken using this method because if the short-term stress suddenly ends and glucose begins to drop again, the drop may be more pronounced than *Loop* predicts due to the untracked primed insulin. ## Open loop and correct manually -Don't forget that you can always go old-school and open your Loop until the cause of the high blood glucose is sorted out and you can get back to normal operations. Site failures are an especially good example of when open looping plus manual correction may be a less frustrating way of dealing with *Loop* during times when prediction just isn't meeting reality. Give IOB a chance to get back to reality by letting open loop run for 4-6 hours and you'll come back after site failure with a more functional *Loop* prediction. +Don't forget that you can always go old-school and open your Loop until the cause of the high glucose is sorted out and you can get back to normal operations. Site failures are an especially good example of when open looping plus manual correction may be a less frustrating way of dealing with *Loop* during times when prediction just isn't meeting reality. Give IOB a chance to get back to reality by letting open loop run for 4-6 hours and you'll come back after site failure with a more functional *Loop* prediction. ## Adjust settings Finally, if your underlying cause doesn't appear to be short-term (no site failures, no stressful event, no illness) or food-related (no recent meals, happens even overnight), then you may need to adjust your underlying settings to help *Loop* get a more accurate prediction curve working for you. -Long duration "stuck" high blood glucose most often means you'll need to increase your underlying basal rate(s). If Loop's high temporary basals aren't making meaningful progress towards your correction range within 4-6 hours, and you don't suspect food, stress, or site failure, then a basal increase is likely a good place to start. Many people start with a 10% basal adjustment to begin with and wait to see the effectiveness before making any additional adjustments. +Long duration "stuck" high glucose most often means you'll need to increase your underlying basal rate(s). If Loop's high temporary basals aren't making meaningful progress towards your correction range within 4-6 hours, and you don't suspect food, stress, or site failure, then a basal increase is likely a good place to start. Many people start with a 10% basal adjustment to begin with and wait to see the effectiveness before making any additional adjustments. What kind of situations are most likely to need this adjustment? Monthly hormonal cycles and steroids are good examples of when underlying basal rate adjustments for a few days could help tremendously until things return to normal. +With children, settings adjustments may be required frequently. + Consult your healthcare provider if you are at all uncomfortable self-adjusting basal rates. -## Maximum basal rate +For more details: see [adjust your settings](../settings/adjust.md){: target="_blank" }. + +## Maximum Basal Rate -It is worth mentioning one adjustment that will *not* be helpful in these situations. Increasing your maximum basal rate is very unlikely to resolve a stuck high blood glucose. Stuck high blood glucose is the result of Loop predicting that the insulin on board is sufficient to cover the needed correction. The issue is almost never that *Loop* is being limited by a maximum basal rate but rather that *Loop* is predicting that the insulin it has been delivering for awhile is adequate. In other words, *Loop* doesn't even think that it needs to reach that maximum basal rate. The better adjustment would be to increase your scheduled basal rates and not the maximum basal rate listed in Delivery Limits. +It is worth mentioning one adjustment that will *not* be helpful in these situations. Increasing your maximum basal rate is very unlikely to resolve a stuck high glucose. Stuck high glucose is the result of Loop predicting that the insulin on board is sufficient to cover the needed correction. The issue is almost never that *Loop* is being limited by a maximum basal rate but rather that *Loop* is predicting that the insulin it has been delivering for awhile is adequate. In other words, *Loop* doesn't even think that it needs to reach that maximum basal rate. The better adjustment would be to increase your scheduled basal rates and not the maximum basal rate listed in Delivery Limits. diff --git a/docs/how-to/iob.md b/docs/how-to/iob.md index bbd7ae5..0b80d09 100644 --- a/docs/how-to/iob.md +++ b/docs/how-to/iob.md @@ -1,6 +1,6 @@ # Using Morning IOB -One of the easiest habits to help check your settings is to simply check-in on your morning blood glucose and active insulin (IOB). Check if you are (1) above, below, or within target range and (2) carrying significant positive or negative IOB in the morning before you start walking around (if you are prone to dawn phenomenon) or eating. Since mornings are free from food influence, these are almost like waking up from a mini-basal testing every overnight. +One of the easiest habits to help check your settings is to simply check-in on your morning blood glucose and active insulin (IOB). Check if you are (1) above, below, or within correction range and (2) carrying significant positive or negative IOB in the morning before you start walking around (if you are prone to dawn phenomenon) or eating. Since mornings are free from food influence, these are almost like waking up from a mini-basal testing every overnight. This Looped group post started the conversation: @@ -15,7 +15,7 @@ This Looped group post started the conversation: ![Looped1](img/looped1.jpg){width="300"} {align="center"} -To illustrate how to use morning IOB and blood glucose to check your basal rates, we will walk through a series of screenshots from a recent Loop experience. When the Looper woke up, she was below her 95 mg/dL target, but relatively steady. At about 8:48am, Nightscout showed negative IOB of -1.33 units, blood glucose of 90 mg/dL and slightly rising but still below a target of 95 mg/dL. (Note: this situation is similar to what the original Facebook poster above was describLooped2](ing.) +To illustrate how to use morning IOB and blood glucose to check your basal rates, we will walk through a series of screenshots from a recent Loop experience. When the Looper woke up, she was below her 95 mg/dL target, but relatively steady. At about 8:48am, Nightscout showed negative IOB of -1.33 units, blood glucose of 90 mg/dL and slightly rising but still below a target of 95 mg/dL. (Note: this situation is similar to what the original Facebook poster above was describing.) ![Looped2](img/looped2.jpg){width="750"} {align="center"} diff --git a/docs/how-to/low-treat.md b/docs/how-to/low-treat.md index 35242e1..d8feac5 100644 --- a/docs/how-to/low-treat.md +++ b/docs/how-to/low-treat.md @@ -1,25 +1,32 @@ # Low Treatments -Low blood glucose will still inevitably happen at some point, even with Loop use. A difficult carb count, illness, equipment malfunction, exercise...you name it, eventually something will help to cause a low blood glucose. +Low blood glucose will still inevitably happen at some point, even with OS-AID use. A difficult carb count, illness, equipment malfunction, exercise...you name it, eventually something will help to cause a low glucose. ## How to Treat -Overall, most people find that they can treat low blood glucose with fewer rescue carbohydrates than they previously used to. Since typically Loop will have been suspending your basal insulin before a low has been reached, you will typically have less IOB to overcome with carbohydrates. In other words, Loop takes some of the momentum out of an upcoming blood glucose dip...which also makes it easier to pull up from declining blood glucose. -If you notice that your old way of treating low blood glucose is leading to rebound blood glucose greater than you expect/desire, eventually consider decreasing the amount of carbohydrates you use to treat predicted/upcoming low blood glucose. +Overall, most people find that they can treat low glucose with **fewer rescue carbohydrates** than they needed before using a hybrid-closed loop system. Typically your OS-AID suspends your basal insulin before a low has been reached; consequently, you have less insulin on board (IOB) to overcome with carbohydrates. In other words, your OS-AID takes some of the momentum out of an upcoming glucose dip...which also makes it easier to pull up from declining glucose. + +If you notice that your old way of treating low glucose is leading to rebound glucose greater than you expect/desire, eventually consider decreasing the amount of carbohydrates you use to treat predicted/upcoming low glucose. + +!!! tip "Why Loop Prevents Deeper Lows" + As explained in [Think Like a Loop](think-like-loop.md), Loop suspends insulin delivery (Action 1) when ANY part of your predicted glucose curve goes below your suspend threshold. This early suspension is why you typically need fewer carbs to treat lows with Loop. ## Logging Low Treatments -Another common question for new Loop users is whether to enter the carbohydrates used to treat a low blood sugar. The answer is that there is not a great agreement across all Loop users on how to deal with low treatment entries. The decision is dependent, often, on factors not just about the Loop algorithm; factors such as extra effort, use of OpenAPS's autotune (which needs all carbohydrate inputs to do a better estimation), or desire to have more thorough clinical records. +Another common question for new OS-AID users is whether to enter the carbohydrates used to treat a low blood sugar. The answer is that there is not a great agreement on how to deal with low treatment entries. The decision is dependent, often, on factors not just about the OS-AID algorithm; factors such as extra effort, use of OpenAPS's autotune (which needs all carbohydrate inputs to do a better estimation), or desire to have more thorough clinical records. + +For the most part, you do not *have* to enter low treatments. Not logging low treatments will work out pretty well if you are not overtreating the low and you have your ISF pretty well determined. In the event you overtreat lows and your ISF value is too low, your OS-AID may be more likely to overtreat rebound situations. -For the most part, you do not *have* to enter low treatments. Not logging low treatments will work out pretty well if you are not overtreating the low and you have your ISF pretty well determined. In the event you overtreat lows and your ISF value is too low, your Loop may be more likely to overtreat rebound situations. +One rule of thumb is that if you know you over-treated a low, and you normally log carbohydrates, then log the "extra" that you consumed. ## Roller Coaster after Low Treatment -If you are roller coastering blood glucose after treating lows (going low, quick rise from the treatment carbs, then drop again from Loop's high temporary basals during the rise, and then repeating pattern), here are some tips: +If you are roller coastering glucose after treating lows (going low, quick rise from the treatment carbs, then drop again from Loop's high temporary basals during the rise, and then repeating pattern), here are some tips: + +1. **While treating the low glucose**, try setting a temporary [override target](overrides.md) higher than your normal target with for an hour to help keep Loop from aggressively treating a rebound. + +2. **Consider adjusting insulin needs in your override** When changing the insulin needs you are decreasing the effective scheduled basal rate and increasing (making weaker) the insulin sensitivity factor and carb ratio [Low Override](overrides.md#low-override) -* While treating the low blood sugar, try setting a temporary workout target of an hour to help keep Loop from aggressively treating a rebound. -* Consider lowering your maximum basal rate in Loop (within the Delivery Limits setting). This will limit Loop's ability to aggressively treat the rebound rise and allow you to work on getting your settings adjusted if needed. -* Consider raising your ISF value (for example, if your ISF is set to 50, consider raising the value to 55) to help Loop understand that a smaller magnitude of insulin adjustment is needed. In other words, tell Loop that insulin is packing a bigger punch than you'd previously thought. If your ISF is set to a value that is too low compared to what it really should be, one of the most common symptoms you'll see is a roller coaster of blood glucose where the temporary basals are cycling between zero and strong high temporary rates. Here are some example graphs from *Looped* group. These are examples where too low of ISF is more than likely a large factor in the roller coaster (doesn't mean it is the only culprit and is more difficult to ferret out when food is involved like the second graph).  But, lightning bolt high temporary basals followed by very quick blood glucose drops and zero temps is usually too low of ISF value...raise the ISF value (e.g., go from 50 to 55) to help Loop know that each unit of insulin is actually having more impact than you'd previously thought. diff --git a/docs/how-to/overrides.md b/docs/how-to/overrides.md index 45d8345..1cd5e50 100644 --- a/docs/how-to/overrides.md +++ b/docs/how-to/overrides.md @@ -1,8 +1,33 @@ # Override Targets -Your Loop has two override targets that you can set; *Pre-meal* and *Workout*. When activated, these targets will "override" or take the place of your usual correction range and therefore will affect Loop's decisions about insulin delivery. +Your Loop has two override icons you can select from the main toolbar: *Pre-meal* and *Custom Preset*. When activated, these targets will "override" or take the place of your usual correction range and therefore will affect Loop's decisions about insulin delivery. -You can set the value for these override targets from the Correction Range area of Loop settings. Generally speaking, pre-meal targets are set to value(s) lower than your correction range, and workout targets are set to value(s) greater than your correction range. *Loop* will indicate that an override target is active by showing a darker blue bar on the blood glucose chart showing the duration and location of the target. +* The *Pre-meal* icon can be configured to choose a target as low as the glucose safety range +* The [*Custom Preset*](https://loopkit.github.io/loopdocs/operation/features/overrides/) icon allows you select an existing named preset or create a new one + * *Custom presets* allow you to adjust the target or the insulin needs sensitivity or both and provide a name so you can save and reuse that preset again. + +* In an older version of Loop (version 1.9), and for the *twiist* commercial system, the *Custom Preset* icon is used for the *Workout* feature which only enables the user to change the target and not the insulin sensitivity. + +*Loop* will indicate that an override target is active by showing a darker blue bar on the glucose chart showing the duration and location of the target. + +You can set the value for the *Pre-meal* targets from the Correction Range area of Loop settings. Generally speaking, *pre-meal* targets are set to value(s) lower than your correction range. + +A *Custom Preset* can be created or edited by tapping on the heart icon when no preset is active. + +* If a *Custom Preset* is active, it can be edited by tapping on the name of the preset in the heads-up display (HUD) + +!!! tip "Why Override Targets Work" + Remember from [Think Like a Loop](think-like-loop.md): Loop makes all decisions based on your predicted glucose curve relative to your correction range. By changing the correction range temporarily with an override, you change how Loop responds. Lower targets make Loop more aggressive; higher targets make Loop more conservative. + +!!! tip "What happens when the `Insulin Needs` setting is modified" + When the `Insulin Needs` setting is modified in a *Custom Preset*, the effective basal rate (U/hr), ISF and CR are all adjusted in parallel. See the example table below using a pump that can delivery an increment of 0.05 U/hr scheduled basal rate using units associated with mg/dL. + + | Insulin Need | Basal Rate
U/hr | ISF | CR | Comment | + |--:|:-:|--:|--:|:--| + | 100% | 1.00 | 100 | 15 | Standard Therapy | + | 90% | 0.90 | 111 | 16.7 | need less insulin than normal
more sensitive | + |120% | 1.20 | 83 | 12.5 | need more insulin than normal
less sensitive | + ## Pre-Meal Targets @@ -24,7 +49,11 @@ Pre-meal target won't replace the utility of a true pre-bolus in most situations * During illness that is causing high blood glucose -## Workout Targets +## Custom Presets (OS-AID Loop v2 and newer) + +The **Custom Presets**, often referred to as Overrides, offered with Loop starting with version 2.0, 31 December 2019, are significantly more flexible than the original Workout Targets. Please refer to [LoopDocs Overrides](https://loopkit.github.io/loopdocs/operation/features/overrides/). + +## Workout Targets (commercial *twist*) The workout target, when activated, will give a duration choice of 1 hour, 2 hours, or indefinitely. The workout target set greater than your usual correction range is useful to help in situations where Loop needs to be *less* aggressive with insulin delivery. The most common use of the workout target is to set it in advance and during exercise to help minimize IOB going into a workout. While the name is a hint to the most common timing of this override's use, there are other times when it can be helpful, such as: diff --git a/docs/how-to/site-fail.md b/docs/how-to/site-fail.md index 2593eca..69c2373 100644 --- a/docs/how-to/site-fail.md +++ b/docs/how-to/site-fail.md @@ -11,6 +11,13 @@ Open loop mode is a first line of defense during this situation. By open looping ![insulin percent remaining](img/insulin_percent_remaining.png) +## Injections or Afrezza +You can take an injection to make up some of the missing insulin from the site failure. Or if you use Afrezza, take that. Often people choose to take non-pump insulin equal to a fraction of the IOB that Loop thought was present but was not actually absorbed. + +When recovering from a site failure, you may choose not to let the [Loop system about the extra insulin](https://loopkit.github.io/loopdocs//loop-3/features/#non-pump-insulin). But that is a personal choice. + + + ## Prime Insulin If you are more certain about how much insulin is missing from your Loop's tracking of active insulin, you can choose to deliver insulin using the "prime" delivery function in your Medtronic pump while having your tubing connected to the new, working infusion site. Assuming you are using a Preferred Data Source set to Event History (most people are since this is the default setting), then prime insulin is not counted towards active insulin. In this way, you can deliver insulin to make up for some of the insulin that Loop had thought had been delivered (but wasn't). diff --git a/docs/how-to/think-like-loop.md b/docs/how-to/think-like-loop.md index a33eab4..aa31985 100644 --- a/docs/how-to/think-like-loop.md +++ b/docs/how-to/think-like-loop.md @@ -1,4 +1,4 @@ -# Think Like a Loop +# Think Like a `Loop` “Why isn’t *Loop* giving me more?” That is a common question from new Loopers. @@ -7,13 +7,13 @@ For these questions, you'll go really far in Looping if you can remember these two things: 1. Go to therapy with your *Loop* -2. Everything depends on the predicted BG curve +2. Everything depends on the predicted glucose curve -## Therapy with Loop +## Therapy with `Loop` I'll challenge you to "pretend you're at the marriage therapist" as you learn how to use *Loop* as a partner. -Why are you in disagreement with your partner? What would a therapist tell you? Usually, therapy is because of miscommunications with each other. You aren't on the same expectations or priorities. The same applies to *Loop*. For example, you'd be at the therapist's chair telling her "*Loop* just isn't treating my high BG as fast as I want. This is so frustrating. I correct and *Loop* just suspends." That right there is the definition of miscommunications and different priorities. Why? +Why are you in disagreement with your partner? What would a therapist tell you? Usually, therapy is because of miscommunications with each other. You aren't on the same expectations or priorities. The same applies to *Loop*. For example, you'd be at the therapist's chair telling her "*Loop* just isn't treating my high glucose as fast as I want. This is so frustrating. I correct and *Loop* just suspends." That right there is the definition of miscommunications and different priorities. Why? ➡️ *Loop* thinks you have enough insulin to be at target later. @@ -21,11 +21,11 @@ Why are you in disagreement with your partner? What would a therapist tell you? So...look at the objectives and info you both have at hand. -*Loop* has the info from the settings you’ve given it, how you’ve described your meals, and how you’ve given insulin. *Loop* does not know if you are stressed. *Loop* does not know if you are sick. *Loop* is not a rage bolus machine and is predicting 6 hours out to safely bring you down without you needing to prevent a low while it does that. *Loop* is considerate partner. It respects your input and acts gentle and even-keeled. +*Loop* has the info from the settings you’ve given it, how you’ve described your meals, and how you’ve given insulin. *Loop* **does not** know if you are stressed. *Loop* **does not** know if you are sick. *Loop* **is not** a rage bolus machine. *Loop* **is** predicting 6 hours out to safely bring you down without you needing to prevent a low while it does that. *Loop* **is** considerate partner. *Loop* **respects** your input and acts gentle and even-keeled. If you are frustrated with Loop’s actions now...that means you told it the wrong info previously (or are lacking some patience that *Loop* has). Most often either your meal entry was wrong or your basals or...something else you’ve told *Loop* has ended up being incorrect. -Fixing that miscommunication will allow *Loop* to do a better job. +**Fixing that miscommunication will allow *Loop* to do a better job.** If you misjudged a meal, go back and edit that meal entry. @@ -37,89 +37,108 @@ If you aren’t patient, you can override *Loop*...but do expect that is not lik ## Tools when you are in disagreement -Sure, even with the best therapist, you may still have disagreements. They happen. There are several options for recovering from times like that. The tool you choose may be situationally dependent. Seeing a huge quick BG climb after a meal may be better helped by a carb entry edit as opposed to added patience, but that will depend on your management style. +Sure, even with the best therapist, you may still have disagreements. They happen. There are several options for recovering from times like that. The tool you choose may be situationally dependent. Seeing a huge quick glucose climb after a meal may be better helped by a carb entry edit as opposed to added patience, but that will depend on your management style. 1. Add some patience to your practice. A little patience to give the already added insulin time to work can help with *Loop*. 2. Edit your meal's carb entry. If you find your meal going crazy different than expected (did they forget you said "diet" coke?), you can always go back and edit your original carb guess to be more accurate based on what you're seeing. You can decrease the carbs or increase the carbs. You can change the absorption time. These edits can be done by tapping on the carb chart on Loop's main screen. 3. Use overrides to tell *Loop* about overall insulin needs changing. Hormones...oh lordy the hormones are horrible. That's a good time to use an override to let *Loop* know that overall you need more than usual. Or if you're about to hike the Himalayas, use an override to let *Loop* know you will need far less insulin than an average day. 4. Open Loop. This is a great tool. If you just had things go really wrong for a bit (bad cannula kink anyone?) then you can open the loop until things settle down and you get squared away again. Give your manual injection, Afreeza, or whatever your desire is, and wait until you've had 4-6 hours of regular basals going before closing the loop again. -5. Give pending insulin. If you are really feeling the itch to rage bolus, you can meet *Loop* at the halfway mark. If you click on the bolus tool while *Loop* is high temping you, you will see a "pending insulin" value. That is the amount of insulin *Loop* is planning on giving you through temp basals over the next 30 minutes. If you give that pending insulin total as a bolus now, you will get the entire amount working faster AND *Loop* agrees you are safe to use it. In this way, *Loop* won't automatically suspend insulin when you give pending insulin...because your predicted BG curve had said it was needed anyways. Win-win...you got a mini-rage bolus and *Loop* won't be working against you. Good therapy and a good way to avoid post-rage lows. +5. Give pending insulin. If you are really feeling the itch to rage bolus, you can meet *Loop* at the halfway mark. If you click on the bolus tool while *Loop* is high temping you, you will see a "pending insulin" value. That is the amount of insulin *Loop* is planning on giving you through temp basals over the next 30 minutes. If you give that pending insulin total as a bolus now, you will get the entire amount working faster AND *Loop* agrees you are safe to use it. In this way, *Loop* won't automatically suspend insulin when you give pending insulin...because your predicted glucose curve had said it was needed anyways. Win-win...you got a mini-rage bolus and *Loop* won't be working against you. Good therapy and a good way to avoid post-rage lows. -## Predicted BG curve is everything +## Predicted glucose curve is everything As you start to use *Loop* you will probably find yourself wondering at some point "Why is it suspending insulin right now?" or "Why isn't it giving me increased basals right now?" You might find yourself reverting to a bunch of old-school habits like looking at your carbs on board or insulin on board and trying to calculate a bunch of numbers. Stop there...that's so 1990s. You're a looper now and there is actually an easier way to assess things. -!!! danger "**Thinking like a Loop involves just three things**" -

- ➡️ Predicted BG curve

- ➡️ Correction Range

- ➡️ Suspend Threshold


-

+!!! question "**Thinking like a Loop involves these three things**" + ➡️ Predicted glucose curve
+ ➡️ Correction Range
+ ➡️ Glucose Safety limit
-All of Loop's decisions are based on what your predicted BG curve is doing with respect to your correction range and suspend threshold. That's it. All the time. Everytime. It always comes down to that predicted BG curve. +All of Loop's decisions are based on what your predicted glucose curve is doing with respect to your correction range and glucose safety limit. That's it. All the time. Everytime. It always comes down to that predicted glucose curve. -That predicted BG curve has four contributions to its shape: +That predicted glucose curve has four contributions to its shape: -1. Carbs (the ones you've told it about)

-2. Insulin (the ones you've given through your pump or recorded in the Health app)

-3. Blood glucose momentum (how fast your BG has been changing recently)

-4. Retrospective correction (how accurate/inaccurate *Loop* has been recently in predicting your BGs)

+1. **Carbohydrates** (the ones you've told *Loop* about) +2. **Insulin** (the amount you've given through your pump or recorded as non-pump insulin or in the Health app) +3. **Glucose momentum** (how fast your glucose has been changing recently) +4. **Retrospective correction** (how accurate/inaccurate *Loop* has been recently in predicting your glucose) or, if enabled, **Integral Retrospective correction** (uses a longer term view of difference between what *Loop* predicted compared to what your glucose readings actually were) -*Loop* models the inputs from those four contributions to form the final shape of the predicted BG curve. Once that curve is generated, *Loop* looks at where the entire curve will be for the next 6 hours relative to your suspend threshold and correction range, and take one of four actions: +*Loop* models the inputs from those four contributions to form the final shape of the predicted glucose curve. Once that curve is generated, *Loop* looks at where the entire curve will be for the next 6 hours relative to your glucose safety limit and correction range, and take one of four actions: -**Action 1: Set a 0 u/hr basal rate (aka suspend basals)** +### `Loop's` Four Actions Summary -*Loop* will do this anytime your predicted BG curve has any portion that goes below your suspend threshold. +| Predicted Glucose Scenario | `Loop` Action | Reasoning | +|----------------------|-------------|-----------| +| **Any part** below glucose safety limit | **Suspend**
(0 U/hr) | Safety first - prevent low glucose | +| **All** within range OR eventual glucose above range but **dips below** correction range | **Scheduled basal** | Wait-and-see: maintain insulin but don't risk going low | +| **All** above low end of the correction range | **Increased basal** or

**Scheduled basal** + **Automatic Bolus**| Bring glucose down to target | +| **Eventual glucose** below correction range | **Decreased basal** | Prevent predicted low glucose | -And the remaining three actions all assume NONE of your predicted BG curve is below suspend threshold, otherwise you'd be in Action 1. +**Important:** The remaining three actions all assume NONE of your predicted glucose curve is below glucose safety limit, otherwise you'd be in Action 1 (suspend). -**Action 2: Set scheduled basal rate** +**Action 1: Set a 0 U/hr basal rate (aka suspend basals)** -*Loop* will set your scheduled basal rate when: +*Loop* will do this anytime your predicted glucose curve has any portion that goes below your glucose safety limit. -1. All the predicted BG curve is within the correction range, including the very last value which is called your "eventual BG", or when -2. If the eventual BG is above your correction range in 6 hours, but there's a dip below the correction range earlier in the curve. +**Action 2: Return to scheduled basal rate** -**Action 3: Increased basal rate** +*Loop* will return to your scheduled basal rate when: -If the eventual BG and all the predicted BG curve is above your correction range, *Loop* will give you a high (increased) temp basal. +1. All the predicted glucose curve is within the correction range, including the very last value which is called your "eventual glucose", or when +2. If the eventual glucose is above your correction range in 6 hours, but there's a dip below the correction range earlier in the curve. + +**Action 3: Provide increased insulin delivery** + +If the eventual glucose and all the predicted glucose curve is above the low-end of your correction range, *Loop* will provide additional insulin: + +* For Dosing Strategy: Temp Basal Only: `Loop` will give you a high (increased) temp basal +* For Dosing Strategy: Automatic Bolus: `Loop` provides scheduled basal with a fraction of the recommended insulin delivered and recalculated with each new glucose reading **Action 4: Decreased basal rate** -If your eventual BG in 6 hours is below the correction range, you'll get a decreased basal. +If your eventual glucose in 6 hours is below the correction range, you'll get a decreased basal. ## What would Loop do? Test your new found skills...let's play a game where you try to guess the action... -!!! warning "What would *Loop* do?" - It’s 8pm and your predicted BG curve looks like the following. What do you expect *Loop* to recommend/enact at 8pm?

- A. Zero (suspend) temp basal

- B. Scheduled basal from your settings

- C. High temp basal

- D. Lower temp basal (between zero and scheduled)


+!!! question "What would *Loop* do?" + It's 8pm and your predicted glucose curve looks like the following. What do you expect *Loop* to recommend/enact? For this case the glucose safety limit was allowed to be set to 60 mg/dL. + + A. Zero (suspend) temp basal
+ B. Scheduled basal from your settings
+ C. High temp basal (or auto bolus)
+ D. Lower temp basal (between zero and scheduled)
+ ![wwld1](img/wwld1.png){width="650"} {align="center"} -

-What would your answer be?  Before you give your final answer...consider this next twist.  Would you give the same answer to this graph as you gave the graph above?  If not, what would the answer be for this graph and why? (ignore the timestamp mismatch

-![wwld2](img/wwld2.jpg){width="650"} -{align="center"} +The answer is below but ...consider this next twist.  -This second case has a dramatic drop happening.  Suspend threshold is still at 60 mg/dL, the correction range is still 90-110, the lowest value on the predicted BG chart is 75 mg/dL, and the eventual BG is 171 mg/dL for this example.  So, pretty similar to the first example except for this precipitous drop going on right now. +!!! question "What would *Loop* do now?" + + Would you choose A, B, C or D for this graph? The glucose safety limit is still 60 mg/dL. + + ![wwld2](img/wwld2.jpg){width="500"} + {align="center"} + +This second case has a dramatic drop happening.  safety limit is still at 60 mg/dL, the correction range is still 90-110, the lowest value on the predicted glucose chart is 75 mg/dL, and the eventual glucose is 171 mg/dL for this example.  So, pretty similar to the first example except for this precipitous drop going on right now. Let me tell you some of the common pitfalls we all can easily slip into when trying to answer these "Why is *Loop* giving me this basal?" questions. -Wondering about IOB, COB, or DIA in order to answer...those aren't a factor in answering the question as they have already been used to make the predicted BG curve.  In other words, they are accounted for already in the information presented.  All you need to answer this question is provided by the predicted BG curve, your suspend threshold, and your correction range. -Thinking about this as a human...humans tend to say "Well, I'm on a rise/fall right now so...[insert Loop action based on that]" *Loop* isn't looking at the past BG movement alone, instead, it's looking at the prediction curve ahead and applying its rules based on that.  Any drop or rise going on will have been added to the predicted curve through the BG momentum and retrospective correction components of the algorithm...so again they're already incorporated into the predicted curve. +Wondering about IOB, COB, or DIA in order to answer...those aren't a factor in answering the question as they have already been used to make the predicted glucose curve.  In other words, they are accounted for already in the information presented.  All you need to answer this question is provided by the **predicted glucose curve**, your **glucose safety limit**, and your **correction range**. + +Thinking about this as a human...humans tend to say "Well, I'm on a rise/fall right now so...[insert Loop action based on that]" *Loop* isn't looking at the past glucose movement alone, instead, it's looking at the prediction curve ahead and applying its rules based on that.  Any drop or rise going on will have been added to the predicted curve through the glucose momentum and retrospective correction components of the algorithm...so again they're already incorporated into the predicted curve. + +Restating for emphasis:  **All you need to answer this question is provided by the predicted glucose curve, your glucose safety limit, and your correction range.** -Restating for emphasis:  All you need to answer this question is provided by the predicted BG curve, your suspend threshold, and your correction range. +For both situations above, the answer is B. -The answer is B:  *Loop* will give your scheduled basal in both situations shown above.  When your predicted BG curve (1) drops for a time below the correction range but (2) all of the curve is still above suspend threshold, and Eventual BG is (3) above range or within range...*Loop* will give your scheduled basal. +> *Loop* will give your scheduled basal in both situations shown above.  When your predicted glucose curve (1) drops for a time below the correction range but (2) all of the curve is still above glucose safety limit, and Eventual glucose is (3) above range or within range...*Loop* will give your scheduled basal. -The logic is a bit of a wait-and-see.  Scheduled basal will maintain the delivery of insulin.  Your settings haven't told it this is an "oh my gosh...stop the insulin!" moment (you're predicted to still stay above suspend threshold), but we also don't want to give high temps yet (to correct the eventual BG) because we'd like to safely make it through the part that is below correction range coming up. +The logic is a bit of a wait-and-see.  Scheduled basal will maintain the delivery of insulin.  Your settings haven't told it this is an "oh my gosh...stop the insulin!" moment (you're predicted to still stay above glucose safety limit), but we also don't want to give high temps yet (to correct the eventual glucose) because we'd like to safely make it through the part that is below correction range coming up. -If BGs were to drop (enough) or keep dropping (enough), your predicted BG curve would likely slip to your suspend threshold and then *Loop* would suspend. (One important take away is to not set your suspend threshold so low that it no longer acts as a safety in these situations.) -If BGs were to rise enough such that the whole predicted curve comes back into or above the correction range completely, you'd then get high temp basals to correct for that eventual BG that is above the correction range. +If glucose were to drop (enough) or keep dropping (enough), your predicted glucose curve would likely slip to your glucose safety limit and then *Loop* would suspend. (One important take away is to not set your glucose safety limit so low that it no longer acts as a safety in these situations.) +If glucose were to rise enough such that the whole predicted curve comes back into or above the correction range completely, you'd then get high temp basals or automatic boluses to correct for that eventual glucose that is above the correction range. diff --git a/docs/index.md b/docs/index.md index 737ef92..6915ba4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,8 +1,56 @@ # Introduction -Welcome to LoopTips! The purpose of these pages is to help you make the most of your DIY closed-looping experience. In particular, these pages support users of the [Loop app](https://loopkit.github.io/loopdocs/){: target="_blank" }. These documents have been a long time in the making and as always, your feedback is welcome. If you have comments, please feel free to provide input at the [Looped Facebook Group](https://www.facebook.com/groups/TheLoopedGroup){: target="_blank" }, [Loop and Learn Facebook Group](https://www.facebook.com/groups/LoopandLearn){: target="_blank" } or in [ Loop's Zulipchat](https://loop.zulipchat.com/#narrow/channel/270362-documentation/topic/LoopTips){: target="_blank" }. +Welcome to *LoopTips*! The purpose of these pages is to help you make the most of your *Loop* experience. -LoopTips is a companion to LoopDocs. LoopTips does not cover the build or installation of Loop app. If you have problems with building your Loop app or troubleshooting the technical aspects of Loop operations, please head over to [LoopDocs](https://loopkit.github.io/loopdocs/){: target="_blank" } for help. The LoopTips pages are specifically related to understanding how your loop is recommending the actions being taken, and how you can improve your blood glucose outcomes on Loop. Some of the pages that originated in LoopTips are now included in LoopDocs. Don't be surprised when you find links between the sites. (The color bar is deliberately a different shade to help you know where you are.) +## Who Should Use *LoopTips*? + +*LoopTips* is designed for people who: + +- Already have the *Loop* app built and running +- Want to optimize their *Loop* settings and outcomes +- Need practical guidance on using *Loop* in daily life +- Want to understand how *Loop* makes decisions + +*LoopTips* can be helpful for those using a different hybrid closed-loop system, both Open-Source and commercial. There are some sections with tips applicable to more than just the *Loop* app. + +If you haven't built *Loop* yet or need technical troubleshooting, visit [*LoopDocs*](https://loopkit.github.io/loopdocs/){: target="_blank" } first. + +## *LoopTips* vs *LoopDocs* + +Think of these two resources as complementary guides: + +- **LoopDocs**: Building, installing, operating and technical troubleshooting +- **LoopTips**: Understanding Loop's algorithm, optimizing settings, and improving glucose outcomes + +Some pages that originated in *LoopTips* are now included in *LoopDocs*. Don't be surprised when you find links between the sites. The color bar is deliberately a different shade to help you know where you are. + +## How to Use This Documentation + +**Start Here:** + +1. [**Settings**](settings/settings.md){: target="_blank" } - Learn why settings matter and how to configure your initial settings correctly +2. [**Think Like a Loop**](how-to/think-like-loop.md){: target="_blank" } - Understand how Loop makes decisions (essential reading!) +3. [**Data Tools**](data/overview.md){: target="_blank" } - Set up tools to track and analyze your Loop data + +**Daily Management:** + +- CGM habits, managing insulin on board (IOB), treating lows, and using overrides + +**Special Situations:** + +- Exercise, site failures, being stuck on high (glucose), showering/swimming + +**Data & Analysis:** + +- Apple Health, Nightscout, Tidepool, and Perceptus for reviewing your Loop data + +## Feedback Welcome + +Your feedback helps improve these documents. Please share comments at: + +- [Looped Facebook Group](https://www.facebook.com/groups/TheLoopedGroup){: target="_blank" } +- [Loop and Learn Facebook Group](https://www.facebook.com/groups/LoopandLearn){: target="_blank" } +- [Loop's Zulipchat](https://loop.zulipchat.com/#narrow/channel/270362-documentation/topic/LoopTips){: target="_blank" } ## What is a closed loop? @@ -17,13 +65,29 @@ The U.S. Food and Drug Administration (FDA) has a general definition of an "arti >*An Artificial Pancreas Device System will not only monitor glucose levels in the body but also automatically adjust the delivery of insulin to reduce high blood glucose levels (hyperglycemia) and minimize the incidence of low blood glucose (hypoglycemia) with little or no input from the patient."* -## What is Loop? +## What is `Loop`? + +The *Loop* app is a do-it-yourself closed loop algorithm and user interface, developed through the work of community volunteers. You can read about the history of *Loop* development in *LoopDocs*. *Loop* predicts future blood glucose based on basals, carbohydrate intake, insulin deliveries, and current CGM readings. These blood glucose predictions provide *Loop* with the information needed to recommend a temporary basal rate to attain a targeted glucose range in the future. The system can either operate as an `open loop` by making recommendations to the user for their approval before enacting or as a `closed loop` by automatically setting the recommended temporary basal rate. + +As exciting as this sounds...we should first get the caveats out of the way. There are some limitations on what kind of pumps/equipment are required. This system doesn't work with most pumps and requires you to do some work. The pumps that are supported and the directions for building are thoroughly covered in [*LoopDocs*](https://loopkit.github.io/loopdocs/){: target="_blank" }. + +## Terminology Used in This Documentation + +Throughout *LoopTips*, we use standard abbreviations for common diabetes terms: -The Loop app is a do-it-yourself closed loop algorithm and user interface, developed through the work of community volunteers. You can read about the history of Loop development in LoopDocs. Loop predicts future blood glucose based on basals, carbohydrate intake, insulin deliveries, and current CGM readings. These blood glucose predictions provide Loop with the information needed to recommend a temporary basal rate to attain a targeted glucose range in the future. The system can either operate as an “open loop” by making recommendations to the user for their approval before enacting or as a “closed loop” by automatically setting the recommended temporary basal rate. +- **BG** = Blood Glucose (also referred to as "glucose" or "blood sugar") +- **IOB** = Insulin On Board (active insulin in your body) + * IOB is measured with respect to your scheduled basal, so it can be negative when basal is withheld to prevent lows +- **COB** = Carbs On Board (carbohydrates still being digested) +- **ISF** = Insulin Sensitivity Factor (how much one unit of insulin lowers glucose) +- **CR** = Carb Ratio (how many grams of carbs are covered by one unit of insulin) +- **DIA** = Duration of Insulin Action (how long insulin remains active) +- **AID** = Automated Insulin Delivery system (refers to commercial as well as Open-Source systems) +- **OS-AID** = Open-Source Automated Insulin Delivery system (refers to *Loop* and others such as *Trio*, *iAPS*, *OpenAPS*, *AAPS*) -As exciting as this sounds...we should first get the caveats out of the way. There are some limitations on what kind of pumps/equipment are required. This system doesn't work with most pumps and requires you to do some work. The pumps that are supported and the directions for building are thoroughly covered in [LoopDocs](https://loopkit.github.io/loopdocs/){: target="_blank" }. +When we say "correction range" or "target range," we're referring to the same thing - your desired glucose range configured in Loop settings. ## Disclaimer -While it may seem obvious, please consult with your healthcare professional regarding your diabetes management. The suggestions and discussion in LoopTips are not a one-size-fits-all nor intended to replace the input from your doctor. You take full responsibility for building and running this system and do so at your own risk. +While it may seem obvious, please consult with your healthcare professional regarding your diabetes management. The suggestions and discussion in *LoopTips* are not a one-size-fits-all nor intended to replace the input from your doctor. You take full responsibility for building and running this system and do so at your own risk. diff --git a/docs/settings/adjust.md b/docs/settings/adjust.md index 4e78aee..7f0752d 100644 --- a/docs/settings/adjust.md +++ b/docs/settings/adjust.md @@ -10,7 +10,7 @@ Before considering a change to your settings, the usual laundry list of possible * Bad infusion site (kinked cannula, blood in cannula, infected site?) * Bad insulin (cloudy? insulin exposed to heat/freezing?) -* Unexpected food impacts (that diet Coke wasn't diet, kid sneaking food?) +* Unexpected food impacts (that diet Coke wasn't diet, eating food without bolusing or announcing carbs?) * CGM damaged (poor calibration, damaged sensor site?) Some signs that the issue is actually the result of equipment failure include the failure of blood glucose to decrease despite repeated bolus corrections. Often during equipment failure troubleshooting, you've blamed the food (and adjusted a carbohydrate count), given corrections, checked for hidden food wrappers, and maybe even open-looped rage bolused. Breathe deep, it is super frustrating to have equipment failure. One of the benefits of Loop can be that equipment failures can become a little easier to identify over time because blood glucose control becomes more predictable and reliable. @@ -54,4 +54,4 @@ Once you have assessed that there's a need for a settings adjustment, the next s Whether you undertake the adjustments by yourself and/or with your healthcare provider's input is at your own discretion. Ideally, you would have your healthcare provider's input and support to discuss the observations and concerns you have and develop an adjusted setting profile based on those discussions. Many endocrinologists are still becoming familiar with Loop and its algorithm, so providing them links to the various sites would be a good starting point for discussion. This can help the endocrinologist understand where Loop is similar/different than traditional pump therapy. If you and your healthcare provider are comfortable with your self-adjustments and Loop's algorithm, then proceed ahead. -To begin the process of settings adjustment, visualizing your data trends is important. You need to be able to piece together what was eaten, how it was bolused, what temporary basals were applied, and how your blood glucose was reacting. The Data section of LoopTips covers the various places you can find your diabetes-related data to help you during adjustments. +To begin the process of settings adjustment, visualizing your data trends is important. You need to be able to piece together what was eaten, how it was bolused, what temporary basals were applied, and how your blood glucose was reacting. The Data section of LoopTips covers the various places you can find your diabetes-related data to help you during adjustments. But first, read through the How To section to get ideas how to use your Data. diff --git a/docs/settings/overview.md b/docs/settings/overview.md index 05db45b..4aff350 100644 --- a/docs/settings/overview.md +++ b/docs/settings/overview.md @@ -5,49 +5,106 @@ In the context of the following discussion, the term "settings" refers to inform * basal rate schedule * insulin sensitivity factor (ISF) * carbohydrate to insulin ratio (CR) -* glucose target range +* correction range * duration of insulin activity (DIA) -Typically, most people with type 1 diabetes consult with their endocrinologist to develop and revise their settings. The endocrinologist usually reviews the patient's blood glucose and treatment history at each appointment to assess whether settings need to be adjusted. There are several great books available about the topic ([*Think Like A Pancreas*](https://www.amazon.com/Think-Like-Pancreas-Practical-Insulin-Completely/dp/0738215147){: target="_blank" } and similar) +Typically, most people with type 1 diabetes consult with their endocrinologist to develop and revise their settings. The endocrinologist usually reviews the patient's blood glucose and treatment history at each appointment to assess whether settings need to be adjusted. There are several great books available about the topic ([*Think Like A Pancreas*](https://www.amazon.com/Think-Like-Pancreas-Practical-Insulin-Completely/dp/0738215147) and similar) ## Why settings matter -Loop is primarily a set of math equations called an algorithm. The recommendations and actions that Loop takes are based on that algorithm, and the settings you enter in your Loop app are the basis for that math. +Loop is primarily a set of math equations called an algorithm. The recommendations and actions that Loop takes are based on that algorithm, and the settings you enter in your Loop app are the basis for that math. -Let's start by thinking about basal rates. A well-adjusted basal schedule is designed to keep your blood glucose steady throughout the day, everything else being equal. If you were to not eat, not exercise, and basically keep a mellow lifestyle...basals should keep your blood glucose steady. +### The Foundation: Basal Rates -That is how Loop's math starts, and it's an important point to remember as you use and learn your Loop app. Loop's math is based on the assumption that the basal schedule you have provided in your settings are capable of keeping your blood glucose steady in the absence of other stressors. So as your blood glucose goes higher than your correction range for an unusual short-term influence like stress or unannounced carbs, you've been accustomed to delivering a "correction bolus" to get back to range. Or if blood glucose goes below your correction range, you may need to eat recovery carbohydrates. +Let's start by thinking about basal rates. A well-adjusted basal schedule is designed to keep your glucose steady throughout the day, everything else being equal. If you were to not eat, not exercise, and basically keep a mellow lifestyle...basals should keep your glucose steady. -With all the excitement about automated insulin delivery, some people mistakenly assume that the user's settings don't matter anymore....that **_everything_** is automated. However, settings do still matter as they provide the basis for Loop's math. Diabetes is not a static math equation. Loop does not adjust your settings for you, that responsibility still falls to the Loop user when needed. +### Loop's Core Assumption -Let's give some examples to help. When you calculate a meal bolus, your math probably looks similar to this: +That is how Loop's math starts, and it's an important point to remember as you use and learn your Loop app. **Loop's math is based on the assumption that the basal schedule you have provided in your settings are capable of keeping your glucose steady in the absence of other stressors.** + +So as your glucose goes higher than your correction range for an unusual short-term influence like stress or unannounced carbs, you've been accustomed to delivering a "correction bolus" to get back to range. Or if glucose goes below your correction range, you may need to eat recovery carbohydrates. + +### Settings Still Matter with Automation + +With all the excitement about automated insulin delivery, some people mistakenly assume that the user's settings don't matter anymore....that **_everything_** is automated. + +**This is not true.** Settings do still matter as they provide the basis for Loop's math. Diabetes is not a static math equation. **Loop does not adjust your settings for you** - that responsibility still falls to the Loop user when needed. + +### Factors That Affect Blood Glucose + +When you calculate a meal bolus, your math probably looks similar to this: ![Bolus Equation](img/bolus-equation.jpg){width="450"} {align="center"} -But many times you are probably adjusting that math based on any number of "factors" that you are aware could be affecting your blood glucose. [Diatribe](https://diabetesresearchconnection.org/42-factors-affect-blood-glucose/) put together this great list of factors that affect blood glucose, and therefore could also affect how you'd adjust your insulin delivery from what they otherwise would normally be. +But many times you are probably adjusting that math based on any number of "factors" that you are aware could be affecting your glucose. [Diatribe](https://diabetesresearchconnection.org/42-factors-affect-blood-glucose/) identified 42+ factors that affect blood glucose, and therefore could also affect how you'd adjust your insulin delivery. ![BG Factors](img/bg-factors.png){width="450"} {align="center"} -Some of those factors you are already used to making allowances for, such as: +### Common Factors You Already Manage + +Some of those factors you are already used to making allowances for: + +* **Pizza boluses** - You probably are accustomed to needing an extended bolus and/or higher temporary basal rate to help with the late glucose spike common after the initial bolus starts to wear off. That pizza takes a long time to digest thanks to those slow-acting fats. + +* **Medications** - How about that time that you had to take steroids for an achy joint? Those steroids probably resulted in a dramatic overall increase in insulin needs for several days, and you had to set aggressive temporary basal increases or other settings adjustments. + +* **Hormones** - Monthly hormone cycles have many women adjusting their basal rates and/or insulin sensitivity schedules for a week or so each month. + +* **Exercise** - Always a tough one because some exercise may make your glucose rise (lifting weights) and other exercise may make your glucose drop (running). Through repetition, most people have learned how to adjust for exercise by using temporary basal rates or timing of meals/boluses. + +### How Loop Handles Different Duration Factors + +The degree to which *Loop* can deal with those stresses/factors largely depends on: -* Pizza boluses...You probably are accustomed to needing an extended bolus and/or higher temporary basal rate to help with the late blood glucose spike common after the initial bolus starts to wear off. That pizza takes a long time to digest thanks to those slow-acting fats. -* Medications...How about that time that you had to take steroids for an achy joint? Those steroids probably resulted in a dramatic overall increase in insulin needs for several days, and you had to set aggressive temporary basal increases or other settings adjustments. -* Hormones...monthly hormone cycles have many women adjusting their basal rates and/or insulin sensitivity schedules for a week or so each month. -* Exercise...always a tough one because some exercise may make your blood glucose rise (lifting weights) and other exercise may make your blood glucose drop (running). Through repetition, most people have learned how to adjust for exercise by using temporary basal rates or timing of meals/boluses. +1. **Duration of the factor** itself +2. **How well we can communicate to Loop** that those factors are at play -The degree to which *Loop* can deal with those stresses/factors largely depends on the duration of the "factor" itself and how well we can communicate to *Loop* that those factors are at play. For things we know are coming, we can tell Loop in advance, and *Loop* has ways of dealing with them mathematically. In the pizza example, Loop lets us mark the meal as long, slow digestion, and therefore better react to a potential late blood glucose rise. For exercise, we can use temporary override blood glucose targets before/after exercise to help Loop administer less insulin for awhile. +**Short-term factors** - For things we know are coming, we can tell Loop in advance, and *Loop* has ways of dealing with them mathematically: -If, however, your insulin needs are impacted by something more long-term such as hormone cycles, medications, or illness then sometimes your Loop may not be able to consistently hold you at your desired blood glucose. You may end up holding steady at a higher/lower blood glucose than you'd prefer. This is because Loop's math is still using the inputs that were from before you got sick/stressed/hormone'd (new word). Then the decision becomes "Do you adjust your settings now or just wait it out until the stressor goes away?" +- Pizza example: Loop lets us mark the meal as long, slow digestion, and therefore better react to a potential late glucose rise +- Exercise: We can use [override targets](../how-to/overrides.md){: target="_blank" } before/after exercise to help Loop administer less insulin for awhile + +**Long-term factors** - If your insulin needs are impacted by something more long-term such as hormone cycles, medications, or illness, then sometimes *Loop* may not be able to consistently hold you at your desired BG. You may end up holding steady at a higher/lower BG than you'd prefer. + +This is because Loop's math is still using the inputs that were from before you got sick/stressed/hormone'd (new word). Then the decision becomes "Do you adjust your settings now or just wait it out until the stressor goes away?" ## When do you need to change settings? -If the inputs to those math equations (i.e., your settings) are not accurate, your blood glucose control results may also not be optimal. +If the inputs to those math equations (i.e., your settings) are not accurate, your glucose control results may also not be optimal. + +### Short-Term Stressors: Use Loop's Tools + +Your basic insulin settings are what keeps your glucose steady *without stressors* present. For much of the time, the stressors in type 1 are short-lived and temporary (we just ride them out): + +- Carbohydrate count is a little off +- Math test in algebra class +- Public speaking engagement + +**Loop does well helping with short-term stressors.** They don't represent a prolonged need to change settings and the glucose impacts are short-lived as Loop corrects for them. + +### Long-Term Stressors: Adjust Settings + +However, **longer-term stressors are often helped by settings adjustments.** Examples include: + +- Medications +- Illness +- Hormones +- Travel +- Altitude + +### Example: When to Adjust Basal Settings + +By letting Loop know that the status quo has changed (more/less insulin is needed overall) will help glucose get and stay in range. + +**Scenario:** If you have told Loop that your insulin need is 1 U/hr, but in reality, you're needing 1.3 U/hr because you've traveled to a colder place and will be sedentary for days... -Your basic insulin settings are what keeps your blood glucose steady *without stressors* present. For much of the time, the stressors in type 1 are short-lived and temporary (we just ride them out)...carbohydrate count is a little off, math test in algebra class, public speaking engagement, etc. Loop does well helping with the short-term stressors. They don't represent a prolonged need to change settings and the blood glucose impacts are short-lived as Loop corrects for them. +- **What happens**: You will likely find yourself steady but higher than your correction range while Looping +- **Why**: The high temporary basals that Loop will be providing in an attempt to bring you back to target will simply be going to fill the lack of adequate basal scheduled +- **Solution**: If you update your basal schedule to reflect 1.3 U/hr of basal needs, Loop would be better positioned to provide needed insulin delivery to keep you in the correction range -However, the longer-term stressors are often helped by settings adjustments. Examples of longer term stressors are medications, illness, hormones, travel, or altitude. By letting Loop know that the status quo has changed (more/less insulin is needed overall) will help BGs get and stay in range. If you have told Loop that your insulin need is 1 unit/hour, but in reality, you're needing 1.3 units/hour because you've traveled to a colder place and will be sedentary for days...you will likely find yourself steady but higher than your target range while Looping. The high temporary basals that Loop will be providing in an attempt to bring you back to target will simply be going to fill the lack of adequate basal scheduled. If you update your basal schedule to reflect 1.3 units/hour of basal needs, Loop would be better positioned to provide needed insulin delivery to keep you in the target range. +See [Adjust Your Settings](adjust.md){: target="_blank" } for guidance on making these changes. ## Automated settings adjustments @@ -55,8 +112,8 @@ A common sentiment among new Loop users goes something like *"Why doesn't Loop s What the user is actually implying is that the user thinks Loop should be doing some sort of retrospective analysis on the user's blood glucose and data to make a "better" decision. The user wants Loop to learn from recent data and adjust. -There is a short-term retrospective analysis built into Loop which will apply a weighted-correction based on the past 60 minutes of blood glucose changes. While this does help some, larger-scale "learning" is not currently a part of Loop's algorithm. +There is a short-term retrospective analysis built into Loop which will apply a weighted-correction based on the past 60 minutes of blood glucose changes. There is a longer-term integral retrospecive correction (disabled by default) that can be enabled in the Open-Source version of *Loop*. While these retrospective corrections help some; larger-scale "learning" is not currently a part of Loop's algorithm. -Perhaps in subsequent versions of Loop, auto-adjustment of settings or machine learning could be incorporated. Until then, you will need to tell Loop if your underlying settings need updating or make temporary adjustments for short-term issues. These pages in LoopTips are written to help you identify when settings may need adjustment or when other techniques may be useful in given situations. +Perhaps in subsequent versions of Loop, auto-adjustment of settings or machine learning could be incorporated. Until then, you need to tell Loop if your underlying settings need updating or make temporary adjustments for short-term issues. *LoopTips* is provided to help you identify when settings need adjustment or when other techniques may be useful in given situations. diff --git a/docs/settings/settings.md b/docs/settings/settings.md index 5f10a7e..a9780d3 100644 --- a/docs/settings/settings.md +++ b/docs/settings/settings.md @@ -17,10 +17,12 @@ If I could offer one bit of really useful advice, it would be to open loop for a If you want extra help, you can read some excellent books about pump settings and what they mean. For example, "*Think Like a Pancreas*" by Gary Scheiner is a great reference for understanding some of the guiding principles in pump therapy.  Let me summarize the important parts about pump settings: -* Basal rates should keep your blood glucose steady in the absence of other influences (such as food, medications, etc). -* Boluses should return your blood glucose to target after a meal. -* Insulin Sensitivity Factor (ISF) is the amount one unit of insulin drops your blood glucose without other influences. -* Carb Ratio (CR) is the meal entry in grams that requires one unit of insulin to cover +* **Basal rates** should keep your glucose steady in the absence of other influences (such as food, medications, etc). +* **Boluses** should return your glucose to target after a meal. +* **Insulin Sensitivity Factor (ISF)** is the amount one unit of insulin drops your glucose without other influences. +* **Carb Ratio (CR)** is the meal entry in grams that requires one unit of insulin to cover + +See [Why Settings Matter](overview.md) for more on how Loop uses these settings. !!! tip "Basal, ISF and CR" It's the way it was defined in the beginning, but it can be confusing. @@ -63,7 +65,7 @@ Many people, especially little kids, are not enthusiastic about fasting basal te ### Insulin Sensitivity Factor -Insulin sensitivity factor (ISF) is the next logical setting to test. If you've just done the basal test and gotten steady blood glucose with an open loop, try taking a glucose tab or two. Wait for your blood glucose to be steady at the higher value, and give a safe correction that you think will get you close to target. Watch the resulting blood glucose drop over the next 3-4 hours. You should see blood glucose come to a steady level again. How much did the blood glucose drop? How many units of insulin did you use? Divide the two numbers and you will have your ISF.  If your BG dropped 15 mg/dL with half a unit of insulin, your ISF is approximately 30 mg/dL per unit. +Insulin sensitivity factor (ISF) is the next logical setting to test. If you've just done the basal test and gotten steady blood glucose with an open loop, try taking a glucose tab or two. Wait for your blood glucose to be steady at the higher value, and give a safe correction that you think will get you close to target. Watch the resulting blood glucose drop over the next 3-4 hours. You should see blood glucose come to a steady level again. How much did the blood glucose drop? How many units of insulin did you use? Divide the two numbers and you will have your ISF.  If your glucose dropped 15 mg/dL with half a unit of insulin, your ISF is approximately 30 mg/dL per unit. Testing ISF is an important step in successful closed Loop use. ISF is used in every Loop calculation and plays an important part in Loop's prediction curve. Most users find that they have to adjust ISF; most often increasing the value. If you are experiencing roller coastering blood glucose, as described below, that is often a sign that ISF needs to be weaker (higher value). diff --git a/mkdocs.yml b/mkdocs.yml index ff7c0fb..de8eb64 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,6 +5,7 @@ theme: name: material language: en features: + - navigation.footer - navigation.tabs - navigation.tabs.sticky - navigation.tracking @@ -21,7 +22,42 @@ extra_css: - css/extra.css - css/primary-color.css +markdown_extensions: + - meta + - abbr + - admonition + - attr_list + - pymdownx.arithmatex: + generic: true + - pymdownx.details + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.highlight + - pymdownx.mark + - pymdownx.tilde + - pymdownx.inlinehilite + - pymdownx.keys + - pymdownx.superfences: + # make exceptions to highlighting of code: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.snippets: + auto_append: + - includes/tooltip-list.txt + - toc: + permalink: true + permalink_title: Anchor link to this Header on this Page + toc_depth: 3 + title: Headers on this Page + +extra_javascript: + - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js + plugins: + - open-in-new-tab - search - htmlproofer: enabled: !ENV [CHECK_BROKEN_LINKS, False] @@ -29,31 +65,6 @@ plugins: use_directory_urls: !ENV [CHECK_BROKEN_LINKS, True] -markdown_extensions: - - meta - - abbr - - admonition - - attr_list - - pymdownx.arithmatex: - generic: true - - pymdownx.emoji: - emoji_index: !!python/name:material.extensions.emoji.twemoji - emoji_generator: !!python/name:material.extensions.emoji.to_svg - - pymdownx.highlight - - pymdownx.inlinehilite - - pymdownx.superfences - - pymdownx.snippets: - auto_append: - - includes/tooltip-list.txt - - toc: - permalink: true - permalink_title: Anchor link to this Header on this Page - toc_depth: 3 - title: Headers on this Page - -extra_javascript: - - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js - validation: anchors: warn # Check for the existence of anchors present in links @@ -63,22 +74,22 @@ nav: - "Why Settings Matter": "settings/overview.md" - "Initial Settings": "settings/settings.md" - "Adjust Your Settings": "settings/adjust.md" - - Data Tools: - - "Overview": "data/overview.md" - - "Health": "data/health.md" - - 'Nightscout': "data/nightscout.md" - - 'Tidepool': "data/tidepool.md" - - "Perceptus": "data/glucodyn.md" - How To: - "Think Like a Loop": "how-to/think-like-loop.md" - - "CGM habits": "how-to/cgm.md" - - "Use morning IOB": "how-to/iob.md" - - "Override Targets": "how-to/overrides.md" + - "CGM Habits": "how-to/cgm.md" + - "Use Morning IOB": "how-to/iob.md" - "Low Treatments": "how-to/low-treat.md" - - "Shower & Swimming": "how-to/disconnect.md" - - "Exercise": "how-to/exercise.md" - "Extended Bolus": "how-to/bolus.md" - - "Site Failure": "how-to/site-fail.md" + - "Override Targets": "how-to/overrides.md" + - "Exercise": "how-to/exercise.md" + - "Shower & Swimming": "how-to/disconnect.md" - "Stuck on High": "how-to/high-bg.md" + - "Site Failure": "how-to/site-fail.md" - "Talk with Endo": "how-to/endo.md" + - Data Tools: + - "Overview": "data/overview.md" + - "Health": "data/health.md" + - 'Nightscout': "data/nightscout.md" + - 'Tidepool': "data/tidepool.md" + - "Perceptus": "data/glucodyn.md" - Translation: "translate.md" diff --git a/requirements.in b/requirements.in index 29c7b7f..8b10a0b 100644 --- a/requirements.in +++ b/requirements.in @@ -1,4 +1,10 @@ +jinja2~=3.1 mkdocs~=1.6.1 -mkdocs-htmlproofer-plugin~=1.4 +mkdocs-exporter~=6.2 mkdocs-material~=9.7 +mkdocs-htmlproofer-plugin~=1.4 +mkdocs-include-markdown-plugin~=7.2 +mkdocs-open-in-new-tab~=1.0 +mkdocs-macros-plugin~=1.5 mkdocs-unused-files~=0.2 +mkdocs-redirects~=1.2 diff --git a/requirements.txt b/requirements.txt index 1461882..19174e6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,8 +10,11 @@ backrefs==6.1 # via mkdocs-material beautifulsoup4==4.14.3 # via + # mkdocs-exporter # mkdocs-htmlproofer-plugin # mkdocs-unused-files +bracex==2.6 + # via wcmatch certifi==2025.11.12 # via requests charset-normalizer==3.4.4 @@ -22,12 +25,24 @@ colorama==0.4.6 # via mkdocs-material ghp-import==2.1.0 # via mkdocs +greenlet==3.3.0 + # via playwright +hjson==3.1.0 + # via + # mkdocs-macros-plugin + # super-collections idna==3.11 # via requests jinja2==3.1.6 # via + # -r requirements.in # mkdocs + # mkdocs-macros-plugin # mkdocs-material +libsass==0.23.0 + # via mkdocs-exporter +lxml==6.0.2 + # via mkdocs-exporter markdown==3.10 # via # mkdocs @@ -45,37 +60,65 @@ mergedeep==1.3.4 mkdocs==1.6.1 # via # -r requirements.in + # mkdocs-exporter # mkdocs-htmlproofer-plugin + # mkdocs-include-markdown-plugin + # mkdocs-macros-plugin # mkdocs-material + # mkdocs-open-in-new-tab + # mkdocs-redirects # mkdocs-unused-files +mkdocs-exporter==6.2.0 + # via -r requirements.in mkdocs-get-deps==0.2.0 # via mkdocs mkdocs-htmlproofer-plugin==1.4.0 # via -r requirements.in +mkdocs-include-markdown-plugin==7.2.0 + # via -r requirements.in +mkdocs-macros-plugin==1.5.0 + # via -r requirements.in mkdocs-material==9.7.1 # via -r requirements.in mkdocs-material-extensions==1.3.1 # via mkdocs-material +mkdocs-open-in-new-tab==1.0.8 + # via -r requirements.in +mkdocs-redirects==1.2.2 + # via -r requirements.in mkdocs-unused-files==0.2.0 # via -r requirements.in packaging==25.0 - # via mkdocs + # via + # mkdocs + # mkdocs-macros-plugin paginate==0.5.7 # via mkdocs-material pathspec==0.12.1 - # via mkdocs + # via + # mkdocs + # mkdocs-macros-plugin platformdirs==4.5.1 # via mkdocs-get-deps +playwright==1.57.0 + # via mkdocs-exporter +pyee==13.0.0 + # via playwright pygments==2.19.2 # via mkdocs-material pymdown-extensions==10.19.1 # via mkdocs-material +pypdf==6.4.2 + # via mkdocs-exporter python-dateutil==2.9.0.post0 - # via ghp-import + # via + # ghp-import + # mkdocs-macros-plugin pyyaml==6.0.3 # via # mkdocs # mkdocs-get-deps + # mkdocs-macros-plugin # pymdown-extensions # pyyaml-env-tag pyyaml-env-tag==1.1 @@ -83,14 +126,23 @@ pyyaml-env-tag==1.1 requests==2.32.5 # via # mkdocs-htmlproofer-plugin + # mkdocs-macros-plugin # mkdocs-material six==1.17.0 # via python-dateutil soupsieve==2.8.1 # via beautifulsoup4 +super-collections==0.6.2 + # via mkdocs-macros-plugin +termcolor==3.2.0 + # via mkdocs-macros-plugin typing-extensions==4.15.0 - # via beautifulsoup4 + # via + # beautifulsoup4 + # pyee urllib3==2.6.2 # via requests watchdog==6.0.0 # via mkdocs +wcmatch==10.1 + # via mkdocs-include-markdown-plugin