Skip to content

Dangerous overestimation of COB after extended carbs entry, as if entry was doubled #4436

@planiitis

Description

@planiitis

AAPS version 3.3.2.1
Glucose sensor: Freestyle Libre 3+ via Juggluco (1-minute interval!)
Pump: Omnipod Dash
Using closed loop with SMB enabled in Simple mode

  • 12:16:19: Starting with no COB recorded, I made an extended carbs entry of 70 g with a time offset of -10 min and a duration of 1 h.
  • 12:16:46: I used the calculator to perform a bolus, based on BG, COB and IOB. COB at this point was 16.4 g.
  • 12:17: AAPS set temp basal to 0.00U/h (it remained at 0.00U/h until 15:58).
  • 12:20–14:40: AAPS kept giving SMBs, keeping the glucose level in range (peak of 9.6 mmol/l at around 13:00). With some exceptions between 12:29 and 13:01, every SMB was delivered at 5 minute intervals, at either xx:x0 or xx:x5.
  • 12:51: Peak recorded COB at about 45 g. Graph shows four individual peaks spaced 15 minutes apart.
  • 14:56: The glucose level started dropping rapidly and I started getting warnings about up to 42 g additional carbs required. Looking at the history graph, at this point the BG was at around 8 mmol/l the COB was at 0 g, while the IOB was very high: enough to reduce the BG further by about (IOB * ISF) = 15 mmol/l or absorb about (IOB * IC) = 55 g of carbs.
  • 15:06: I noticed something very troubling:
    • Suddenly the COB had jumped from zero to 57 g, and the history graph showed a peak of 114 g at around 12:56. The graph also showed twice as many peaks, as if the extended carbs entry had duplicated and shifted by 5 minutes.
    • At the next refresh a few seconds later it was all back to normal again, showing 0 g COB with a peak at about 46 g at 12:46.

It seems that the calculated COB has been repeatedly switching between the proper amount and one based on a duplicated carbs entry, effectively giving up to twice as much insulin via SMB as it should. It actually keeps switching between the correct and the wrong COB as I'm writing this at 17:00 UTC.

There's a very specific pattern: The wrong calculation happens every 5 minutes, at xx:x0 or xx:x5, then reverts to the correct one at the next recalculation one minute later. Some sort of off-by-one error somewhere?

This is of course a serious safety concern and needs to be fixed. I'll see if I can provide relevant log data. I have disabled SMB on my instance for now (while SMB is not the cause here, it does make the issue worse).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions