Saturday, February 28, 2015

Dexcom G4 (non AP) - calibration, simplified tech explanation and consequences

Puzzled by your Dexcom?

The Dexcom sensor can be infuriating at times, especially during its first days. In this post, I will try to explain simply the reasons why it may seem to behave in such unpredictable ways. I will (hopefully) reach that goal by using a realistic, but simplified, calibration mechanism example that is too not far from the real calibration algorithm used in the non AP G4.

Quick reminder.

The sensor wire measures the interstitial glucose through a chemical reaction (glucose deshydrogenase) that produces electrical current. That current is measured in a complex process that results in a summary value that we usually call "raw value". It is a numerical value that is supposed to be directly proportional (ok, strictly speaking it is not because there is an intercept/offset but it doesn't really matter) to the interstitial tissue glucose concentration. In this example, we will assume the following

  • we have constant magical access to the real interstitial fluid glucose concentration.
  • our sensing wire is perfect and should always return 650 "ticks" per mg/dL of glucose over the whole range.
  • when exposed to a zero glucose concentration, our sensor will return a value of 30000 "ticks" - that is the initial offset/intercept
And make the following simplifications
  • the insertion wound has no impact.
  • the environmental conditions will not change.
  • our sensor will not age.

This will help us visualize what may happen, why it happens and what we can do to avoid it

Meet our ideal sensor

Our ideal sensor responds perfectly and linearly to the Interstitial fluid glucose concentration. What's not to like? Unfortunately, that perfect view doesn't work in real life (at least with the Dexcom G4) and we have to calibrate it...

First calibrations

At the first initial double calibration, our real interstitial glucose is 80 mg/dL, our perfect sensor returns 82000 (30000+80*650) and our meter returned 65 and 75 mg/dL, which average nicely to 70 mg/dL. Our Dexcom has been told the value it is reading is 70 mg/dL and it recalculates the number of ticks per mg/dL it should use: 743 ticks per mg/dL of glucose (instead of the correct 650 mg/dL). A bit later, the meter returns 155 mg/dL (for a real 150 mg/dL and a real 127500 ticks). The Dexcom computes a value with the scaling factor and displays 131 mg/dL. Not great, but still acceptable. We are just reading too low.

We enter our second calibration point but, unfortunately, traces of sugar on the finger lead to an artificially higher value. Instead of seeing 101500 raw as the equivalent of 110 mg/dL, it is now told that it is worth 140 mg/dL and duly calculates a new value for the number of ticks per mg/dL: 511.

That error starts biting at the next check, where a real IG of 215 mg/dL, seen as a reasonable 205 mg/dL by the meter, sensed as 169750 raw at the wire, is displayed as 273 mg/dL. We are now reading way too high! At that point, we are likely to hit the Internet forums with something like: "I don't understand, we were a bit low and we are now way too high!"

Note: this is a bit simplified, as the Dexcom doesn't use a single value, we'll get to that below.

Let's now quickly look at the opposite case: this time we washed our hands but we have a bit of water on the finger, which leads to a meter under-estimation.

Nothing changes except that the real 110 mg/dL is not metered at 140 mg/dL but at 80 mg/dL. We end up with a new tick value that will ultimately lead to the display of 157 mg/dL for the real 215 mg/dL value, seen as 205 by the meter. We are tempted to conclude that "this sensor is definitely running a bit low" and we make a mental note of it, no big deal, just remember. (really, do remember, you will be surprised later)


Let's now have a look at the dreaded compression event. It is a fairly typical situation. Your kid sleeps on the sensor, the area is compressed, glucose doesn't reach it, the real local IG is at 40, wich the sensor reports as LOW, alarm ring, and we blood check at 90 mg/dL. We are fed up with the beeps, fed up that the Dexcom is so wrong, and recalibrate.

That is a huge mistake, I repeat, A HUGE MISTAKE: the Dexcom is perfectly correct and consistent in its view of its limited world. By recalibrating at that point, we are feeding it utterly wrong data. Just as the Lannisters, the Dex always pays its debts, and pay we will. What we have done is force the Dexcom to recalculate his scaling factor which now stands at a paltry 289 raw ticks per mg/dL. As soon as the compression subsides, and we actually hit that perfect 90 mg/dL value, sensed perfectly at 88500, the new scaling factor leads to a display of..... 202 mg/dL! If we also have treated the false low, we could even be much higher. But even without treating, we could have gone from LOW to 200 in less than an hour while staying at 90 mg/dL all the time....

Lines, Lines, Lines

In each of the above cases, whenever we adjusted the scaling factor, we adjusted the slope of our calibration line. Our second example (post-water) is shown as the green line below. In that case, we will always read too low (until we recalibrate) because we have overestimated the scaling factor: we need higher raw values for each ideal value. The compression example is shown in red. Its effect is quite dramatic as you can see: our scaling factor is so underestimated that we will always read way too high. There is another sever adverse effect in that situation: minor changes in raw values will lead to major changes in displayed values. This will, without any doubts, make an already annoying situation, completely crazy (did I say we would pay for this?).

In fact, fortunately and unfortunately, the Dexcom G4 non-AP doesn't rely on a single value, but it does use up to 6 of the last calibrations to make its mind. Let's see what that means.

In the "post-sugar" situation, the two values we have entered define a new calibration slope, not horrible, but quite far from the ideal line. You'll note that the error introduced remain acceptable in the 50 to 150 mg/dL range and then slowly starts becoming unacceptable.

The "post water" situation may have looked more benign initially (after all, the Dexcom seemed to be just running a bit low) but is in fact much worse than the "post sugar" situation. Look at the chart. In that scenario, you could be at 300 mg/dL with a displayed value below 150 mg/dL. It does not take a PhD in rocket science to realize that this situation can be dangerous.

And finally, lets have a look at the compression event after two calibrations. The calibration slope does not make any sense. Fortunately, in most cases, the Dexcom will come to that conclusion by itself and will ask for a new calibration value or go "???".

But there is hope...

You can't be unlucky all the time. As you enter calibrations, you might be spot-on the real value, a bit above, a bit below. As the calibration builds itself, a better approximation of our ideal curve begins to appear, even if we have been unlucky to introduce a very bad value in a critical range such as the 54 instead of the real 40 here.

Based on this simplified explanation, I hope it has become a bit clearer why
  • the first day or couple of days is typically less accurate than the rest of the week.
  • we sometimes get seemingly absurd "too high - too low - too high" situations.
  • seemingly innocuous situations can suddenly turn into dangerously inaccurate ones.
  • not recognizing compression events and calibrating at that time is a killer.
One other side effect of such a calibration linear technique is that, even if we assume a perfect sensor, the difference between 40 and 70 is 19500 raw ticks. The same difference we find between 300 and 330. With, of course, a completely different clinical signification. 

Since the raw value we see are actually not pure raw values, this may have been addressed by Dexcom in its black box. If it has not, or has only been partially corrected, it is a direct explanation of the relative lack of accuracy in the low range visible on the large scale statistical analysis. I will not, however, take a firm stand on this until I have confirmed there is no correction.

In practice

In practice, for my own use, one of the tips I have developed is to sail through that stormy sea as quickly as possible. At the first hint I am not in a stable situation - or almost by default on the first day - I will enter the first 6 calibrations as quickly as it is possible, possibly more if my analysis indicates that the first 2 or 3 calibrations need to be purged (typically, 6 calibrations during the first 12 - 16 hours) and I will then smoothly sail at 1 or 2 calibrations per day.

PS: I'd like to insist once again that this is not the complete picture. The reality is more complex. Neither the sensor, nor the insertion are perfect. The precise calibration algorithm used by Dexcom in the G4 non AP is a bit different but very similar in principle. The Dexcom AP algorithm and the Dexdrip algorithm are a bit different

No comments:

Post a Comment