Giter VIP home page Giter VIP logo

Comments (13)

mountrcg avatar mountrcg commented on July 21, 2024

With people striving for full closed loops, situations like this

2 loop cycles would not administer SMB's due to skip_neutral_temps. May be this can be changed without invalidating the original purpose
Set neutral temp basals By default Medtronic pumps beep on the hour when a temporary basal rate is active. Enabling this option can help reduce the number of beeps heard by interupting a temporary basal at the hour change in order to supress the beep.
of this option, which at the moment would have to be switched off.

from oref0.

scottleibrand avatar scottleibrand commented on July 21, 2024

The reason for skip_neutral_temps was to stop the pump beeping or vibrating from them. Every SMB causes a vibration/beep, so the original intended reason to use skip_neutral_temps doesn’t apply with SMB.

What is your use case for it?

from oref0.

mountrcg avatar mountrcg commented on July 21, 2024

What we see is that between :55 and :00 every loop cycle skips to calculate insulin required, and therefore cannot issue an SMB, if above option is enabled. So wouldn’t it be better to run the full calculation, in order to get necessary SMBs and than skip neutral temps. At the moment the loop is basically stopped, right?

from oref0.

scottleibrand avatar scottleibrand commented on July 21, 2024

Why do you care? AFAICT skip_neutral_temps is approximately useless with SMB, so you shouldn’t have it enabled.

from oref0.

mountrcg avatar mountrcg commented on July 21, 2024

I just saw one user report it for autoISF branch in iAPS, he has a medtronic and had this option enabled not knowing it has such an impact. if I see a setting that might have a huge impact, which is not really seen from the description of the variable – I just think something needs to be fixed. Oref is just too good to not make it better.

from oref0.

scottleibrand avatar scottleibrand commented on July 21, 2024

Gotcha. If you want to change the behavior, I would suggest writing a PR to disable skip_neutral_temps when SMB is enabled.

from oref0.

mountrcg avatar mountrcg commented on July 21, 2024

wouldn't it make more senso to move the conditional here?

from oref0.

scottleibrand avatar scottleibrand commented on July 21, 2024

If you want to make the two functions work together, that might be sufficient, but it'd require some testing. I don't see any reason why anyone would want them to work together, so I'd rather disable skip_neutral_temps if SMB is enabled and not have to think about the interaction effects. But if you have a use case for using both, please feel free to test out that potential solution, and please also describe what the scenario is where both are needed.

from oref0.

mountrcg avatar mountrcg commented on July 21, 2024

I don’t have a medtronic so no experience with it at all.

But if skipNT‘s is just a cosmetic function to prevent beeping, then why should this „cosmetic function“ not work together with the real stuff? In other words, why is there a use case without SMB for skipNT and not a use case with SMB four you @scottleibrand - or am I missing something about skipNT?

from oref0.

scottleibrand avatar scottleibrand commented on July 21, 2024

If it’s important enough to you to keep your MDT completely silent, you have to turn off SMBs, because every bolus makes the pump beep or vibrate. Once you’ve done that, you can further eliminate the beeps and vibrations caused by temp basals running at the top of the hour by using the SNT feature. Doing the latter without doing the former doesn’t really make any sense to me.

from oref0.

mountrcg avatar mountrcg commented on July 21, 2024

ok, then I put your first suggestion in motion. Thanks Scott.

from oref0.

mountrcg avatar mountrcg commented on July 21, 2024

So I suggest just the following:

    // if not in LGS mode, cancel temps before the top of the hour to reduce beeping/vibration
    // console.error(profile.skip_neutral_temps, rT.deliverAt.getMinutes());
    if ( profile.skip_neutral_temps && !enableSMB && rT.deliverAt.getMinutes() >= 55 ) {
        rT.reason += "; Canceling temp at " + (60 - rT.deliverAt.getMinutes()) + "min before turn of the hour to avoid beeping of MDT. SMB disabled anyways.";
        return tempBasalFunctions.setTempBasal(0, 0, profile, rT, currenttemp);
    }

I have enabled sNT

Screenshot 2023-06-26 at 12 57 12

When disabling SMB or the algo disables SMB's sNT kicks in at xx:55 o'clock. I missed screenshotting the clock:
Screenshot 2023-06-26 at 12 55 58

with logoutput (here you see the time), see rT.reason in 4th last log line:

