openaps / oref0

oref0: The open reference implementation of the OpenAPS reference design.
http://www.OpenAPS.org
MIT License
431 stars 395 forks source link

Why does oref0.6.0 Zero-Temp me after breakfast? #888

Closed endafarrell closed 6 years ago

endafarrell commented 6 years ago

A few days ago there was a Facebook chat about oref0 zero temping some people after breakfast and Dana asked that perhaps some screenshots could be added to gitter for further discussion.

Given that there's rarely overlap where I am online with knowledgeable people, I though it might be more productive to add the screen shots here in a ticket where the conversation may be kept together.

In these images you'll notice that the pill is slightly different to 0.6.0 - I have added a little detail (I was trying to understand "deviations"), but the core algorithm itself has not been changed.

I have autotune, and my basals are very close to its suggestions.

I use NovoRapid, and I need to prebolus at least 20 minutes before eating.

The carb ratio I used for breakfast this morning was 6.7 - as per the pill. Today breakfast was in two parts a 32g/4.8U and a later 13g/1.9U - though normally I breakfast with just one sitting. This has no effect other than to make the starting conditions a little more difficult to understand.

As I prebolus, I am aware that carbs in the future will not be taken into account, so ZeroTemping between the prebolus and the carbs can be expected. However, when the carbs do arrive, I would expect that oref0 calculates what it needs to and set a neutral temp. However, this does not happen, every day now, and then my glucose levels rise, and continue to do so to the point that I stop the loop (by setting a temp basal type of %) and take control.

My preferences:

root@erig0:~# cat myopenaps/preferences.json
{
        "max_iob": 10,
        "max_daily_safety_multiplier": 3,
        "current_basal_safety_multiplier": 4,
        "autosens_max": 1.2,
        "autosens_min": 0.7,
        "rewind_resets_autosens": true,
        "adv_target_adjustments": false,
        "exercise_mode": false,
        "wide_bg_target_range": false,
        "sensitivity_raises_target": true,
        "unsuspend_if_no_temp": false,
        "enableSMB_with_COB": true,
        "enableSMB_after_carbs": true,
        "enableSMB_with_temptarget": true,
        "enableSMB_with_high_temptarget": true,
        "enableUAM": false,
        "maxSMBBasalMinutes": 60,
        "curve": "rapid-acting",
        "offline_hotspot": false
}
root@erig0:~#

I would really love an explanation as to why oref0's predictions all point to me going low, yet I am using autotune and I do not go low with those autotune settings (I am on a single ISF, single CR and single profile).

image image image image image image image image image

scottleibrand commented 6 years ago

What does the full 4h prediction look like? Is it predicting that BG will drop precipitously from the big bolus, and then gradually come back up as carb absorption ramps up? It looks like later predictions, around the time it starts SMBing, are more accurate, so this may simply be a matter of the remainingCA predictions being fairly conservative, and not predicting that carb absorption will ramp up as quickly as it does. There is also a cap on the rate of carb absorption oref0 will predict, and I think it's lower than the 20 mg/dL/5m you're seeing (minDelta 2 and BGI -18, or Dev 118 / 6 == 19.7).

danamlewis commented 6 years ago

Closing due to lack of activity/resolution in other channels. Please reopen if this is still a pending question.