Re: [PATCH] Visualisation of individual oxygen sensor data for CCR dives
stevewilliams at internode.on.net
Wed May 10 07:11:42 PDT 2017
From phone. I am happy for you to show my dives.
I am diving a Kiss manual ccr so the computer is only used as a display of the sensors.
It doesnt do any control, that is up to the computer in my head ;)
Eg where it goes up to 1.75 it would have been me checking that the cells were not current limited.
Also as I cave dive the environment dictates ups and down a fair bit.
I might let the ppo2 wander around rather than always wasteing gas (adding and removing gas constantly) just to be within 1% of a target number like the computer running a solenoid controlling the o2 would.
<div>-------- Original message --------</div><div>From: Jef Driesen <jef at libdivecomputer.org> </div><div>Date:10/05/2017 21:37 (GMT+09:30) </div><div>To: Anton Lundin <glance at acc.umu.se> </div><div>Cc: Subsurface <subsurface at subsurface-divelog.org> </div><div>Subject: Re: [PATCH] Visualisation of individual oxygen sensor data for CCR
</div>On 2017-05-10 11:33, Anton Lundin wrote:
> On 10 May, 2017 - Jef Driesen wrote:
>> I've implemented the scaling factor now. See attached set of
>> patches. It took me a bit longer than expected because there were a
>> few cases where the ppO2 still ended up being zero. And that turned
>> out to be for dives without external O2 sensors enabled (e.g. fixed
>> setpoint mode). But the tricky part was that the external PPO2 bit
>> seems to be reversed. According to the documentation  external
>> PPO2 is 1 and internal PPO2 is 0. But based on the data I have, it
>> seems to be the opposite.
>> BTW, I wonder if we should ignore the setpoint value when external
>> O2 sensors are used? Are setpoint still used in such case?
> Do we have any data from a Shearwater running as solenoid controller?
> Ex. On the JJ-CCR's they use a Shearwater Petrel with sensors which
> controls the o2 solenoid to try to get the o2 sensor values to match
> your configured setpoint.
I have data from several Petrels, but I have no idea how they were being
used. Is it possible to detect this somehow based on the data itself?
> That said, I think setpoint values are still interesting to see, to
> validate how well the controller did manage to try to keep the o2 close
> to the setpoint.
After looking at the data, I had the impression that the setpoint value
is "unused" because it seems to just contain some "dummy" value (for
example the last used value, or some default value).
I'll illustrate with an example dive from Steve's Petrel (*). This dive
has a fixed setpoint of 0.70 on every sample, but the ppo2 values range
from 0.32 to 1.74!
(*) I can send you the data if you want to take a look. I don't know if
Steve is okay with sending his dives to a public mailinglist, so I
didn't attach it to this email.
To me that doesn't look like the dive computer is even trying to keep
the ppo2 close to the setpoint. At least not to the setpoint value
that's stored in the sample. Hence my question whether this value is
relevant or not?
> Attached is the last iteration I did of the sensors patch. It has some
> minor differences from the one you included, but most of them isn't
The part where you add 1024 to the calibration value is actually worse
then the original version where you only did that if the value is
smaller than 1000. It works (although not perfect) for the Predator, but
it breaks for the Petrel because it doesn't need any correction at all.
The variant with the if < 1000 works for the Petrel because the values
are always greater than 1000, and also for some Predators, but not all
because sometimes the values are greater than 1000 too. So if you want
to do it correctly, then you would need to check on the model as I did
in the third patch. If you want, I can move that code from the third
patch to the second one.
The SENSOR_AVERAGE is maybe a good idea to keep around. Might come in
handy once we have a way to communicate the type of value (sensor vs
> The only relevant information is that the adc offset value is probably
> in 0.025 mV as unit.
> Thats party based on the information in
The info in the comments is indeed useful knowledge, but since we're not
using the adc values, it's pretty pointless to store them in the parser
struct. It's just a waste of space there. I know it's only a few bytes,
but I see no good reason to clutter the code with unused stuff.
> The only real comment about the code is that I would have liked to see
> the calibration factor kept as a int, and just change the unit factor
> from .00001 to .000022, between the models.
What would be the advantage of that? That would mean yet some other
field to store the scaling factor, or doing some "if (model ==
PREDATOR)" when calculating the ppo2. Now it's just done once in
advance, making the conversion from millivolt to ppO2 independent of the
model. I'm even tempted to pre-multiply the value with the 100000.0
factor too, to get rid of an extra
subsurface mailing list
subsurface at subsurface-divelog.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the subsurface