RC Submarine - Periscope raising/lowering...?

Hello – thank you for the advice and guidance ahead of time!

I am constructing a 42” RC Submarine. I’ve used a BS2 to automate the flashing sequence of a yellow LED to represent the Sub ID beacon located in the sail. I would also like to automate the raising and lowering of the periscopes...I have one remaining channel off of my receiver for that purpose. I have purchased a Pololu Micro Metal Gearmotor with a voltage operating range of 1.5-12V DC. The output shaft has a 2.16” threaded rod I can use to drive the periscope and masts platform up and down inside the sail via an embedded bolt that will thread onto the motors shaft. I am using a VEX 6-channel transmitter.

How can I control the direction (polarity) of the motor, speed (voltage), and have precise endpoints to prevent mechanically overdriving the mast assembly (either up or down)? How can I use the output from the receiver to provide the correct signal (up/off/down) and mechanize the control device?

BS2? How would it be wired and what code?

A couple relays with reed switches and a 3 pole switch (up/off/down)?

I have limited space...the internal waterproof space available is a bit over 2.25” wide (I.D.) and 12’ long and is shared with other components...the receiver can provide 5 volts of power or I can tap from an internal LiPo 3S 11.1 Volt battery.

Ideally, I would like to be able to program this all to work using the BS2. The motor and reed switches (if used) will be waterproofed as they will be external to the water tight cylinder.

Thanks for the help - Mike
«1

