Decompression model source code and verification/checking

OSTC's running hwOS sport or tech
Post Reply
aquarat
Posts: 24
Joined: Sunday 12. June 2016, 11:18

Decompression model source code and verification/checking

Post by aquarat »

Good day

I have an OSTC Sport, which I am very happy with. Someone recently asked me how certain I was whether or not the decompression model implementation on the OSTC Sport is accurate and I couldn't answer.

So I was wondering, has the decompression code for the Sport ever been checked by a third party ?
Also, is the Sport's decompression model code close/identical to either of these files :
p2_deco.c (OSTC2)
or
p2_deco.c (hwOS)

Thank you
OSTC 3 # 4897
OSTC Sport #12887
OSTC Sport #13246
aquarat
Posts: 24
Joined: Sunday 12. June 2016, 11:18

Re: Decompression model source code and verification/checking

Post by aquarat »

In your hwos_code repository you have automated tests for gas volume consumption in "Tests", do you have tests for your deco model ?
OSTC 3 # 4897
OSTC Sport #12887
OSTC Sport #13246
aquarat
Posts: 24
Joined: Sunday 12. June 2016, 11:18

Re: Decompression model source code and verification/checking

Post by aquarat »

I would have expected that these kinds of queries would have been welcomed by HeinrichsWeikamp. They're not difficult questions to answer; "yes, yes, no" or "You need to buy an OSTC 2/3/4 to ask these kinds of questions".

I'm currently trying to simulate the decompression model (p2_deco.c) on an x86_64 machine using gcc on Linux. The only odd thing I haven't yet worked out is
[pre]
(from simulator.asm: line 117/deco_setup)
movlw LOW(.1000)
movwf int_I_pres_surface+0
movwf int_I_pres_respiration+0
movlw HIGH(.1000)
movwf int_I_pres_surface+1
movwf int_I_pres_respiration+1
[/pre]
which seems to imply int_I_pres_surface is a 16-bit float.

I'm surprised that you don't have automated tests for your decompression model code (especially when you do have tests for code which is arguably less important).

All that said, my OSTC Sport, with GF set to 30/70 roughly matches a Suunto D4i with +1 conservatism, at least on the first dive.

Thank you and apologies for being difficult.
OSTC 3 # 4897
OSTC Sport #12887
OSTC Sport #13246
heinrichsweikamp
Posts: 4383
Joined: Sunday 13. May 2007, 18:07

Re: Decompression model source code and verification/checking

Post by heinrichsweikamp »

Hi,

We've tested this code intensively, mostly in real life (I did ~1000 dives with this code personally + millions of dives of the 20000+ OSTC users) but also using a simulator. We haven't found a bug for a while now in this part of the firmware so I'm quite confident that it's fine for the ranges we build the computer for (120m, 40h max. dive time).

But, honestly, no complex code (Deco code is ~ 2000 lines of C) is bug free. If you find something: Let us know!

regards,
matthias
aquarat
Posts: 24
Joined: Sunday 12. June 2016, 11:18

Re: Decompression model source code and verification/checking

Post by aquarat »

Thank you very much Matthias --- once I figure out what the inputs (int_I_pres_surface) are I'll be able to compare it to other decompression implementations :P .
OSTC 3 # 4897
OSTC Sport #12887
OSTC Sport #13246
heinrichsweikamp
Posts: 4383
Joined: Sunday 13. May 2007, 18:07

Re: Decompression model source code and verification/checking

Post by heinrichsweikamp »

Hi,

It's the surface pressure in mbar.

regards,
Matthias
Post Reply