Monday 23 April 2012

debuging continues

So the last version of this code turned out to generate rather strange deep stops with zero time. Finally found a small error in the conservatism module that was mis-calculating the stop depths so fixed that.

Now getting values for a first dive from totally equilibrated state (ie at surface with no previous dives) that pretty much match mplan and my old apeks quantum simulator.

I'm finally confident enough of this to begin trying to encode things onto the final pic circuit and encapsulatee in a hopefully waterproof housing. Freescale have confirmed that their pressure sensor can be made water compatible (with no guarantees though) if one injects it with silicon oil of a certain type so am hoping to try this out using a vacuum filler next week. If the MPX5700 doesn't survive I may have to resort to the more expensive SMD variety that the OSTC uses but as this costs £25 I'm a little reluctant to invest until I know that the freescale is useless.

I guess I could try to encapsulate the freescale one in an air filled volume with a pressure transducing membrane but it'd need to be pretty durable whilst having an insignificant effect from elasticity. ....

Instead I'm going to add quite a long tube to the sensor pipe with a very narrow diameter - water will enter this tube but capillary action should keep it from every arriving at the active element. This plus the silicon oil should be ok - finger crossed for a wet test next week.....

 Now do I invest in schurter piezo switches....???

Saturday 14 April 2012

Finally sorted out how to add conservatism to the software. now running at 85% M values and 60% max gradient factor. May give the user options to change these one day. Seems to give very similar profiles to m-plan and vplanner.

25m dive on air 30 mins bottom time square profile descent 15m/min ascent 10m/min
1min at 9m
2m26s 6m
12m32s 3m

output looks like this for all % m values , profile and predicted ascent time.



Hardware platform now developing too. Turns out olimex make a very nice small pic board called a pinguino-OTG which includes a realtime clock , SD card slot and lithium ion battery mangement kit. Just need to add the screen and sensor and a battery ant its ready to dive.
nice things about this is it is 32 bit with lots of program space (32kB) and 8kB of RAM. Should be less of a problem to fit the code into this thing.
Will need a fairly big box though - board is 69mmx54mm .

Wednesday 4 April 2012

Frantic programming session...

Finished dry version of basic software. Now for lots of simulated dives...... sad to say the software is now far too big to fit into pinguino code model so going to have to grit my teeth and use the C18 compiler from microchip....

So far testing has got me agreement (within 1 or 2 minutes) with the BSAC tables although I'm not currently implementing any conservatism so not great for safety so far....


for a 30 minute dive to 30m, I'm getting 10 mins of ascent time with a ceiling of 2.9m at the end of the 30 mins before ascent starts. It's putting in one deco stop at 3m for 6mins and 44s. The rest of the ascent time comes from assuming a fixed ascent rate of 10m / minutes for 30m total ascent.

Given the less than 10cm between ceiling and stop depth I clearly need to build in a bit more caution in deciding the stop depth......

Here's a snippet of one of the generated tables...

dive depth 30m, gas EANx21

nostop time:  16mins (including 1 minute descent time to 30m - fast!)

Dive time is the end fo the square profile bottom time

Dive time (mins)           Ceiling (m)        Asc time    Stops
21                                    1.15                   4m 24s     3metres 1m26s
24                                    1.73                  5m 54s      3metres  - 2m 54s
29                                    2.72                  6m 08s      3metres  6m 08s
33                                    3.43                  12m 32s    6metres 43s, 3metres 8m 49s

lots more to do though...... like getting the code to fit into the pic, adding conservatism buil;ding in gas switching etc