failsafe for a submarine in arduino

Hi all

I have a model sub which works very well but I am trying to automate it.  The sketch is now complete (subsketchlatest14) other than this last issue that I can’t seem to get right at all.  Even with suggestions, nothing works.


What I want is code which recognises the transmitter when it is off, which can then in turn, turn on a failsafe function.

So I have stripped down the sketch to a couple of bare elements and attached it.  I have attached a video of the screen and the serial monitor, running the attached script.  What it shows is the reading of ‘unballastin.’ It works normally and you can hear the relays clicking as it runs between 1200 and 1800.  When I turn the Tx off, the input becomes completely random. It appears to be between 0 and 40000.

http://youtu.be/1TlLvrqY3RY

What I need, is to have some code that recognises the scramble, waits maybe 4 seconds (there is no hurry in a sub) to check this is an ongoing problem and not an minute glitch, and then clicks into failsafe mode.  What I would like is the PISTON_SURFACE_PIN, to go LOW, or ‘on.’

What is also needed is for the failsafe function to come off when the input is restored to normal. 

If anyone can lend a hand I would be most grateful.  I have spent days on this so far. 

I first came across arduino 3 months ago.

John

subsketchlatest14.ino

substripped.ino

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi John - you are basically looking for a failsafe function triggered by loss of radio signal - right? If so I see three options:
    1. switch to PCM modulation on your TX and RX - failsafe positions can be set as you like from the TX as is the case with my Futaba FX 18 and FX30 TX
    2. or get yourself a PPM RX that offers digital signal processing and thus programmable failsafe settings such as the Schulze alpha 8 plus (www.matthias-schulze-elektronik.de) or the ACT DSL DSQ 8 (www.acteurope.de) or the rp8d1 (www-modelluboot.de).
    3. if 1 and 2 are a no go and if you are using a piston tank diving system get a piston tank controller from www.engel-modellbau.de - their diving systems automatically switch to "drain MBT's" if RC signal is lost for either 2 or 7 seconds (jumper selection).

    You may couple these functions with a safety buoy that is connected to the pressure hull by a suitable thread and retained in place by an electromagnet and that is released by cutting power to the magnet either in the case of a lost RC signal (best case) or in case of a total power loss (= flooding of the pressure hull = worst case scenario....) - you would know where you lost (and could retrieve) your sub - and may be able to retreive it directly by pulling the thread attached to the buoy. Hope this helps. You dont need the APM to get this working

    Theo
    matthias-schulze-elektronik.de
    This domain may be for sale!
  • John,

    What type of receiver are you using?

    Are you familiar with how the failsafe's work in Arducopter, Arduplane and Rover?

    I will look at your sketch over the weekend.

    Regards,

    David R. Boulanger

This reply was deleted.