Skip to content
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

maxDelta bg % threshold as hidden preference #1382

Merged
merged 6 commits into from
Aug 30, 2020

Conversation

Foxy7
Copy link
Contributor

@Foxy7 Foxy7 commented Aug 21, 2020

As per @tynbendad #1278 (comment), we also run into this issue regularly with fast carbs and bgs < 6 mmol/L.

So added a hidden optional % threshold to disable SMB.

Tried this out for the past 24hrs and works as normal at 20%, RigToo running updated % threshold, MealsDev2 running Dev.

Aug 21 12:48:56 RigToo pump-loop.log maxDelta 1.4 > 20% of BG 5.9 - disabling SMB
Aug 21 12:48:57 RigToo pump-loop.log "minPredBG 11.3, minGuardBG 6.9, IOBpredBG 11.8, UAMpredBG 13.8; maxDelta 1.4 > 20% of BG 5.9: SMB disabled; Eventual BG 13.8 >= 6.0, temp 0.35<1.6U/hr. "
Aug 21 12:51:06 MealsDev2 pump-loop.log maxDelta 1.4 > 20% of BG 5.9 - disabling SMB
Aug 21 12:51:07 MealsDev2 pump-loop.log "minPredBG 11.2, minGuardBG 6.9, IOBpredBG 11.6, UAMpredBG 13.6; maxDelta 1.4 > 20% of BG 5.9: SMB disabled; Eventual BG 13.6 >= 6.0, temp 1.6 >~ req 1.6U/hr. "

Then changed the threshold to 10% in preferences on RigToo and got the following result post lunch.

Aug 21 12:59:11 RigToo pump-loop.log maxDelta 1.7 > 10% of BG 9.3 - disabling SMB
Aug 21 12:59:12 RigToo pump-loop.log "minPredBG 17.7, minGuardBG 10.9, IOBpredBG 14.5, UAMpredBG 20.9; maxDelta 1.7 > 10% of BG 9.3: SMB disabled; ; Canceling temp at 59m past the hour. "

Copy link
Contributor

@scottleibrand scottleibrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d want to add some bounds checks for this: it’s unsafe to set this much above 0.2.

@Foxy7
Copy link
Contributor Author

Foxy7 commented Aug 30, 2020

@scottleibrand Thanks, I've updated the code to set 0.2 as default and 0.3 as a cap.

I think this along with PR #1365 will help limit the SMB whilst BGs are low or jumping up from a compression low but also capture the requirement for SMB when BGs rapidly rise following fast acting carbs.

Having looked out our recent data I can see BG % moves regularly hit 22%, but we have a lot less 30% moves these days, possibly due to better experience of the system/tuning.

Copy link
Contributor

@scottleibrand scottleibrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment comment. Otherwise LGTM.

@@ -51,6 +51,7 @@ function defaults ( ) {
, maxUAMSMBBasalMinutes: 30 // maximum minutes of basal that can be delivered as a single SMB when IOB exceeds COB
, SMBInterval: 3 // minimum interval between SMBs, in minutes.
, bolus_increment: 0.1 // minimum bolus that can be delivered as an SMB
, maxDelta_bg_threshold: 0.2 // maximum % change in bg to use SMB, above that will disable SMB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically a multiple, not a percent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, have removed the %.

@scottleibrand scottleibrand merged commit b51cfe2 into openaps:dev Aug 30, 2020
@Foxy7 Foxy7 deleted the dev_maxDeltaBGthreshold_2 branch August 30, 2020 19:57
TrachYuri added a commit to TrachYuri/oref0 that referenced this pull request Sep 2, 2020
maxDelta bg % threshold as hidden preference (openaps#1382)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants