Shop OBEX P1 Docs P2 Docs Learn Events
RC Submarine - Autonomous control upon loss of PW — Parallax Forums

RC Submarine - Autonomous control upon loss of PW

- I currently own a BoE and have successfully programmed (with MUCH help from ClockLoop - thank you!!) a BS2 to automate some functions in a scale Remote Control (RC) submarine I have built - leak detect functions, LED light illumination and differing indications based on loss of PW or a leak. 

- If a 2.4GHZ transmitter /receiver is utilized for the model the 2.4GHZ will NOT penetrate water - as soon as the antenna dips below the surface reception is lost.

- My intent is to increase the functionality of my current program such that if the model submarine antenna does dip underwater UNINTENTIONALLY (provided I am using a 2.4GHZ radio - 75MHZ can penetrate fresh water up to about 10' at .75 Watts) resulting in loss of reception with the transmitter the onboard microcontroller will recognize this condition, and then drive the servos and ESC to immediately return the submarine to the surface.

- I would also like the option to select pre-determined navigation routines that can be pre-selected prior to INTENTIONALLY driving the submarine (and antenna) below the surface.

- Would also be a bonus if using a 75MHZ radio and driving underwater to be able to flip a switch and have a navigation routine take over.


- Assume control by either a 75MHZ or 2.4GHZ RC aircraft transmitter.

- Can I do this with my BS2? What products would best suit my purpose if not the BS2 and would the require a programming board other than than the board of education?? Size is a constraint - the tubes inside the submarine that are waterproof are anywhere from 2.5" to 3.5" in diameter.

- I need to drive at least 6 servos - possibly 8

- Is there a 2.4GHZ antenna chip I can use to interface with the microcontroller vice using an off-the-shelf 2.4GHZ RC receiver? If so - how do I bind the antenna chip to the receiver?

- Do I need an add-on board to dump the navigation routine onto which would control the servos while the main microcontroller would monitor for PW and other inputs (depth, magnetic heading)?


THANK YOU ALL in advance of your advice and guidance.


Mike

Comments

  • Thought some pictures would be helpful...as well as code and some notes from my first iteration.

    4032 x 3024 - 4M
    4032 x 3024 - 3M
    3024 x 4032 - 5M
    3024 x 4032 - 4M
    3024 x 4032 - 4M
    3024 x 4032 - 4M
  • A few pics with the upper hull attached...

    3674 x 2755 - 2M
    4032 x 3024 - 3M
  • Duane DegnDuane Degn Posts: 10,588
    edited 2021-01-30 03:31

    There are lots of small Propeller microcontroller boards which are a lot smaller than the BS2 BOE.


    The Propeller QuickStart board is one option for a small Propeller board. I've used this board for a lot of my robotics projects. Another option is the FLiP. The FLiP is even smaller than the QuickStart.


    Do you have radio system yet?


    "- Is there a 2.4GHZ antenna chip I can use to interface with the microcontroller vice using an off-the-shelf 2.4GHZ RC receiver? If so - how do I bind the antenna chip to the receiver?"


    Sort of. Older FrSky receivers used a S-Bus protocol to talk with the flight controller. This S-Bus protocol can be received by the Propeller and each channel can be parsed out. I've done this myself. There are other receivers which use an UART to communicate. UART type receivers are nice since you don't need a separate I/O pin for each channel. Even if you end up using a more traditional RC receiver, you can have the Propeller monitor each channel separately.


    "- I need to drive at least 6 servos - possibly 8"


    No problem. Here's an example of controlling 22 servos. If you don't need I/O pins for anything else, the Propeller can control up to 32 servos.


    If you don't have a radio yet, you might want to consider one which uses OpenTX as the firmware. The RadioMaster TX12 apparently has a lot of features for the price.


    "- Do I need an add-on board to dump the navigation routine onto which would control the servos while the main microcontroller would monitor for PW and other inputs (depth, magnetic heading)?"

    One of the Propeller boards mentioned above could both monitor the radio and control the servos. It could also monitor other sensors as well.


    I keep intending to do more with autonomous navigation myself but my one video example of using an electronic compass is this old figure 8 video. It's getting much easier to to this sort of navigation with some of the control boards available for airplanes and boats.


    Using 6 or more servos while monitoring multiple RC inputs would tax a BS pretty heavily (if it's even possible). These sorts of tasks are easy for a Propeller microcontroller.


    As with the BS2, you'll find lots of people willing to help with the programming (including myself).


    Edit: Very cool submarine you have there. Thanks for sharing those amazing photos!

  • Sorry for the delay in replying! I have been busy with work and other demands of life...


    Publison - thank you! I'm working on the sail now; mounting and linking up the fairwater planes, masts and assembly to raise and lower, LED mounting in the sail (Masthead light, Sub Id Beacon, port and starboard running lights) - once all that is complete it is on to torpedoes and a lunching device. I'll definetly post a demonstration video when complete.


    Duane - really appreciate the detailed reply!

    • It sounds like the Propeller board is the way to go... It would support driving the servos, sensing various things (depth, heading, GPS, attitude, magnetic heading) and be able to execute Nav routines and not be bogged down with time gaps while driving the servos. All on one board. I noticed some of the FrSky receivers had built-in 3-axis gyros and 3-axis accelerometers.
    • What language is it programmed with..? I assume I will not be able to use my BS2 programming board... What Propeller do you suggest and what programming board?
    • I am currently using Futaba T9CAPs at 75MHZ - old school but the 75MHZ will penetrate water unlike the 2.4GHZ. There are drawbacks though - the old receivers do not have a common bus like iBus (FlySky), or Sbus (FrSky, Futaba, RadioMaster) to tap into..so if I stick with 75MHZ I'd have to route each control signal for each servo to the board and then out to the servos - more wiring and I assume more time taken up sampling. But - you can drive an RC Submarine around under water up to 10' or so (depending on TX wattage) with 75MHZ.
    • 2.4GHZ does offer a lot of cool stuff...telemetry, FPV, no channels conflicts... And the newer receivers along with a Propeller would offer the capability to provide data to a 'command station'... FPV, GPS for a moving map, telemetry, then when PW is loss either it is programmed to drive back to the surface or execute some pre-determined mission profile.
    • There are several boards internal to the current setup that could be consolidated as well...the Battery Link Monitor, the Depth Controller (maintains the current depth by driving the fairwater planes provided the user is not providing direct input) and Attitude Unit (maintains the sub level by driving the sternplanes opposite to the current attitude if the user if not providing direct input).
    • I took a look at the RadioMaster and did some reading on the OpenTX ... still unclear what flexibility that provides...

    Your video of the ROV completing the figure-8 was really cool BTW! It seems a lot of this is out there (Drone tech seems to fit really well) - it's just a matter of figuring out the best hardware and its capabilities such that they will accommodate my goals.


    All that said...what do propose as my next steps here? It would seem getting the right radio and rcvr, the propeller board, and hardware (sensors, servos) and start breadboarding something together... Something with the capabilities already built in would be great - including a monitor for FPV.


    Very much appreciate your thoughts and insight!


    Mike

  • I noticed some of the FrSky receivers had built-in 3-axis gyros and 3-axis accelerometers.

    Do they? Either I'm not aware of these receivers or you're thinking of flight controllers which use FrSky receivers as the radio.

    What language is it programmed with..?

    There's a variety of languages which may be used. Spin, C, PropBASIC and Forth are the ones I can think of off the top of my head. I greatly prefer Spin. IMO, programming the Propeller in Spin is fun. There's also a graphical programming language called Blockly but I think Blockly isn't practical for anything but simple programs. These Scratch type languages (such as Blockly and MIT's App Inventor 2) quickly become unrulily when they get big.

    What Propeller do you suggest and what programming board?

    I linked to a couple boards in my earlier reply. I think the QuickStart board and the FLiP would be good options. These two boards include a USB to serial circuit so they can be directly programmed with a USB cable. Another option is to use a small Propeller board with an external programmer. I make my own 1.25" x 1.25" Propeller boards. If you want to use one of these small boards I could either loan one to you or sell one. There are lots of inexpensive USB to serial devices you could use with it (if I loan/sell you a board, I'll also loan/sell you a USB programmer board).

    I took a look at the RadioMaster and did some reading on the OpenTX ... still unclear what flexibility that provides...

    OpenTX allows all sorts of various mixes and adjustments. One of the nice things about the RadioMaster is its multiprotocol feature. This allows the radio to control lots of the inexpensive quadcopters and airplanes on the market. It can also communicate FreeSky and some FrSky receivers. This isn't really an advantage in your situation.

    I am currently using Futaba T9CAPs at 75MHZ - old school but the 75MHZ will penetrate water unlike the 2.4GHZ.

    I have a few older Futaba radios myself. My Conquest FP-T6NFK is a 6 channel 72.290MHz radio.

    2.4GHZ does offer a lot of cool stuff...telemetry, FPV, no channels conflicts...

    Agreed but I think not being able to use it underwater is probably enough of a reason it stick with the older Futaba radios.

    It seems a lot of this is out there (Drone tech seems to fit really well) - it's just a matter of figuring out the best hardware and its capabilities such that they will accommodate my goals.

    Something to consider is ArduPilot. It has support for boats. I'm not sure if using a controller compatible with ArduPilot would eliminate the need for the Propeller. Probably not since you'd like to control devices not available in ArduPilot.

    I'm not sure what sort of sensors you can reliably use on a submarine. I'd think an electronic compass would work underwater but you need to keep the sensor away from motors and servos. A GPS would not likely work underwater but it could be used while surfaced.

    I've played with a few IMUs (accelerometer and gyro combos). I have some BNO055 sensors and a couple BNO080 sensors. I purchased these with the intention of comparing the sensors. I haven't done this yet. These sorts of IMU sensors should work fine underwater.

    In case it's not clear, I've been toying with the idea of making some sort of underwater vehicle myself. I doubt I'll try to make anything as cool looking as the submarine you're making but I might attached some brushless motors to the outside of a water tight box and see if I can control it.

    Crazy/Dumb Idea

    Here's one crazy idea I can't shake from my mind. Use two FM transmitters and two FM receivers as a custom underwater transceiver. My thought is to use Phil Pilgrim's Bell 202 Modem object to send data over the radio. I found some relatively inexpensive (~$10) FM transmitters on AliExpress. Or even better, use a module like this one for the transmitter. A similar size module could be used as a receiver.
    This DIY FM controller may not be legal so it's probably better to stick with the Futaba radios. It's possible the old Futaba radios may not be legal to use. I have a feeling using an out of date RC controller wouldn't land a person in as much trouble as a DIY FM transmitter box.

  • Looking over your submarine project, it is very interesting and I know you put a LOT of work into it.

    A couple of items - Have you considered using or getting a ham radio license, it opens up a lot of possibilities that pre-made radio / RF solutions are off limits to? Once you have a license the world of experimentation is wide open.
    Second - the microwave and other VHF bands are notorious for path loss and moisture / water losses. Better to use the 10 or 15 meter ham bands with shortened antennas, for water penetration and things like that.
    Third - the US military is always looking for unique and capable devices for any number of special operations. They would love to hear from you and domo your projects.

  • PropGuy2 - My apologies to you and Duane! I have not been on the site here in a long time (obviously) - all is well. Work, family, significant problems with my RC sub (which I have fixed) - currently priming, sanding and doing final assembly. Leak tests, final wiring (connectors) and trimming are soon to follow! I intend to post some pics and video when I get this thing finally completed. Here is a link from a few weeks back - mostly complete now...I do not have the LED's connected in this demonstration. https://drive.google.com/file/d/1ygTta-oog32y94_UtYIf51toTnb6xZLP/view?usp=sharing (I just uploaded so Google may still be 'processing' the video). BTW - I am an active duty Naval Aviator and former Submariner... ;-)

    By the way - I saw a video of Rick Galinson demonstrating his RC submarine which also contains a BS2. Would love to see the code so I could do the same with my sub (read the RX and pass-through commands to the servos OR select a pre-set routine and the BS2 would control the servos and drive the sub around on a pre-programmed path). Follow this link and FF to 19:49.

    Be safe! Mike

Sign In or Register to comment.