These are chat archives for nightscout/intend-to-bolus

24th
Feb 2015
Scott Leibrand
@scottleibrand
Feb 24 2015 01:40
I don't want to put out a call for pumps and be a central clearinghouse, but if someone knows someone and puts them in touch with someone else, I think that's much lower risk.
Toby Canning
@TC2013
Feb 24 2015 03:06
@diabeticgonewild Excellent work with all of this. When comparing the values side by side there is no meaningful difference between the 530G DIA curve and the other MM models. At most it is within 2 (or so) points for any given minute of the other Medtronic Models (and the T-Slim too).
diabeticgonewild
@diabeticgonewild
Feb 24 2015 03:06
Thank you and you are welcome. I hope it helps. It was no big deal at all to do it. Very easy, but it just took time!
diabeticgonewild
@diabeticgonewild
Feb 24 2015 03:37
Of course, I was filling out a form for OpenAPS about my work, and my 5 year old Mac with a bad logic board (kind of like a motherboard) shuts off and restarts again! So, I am retyping the form...
Toby Canning
@TC2013
Feb 24 2015 03:39
"bad logic board" = illogical board ???
or is that bad logic on my part?
diabeticgonewild
@diabeticgonewild
Feb 24 2015 03:40
The logic board is the "brains" of the computer and it controls the computer.
If it overheats for any reason, the electricity will take the path of least resistance, causing a short.
Matthias Granberry
@mgranberry
Feb 24 2015 03:40
"logic board" is Apple's name for a laptop motherboard
diabeticgonewild
@diabeticgonewild
Feb 24 2015 03:40
Heat increases resistance.
decreases I mean
Toby Canning
@TC2013
Feb 24 2015 03:41
Thank you Mrs. Spock... and Mr. Spock too
You look past my bad pun and go straight for the opportunity to teach!
I actually do love that about both of you :)
diabeticgonewild
@diabeticgonewild
Feb 24 2015 03:43
haha :D
Matthias Granberry
@mgranberry
Feb 24 2015 03:43
humor is tricky over text with people you don't know well. Even if it's obvious in hindsight.
Toby Canning
@TC2013
Feb 24 2015 03:43
Yes, Mr. Spock, it is!
At least for Vulcans...
Scott Leibrand
@scottleibrand
Feb 24 2015 03:45
lol
Matthias Granberry
@mgranberry
Feb 24 2015 03:45
nobody ever wins in a punfight
Toby Canning
@TC2013
Feb 24 2015 03:46
HA! That's a new one for me...
Scott Leibrand
@scottleibrand
Feb 24 2015 03:49
What's the difference between a rhetorical question and a joke?
Matthias Granberry
@mgranberry
Feb 24 2015 03:49
That's dirty pool.
Toby Canning
@TC2013
Feb 24 2015 03:50
What?
:)
Scott Leibrand
@scottleibrand
Feb 24 2015 03:50
:)
that one is more fun to do in person, but it sometimes still works online.
Toby Canning
@TC2013
Feb 24 2015 03:50
Here's a good joke one of my patients told me the other day:
A guy wrapped in saran wrap walks into a psychologist's office.
Psychologist, "I can clearly see you're nuts."
diabeticgonewild
@diabeticgonewild
Feb 24 2015 04:30
LOL
diabeticgonewild
@diabeticgonewild
Feb 24 2015 04:43
Alright I sent out that form that you wanted me to fill out for the OpenAPS group. Hopefully it will explain my work better.
Awesome!
diabeticgonewild
@diabeticgonewild
Feb 24 2015 05:31
This looks like highly useful research for an OpenAPS application http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3879757/
very easy to program too, from what I can tell.
Jason Calabrese
@jasoncalabrese
Feb 24 2015 07:28
@danamlewis @TC2013 I'm not sure if the foundation should be in the middle of pump donations, seems like there could be some issues with that, but maybe there's a way. Maybe @jwedding or someone else did some research and thinks we could help there?
Ben West
@bewest
Feb 24 2015 07:28
I'm not too worried about pump donations
pumps are legally marketed devices
and to boot, everyone actually has an Rx for one
Dana Lewis
@danamlewis
Feb 24 2015 07:29
Right, we just don't want to be publicized as the contacts as a clearinghouse for them though
Ben West
@bewest
Feb 24 2015 07:30
why not
maybe it's not a problem
there are orgs out there that do this publicly for donated/under-privileged use
Dana Lewis
@danamlewis
Feb 24 2015 07:31
Right, but I'm not an org.
Jason Calabrese
@jasoncalabrese
Feb 24 2015 07:32
there's probably some liability, but maybe there's a way to deal with it
Dana Lewis
@danamlewis
Feb 24 2015 07:32
I think the approach before worked. Voice a need, someone can volunteer to send a pump, ppl work out shipping details offline or in private.
Jason Calabrese
@jasoncalabrese
Feb 24 2015 07:32
yeah
that worked for me
off the post in the FB group
yeah, that's basically their recommendation
do it in private
but it would be useful to identify if someone has a knack for matchmaking in this way
Dana Lewis
@danamlewis
Feb 24 2015 07:35
Or ppl who need pumps can just ask, since no one is stepping forward to do rbat
Scott Leibrand
@scottleibrand
Feb 24 2015 07:36
How sneaky of them.
(Medtronic, collecting the "donated" pumps to replace the old firmware)
I suppose the $500 for a 2-year warranty isn't unreasonable. But it does take OpenAPS-capable pumps off the market.
Dana Lewis
@danamlewis
Feb 24 2015 07:39
Yea, I think that's where some of my old ones went in the past
Jason Calabrese
@jasoncalabrese
Feb 24 2015 07:40
wonder when we'll start seeing locked down 522's
Ben West
@bewest
Feb 24 2015 07:40
nah, unlikely
there is no reason for them to retrofit builds for previous models
their intent is to replace models in the market, not recall them
Jason Calabrese
@jasoncalabrese
Feb 24 2015 07:41
but would they re-donate a 522?
Ben West
@bewest
Feb 24 2015 07:41
they take those off the market
last october, they were banned from selling insulin pumps
they don't redistribute those models, they just trash them
Scott Leibrand
@scottleibrand
Feb 24 2015 07:42
?
banned from what?
Ben West
@bewest
Feb 24 2015 07:42
they now sell artificial pancreas systems that integrate pump + cgm
Scott Leibrand
@scottleibrand
Feb 24 2015 07:42
banned by whom?
Ben West
@bewest
Feb 24 2015 07:42
it's not an insulin pump ;-)
FDA
Scott Leibrand
@scottleibrand
Feb 24 2015 07:42
link?
Ben West
@bewest
Feb 24 2015 07:42
might have been year ago, no months
Scott Leibrand
@scottleibrand
Feb 24 2015 07:43
i could see the logic in selling only 530g once it's available, but surprised they'd ban older ones.
Ben West
@bewest
Feb 24 2015 07:44
sorry, previous year
mark was telling me during our time there at the meeting
along with the guy I was sitting next to
when jack barnaby hit the news, it was bad
they started taking hit after hit, there was significant pressure to pull pumps off the market
and mark basically put his foot down and said "we're not doing that"
so plan was to design better, and just organically replace the pumps, they've been pretty successful, you can't buy old models from them
Scott Leibrand
@scottleibrand
Feb 24 2015 07:46
That press release says precisely nothing.
Ben West
@bewest
Feb 24 2015 07:47
there are others, you can google fda medtronic
point being, I'm very concerned about availability of usable pumps
Jason Calabrese
@jasoncalabrese
Feb 24 2015 07:52
what about the euro models
Ben West
@bewest
Feb 24 2015 07:52
oh yeah, love those
there's a 554 that is awesome
veo
Scott Leibrand
@scottleibrand
Feb 24 2015 07:52
Importing those is actually illegal AFAIK.
Ben West
@bewest
Feb 24 2015 07:53
well, I like 'em
diabeticgonewild
@diabeticgonewild
Feb 24 2015 07:53
Correct, class III = no legal way to import them
Ben West
@bewest
Feb 24 2015 07:53
the display IOB on wizard screen
Scott Leibrand
@scottleibrand
Feb 24 2015 07:53
Whereas there's nothing wrong with private party transactions in used US ones.
Maybe we should just find a central message board type thing for people to use. No central coordination at all?
Jason Calabrese
@jasoncalabrese
Feb 24 2015 07:55
a google sheet and a randomizer?
Scott Leibrand
@scottleibrand
Feb 24 2015 07:56
Or just let people list and claim pumps.
No need for an algorithm.
Jason Calabrese
@jasoncalabrese
Feb 24 2015 07:57
only if people want to be more private about it
not sure if that is an issue
Ben West
@bewest
Feb 24 2015 07:58
here's something to think about, RE command and control
there are commands to set all the settings
eg, program the basal schedules, including the alternate/unused ones
turn them on/off
program the sensitivities, ratios
Jason Calabrese
@jasoncalabrese
Feb 24 2015 08:00
so you could push new settings to the pump
would make testing on multiple pumps easier
on an other topic, what are the issues with reading bolus history, doesn't always match the command that was sent or something?
Ben West
@bewest
Feb 24 2015 08:01
I need help making sure that the decoding is accurate
I had to make a number of guesses
if you can tell that a decoded record is not right, it's important to figure out what the right value is , and give me the right values with the raw data
if you have a test pump
great way to do that is to run lots of stuff repetatively
basically cycle through all the values, incrementally
Jason Calabrese
@jasoncalabrese
Feb 24 2015 08:04
I think I saw some discussion about it, wasn't sure what the issue was
Ben West
@bewest
Feb 24 2015 08:04
would be good, eg, to run same bolus wizard commands ten times in a row
changing the ratio in between runs
then run another ten with different bg/carb amounts instead
get it to produce the negative correction fields
then take carelink export csv
and dump the data :-)
I've gotten lots of raw data to re-run, but problem is getting known binary data with known good carelink csv
that's the best, because I can really verify
Jason Calabrese
@jasoncalabrese
Feb 24 2015 08:06
I need to get setup to do that
never enough time, and whenever I do get a chance I'm so tired
Ben West
@bewest
Feb 24 2015 08:07
yeah :-$
plus it's a chore to set up this stuff anyway
really hard to go hack for someone all day and then have any appetite for it at all in off hours
doesn't matter how awesome it is
Jason Calabrese
@jasoncalabrese
Feb 24 2015 08:13
at least I got my mqtt test setup again, but still can't get ssl to work
Scott Leibrand
@scottleibrand
Feb 24 2015 08:31
Wow, we have been working on MQTT for a really long time.
I wonder if it's even worth it.
diabeticgonewild
@diabeticgonewild
Feb 24 2015 08:33
What is MQTT? I know it's going to be a dumb question...
Ben West
@bewest
Feb 24 2015 08:34
it's similar to http, but binary, light weight
2 byte overhead instead of 100s/killobytes with http
Scott Leibrand
@scottleibrand
Feb 24 2015 08:34
Seems like the developer time required to make it work is too high. I wonder if we want that level of overhead. Seems somewhat incompatible with #WeAreNotWaiting...
Ben West
@bewest
Feb 24 2015 08:34
it's done
diabeticgonewild
@diabeticgonewild
Feb 24 2015 08:35
Got it
Ben West
@bewest
Feb 24 2015 08:35
it will also make the battery last longer
it will also cut your cell bill :)
Scott Leibrand
@scottleibrand
Feb 24 2015 08:35
That all sounds good. But what still needs done/tested?
Ben West
@bewest
Feb 24 2015 08:35
depends on your comfort level
I've been using it for 3 months now
think android-uploader shipped it
then as people test the c-r-m, we'll get it patched up/cleaned up
there's also a user-auth project going on, btw
was able to get a quicker approach working with some advice from beta chat room
I have a very very rudimentary version where you have to login in order to see NS
Scott Leibrand
@scottleibrand
Feb 24 2015 08:40
Cool
Ben West
@bewest
Feb 24 2015 08:41
btw, you in town?
Scott Leibrand
@scottleibrand
Feb 24 2015 08:41
Yep. Want to meet up tomorrow or Wednesday night?
Ben West
@bewest
Feb 24 2015 08:42
yeah :-)
Scott Leibrand
@scottleibrand
Feb 24 2015 08:44
Dinner @ Twitter tomorrow?
Ben West
@bewest
Feb 24 2015 08:46
yeah, sounds good
Scott Leibrand
@scottleibrand
Feb 24 2015 08:51
Cool. Text me when you have an ETA.
Matthias Granberry
@mgranberry
Feb 24 2015 17:20
I just got some pretty good results with the IOB-COB branch. I had to adjust the DIA out to 4.5h to get a .85 correlation coefficient. I think the disagreement is due to incorrect basal settings.
Chris Oattes
@cjo20
Feb 24 2015 17:22
It's pretty critical that basals are spot on to get good results really
diabeticgonewild
@diabeticgonewild
Feb 24 2015 17:22
Probably. It would be nice to apply this in Nightscout. http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3879757/ . Very easy to program, given I have made polynomial IOB curves. Too bad math.js is not included in NS, although this can be done without it
Scott Leibrand
@scottleibrand
Feb 24 2015 17:25
I think you can include math.js if it's not already.
diabeticgonewild
@diabeticgonewild
Feb 24 2015 17:25
I'm just wondering, how? It would be very, very nice to
Scott Leibrand
@scottleibrand
Feb 24 2015 17:25
@Mgranberry: how are you doing DIA 4.5 in NS?
Should be easy, just google it.
diabeticgonewild
@diabeticgonewild
Feb 24 2015 17:26
like in my own fork?
Scott Leibrand
@scottleibrand
Feb 24 2015 17:26
Ya
Matthias Granberry
@mgranberry
Feb 24 2015 17:26
@scottleibrand I yanked the DIA curve and swapped it with my own IOB calculation.
diabeticgonewild
@diabeticgonewild
Feb 24 2015 17:26
I mean, I know that's a dumb question, but I am no expert at GitHub
Scott Leibrand
@scottleibrand
Feb 24 2015 17:26
should be one line to include the library.
diabeticgonewild
@diabeticgonewild
Feb 24 2015 17:27
got it
Scott Leibrand
@scottleibrand
Feb 24 2015 17:27
@mgranberry: so does yours support any floating point DIA then?
and if so, have you pushed that to your github fork of wip/iob-cob yet?
Matthias Granberry
@mgranberry
Feb 24 2015 17:28
Let me show you what would probably work:
Scott Leibrand
@scottleibrand
Feb 24 2015 17:29
For backwards compatibility, we could use the existing curve for DIA=3 and yours for anything else
Matthias Granberry
@mgranberry
Feb 24 2015 17:29
and of course I forgot to include the scaling. 1 sec.
Scott Leibrand
@scottleibrand
Feb 24 2015 17:30
Oh, did you just scale my formula?
Or did you use one of the new ones?
Matthias Granberry
@mgranberry
Feb 24 2015 17:30
No, I ripped it out and replaced it, but that looks good too after a quick eyeballing
Scott Leibrand
@scottleibrand
Feb 24 2015 17:30
dunno why I never though of scaling mine. Duh. :-)
diabeticgonewild
@diabeticgonewild
Feb 24 2015 17:30
I scaled mine. Easy to do.
Scott Leibrand
@scottleibrand
Feb 24 2015 17:31
You want to commit and push that to your wip/iob-cob fork and do a PR to nightscout wip/iob-cob ?
that would resolve an open issue asking for 4h
Matthias Granberry
@mgranberry
Feb 24 2015 17:33
sure. I'll try to take care of it later today
Scott Leibrand
@scottleibrand
Feb 24 2015 17:33
awesome thx.
And thx for the idea to scale, Monica. Sorry I was so slow realizing we could do that with the existing formula too. :-)
diabeticgonewild
@diabeticgonewild
Feb 24 2015 17:35
LOL of course you can scale. Actually there are only 4 equations (one for each pump) irrespective of DIA. It's just normalized. Like for a DIA the normalization factor x = (time elapsed - mean time of specific DIA)/std of specific DIA
That's the only difference.
Matthias Granberry
@mgranberry
Feb 24 2015 17:36
That's what all the pumps do, btw.
diabeticgonewild
@diabeticgonewild
Feb 24 2015 17:36
For sure, that would logically make sense. And you are welcome Scott.
I really think this would be awesome in Nightscout, and easy to program (like an hour of work):
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3879757/
Obviously if the IOB exceeds an amount that would produce hypoglycemia based on the current CGM value - ((ISF)*(IOB)), you would want the pump to shut off. You could use this calculation to more accurately predict that with an OpenAPS, and further adjust insulin dosages in general.
Matthias Granberry
@mgranberry
Feb 24 2015 17:41
I need to keep a gist of papers to read
but now that I have NS tweaked it's pretty clear to me that DIYPS's models are going to do a great job for me when paired with my own parameters
diabeticgonewild
@diabeticgonewild
Feb 24 2015 17:45
Yeah, it's a great approach!
Matthias Granberry
@mgranberry
Feb 24 2015 17:45
in fact a 3h DIA coupled with basal adjustments would tend to favor "early" corrections and flatten out the long tail of insulins, which would be closer to physiological insulin delivery
diabeticgonewild
@diabeticgonewild
Feb 24 2015 17:46
True. I can visualize that for sure
Matthias Granberry
@mgranberry
Feb 24 2015 17:49
I don't trust a control system without seeing the result of a laplace transform, though, and I haven't done one in a decade. It might be time to dust off my engineering math books. That and look for a 522. Too bad I chucked mine years ago. I hated entering carbs on that thing.
Scott Leibrand
@scottleibrand
Feb 24 2015 19:04
Dynamic diurnal DIA is interesting. I'll have to read the paper and figure out if we can determine the diurnal variation.
Matthias Granberry
@mgranberry
Feb 24 2015 21:03
there is an error in the formulas given in that paper. The interval [8,8] should probably be [3,8] if their graphs are to believed.
Matthias Granberry
@mgranberry
Feb 24 2015 21:13
it looks like it predicted a previously-unexplained (via my model) low last night.
Does anyone know if there is a metabolic simulator and set of patient parameters for in silico testing that we could use?
pull blue down to increase insulin
click anywhere to make a new event
drag orange to increase carbs
click top of orange to kill event
Matthias Granberry
@mgranberry
Feb 24 2015 21:18
Yep. The Havorka model is what I was looking for. Thanks.
Ben West
@bewest
Feb 24 2015 21:18
:-)
diabeticgonewild
@diabeticgonewild
Feb 24 2015 21:20
yeah, correct @mgranberry , for y(t), the third component of the piecewise equation should be [3,8]
I <3 Hovorka's models. I would trust them completely, but I don't know how to design the nonlinear model predictive controller, although Hovorka has a paper on it from 2004. I think that MATLAB can do it automatically (even the nonlinear MPC) without having to parameterize the equations in the mathematical models for the control algorithm, but I could be wrong, as I have never done it before. http://www.mathworks.com/help/mpc/examples/control-of-a-multi-input-multi-output-nonlinear-plant.html
diabeticgonewild
@diabeticgonewild
Feb 24 2015 21:28
wow, so the Diacon group solved the Hovorka models in c, nice!
Darrell Wright
@beached
Feb 24 2015 21:55
I am looking at the ISF stuff and I am wondering if there is a better way to identify the parts of the time series that mark the start and end of a meal(CoB). Is it just 6hrs(360min) or are there any heristics used.
Scott Leibrand
@scottleibrand
Feb 24 2015 22:30
the code in wip/iob-cob has actually got some additional complexity around the COB decay function. Previously, it was simply initial delay (20m) + carb absorption rate (30g/hr) * carbs consumed. The liver carbs modification actually extends that a bit when there is significant insulin activity while carbs are being absorbed.
@beached does that answer your question?
Darrell Wright
@beached
Feb 24 2015 22:38
I will look there, but the research I am reading has it purely as a function of time(Quantitative Estimation of Insulin Sensitivity in Type 1 Diabetic Subjects Wearing a Sensor-Augmented Insulin Pump). Which I think uses model 2 from " A system model of oral glucose absorption: validation on gold standard data". They seem to use 360min as a hard cutoff.
diabeticgonewild
@diabeticgonewild
Feb 24 2015 23:30
BG: 25 .... Gummy bears for the win.... just woke up too. No Dexcom :(
Matthias Granberry
@mgranberry
Feb 24 2015 23:30
yikes.
diabeticgonewild
@diabeticgonewild
Feb 24 2015 23:31
Yeah, I don't feel that bad. I do have hypoglycemia unawareness (obviously) due to autoimmune autonomic ganglionopathy/neuropathy
I honestly don't worry that much about lows like that. Have too many other problems, honestly
I switched from Humalog to Novolog recently, which I take ~20% less Novolog compared to Humalog.
I am still like 26 so I am waiting for my BG to go up.
I hate when my BG is my age (25)!
Matthias Granberry
@mgranberry
Feb 24 2015 23:35
I noticed that Apidra made me bottom out after most meals. I never was able to get it balanced right.
diabeticgonewild
@diabeticgonewild
Feb 24 2015 23:35
Yeah, I can't get Humalog covered and Apidra doesn't work supposedly with the t:slim
37 now.
36 still :(
diabeticgonewild
@diabeticgonewild
Feb 24 2015 23:44
46 now .... slowly going up. I'm pretty much out of the woods once I reach 50.
I wouldn't be testing so often if I didn't have gastroparesis. I would just assume that I would be "out of the woods" in 10-15 min
diabeticgonewild
@diabeticgonewild
Feb 24 2015 23:58
46 still, FML
Not going to ingest any more carbs. Just going to wait it out.