Skip to content

Overestimation of IOB #166

Closed
Closed

Description

@thebookins

I have noticed on occasion the IOB calculation in Loop is incorrect. We are using a 722 pump with an iPhone 4s. The preferred data source is set to Event History. Here's one example.

Bolus of 1.4 U at 6:21 PM resulted in a jump in IOB of 2.8 U (I imagine it was counted twice) and immediate temp to zero:
img_1590

The reservoir history does not show a drop of this magnitude:
res

and the history shows a single bolus at 6:21 PM:
history
history_detail

Manually deleting the reservoir history list seems to force Loop to recalculate IOB using pump history alone, resulting in the correct IOB:
correct

Activity

  1. loudnate commented on Sep 15, 2016

    @loudnate
    Collaborator

    Thanks for filing this.

    Manually deleting the reservoir history list seems to force Loop to recalculate IOB using pump history alone

    Do you remember how many entries you needed to delete?

  2. thebookins commented on Sep 15, 2016

    @thebookins
    ContributorAuthor

    No, I just deleted all of them (I think they went back to 12 am) but my son
    wasn't using Loop during the day at school so there was a gap in the
    middle. I'm not sure how many need to be deleted to force a recalculation.

    On Thu, Sep 15, 2016 at 2:40 PM, Nathan Racklyeft notifications@github.com
    wrote:

    Thanks for filing this.

    Manually deleting the reservoir history list seems to force Loop to
    recalculate IOB using pump history alone

    Do you remember how many entries you needed to delete?

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #166 (comment), or mute
    the thread
    https://github.com/notifications/unsubscribe-auth/ALsegJGC_4X1fb-VKDBnW1fzp1xtpCgTks5qqMwygaJpZM4J9eY2
    .

  3. loudnate commented on Sep 15, 2016

    @loudnate
    Collaborator

    there was a gap in the middle

    Do you remember what time the gap ended?

    I'm not sure how many need to be deleted to force a recalculation.

    Just try deleting one reservoir entry next time and let me know what you see.

  4. thebookins commented on Sep 15, 2016

    @thebookins
    ContributorAuthor

    The gap would have ended around 3pm. Will try deleting one entry next time.
    Cheers.

    On 15 Sep 2016 3:07 PM, "Nathan Racklyeft" notifications@github.com wrote:

    there was a gap in the middle

    Do you remember what time the gap ended?

    I'm not sure how many need to be deleted to force a recalculation.

    Just try deleting one reservoir entry next time and let me know what you
    see.

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #166 (comment), or mute
    the thread
    https://github.com/notifications/unsubscribe-auth/ALsegPBfTFFJV0iMy8qSSO8v6TB_4DcZks5qqNKngaJpZM4J9eY2
    .

  5. ps2 commented on Nov 24, 2016

    @ps2
    Collaborator

    @thebookins Have you been able to reproduce this issue?

  6. thebookins commented on Nov 24, 2016

    @thebookins
    ContributorAuthor

    @ps2 I haven't noticed this again since filing the issue, but I also haven't tried to reproduce it, as I don't have a second rig for testing. Could easily have happened again on small boluses without us knowing. I'll have a look at the code to see if there's any way a bolus could be counted twice. Where should I start looking? Somewhere in LoopKit/InsulinKit?

  7. ps2 commented on Nov 24, 2016

    @ps2
    Collaborator

    https://github.com/LoopKit/Loop/blob/master/Loop/Managers/LoopDataManager.swift#L195 is the top level entry point into calculating IOB in Loop.

  8. thebookins commented on Nov 24, 2016

    @thebookins
    ContributorAuthor

    Thanks @ps2 I'm wondering if there's an edge case where the dose is counted once from pump history and then a second time from recent reservoir values. Might have to do with the speed of bolus delivery and the timing of pump bolus events vs reservoir events.

  9. thebookins commented on Nov 28, 2016

    @thebookins
    ContributorAuthor

    @ps2 After a careful read of DoseStore.swift I've realized that the IOB is based on reservoir history alone (if continuous) or pump history alone, so I don't think it's possible for the dose to be counted once on reservoir data and then again on pump history. My best guess for what is happening here is that the reservoir data wasn't continuous, so the IOB was based on event history, and there was some error in deduping the bolus events. Clearing the reservoir history caused loop to crash which deleted the dose caches and forced a recalculation that fixed the problem. Sound plausible?

  10. jmatheson commented on May 18, 2017

    @jmatheson
    Contributor

    Can this be closed?

  11. ps2 commented on May 18, 2017

    @ps2
    Collaborator

    Yes. I think if this was an ongoing issue, we'd be hearing at least some reports of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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