Skip to content

oref0 0.6.0

Compare
Choose a tag to compare
@danamlewis danamlewis released this 26 Nov 00:59
· 945 commits to master since this release

There are many changes in oref0 0.6.0. Before updating to 0.6.0, please read the following and the related documentation.

High level summary of changes, with more detail below:

  • The default behavior for carb absorption has changed. See notes below.
  • OpenAPS will now use the bottom BG target from the pump (not the range) by default.
  • Exponential curves are now being used for insulin activity. The default is rapid-acting. Fiasp users should select ultra-rapid.
  • SMB has been enhanced (eSMB). There is now also an option for SMB to always be on.
  • oref0-setup.sh will not ask you for the passphrases for enabling SMB. They will only be enabled by adding the related preferences to your preferences.json
  • There is now an exercise mode, which allows high temp targets to also adjust sensitivity manually.
  • There are added risk mitigation steps to prevent A52 pump errors. Bolus wizard is NOT recommended for use if you are using SMB’s (instead enter carbs through NS/IFTTT)
  • The purple lines in NS have changed.
  • Bolus snooze has been eliminated.
  • 0.6.0 and beyond will no longer use git, which will reduce git-related errors.

More details on the above:

CHANGED: Default behavior change for carb absorption

In 0.6.0, carb absorption now uses a /\ shaped bilinear carb absorption model (replacing the previous --- shaped constant model for predicting the future absorption of newly entered carbs that haven't shown any effect on BG yet. As a result, the COB predBG purple prediction line immediately after entering carbs shows an S-curve shaped rise that starts out flat (in line with current BG trends), and then rises sharply after about an hour before flattening out.

  • A typical meal absorption time of 3h is assumed when carbs are first entered, which is then extended over time, so that oref0 gradually relies more on actual observed carb absorption as carbs are absorbed. When the carbs are first entered, remainingCATime is set to 3 hours. When 50% of carbs have absorbed, the remainder (that aren't seen to be absorbing already) are predicted to take another 4.5h. And as COB approaches zero, remainingCATime will approach 6 hours.
  • As in 0.5.x, any actual observed carb absorption will be predicted to continue into the future. The predCI assumed carb absorption described above only kicks in for carbs would not be absorbed within the current carb absorption time if the current carb absorption rate decreases linearly over that time.

CHANGED: Single BG target (not range) by default

Many people seem to set their pump's bolus wizard target range rather wide, and then ask questions about why OpenAPS isn't doing more to prevent highs and/or lows. Most experienced users end up with a much narrower target range, usually setting the low and high targets equal (100-100 or similar). So we've changed the default BG target behavior to use only a single value as target, specifically the low end of the pump's bolus wizard target range. This was done by making override_high_target_with_low the default behavior, and adding a wide_bg_target_range preference (false by default) to override that and restore the previous default behavior if someone really wants a wide target range. This also makes it possible to set the high end of the bolus wizard target range to something high (like maybe 160 mg/dL) to prevent the pump from adding on a correction bolus when entering a BG value into the bolus wizard.

Exponential Curves

The code now supports three new configuration variables in preferences.json to allow exponential curves that better reflect the effects of insulin:

  • curve, with legal values of blank, "bilinear", "rapid-acting" and "ultra-rapid"
  1. if set to "bilinear", OpenAPS uses the old insulin activity model
  2. If set to "rapid-acting" (now the default), the new curve model analyzed from publicly available data for Novorapid (Novolog) from Novo Nordisk is used. This curve should match well to Novorapid, Novolog, Humalog and Apidra and is set to peak at 75 minutes
  3. If set to "ultra-rapid", the new curve model analyzed from publicly available data for Fiasp from Novo Nordisk is used, set to reach activity peak at 55 minutes
  • insulinPeakTime, with legal values from 35 to 120. The value defines the minutes from bolus to peak. Note if you don't set it, the above mentioned peak defaults are used.
  • useCustomPeakTime, which must be set to "true" for the customized insulinPeakTime value to take effect

If you use the rapid-acting or ultra-rapid curves, you DIA will be set to a minimum of 5 hours, or longer. 6 hours is recommended as the starting point, especially if you see lows 4h+ after large meals.

The details of the curve calculations and discussions can be found PR #568

Enhanced SMB (eSMB)

Note: for folks with tiny basals (in this case, say <0.5u/hr), exercise even more caution, as additional tweaks may need to be made to SMB-related portions of the code.

The default behaviour for SMB is that the max bolus that can be delivered is no greater than 30 mins of basal insulin. An additional preferences value, "maxSMBBasalMinutes", has been added to allow SMB to deliver a different amount of insulin as an SMB. This gives the ability to make SMB more aggressive if you choose. As with standard SMB, it is triggered by temp targets, carb entries and a pump bolus.

Increasing "maxSMBBasalMinutes" will allow the SMB functionality to deliver more insulin, earlier in the SMB process.

"maxSMBBasalMinutes" can be added into myopenaps/preferences.json. It is recommended that the value is set to start at 30, in line with the default, and if you choose to increase this value, do so in no more than 15 minute increments, keeping a close eye on the effects of the changes.

It is not recommended to set this value higher than 90 minutes, as this may affect the ability for the algorithm to safely zero temp. It is also recommended that pushover is used when setting the value to be greater than default, so that alerts are generated for any predicted lows or highs.

Other SMB adjustments include: The preference of enabling SMB to always be on. (Leaving this as false (off) means the existing SMB toggles for carbs, temp targets, etc. will be what drives SMB behaviors.)

Also adjusted: the basal and bolus distinctions - we eliminated bolus snooze
With eSMB now allowing no-bolus operation of OpenAPS, the distinctions between manual boluses and microboluses are breaking down, which prevents things like bolus snooze, which assume that automatically administered insulin should be classified as basal insulin / IOB and kept distinct from bolus insulin / IOB. Now that carb ratios can be properly autotuned, carb absorption is assumed to occur over less than DIA, the original need for bolus snooze is largely eliminated. The only remaining need for it might be if anyone is not entering carbs (either via NS or the pump), is manually bolusing for food, and then is expecting bolus snooze to cover until UAM kicks in, but that is likely a minimal or non-existing set of people. (Please test & let us know if there are any issues). Moving forward, this removes all references to bolus snooze, bolus vs. basal insulin, and other similar now-obsolete distinctions.

CHANGED: High temp targets and exercise mode

How temporary targets impact operation of OpenAPS in 0.6.0:

  • For SMB, a temporary target of 99 or lower can enable SMBs (when the option for SMBs from targets is turned to true). A temporary target of 101 (or higher) will disable SMBs.
  • A temporary target of (anything less than normal target) will trigger the traditional "eating soon" mode for temporary basal rates - even if target is normally 130, and ES target is set to 100, that will trigger more basal (but per above, no SMB's, since that is >99).
  • Historically, a high temp target solely caused the system to adjust the target and calculate behavior from there. (i.e. a normal target of 100, an 'activity mode' temp target for 2 hours of 140 means that OpenAPS would target 140 instead of 100 for those two hours, then revert upon canceling or expiration to targeting 100). Now, exercise_mode when enabled means that for a target of 111 or higher will create a manual sensitivity ratio, thus adjusting ISF and basals in proportion to this adjusted target. The goal of this is to recalculate IOB down to zero sooner ahead of and during activity, when the human knows this increased sensitivity is coming.

There is another variable, half_basal_exercise_target, for people to configure at which level they'd like basals to be at 50%.

A52 risk mitigation by disabling SMBs with Bolus Wizard

In order to cancel out of any bolus wizard or other menus before bolusing and reduce the risk of pump A52 errors, oref0 now sends ESC three times to the pump before issuing an SMB.

In addition, the recommended method for using SMBs is to enter carbs via NS and easy bolus any desired up-front insulin (generally less than the full amount that would be recommended by the bolus wizard) and then let SMB fill in the rest as it is safe to do so. For situations where the bolus wizard is preferred, such as for carb entry by inexperienced caregivers, or for offline use, we feel that it is safer for OpenAPS to disable SMBs and fall back to AMA until the next meal. In addition to reducing the risk of A52 errors, disabling SMBs when the bolus wizard is in use leads to more predictable AMA behavior (instead of SMB zero-temping) for untrained caregivers in an environment that is usually more prone to walk-away pump communication issues.

For anyone who does not wish to follow this recommendation, and wants to use the pump bolus wizard with SMB despite the increased risk of A52 errors, this change adds support for a non-displayed preference defaulting to false. Anyone who wishes to explicitly acknowledge their increased risk tolerance can add that preference, with a value of true, to retain the old behavior.

  • Using the pump bolus wizard to enter carbs will prevent SMBs from being enabled for COB as long as those carbs are active.
  • Using the pump bolus wizard will prevent SMBs from being enabled for up to 6 hours by the "after carbs" or "always" preferences.
  • If anyone wants to get around that, they can add A52_risk_enable (with the capital A) to preferences and set it to "true" to acknowledge and intentionally use that approach, which we know leads to increased A52 errors.

Purple lines changing in NS

The purple lines in Nightscout have changed. We are removing aCOB (unused by everyone) and subbing in a "zero temp"-predBG line (ZTpredBG, etc.) showing how long it will take BG to level off at/above target if deviations suddenly cease and we run a zero temp until then. It then uses the lowest of those ZTPredBGs to ensure that we're dosing safely with UAM: if UAM predicts BG to stay high (based on deviations), but we wouldn't be able to prevent a low if those deviations suddenly stopped, we'll adjust the UAM-based insulinReq to be somewhat less aggressive. Conversely, if UAM shows BG ending up below target in 4h, but the ZTPredBGs show that we can safely zero temp and level out well above target, it will allow oref0 to be slightly more aggressive and bring BG down faster, safe in the knowledge it can zero temp if needed. NOTE: you will require an update to NS to view the new line. See: nightscout/cgm-remote-monitor#2919

Miscellaneous:

  • 0.6.0 also has support for no-git-based-flow, to reduce git-related errors for most users. This is now the default path.
  • carbsReqThreshold defaults to 1 gram. Can be added to preferences.json if you want to change it to only get carb notifications via Pushover for larger amounts.

Documentation is now updated to support this release

See http://openaps.readthedocs.io/en/latest/index.html for OpenAPS documentation. See openaps/docs#1104 for specifics on what changed related to 0.6.0