-
Notifications
You must be signed in to change notification settings - Fork 400
Exercise mode #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exercise mode #684
Conversation
danamlewis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This 1) needs to be a preference for people to enable. 2) default should be off, until this feature is more stable, and is more normalized behaviorally in the community (and well-documented and understood) 3) some thought needs to be given to naming. "Exercise mode" is too vague and will be confusing re: baseline behavior of simply setting a high temp and the system only adjusting the target.
|
Some future documentation notes: How temporary targets impact operation of OpenAPS:
|
|
We just went on a tiny hike for science ;) Exercise mode did very well and the behaviour was much closer to what we would have done manually. IOB at the beginning was 0.5u with Fiasp/ultra-rapid curve/DIA=6h. The recalculation of IOB (0.5u->2.9u) , which led to long low temping, proved very useful. In my opinion the relation between temporary target and sensitivity ratio ( Achieving the same in exercise mode with the current constant of 40 in the formula requires us to set a temp target of 180 for moderate hikes. At least for us a constant of 20 or 25 feels much closer to what we do manually. Also only such constants make it possible to calculate sensitivity ratios of ca. 0.3 which we find typical for more intense exercise. Does oref0 provide a protection against endless low temping? Otherwise extensive low temping in exercise mode might lead to ketoacidosis. |
|
Thanks, good analysis. I think lowering the constant to get even more aggressive low-temping in exercise mode will be good to do eventually. I'd be interested in thoughts as to whether we should make such adjustments all at once in a single release, or start with a higher constant at first and lower it as people get comfortable with the idea... We have chosen not to put any limitations in place on duration of low temping, as preventing low BG is more important than preventing low levels of ketones. We should continue to recommend that people eat during activity if the activity is strenuous enough to keep BG levels low/falling despite long periods of low temping. Dana has found that eating enough while hiking to bring BG levels up a bit and allow OpenAPS to administer some insulin helps prevents an icky ketoney feeling she otherwise gets by the end of a long hike. |
|
If exercise mode becomes an optional preference instead of the default behavior (at least during introduction), I think it would be ok to start with a low constant immediately. The current approach is not a problem during mild exercise, only during more strenuous activity, so relatively aggressive low-temping should be the goal for the new behavior in my opinion. |
|
Seems reasonable. Any other thoughts from others with experience low temping for activity as to what target BG level should correspond to a 50% reduction in basal? To me, 180 does seem a little too high, but 140 doesn't give a lot of wiggle room to shoot for a higher target without overshooting for milder exercise... |
|
We also target 170-180 for strenuous, prolonged exercise (long hiking, long cross country practice, etc) |
|
Do you really aim for a BG of 170-180 or do you set this target to get OpenAPS to do what you want it to do? |
|
@drnoname82 No we don't really aim for 170-180 but find it necessary to set this target to get OpenAPS to low-temp sufficiently. And usually take extra carbs as well. |
|
@jbwittmer so the question at hand is: if you have an activity strenuous enough that it would require basal to be cut in half, what would you like BG to be riding at? If you could set a 160, 140, or 120 temp target and achieve that, which would give you the right amount of extra buffer for the activity? |
|
That's tricky. Often for the type of exercise I do, I don't want a high target as I initially drop and then rise as I go in to anaerobic exercise and put stress on my body. For me 120 would be a max. |
|
Sorry if I didn't read this thoroughly the first time. For a 50% basal and strenuous activity we would require a higher temp target, and we have our basal settings pretty well dialed in for "normal activity". For example for mountainous hiking we would typically set a temp target of 160 and dial basal down to 30% or so. Less strenuous activities like heading to the water park, etc where you're active but not continuously so, we would use a 50% basal and target 140 or so. Our experience is different than Tim's. We need him to start strenuous exercise about 150 because he can precipitously drop with strenuous activity and we've been in the position where we can't get carbs to absorb quickly enough subsequently to catch up, making for a miserable day for all. I don't think he's determined enough to get above his anaerobic threshold with any frequency so we haven't seen that effect. |
|
If no objections, I'm leaning toward changing the 40 to 30 such that 50% basal corresponds to a 160 target instead of 180. We can lower it further from there if testing justifies. |
|
Thanks Scott. I'm keen to test this. A small suggestion. Could the formula be simplified from: |
|
@tepidjuice good idea. I went two steps further and made the formula calculate the constant halfBasalTarget - normalTarget, and then made the constant a variable by setting halfBasalTarget in preferences.json. It now defaults to 160 mg/dL = 50% basal (instead of 180 mg/dL). |
|
Do we want to also have this adjust carb ratio accordingly? |
|
Based on offline convo w/ @scottleibrand and some other-branch-testing we did - leaving carb ratio off from here for now. Let's get the community testing as-is into dev now, with adjusting basals, ISF, and target and see how that does, and can decide and tweak any carb adjustments for this mode later. |
|
Tested successfully. Merging to dev for further testing. See the dev PR for updated notes on behavior and the variable names for preferences. #707 |
|
The introduction of a variable is a great idea. I just tested this feature in dev, however changing |
|
@drnoname82 good catch. PR to fix is at #712 |


As described in #588 and LoopKit/Loop#593, OpenAPS activity mode doesn't do enough (at reasonably low temp target levels) to handle extended aerobic exercise, and often overshoots if you set the temp target high enough to do so. This implements a better approach, which uses the level of the temptarget to set a manual sensitivityRatio. This is used the same way as the autosens ratio, to set the basal and ISF used for current decisions. In addition, it also is used to set the basal used by IOB calculations, such that setting an activity mode raises OpenAPS' estimate of IOB, and causes it to zero temp long enough to get IOB down to a level more suitable for aerobic activity.
These extra adjustments kick in for temp targets > 110 mg/dL, and scale up as the target increases. Some testing will be required to see if the formula used for scaling that up is appropriate or if it needs adjusting to better balance the basal and ISF adjustments against the actual BG target people want to run at during such exercise.