2023-06-26 12:55:12.061311+0200 FreeAPS[50894:17361867] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log: currenttemp:2 lastTempAge:1m, tempModulus:0m
2023-06-26 12:55:12.061695+0200 FreeAPS[50894:17361867] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log: profile.sens:54, sens:54, CSF:5.4
2023-06-26 12:55:12.062048+0200 FreeAPS[50894:17361867] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log: Carb Impact:-3mg/dL per 5m; CI Duration:0hours; remaining CI (1.5h peak):,0mg/dL per 5m
2023-06-26 12:55:12.062787+0200 FreeAPS[50894:17361867] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log: UAM Impact:-3mg/dL per 5m; UAM Duration:0hours
2023-06-26 12:55:12.063223+0200 FreeAPS[50894:17361867] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log: minPredBG: 171 minIOBPredBG: 171 minZTGuardBG: 187
2023-06-26 12:55:12.063595+0200 FreeAPS[50894:17361867] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log:  avgPredBG:187 COB/Carbs:0/0
2023-06-26 12:55:12.064029+0200 FreeAPS[50894:17361867] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log: autoISF disabled, don't adjust SMB Delivery Ratio
2023-06-26 12:55:12.064399+0200 FreeAPS[50894:17361867] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log: maxDelta threshold for BG-Jump to allow SMB's set to: 30%
2023-06-26 12:55:12.064757+0200 FreeAPS[50894:17361867] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log: BG projected to remain above 100 for 240minutes
2023-06-26 12:55:12.065106+0200 FreeAPS[50894:17361867] [OpenAPS] JavaScriptWorker.swift - createContext() - 23 DEV: JavaScript log: naive_eventualBG: 187, bgUndershoot: -117, zeroTempDuration: 240, zeroTempEffect: 443, carbsReq: -104
2023-06-26 12:55:12.065850+0200 FreeAPS[50894:17361867] [OpenAPS] OpenAPS.swift - determineBasal(currentTemp:clock:) - 77 DEV: SUGGESTED: {
    "temp": "absolute",
    "bg": 187,
    "tick": -3,
    "eventualBG": 164,
    "insulinReq": 0,
    "reservoir": 72.28434399902787,
    "deliverAt": "2023-06-26T10:55:12.052Z",
    "sensitivityRatio": 1,
    "TDD": 0.1,
    "insulin": {
        "TDD": 0.1,
        "bolus": 0,
        "temp_basal": 0.1,
        "scheduled_basal": 0
    },
    "predBGs": {
        "IOB": [
            187,
            184,
            182,
            180,
            178,
            176,
            174,
            173,
            172,
            171,
            171,
            171,
            171
        ],
        "ZT": [
            187,
            187,
            187,
            187,
            187,
            188,
            188
        ]
    },
    "COB": 0,
    "IOB": 0,
    "BGI": 0,
    "insulinForManualBolus": 0,
    "deviation": -23,
    "dura_ISFratio": 1,
    "bg_ISFratio": 1,
    "delta_ISFratio": 1,
    "pp_ISFratio": 1,
    "acce_ISFratio": 1,
    "auto_ISFratio": 1,
    "ISF": 54,
    "CR": 10,
    "TDDytd": 43.7,
    "TDD7d": 33.8,
    "target_bg": 100,
    "SMBratio": 0.5,
    "reason": "SMB Del.Ratio:, 0.5, autoISF, disabled, Standard, COB: 0, Dev: -23, BGI: 0, ISF: 54, CR: 10, Target: 100, minPredBG 171, minGuardBG 171, IOBpredBG 171, TDD: Not enough pumpData (< 21h); ; Canceling temp at 5min before turn of the hour to avoid beeping of MDT. SMB disabled anyways.",
    "duration": 0,
    "rate": 0
}

Once SMB is enabled, the regular SMB gets calculated and enacted:
Screenshot 2023-06-26 at 12 56 43

With the following log:
"reason": "SMB Del.Ratio:, 0.5, autoISF, disabled, Standard, COB: 0, Dev: -23, BGI: 0, ISF: 54, CR: 10, Target: 100, minPredBG 171, minGuardBG 171, IOBpredBG 171, TDD: Not enough pumpData (< 21h); ; Canceling temp at 5min before turn of the hour to avoid beeping of MDT. SMB disabled anyways.",

from oref0.

mountrcg avatar mountrcg commented on July 21, 2024

I cannot test on rigs. If someone else could, this would be great!

from oref0.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.