Comments

  • Clock LoopClock Loop Posts: 1,976
    edited 2020-10-22 - 00:21:48
    Did you get a https://www.pololu.com/product/3081
    Magnetic Encoder Pair Kit for Micro Metal Gearmotors, 12 CPR, 2.7-18V

    That would let you precisely position the periscope, thus eliminating everything outside the electronics tank. (if you planned to put reed switches on the periscope for position sensor)

    The only issue with a encoder is if the bs2 loses count somehow, it will need to be re-calibrated.
    So that might call for at least 1 sensor to detect the periscope position (like all the way down)

    The bs2 is a very nice platform to work with.

    What are you using for a motor drive? (the motor you have, has a stall current of .75 A)

    If you want to skip the encoder and motor drive, using a 12v regulator direct fed to a relay that runs the motor at max speed, relay controlled by the bs2?
    With reed switches as position indicators up/down.

    If so, the motor matters... WHICH 12v Micro Metal Gearmotors are you using. Their gear ratios vary greatly, 6800 rpm down to 35 rpm.


    Mike27283 wrote: »

    How can I control the direction (polarity) of the motor, speed (voltage), and have precise endpoints to prevent mechanically overdriving the mast assembly (either up or down)?


    The voltage is the very raw way to control speed in a dc motor, but a proper way is to pulse the rated voltage of the motor (12v)

    So you can do that with this: A motor drive. https://www.parallax.com/product/28820
    If you don't have a drive for the motor, you could use this with a BS2.



    Mike27283 wrote: »
    How can I use the output from the receiver to provide the correct signal (up/off/down) and mechanize the control device?
    What model receiver are you using?
    I would imagine you can just send "on-off-on" signals in a specific time period to send different signals using a single reciever output to the BS2.


    You could also control both the periscope and the LED with that same "on-off-on" signals. (say have the led stay on, or stay off, or blink.)


    And then you will want some water transducers, so the bs2 can do some object avoidance...?

    What rc sub are you building? (is it a kit?)
    Mike27283 wrote: »
    BS2? How would it be wired and what code?

    The code can get extensive if you want sub feedback via a wifi device like a https://www.parallax.com/product/32420s debug output on your tablet/phone.

    Bs2 code that can control a motor, setup the motor drive, read an encoder, monitor for pulse signals on a pin, this starts to get involved
    How experienced are you with BS2 code?

    Do you know about the propeller chip also?
  • Hello Clock Loop - thank you for the quick reply!

    I'll attempt to add some pictures to answer your questions.

    - In inventory right now for this portion of the build...: the micromotor, an E Sky Model 000100 72MHZ receiver (my transmitter is a VEX 6-channel) and the ability to program a BS2. Not sure if I can use the BS2 I currently have to strobe the Sub Beacon LED as well as run the micromotor to drive the periscopes up and down...? I have no problem purchasing another BS2 specifically for this periscope project.
    - I did not purchase the encoder kit. I purchased the motor from an RC Submarine site - a picture of the motor and specs are attached. When I bridged the contacts on the motor to a 9V battery it ran at a slow rate...specs state it will do 60RPM @ 12V. With the 9V attached it was about 30RPM or so...it seemed a reasonable scale speed. Although having the ability to set the speed would be desirable to dial in the speed so the Periscopes look realistic when raising and lowering.
    - I do not have a motor drive.
    - I am inexperienced with BS2 although I did do some basic programming back in the day so am not entirely clueless.
    - I did see the propeller chip but did not read up to understand what it was capable of...I believe it is be too big for the 2.25" wide tube it would need to fit inside.
    - "Bs2 code that can control a motor, setup the motor drive, read an encoder, monitor for pulse signals on a pin, this starts to get involved." I agree...the hardware portion and soldering everything together shouldn't be too hard - but the code is likely going to be a pain.
    - What do I need?? Another BS2, Motor Drive, Encoder kit...? Reed switches to signal top and bottom limits of travel? How are they connected - to what pins? And how is the output of the receiver used to send command signals?
    - Once the hardware is procured and I know how to wire it all together - then trying to figure out the code would be the next step...

    That all said - is this the best way to go about mechanizing my periscopes?

    Thank you!

    Mike

    1125 x 2436 - 4M
    1125 x 2436 - 288K
    4032 x 3024 - 2M
    3024 x 4032 - 2M
  • By the way - here is a short video of my BS2 flashing the LED...my first BS2 project. A Submarine ID beacon flashes 3x over 3 seconds and then pause for 3 seconds. This will look very realistic along with the other running lights I am installing.

    https://drive.google.com/file/d/1uLQP4nFgHKIEdNL9uORhcSdpAycjtL20/view?usp=sharing
  • Clock LoopClock Loop Posts: 1,976
    edited 2020-10-22 - 03:06:14
    ok so i see its a kit.

    Personally I would build it as the kit is made, run it in water, make sure everything works how i want.

    Then I would ask the questions you are asking, mostly because its hard to tell how much room you will have to work with once its built?

    The bs2 is actually larger than the smallest propeller pcb, I have made propeller pcbs the same size as a quarter. BUT the bs2 runs on 5v, the prop on 3.3v. (but the prop can work with 5v devices pretty well with a resistor, and 3.3v is usually above the 5v high logic threshold)

    Since you have already started coding with a bs2, you could stick with that, but the bs2 is a single process chip, which makes things a bit harder, since you need to blink a led, sense periscope position switches, and receive Morse code type signals from the receiver.

    I tried to look for the receiver manual but could not find it, and the transmitter doesn't look like it can send data signals (like a serial stream from a external bs2 connected to some kind of special port on the control/transmitter.) and have the receiver send that to the sub bs2.

    Do you control the periscope led state with the transmitter now, or is it always on, what bs2 board do you use? Do you control the led state with the last channel on the receiver (or one of them)?

    If I were doing what you are doing, I would just use reed switches and magnets to sense the periscope position,
    and then just use a 5v regulator to get 5v (or even 3.3v to go even slower) to the motor for a slow motor movement, and use two 5v bs2 controlled relays (beware many relays require more current than many microcontrollers can do) to control the motor direction.

    I would use the https://www.parallax.com/product/27115 relays since they are made to be driven by a microcontroller pin.



    Then its a matter of the bs2 code.
    1. determine how to get multiple different signals to the bs2. (from what I can tell, you need to manually hold a receiver output high for a determined amount of time, then low for a determined amount of time, the bs2 would count the time
    , and then you would also need to count time and switch the state of the 6th channel your self to match it.

    Integrate that with the blinking of the led, simply the bs2 would do the duty of blinking the led, but also looking for a high start bit on the 6th channel receiver output.

    If it sees the high, it would go into a timing loop to determine how long it stays high.
    If high for 6 seconds or more.... do this. (lower periscope, and once lowered, turn off led)
    If high for 3 seconds or less, do that. (turn on led, and raise periscope)

    Its possible to have more set states by adding more timing loops. if high for 3 or more seconds, and then low for 3 or more seconds and then high for 3 or more seconds, (and then low forever, the receiver output channel off state)

    I would think that if the periscope is up, the led is on, and if the periscope is down the led is off. (subs are stealth, so why have a led on when the periscope is down?)

    Then the periscope up or down state would determine the led state.?
    That would make the bs2 code a bit simpler, but you would still need a code loop(non blocking) that not only flashed the led, but also looked for a high signal on the reciever channel 6.


    I suppose there are a few ways to do this.

    The receiver 6 output could simply be high or low to determine the periscope state, up or down i suppose,
     then the bs2 would control the two relays for the motor,
    and the two reed magnetic switches could signal to the bs2 to open the relay and stop the motor
    then the bs2 would go in to a loop to blink the led (if periscope is up) and also monitor the receiver channel state, high /low
    if the receiver changes state, to a low, then turn off led and lower periscope.
    Is this the sequence you are looking for?
    

    To get code working, ideally you should wire it all up so the pin numbers are known.

    So you would need 2 - https://www.parallax.com/product/27115 and a 5v regulator (7805) https://www.parallax.com/product/601-00506
    (if you have a bs2 board, then you probably already have 5v available with a regulator that can handle the less than 1amp motor peaks)

    Or if you want to go even slower, get a 3.3v regulator. https://www.parallax.com/product/601-00513

    A schematic and code could be made pretty simply and I could do both (roughly) because im such a nice guy..... lol...
    (but i would need a manual for the receiver (to see its pinout and pin specs)

    I would need to get something in return tho.. How about a trivia question? Ok,

    Who is considered the "Father of the Nuclear Navy (USA)"
  • Clock LoopClock Loop Posts: 1,976
    edited 2020-10-22 - 03:30:25
    The propeller mini which has a 3.3v and a 5v regulator on it is very small similar to the bs2 module. https://www.parallax.com/product/32150
    It can accept Regulated 6.5–12 VDC though VIN pin

    The bs2 module has pins sticking out, the propeller mini has holes to solder pins. It can accept 5.5 to 15 VDC (Vin),

    So size shouldn't be a factor between the two, and if you are using a bs2 carrier board, then the propeller beats the bs2 hands down for space.

    Your battery is 11v so direct input to either module would work, but you would likely want a separate 5v regulator for the motor.
    (smt regulators are only rated around 700ma) Your motor stall current might drop a microcontroller if you use the same regulator as the bs2 or the prop,
    so ideally get a to-220 package separate regulator for the motor.
    (but you won't be running the motor long or continuously.)

    I would personally try to use a propeller mini and its onboard 5v regulator with relays to do it all..., you would need to test it to see it its current draw is above the prop mini's regulator. or near its max.

    There are many ways to go with this.
  • In response to the question, "Who is considered the "Father of the Nuclear Navy (USA)" ", it is a chap named Rickover. He was the longest serving Admiral and fought hard for the creation of the first nuclear powered sub. We floated squads of these amazing subs before we started building and floating carriers. The first one was named Nautilus, and she's currently retired, and lives at the sub school in Groton, across the river from the sub building facility that goes back to the period well before the First World War in New London.
  • I would use this device Dual Motor Driver.

    This would allow controlling the direction of the motor as well as setting the speed of the motor. With varying PWM pulses to the enable pin you can control the speed of the motor.

    Since a periscope is either up or down you would need a switch at either end to determine when to turn the motor off. This could be a simple push button or two pieces of wire that come together.

    Mike
  • tritoniumtritonium Posts: 368
    edited 2020-10-22 - 20:09:15
    Hi

    It looks like the 12v micromotors have a stall current of 0.75 amp so a 1 amp single bridge driver should do- like the max14870 which Pololu say- "This compact breakout board for Maxim’s MAX14870 motor driver offers a wide operating voltage range of 4.5 V to 36 V and can deliver a continuous 1.7 A (2.5 A peak) to a single brushed DC motor. It features a simple two-pin speed/direction interface and built-in protection against reverse-voltage, under-voltage, over-current, and over-temperature."
    Comes on a 0.6 X 0.5 inch breakout board and costs $5.95
    https://www.pololu.com/product/2961
    Since it has over current over temperature and over voltage protection you can simple drive it until it stalls then switch off, so no nasty limit switches.
    You only need to monitor one channels pulse width to determin what to do. Radio control channels have a pulse of between 1 to 2 ms with 1.5 ms representing the centre point, repeated every 20ms. I believe the stamp has a pulsein command so this should be easy for the stamp to determine what to do. Less than say 1.2 ms for one direction and greater than 1.8 for the other, else switch off.
    A useful thing about this driver is that it has an- "Active-low fault output indicates over-current or over-temperature condition"
    so when driving the motor- despite it tollerating overtemperature- you only need to monitor this pin and if it goes low switch off.

    This seems to me a good solution and would be worth setting up a test rig to confirm the above is true- as I have not actually done this myself.

    Dave
  • Since this connects to a normal RC radio, the easiest solution would be to use a brushed ESC.
    Just assign one channel to the periscope. You should be able to use a three position switch or a knob to do the job.

    Here's one I found on Banggood.

    2020040910204841-1649242.jpg
  • Hi

    That's a clever device BUT voltage 3.5 - 6v ?
    Might be ok; or very slow?
    Only testing will tell.

    Dave
  • Hyman G Rickover of course! Nice job to Buck as well...! I’ve worked today and then driven 2.5 hours to my moms to celebrate her 80th birthday party...Zoom, videos, it was quite the event. So - that said sorry for the short reply. For Clock Work - I do NOT plan on using the same BS2 to drive the periscopes as the flashing LED - two separate microcontrollers. That would make the code much easier. Code and a diagram

    Dave - I like the simplicity of the MAX14870...no limit switches required. It would just sense the stops (upper or lower) and shut down the motor....easy. Therefore I would need to build in physical stops along the shaft the scope platform would impinge against causing the over-voltage or over-current. I am still confused on how the receiver interfaces with the 14870..? I am assuming this eliminates the need for a BS2?

    Duane - ESC size is incredibly small which is great! I’ve used ESC’s previously but in this instance if I use one how would it control the motor? ESC plugs into the receiver to channel 6...I solder the motor leads (that drive the periscope platform) to the ESC...but how does it know when to stop when it reaches the upper or lower positions?

    Mike (great name by the way) - this solution looks good as well. How is the controller connected to the receiver...? I assume this eliminates the need for the BS2?

    Very impressed gents - thank you all for the help! Mike
  • Clock Work - sorry...part of my reply was cut off. Code and a diagram would be incredibly helpful to visualize and understand the solution you are proposing. Thank you!!
  • Duane DegnDuane Degn Posts: 10,348
    edited 2020-10-23 - 02:43:15
    tritonium wrote: »
    BUT voltage 3.5 - 6v ?

    That was one of the less expensive reversible brushed ESCs I saw. They sell many brushed ESCs which can use much higher voltages.

    I'll all for adding microcontrollers to my RC projects but I have to admit there are easier ways of solving some problems than adding a microcontroller.

  • Clock LoopClock Loop Posts: 1,976
    edited 2020-10-23 - 08:00:18
    Mike27283 wrote: »
    Clock Work - sorry...part of my reply was cut off. Code and a diagram would be incredibly helpful to visualize and understand the solution you are proposing. Thank you!!

    Clock Work? like in orange? lol, i guess that works, but the name is clock LOOP. hehe

    Anyway, I don't think combining the two functions of blinking the led and raising and lowering the periscope is very hard (for me).

    I'll whip up some code and schematic asap. Its been a while since I have used my bs2, but I have it right here, so I will give it a whirl.

    I also have multiple reed switches, and multiple parallax relays, and a few spare motors around.
    It will take me a bit to do, but I don't mind some alternative fun from my other engine controller railroad project.

    Since you are tight on room in that dry sub tank, you may WANT to use only 1 bs2 to do the job.

    I will whip up a schematic and bs2 code asap. I am going to assign my own pins and I assume the pinout from the reciever is simply 5v output from channel 6 if that output is turned on on your transmitter?
    And the gnd is the B connection?

    Also you didn't answer if you use a bs2 carrier board or just the bs2 alone...
    Mike27283 wrote: »
    Hyman G Rickover of course! For Clock Work - I do NOT plan on using the same BS2 to drive the periscopes as the flashing LED - two separate microcontrollers. That would make the code much easier. Code and a diagram

    The bs2 is already pretty simple, and actually the code to do all this would also be quite simple, if you are just using a few reed switches and magnets to sense the periscope top position and bottom position.
    IT
    If you want these split up between two bs2's that can be accomplished easily.
    I will do both so you can see that combining the two functions is NOT a big deal for the bs2 and NOT complicated.

    Heres the code function and schematic format, I will make over the next few days.
    At power on the sub would make sure its periscope is lowered all the way, by detecting the lower reed switch is closed.
    Then it monitors the 6th output from the receiver for a high.
    If the 6th output is high, the periscope will raise by the bs2 enabling the raise relay.
    It will then do a loop to monitor for the periscope top position reed switch.
    Once raised, it will go into a loop to blink the led, flashes 3x over 3 seconds and then pause for 3 seconds.
    While the bs2 is in between changing the led states in that loop it will look for a LOW on the 6th output.
    If it sees a low, it will break out of the flash led loop, turn off the led, and enable the relay to lower the periscope.
    Then a loop will start that will monitor for the periscope to lower all the way till it activates the lower reed switch.
    Then it repeats everything from the beginning.
    
    
    Does this sound like the function you want? If not, please explain as detailed as you can.

    I will comment and explain each bs2 line so you can understand what is going on,
    so you can understand that you don't need two bs2's to accomplish this.



    I will try to do this without testing it, even though i wired up a bs2 board of education with relays and magnetic reeds and a motor.
    I cannot find my USB to old serial dongle, so that totally stops me from testing the code.
    I can make code example and schematics, but you will need to do the testing. (at least until I find my old dongle)
  • Hi
    Dave - I like the simplicity of the MAX14870...no limit switches required. It would just sense the stops (upper or lower) and shut down the motor....easy. Therefore I would need to build in physical stops along the shaft the scope platform would impinge against causing the over-voltage or over-current. I am still confused on how the receiver interfaces with the 14870..? I am assuming this eliminates the need for a BS2?

    No, the bs2 monitors one of the servo outputs on the receiver and measures the pulse-width to determine what to do, then applies a direction and enable to the motor driver.

    Yes physical stops will be required, and in such a way as to not 'jam' into position and become 'stuck' requiring more torque to release than the motor can provide.

    If all you are doing is flashing a light and operating a motor, this can be done without a bs2- but it will mean building circuits and, well, micro's are fun :)

    Dave
  • Dave - thank you for the time in replying and helping out! Since I have the BS2, Board of Education, and motor - and the only thing I will need to acquire is the reed switches (which I prefer to the stops) I’m going to move ahead with Clock Loops solution. Really appreciate your time and insight!

    Clock LOOP...sorry about the typo earlier. Haha! Of note I never did see that movie...

    - I was focused on the LED flashing function and periscope raising being separated...once I read your summary of how the code will be laid out it totally makes sense how it will work - and will be very realistic!
    - Yes, the pinout from the receiver is a 5V output from channel 6. Standard RC receiver. GND is on one of the poles of the B connection.
    - I only have the BS2 - no carrier board. I was going to solder directly to the pins and wrap it in heat shrink.
    - How would I step down the voltage to 3.3V as you mentioned to slow down the movement if 5V ‘looks’ too fast?
    - You totally nailed the sequence! No changes at all! The VEX transmitter does not have any 3 position switches...if needed I have another 75MHZ transmitter I can use (change out the crystals) which does have a 3-position toggle switch. The VEX transmitter has the channel 5 and channel 6 push buttons (not sticks or switches) on the back of the transmitter. I assume pushing one of the channel 6 pushbuttons raises the scope, the other lowers, and when not pushing either that is the neutral position this acting as a 3-position switch.
    - Really appreciate the help and insight. This is exciting and I am thrilled to be pursuing my hobbies again and learning these skills - thank you. BTW - I also have an interest in HO model trains, I have a couple, a Digitrax DCC system and am trying to figure out where I could construct a layout. As my BS2 skills improve I definetly see this being applied there as well as high power rocketry. I’ve got a 5.5’ V2 I’m starting construction on once the Submarine is nearing completion.
    Thank you again - I’ll be standing by for the info and will definelty do the testing. Any suggestions on the reed switches? Mike
  • Clock LoopClock Loop Posts: 1,976
    edited 2020-10-23 - 22:22:15
    Mike27283 wrote: »

    - How would I step down the voltage to 3.3V as you mentioned to slow down the movement if 5V ‘looks’ too fast?
    Since your motor current is very low (.75A stall) you can just use a 3.3v regulator to get 3.3v. https://www.parallax.com/product/601-00513
    Mike27283 wrote: »
    - You totally nailed the sequence! No changes at all! The VEX transmitter does not have any 3 position switches...if needed I have another 75MHZ transmitter I can use (change out the crystals) which does have a 3-position toggle switch. The VEX transmitter has the channel 5 and channel 6 push buttons (not sticks or switches) on the back of the transmitter. I assume pushing one of the channel 6 pushbuttons raises the scope, the other lowers, and when not pushing either that is the neutral position this acting as a 3-position switch.

    I am kinda confused at how your transmitter controls channel 6. Is it a momentary push button, or an ON/OFF toggle button?
    This is important because it will change how the bs2 code can work.
    You also say, "one of the channel 6 pushbuttons" this concerns me because I just expected a on/off button on the transmitter.
    Mabee get a picture of the transmitter channel 6 control?
    You could also hook up a volt meter to the reciever channel 6 output and tell me how your transmitter buttons are pressed and what happens to the channel 6 output.

    Mike27283 wrote: »
    BTW - I also have an interest in HO model trains, I have a couple, a Digitrax DCC system and am trying to figure out where I could construct a layout.
    I also have(had) a digitrax dcc system, and it all blew up when I drove a g scale decoder engine onto the programming track but I forgot to turn the programming track switch off, so it shorted the main rail to the programming rail, the command station went up in smoke in less than 2 seconds, I have had nothing but problems with digitrax, I have had years of trying to work with their system, and I think they need to recall all their transponding equiptment and fix it. That will never happen so their standard of selling lemons will continue, beware, before you invest too much into any digitrax stuff.

    Mike27283 wrote: »
    Any suggestions on the reed switches?
    Any ol' reed will probably work. Just get a proper neodymium magnet.
    This will require testing to find the perfect positions for the reed switches and the magnets.

    The glass ones are delicate to work with and will break if the leads are stressed at all (if you bend a leg by holding the glass or the other lead it will likely break)
    https://www.digikey.com/en/products/detail/comus-international/RI-02GP1520/7497024

    The encapsulated ones are more sturdy, but might be harder to waterproof.
    https://www.digikey.com/en/products/detail/littelfuse-inc/59165-1-S-00-A/969930

    I would also suggest you do not even put the reed switches in the water if possible.
    I do not know what your periscope mechanics look like or work, so perhaps that is not possible.
    I am not sure how to go about waterproofing them other than dipping the entire thing into some kinda sealer. (like those liquid rubber material made to dip your tool handles into)

    I was curious about that rc sub,,,
    Do you install any kind of water leak detection sensors at the bottom of your tank?
    The bs2 could possibly help with that, if water is detected, it could force the sub to surface (like an emergency blow)
    I suppose you don't have ballast tanks? Since you would need to install compressed co2 cartridges and some control system for it.
    I guess without ballast tanks, surfacing the sub is not as simple as having the bs2 fill the ballast tanks with air.

    Have you thought about installing a window so your submariners can look out and even open it if they want some fresh air? (lol)
    The stench of recycled farts from the poop tank gets a bit old,,, pun intended.. all that stealthiness has its downside...
    (sonar sup... I've got a fart contact bearing.... i suspect its a sub...)
    Such a modern navy and eqiptment that they need to actually release the air from the crap tank into the people tank, seriously?
    I can come up with 5 different ways to deal with waste tank gas. Don't even get me started on this... crap.. (pun intended)
    But some genius comes up with the solution to release it into the submariners breathing AIR?
    WHAT THE HELL IS WRONG WITH PEOPLE TODAY(i guess that was the 60's, but nothings changed so "today" is appropriate)
  • I’m down in NC at my moms house right now - will be home on Sunday. We had an 80th birthday for her... So can’t get pics of the transmitter or test channel 6 until then.

    The transmitter (VEX FM 6-channel) has two sticks on the front as any other transmitter to drive channels 1-4 - the channel 5 and channel 6 inputs are on the back of the transmitter in the form of two pushbuttons for each channel. So - channel 6 has two buttons to press - I assume they are momentary push buttons. If I was to hold either button down it would continue to drive a servo until I released the button at which point the servo would return to neutral. I can test this when I get back to the house on Sunday and send the results.

    Copy all on the 3.3V regulator.

    I do not have leak detectors in the bottom of the two dry waterproof tanks - that is a great idea. The sub has 3 cylinders joined together, the two on the opposite side are dry and contain electronics, the LiPo, servos, ESC, motor, BS2....the center tank is larger and functions as a ballast tank (there is a metal tube that connects the two outer tanks as a conduit for wires). The ballast tank has a servo that has a linkage arm that extends into the tank from one of the dry tanks to press a linkage that opens a valve at the top of the tank to allow air to vent thus flooding the tank from the holes in the bottom allowing the sub to submerge - when in a neutral position the valve is seated sealing the vent. Activate the servo in the opposite direction and it causes two low pressure pumps to operate that suck air from a tube that runs into the sail to fill the same tank with air pushing water out of the bottom allowing the submarine to surface. The throw for that servo is set at 80%. If the BLM (battery link monitor) detects a low voltage condition or loss of signal greater then 6 seconds it throws the servo 100% causing linkage arm to depress a schrader valve in the ballast tank causing a pre-charged small cylinder to discharge airbrush propellant causing the submarine to surface. So yes - it does have an emergency blow system to bring it back to surface if needed.

    Leak detectors would be great - I assume they would send a signal causing the emergency blow system to operate...? I believe I attached a link previously that showed a video of the ballast tank in action. I’ll need to send a couple pics of the BLM and small circuit chip that drives the pumps.

    Haven’t thought of a window - but a small camera would be pretty damn cool...

    I’ve been thinking about torpedos also - AAAA batteries hooked to a small timer and electric motor controlled by a magnetic reed switch - controls by a servo. The AAAA battery is a just a hair larger than in diameter than a 1/72 scale torpedo - so the battery would function as the body, attach a nose cone and a small tube in the back to house the timer chip, motor, propeller and reed switch - plus fins - and I’d have a torpedo!

    I spent the first 10 years of my Navy service in submarines and never really dealt with fart gas at all...maybe once or twice if I recall correctly...thank god!

    Good advice on Digitrax ... probably why I see a lot of guys with NEC...

    Thanks for the help!! Mike
  • Just got home ... testing complete. As I thought - if I push one of the buttons for channel 6 on the back of the transmitter the servo goes full throw - it turns in the opposite direction for the other button. When I release either button the servo returns to neutral. Let me know if any more info is required - thank you!
  • Here is a photo of the back of the transmitter...
  • Mike27283 wrote: »
    Just got home ... testing complete. As I thought - if I push one of the buttons for channel 6 on the back of the transmitter the servo goes full throw - it turns in the opposite direction for the other button. When I release either button the servo returns to neutral. Let me know if any more info is required - thank you!

    Uhh, that seems like the channel 6 is putting out a pwm signal.
    Dang, without a scope I cannot really tell.
    This complicates things if it is really doing pwm.
    I wonder if the transmitter manual talks about those buttons and what they output to the receiver?
    I wonder if there is a way to configure them or if they are just fixed pwm outputs?
  • Is there any way I can check that...?
  • Clock LoopClock Loop Posts: 1,976
    edited 2020-10-25 - 03:03:09
    It seems the vex-6 manual talks about this device....
    And I thought it was odd the manual doesn't talk about the transmitter a whole lot.

    https://www.rc-submarine.com/product-page/step-servo-controller

    I dunno I am trying to understand it all.



    So the video says the two back channels are analog.?

    If you don't have an oscilloscope, the only thing I can think of is to use a multi-meter that has a frequency counter on it or use a sound card to "record" the signal into a wave form so you can see it.

    https://www.nutsvolts.com/magazine/article/turn-your-computers-sound-card-into-a-scope

    A better circuit example.
    http://www.ledametrix.com/oscope/
    529 x 177 - 3K
  • I’ll buy an O-scope if needed... What is it you are trying to figure out? The ‘type’ of signal out of the receiver to drive the BS2? Explain to me what the conundrum is and I’ll try to provide the information. Thanks - Mike
  • Clock LoopClock Loop Posts: 1,976
    edited 2020-10-25 - 03:33:37
    Mike27283 wrote: »
    What is it you are trying to figure out? The ‘type’ of signal out of the receiver to drive the BS2? Explain to me what the conundrum is and I’ll try to provide the information. Thanks - Mike

    When you mentioned this:
    Mike27283 wrote: »
    if I push one of the buttons for channel 6 on the back of the transmitter the servo goes full throw - it turns in the opposite direction for the other button. When I release either button the servo returns to neutral.

    If you have a regular servo attached to the channel 6 output then your transmitter is sending pwm signals.
    I have not read up on the hobby industry or rc control transmitter/recievers.
    They all must use a standard servo type and follow a pwm standard.
    I wonder if its the same as the parallax servos' pwm.
    https://www.parallax.com/product/900-00008
    https://www.parallax.com/product/900-00005

    So if this is true, the pulsin function would probably work, and since its pwm, the state where the button isn't pressed could trigger the led loop.
    Im curious if its possible to press both up and down buttons on channel 6 also what kind of pwm results, or is that an invalid state...

    The bs2 has a PULSIN function.
    Measure the width of a pulse on Pin described by State and store the result in Variable. input fuction...
  • Clock LoopClock Loop Posts: 1,976
    edited 2020-10-25 - 03:54:09
    Ok, we can check this out another way, what model servo are you connecting to channel 6?

    Hopefully the manual on the servo will be more thorough in the signal descriptions.

    This might do?

    https://en.wikipedia.org/wiki/Servo_(radio_control)
    A servo pulse of 1.5 ms width will typically set the servo to its "neutral" position (typically half of the specified full range), 
    This would be when you are not pressing a button.
    
    A pulse of 1.0 ms will set it to 0°, 
    One of the channel6 buttons does this,
    
    And a pulse of 2.0 ms to 90° (for a 90° servo). 
    The other channel6 button does this.
    
    The physical limits and timings of the servo hardware varies between brands and models, 
    but a general servo's full angular motion will travel somewhere in the range of 90° – 180° 
    and the neutral position (45° or 90°) is almost always at 1.5 ms. 
    This is the "standard pulse servo mode" used by all hobby analog servos. 
    
  • Clock LoopClock Loop Posts: 1,976
    edited 2020-10-25 - 04:45:41
    What do you currently have for your led flasher BS2 code?
    I can add to it if you attach it.
    I am going to use pulsin to measure the length of the pwm pulse coming from channel 6 on your reciever.
    There will be 3 states.

    1. More than 1.75ms -Trigger periscope up/down (which one depends on how you wire the motor)

    2. More than 1.25ms and Less than 1.75ms - stop all periscope movement and start led blink if periscope isn't closing bottom reed switch.

    3, Less than 1.25ms -Trigger periscope up/down (which one depends on how you wire the motor)


    The fact that the buttons are momentary and pwm means your periscope can be variable in its raise/lower state.
    Say if you don't want it all the way up.?



    For a leak feedback, the led could stay lit continuously or flash very fast.
    That would just be two parallel bare copper wires very close to eachother at the bottom of the tank the entire length, as close to each end as possible. Glued/Taped down every so often, like every 2inches of wire, a small dab of glue on each wire, or a small perpendicular piece of tape.
    Think of a drop of water on the inside of the tube, and then put the wires that close to eachother at the bottom?
    The wires would connect to the bs2 pins using 1k resistors or something, that is assuming a drop would be conductive.
    This could trigger a ballast blow since the rc receivers signals can be easily over ridden with the bs2 and its pwm/pulsout function.
    or just blink the led fast, or very bright....



    If you want a super bright led one that can possibly be seen deep, you can try the luxeon rebel line of leds.
    I use it with a very high value resistor so it doesn't heat up or use much current(100ohm) (in relation to its normal resistor)
    I can suggest a part number if you tell me what color, but you would need to waterproof it.
    If you wanted it VERY bright, you would need to heatsink it.
    (but with water, you can just use a large copper wire/lug that sticks out into the water through a waterproofed hole.
  • Hello Clock Loop - thanks again for the help here!

    - The servos are SMRAZA Micro Servo 9G S51. I pulled up the data sheet and confirmed the 20ms PWM Period (50Hz) has leading duty cycle of 1-2ms at 5V. As you stated Position "0" (1.5 ms pulse) is middle (neutral), "90" (~2ms pulse) is all the way to the right, and "-90" (~1ms pulse) is all the way to the left for ~ a 180° throw. So - the PULSIN function will work and these numbers are good to go: 1) More than 1.75ms -Trigger periscope up/down (which one depends on how you wire the motor), 2) More than 1.25ms and Less than 1.75ms - stop all periscope movement and start led blink if periscope isn't closing bottom reed switch, 3) Less than 1.25ms -Trigger periscope up/down (which one depends on how you wire the motor).

    - When I press both button at the same time on the transmitter for channel 6 the servo returns to the neutral (middle) position. If I am pushing one button and the servo is fully deflected and then press the other button (so both are then depressed) the servo returns to the neutral (middle) position.

    - Here is the code I developed for flashing the Submarine ID beacon in a realistic manner:
    DO
    DIR0=1
    OUT0=1
    PAUSE 500
    OUT0=0
    PAUSE 500
    OUT0=1
    PAUSE 500
    OUT0=0
    PAUSE 500
    OUT0=1
    PAUSE 500
    OUT0=0
    PAUSE 3000
    LOOP

    - I do like that the way it is being programmed takes advantage of the momentary nature of the channel 6 buttons to stop moving the periscope at any intermediate position.

    - Is it possible to adjust the BS2 code so that the Sub ID Beacon LED is on and flashing whenever the periscope is not in the fully lowered position. I assume this would be pretty easy as that routine would monitor the state of the lower reed switch.

    - I have 4 other LEDs that will also be on the submarine (Mast Head light, Port and Starboard running lights, and a stern light on the rudder) - they will all run off of 12V directly from the Lipo 3S battery. Actually - I am installing a 12V on/off remote switch that is controlled by a RF key fob...so I do not have to mount a switch - can we wire the Submarine ID Beacon in a way that it also receives 12V? This may be problematic as we are using the BS2 to control the Sub ID Beacon LED in conjunction with rasing and lowering the periscope. If this is too difficult don't worry about it. I hooked up the LED to 5V and 12V to compare and it is a noticeable differenc in brightness but not a show stopper.

    - The leak detection function is a great idea. I'd like an emergency blow to be commanded if a leak is detected. The BLM I have installed will command a blow if the pulse train from the transmitter is lost for more than 6 seconds or if the battery level gets too low. It seems the easiest way to do this would be to provide a PWM signal directly to the ballast tank servo to fully throw it 100% (exactly as it would if the battery got too low or the transmitter pulse train was lost) that would cause the linkage it is connected to to depress the shraeder valve releasing the gas from the small pressurized blow tank into the ballast tank causing the submarine to surface. I'm not sure if it would be a PW less than 1.25ms or greater than 1.75ms...but I can test that and it would be easy to change in the code and reload into the BS2. I would take the output from the BS2 for this function and combine it with the output from the receiver channel 4 output (to BLM to LPB controller) - which all goes to the same ballast servo. Since that is the way it would be wired I assume the BS2 output for that function would be totally dead until needed - then wake up and provide the needed pulse to drive the servo to the blow position. If not the servo would be getting competing inputs.

    - Its great you came across Bob Martin and his RC Sub website. Great guy (very helpful) I and have purchased a lot of parts and electronics from him.

    Very exciting this is starting to take shape! The micro-motor and reed switches will be mounted in the sail - so I'll have to figure out how to waterproof them - shouldn't be a problem though.

    Thank you!



  • Duane DegnDuane Degn Posts: 10,348
    edited 2020-10-25 - 18:00:11
    Edit: It looks like you guys already know about the info I found. Maybe the pdf will be useful to someone.

    I haven't read all the replies yet but in cause there's a question about what the buttons do, I thought I'd share what I learned.
    This pdf discusses the buttons on the back of the radio.
    The button act like a momentary three position switch. The channel sends a center pulse when the buttons aren't press or sends a max/min value when one of the buttons is pressed.
  • Thank you Duane!
Sign In or Register to comment.