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

26th
Nov 2015
kenstack
@kenstack
Nov 26 2015 01:05
@cjo20 are you calculating the activity for a bolus or a constant basal ?
Chris Oattes
@cjo20
Nov 26 2015 01:05
that'd be for a bolus
kenstack
@kenstack
Nov 26 2015 01:51
@cjo20 Here is what I got
blob
kenstack
@kenstack
Nov 26 2015 01:59
the dots are for 5 minute intervals and represent the activity (ie the drop) for the next 5 minutes - was that what you are after? The end slope of the original IOB curve is the issue there - it of course totals correctly but your right I dont like that little blip at the end
I have family in for the holiday but Ill work on a better fit over those last 30 min so thanks ! We can do the same activity curve for a basal if you like but you need to do the integral correctly in deltabg - the math I use in glucodyn for the basal integral is in a document called basicmath.pdf in the perceptus repo
Jim Matheson
@jmatheson
Nov 26 2015 02:26
@ochenmiller i really like the concept of rating meal 1-5. Easy to do guesstimate and if in ballpark openaps can do much better. Initially i wanted to be very specific in my entries but in the end it may be too much work to stick with. Ifttt has a separate app called Do that might be an easy first concept test
Scott Leibrand
@scottleibrand
Nov 26 2015 02:29
I suspect anything within about 15g should be good enough for our purposes. Main challenge with a 1-5 or SML scow is calibrating it for each user without introducing a machine learning component.
So I'm actually inclined to let people keep entering carb guesstimates into bolus wizard or care portal.
Jim Matheson
@jmatheson
Nov 26 2015 02:31
I suck at estimating :)
But yea agree that we'd nee some sort or macine learning i guess
Scott Leibrand
@scottleibrand
Nov 26 2015 02:33
You don't have to be all that precise, and you're more likely to learn to be accurate (+/- 15g) than I am to implement ML. ;-)
Chris Oattes
@cjo20
Nov 26 2015 02:46
kenstack: I wonder if you could design a curve from that second derivative
you want one turning point at 75 mins, another at 180 mins
and for a x-crossing at 180 too
it's getting the scaling right for the final IOB curve that'd be a pain though
Jason Calabrese
@jasoncalabrese
Nov 26 2015 02:51
If there was an OpenAPS loop status pill in NS what should it show, could add lots of details to the tooltip
Trying to think of something concise, maybe even an icon
kenstack
@kenstack
Nov 26 2015 02:56
@cjo20 yeah no worries I can get rid of the blip so the bg velocity in the last 30 continues to drop - given how approximate all this stuff is its not going to matter much - even that blip in the last 30 min is only going to lead to a few points of BG under calculated in the first 150 min and a few being over over calculates in the last. but it is working fixing for sure
I meant the acceleration - the bg is still dropping even with the blip
I also want to move away from walsh in the first 30 minutes - walsh over predicts BG drop over the first 30 - I have not observed much drop at all at east with my n of 1 :)
Chris Oattes
@cjo20
Nov 26 2015 03:03
I tend not to have much drop for the first 15 mins or so. I have started noticing it after that
kenstack
@kenstack
Nov 26 2015 03:03
yeah MDT's iob calculator is zero for I think 30 min - but then again they are very conservative
Chris Oattes
@cjo20
Nov 26 2015 03:28
kenstack eugh, trying to design a graph properly runs in to floating point precision issues :/
kenstack
@kenstack
Nov 26 2015 03:28
oh yeah :) law of too small numbers :) Ill play with it over the holiday
Chris Oattes
@cjo20
Nov 26 2015 03:34
ah, no. The problem is that I specified one of the roots, but not the other
kenstack
@kenstack
Nov 26 2015 03:40
I remember when I was doing this now why I used the 4th order - it was to better approximate the first 30 min where there is little to no drop - as you drop the order the accuracy up there gets poor I think - I'll send you the activity curve for a temp basal when I get a minute too that's useful to visualize if you are temping to zero for lows - though it's important to realize that if you total insulin level drops to near or below your basal rate none of this math is right - net haptic glucose balance effects dominate and you'll get the wrong answer - I'm actually working on a model right now that will add low insulin level estimates to "bolus wizard" type math like we all do - I really worry about the fact that we are all using this stuff and it's likely really wrong during drops and low levels of insulin
Chris Oattes
@cjo20
Nov 26 2015 03:41
kenstack: I'm mainly looking at how to design curves right now
kenstack
@kenstack
Nov 26 2015 03:45
@cjo20 for the iob curve @bustavo and I have discussed using a piece wise function - zero for however long you feel it takes to begin to see the effects of insulin on bg then a lower order polynomial for the rest of the curve - will avoid things like the blip and let people better tune their dia as many people have commented Walsh's curves are too agressive early on
Chris Oattes
@cjo20
Nov 26 2015 04:08
oh, I know why I'm failing. Trying to generate a cubic means that the first derivative is quadratic, and therefore symmetrical, so trying to have the peak not be at 1/2*dia breaks things
I'm an idiot :P
Chris Oattes
@cjo20
Nov 26 2015 04:16
kenstack: http://imgur.com/3JcOH6x my attempt at a designed cubic (y = x^3/2916000 - x^2/10800 + 1)
Peter Miller
@ochenmiller
Nov 26 2015 04:19
@jasoncalabrese , regarding openaps pill I'd want to know the following: 1. How long since last successful interaction w pump. 2. Bolus Insulin vs applied by temp. 3. Reservoir. 4. Pump battery.
Jason Calabrese
@jasoncalabrese
Nov 26 2015 04:19
I'm thinking there might be 2 pills, loop status and pump status
then pump status would work for mmconnect also
Peter Miller
@ochenmiller
Nov 26 2015 04:20
I'd also like to see a IOB timeline.
Chris Oattes
@cjo20
Nov 26 2015 04:20
kenstack: altough that does peak later than both walsh and the current oref
Peter Miller
@ochenmiller
Nov 26 2015 04:21
I've been stuffing iob into the CGM records to make them easy to see.
Also because my loop is triggered by a new CGM record rather than by cron
Jason Calabrese
@jasoncalabrese
Nov 26 2015 04:23
for pumps we're thinking something like this: nightscout/cgm-remote-monitor#1355
currently working on extending device status
Peter Miller
@ochenmiller
Nov 26 2015 04:26
That looks right on the money to me.
kenstack
@kenstack
Nov 26 2015 04:29
cool - what does your actual iob curve look like?
kenstack
@kenstack
Nov 26 2015 05:03
blob
@cjo20 there is the compare for oref - the yellow represents a temp basal of 1 u/hr over the first hour versus a 1 unit bolus at time 0. First graph is delta bg, second is the 5 min activity values - its useful to see the timing tradeoff of using a basal versus a bolus (obviously you have the risk of your loop giving boluses) - you can of course shorten the basal and give it over 30 min I can do the curve or send you the .nb file
eyim
@eyim
Nov 26 2015 05:10

@danamlewis Yes - we have been running at nights for the past week or so. The main issues we have been facing technology wise has been getting the openaps system close enough to the pump to continually read what is going on and then also getting a continuous reading on the dexcom. Lots of ??? time periods that the openaps system can't use. I've figured out how to deal with the range by running the pi on a battery at night and putting it in bed with him. And a new Dexcom sensor has limited the ??? time periods.

However, the biggest issue is that I think we have a bad 722 pump. As soon as we switched pumps, we have been having wild swings so bad that no system can handle them and has even been difficult for us to manually handle them. A few honestly had me very worried. I posted a few of the nights earlier this week. The only benefit is that we were able to test the openaps system at some extremes.

But then everything even went more haywire last night. He was in a good range with no carbs on board and no insulin on board at 3 am then went straight to 500+ and had keytones - which never happens to us. Unfortunately, the dexcom system was showing ??? so the openaps could not respond but even still there is no reason why this should happen. I switched pumps this morning back to his 723 and he is back to normal and no more wild swings.

So I need to find another 722 pump
kenstack
@kenstack
Nov 26 2015 05:12
@eyim wow that sucks .... this is hard enough without pump issues .... hope hes ok
eyim
@eyim
Nov 26 2015 05:12
@kenstack Thanks Ken - Ya it has been a tough few days. But the lack of wild swings today just confirmed that we have a bad pump
kenstack
@kenstack
Nov 26 2015 05:13
ugh ... really sorry to hear ....
Scott Leibrand
@scottleibrand
Nov 26 2015 05:25
Wow, scary. Wonder if there is any way to see what it is actually doing. If you had enough patience, maybe just put saline in and set a basal and watch how long drops take to form?
Jason Calabrese
@jasoncalabrese
Nov 26 2015 05:27
Think they have a way to test the pump, filling a cap or something
eyim
@eyim
Nov 26 2015 05:53
Yep - I been thinking about running tests like that. When I first got the pump, I did several test to make sure it worked but not the exact dosage amount. My guess is that the sensor on the piston isn't working correctly as it doesn't mate with the bottom of the reservoir cleanly every time. And this might be causing it to give too much insulin at times and none at all at other times.
Dana Lewis
@danamlewis
Nov 26 2015 05:54
:/
Jason Calabrese
@jasoncalabrese
Nov 26 2015 07:43
Screen Shot 2015-11-26 at 12.43.03 AM.png
getting loop/pump status info uploaded and into the NS client
now to figure out what to display
Ben West
@bewest
Nov 26 2015 08:04
very tempting to get openap community one made
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 12:13

I am working on a system to control the OmniPod Pod. My approach is to let an Android app, PodHIC, use the PDM-Remote Human Interface to send temp basal commands to the Pod. The app dose that by reading the PDM-screen and controlling the PDM-buttons. It’s a very early bulky prototype but I can now successfully with the PodHIC send and temp basal command and also end a temp basal command and get a status update of what the current basal running is. You can see movies of it uploaded in the slack channel OminAPS.

I am now thinking of hove to use this should I go fore and 100% Android App or should I make an interface between OpenAPS running on Pi and the PodHIC Android app that speaks to the OmniPod system.

What do you all think is the best approach? Are there any plans to move current OpenAPS implementation from Pi to Android?

Joakim Ornstedt
@joakimornstedt
Nov 26 2015 12:19
Thank you, I know about HAPP. But as I understand no one is running HAPP connected to a pump?
Milos Kozak
@MilosKozak
Nov 26 2015 12:22
i think closest is @LorelaiL with DanaR pump
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 12:26
Are HAPP and OpenAPS on Pi going to live side by side?
Or are people eventually going to move from Pi to HAPP?
And where do I put RundTrip on the map?
I guess I am trying to find the right track to get in to?
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 12:35
This message was deleted
blob
Lori
@LoriLori
Nov 26 2015 12:46
@joakimornstedt nice, how do you read OmniPod display?
Milos Kozak
@MilosKozak
Nov 26 2015 12:52
incredible hacks around :)
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 12:52
@LorelaiL Thank you, I read it by the cell phone camera, so when a run the PodHIC app I put the phone 2-3 inches above the PDM. This is in the first step intending for overnight use.
Lori
@LoriLori
Nov 26 2015 12:53
my pod controller started to show error once I disassembled it :( congrats you did it right
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 12:53
blob
Lori
@LoriLori
Nov 26 2015 12:54
yes, it is some LVDS signal, would need some fpga or fast controller
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 12:55
This is the backside of the display module in the PDM.
I would be great if I can connect directly to the screen signal and get it into the PodHIC app.
Do think it’s possible?
Lori
@LoriLori
Nov 26 2015 12:56
DSC_0096s.jpg
had my pod too :)
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 12:57
:-)
How much work do you think it’s to read the display signal directly?
Lori
@LoriLori
Nov 26 2015 12:58
lets see what i mx21 supports as display interface
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 13:01
http://cache.freescale.com/files/32bit/doc/data_sheet/MC9328MX21.pdf?fpsp=1&WT_TYPE=Data Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation&fileExt=.pdf
Display and Video Modules
— LCD Controller (LCDC)
— Smart LCD Controller (SLCDC)
— CMOS Sensor Interface (CSI)
Lori
@LoriLori
Nov 26 2015 13:03
think it would need fpga programming, maybe try some freelance site
typically fpga drives displays. reverse should be doable too
I was rather searching for some debug port in pod, but didn't check all test points
may be they put those information in some format somewhere
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 13:05
Okej
I was also thinking of a debug port but never put any effort on that track
Lori
@LoriLori
Nov 26 2015 13:07
didn't went with tracking of wireless chip to main chip comm
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 13:07
What did you mean by reverse should be doable too
Lori
@LoriLori
Nov 26 2015 13:08
this video explains signals there https://www.youtube.com/watch?v=DIIjVSmbtFc
reverse would mean we connect pod display connector to instead of display to some chip
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 13:12
Great clip, thank you!
Lori
@LoriLori
Nov 26 2015 13:13
it seems for we would need about 40M/s sample frequency for 320x240 display
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 13:13
Are you interesting in teeming up on this OmniPod track?
Lori
@LoriLori
Nov 26 2015 13:16
would love to
may be next gen pod controller with dexcom integrated will be more hack friendlly
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 13:19
May be it is, I believe that in the new gen the actual pod is not change, just the PDM-remote.
Lori
@LoriLori
Nov 26 2015 13:20
hopefully they will use some chip we can dump firmware from
or better USB interface rather then one file history
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 13:22
Yes, I wonder what the IR port is for. I also wonder if it is possible to connect to USB in OTB mode and get the PDM-remote to not become an USB memory stick.
Lori
@LoriLori
Nov 26 2015 13:23
what surprised my there is separate USB chip, USB port is not connected to mx21 even it had capability of USB
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 13:26
I did not know that, I know the mx21 has USB support, interesting...🤔
Lori
@LoriLori
Nov 26 2015 13:26
there is memory chip on the back, but tsop48 pin paralel flash, I don't have equipment to dump it
if you have some local hacker lab may be they would have some equpment
after having firmware dump, we could have higher chance to do something
Joakim Ornstedt
@joakimornstedt
Nov 26 2015 15:20
@LorelaiL: I have one problem, with the power button. If I shorten it when its off – nothing happened, but if a shorten it for 2 sec when the PDM is on it shuts down. Do you have any ides why I works to power off but not to power on?
Dana Lewis
@danamlewis
Nov 26 2015 17:54
@joakimornstedt HAPP is a manual alert system based off of openAPS. There is definitely interest in making the full closed loop openAPS usable on something other than a Pi (like android), but other than Toby (Roundtrip), no one has that working. People are also exploring with Edison & other tools as well.
Jason Calabrese
@jasoncalabrese
Nov 26 2015 20:01
Screen Shot 2015-11-26 at 12.48.35 PM.png
initial OpenAPS monitoring in NS
openaps/oref0#33
and nightscout/cgm-remote-monitor#1375
Ed Raskin
@msrcgm
Nov 26 2015 20:47
Hi Gang, so I've been stuck at the state of having the loop running, but can't visualize. Seems like there are a lot of new tools like Nightscout visualization and oref0, but I don't see any instructions as to how to make this all work together. Anyone willing to do some handholding. I would love to actually be up and running in a meaningful way.
Scott Leibrand
@scottleibrand
Nov 26 2015 21:10
The openaps side of it is pretty well captured at https://github.com/openaps/oref0/blob/master/bin/ns-uploader-setup.sh
Dana Lewis
@danamlewis
Nov 26 2015 21:10
Happy thanksgiving everyone!
Scott Leibrand
@scottleibrand
Nov 26 2015 21:11
Just merged
timomer
@timomer
Nov 26 2015 21:34
@jasoncalabrese how did you get APS Result into that tool tip? is it a tool tip for the temp basal?
Jason Calabrese
@jasoncalabrese
Nov 26 2015 21:37
I'm working on some stuff to handle generic device status in NS
Starting with OpenAPS and generic pump
timomer
@timomer
Nov 26 2015 22:14
cool
ill hold back then :)
It seems like it might be a less drastic option that doing a full power-down-reset of the USB bus to get the carelink to start working again
(it should mean that wifi keeps working, even while you reset the carelink, for example)
Scott Leibrand
@scottleibrand
Nov 26 2015 22:48
You have a Pi to test it with and update the reset-usb script?
Oskar Pearson
@oskarpearson
Nov 26 2015 22:50
Only one carelink at the moment, and it's in-use at the moment
I'm using it to successfully reset the rfcat device tho
(We're likely getting another carelink early December.. nobody seems to have them..)