The Association of Model Submariners.

Would you like to react to this message? Create an account in a few clicks or log in to continue.

* THE FORUM FOR ALL THOSE INTERESTED IN BUILDING AND OPERATING MODEL SUBMARINES *



Join the AMS - Registered Forum users can become members of the AMS and it's free ...... To join send an email with your name , address and phone number to amstreasure@googlemail.com


For a guide to past events see the "Shows and Events" section.

Papplewick Pumping Station SUBMARINE Day. 31st March - 1st April 2024.

$$$

&&&

::::

Who is online?

In total there are 6 users online :: 0 Registered, 0 Hidden and 6 Guests :: 1 Bot

None


Most users ever online was 180 on Tue Nov 05, 2019 6:03 am

Latest topics

» Information on camouflage patterns for German seahund
arduino - Arduino proportional control of a  piston tank - Page 2 EmptyFri Mar 15, 2024 4:36 pm by david f

» WW2 mini sub build
arduino - Arduino proportional control of a  piston tank - Page 2 EmptyTue Mar 12, 2024 1:56 pm by geofrancis

» Not the hobby I expected :)
arduino - Arduino proportional control of a  piston tank - Page 2 EmptySun Mar 10, 2024 6:30 pm by cat

» 868/915 Mhz as a viable frequency for submarines.
arduino - Arduino proportional control of a  piston tank - Page 2 EmptyWed Mar 06, 2024 4:50 pm by tsenecal

» Sheerline gasket material
arduino - Arduino proportional control of a  piston tank - Page 2 EmptyMon Feb 19, 2024 9:24 pm by Michaelc

» Choice of CAD software and Printer for 3D printing
arduino - Arduino proportional control of a  piston tank - Page 2 EmptyThu Feb 15, 2024 1:53 pm by david f

» Engel Nautlus
arduino - Arduino proportional control of a  piston tank - Page 2 EmptyTue Feb 13, 2024 9:15 am by palmert6

» RF 27/433MHz maximum depth in pools (1-5 ppm chlorine, 6-8pH)
arduino - Arduino proportional control of a  piston tank - Page 2 EmptyThu Feb 08, 2024 2:05 pm by david f

» Arduino proportional control of a piston tank
arduino - Arduino proportional control of a  piston tank - Page 2 EmptyThu Feb 08, 2024 1:37 pm by david f

Statistics

Our users have posted a total of 12425 messages in 1980 subjects

We have 1005 registered users

The newest registered user is Les

+4
salmon
C-3PO
tsenecal
timgarrod
8 posters

    Arduino proportional control of a piston tank

    avatar
    tsenecal
    Guest


    Posts : 305
    Join date : 2015-04-01

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  tsenecal Thu Feb 21, 2019 3:43 pm

    C-3PO...

    things get even weirder when you throw in what i am doing, and what the Teensy is doing...  they are basically co-opting the software to work with the "almost the same" hardware, bending it far beyond what you would think is prudent in some cases to get their hardware support up to the same level as arduino's IDE support for arduino hardware is.
    david f
    david f
    AMS Treasurer


    Posts : 2395
    Join date : 2010-11-10
    Age : 73
    Location : Cumbria

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  david f Fri Mar 15, 2019 10:15 am

    I have just been building another piston tank for the CSS Pioneer. (I will post a photo in the next day or so.)

    I have been planning to use one of the smaller commercial H bridge units together with an Arduino for the proportional control. The software is giving some issues in connection with the failsafe (At least it failsafes too successfully, too often!) But just a reminder warning that this software has still not been used "in the wet" in a model.

    The PIC version has been "battle" (Oh alright pond!) tested for a number of years.

    More soon,

    David
    david f
    david f
    AMS Treasurer


    Posts : 2395
    Join date : 2010-11-10
    Age : 73
    Location : Cumbria

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  david f Mon Mar 18, 2019 9:06 am

    It is beginning to look as if the occasional glitches in failsafe are caused by power supply problems. Intermittent - the worst sort of problem!

    David
    salmon
    salmon
    AMS Forum Owner


    Posts : 312
    Join date : 2011-09-02
    Age : 64
    Location : Las Vegas, Nevada - USA

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  salmon Mon Mar 18, 2019 11:30 am

    David,
    Do you use the BEC in the ESC or do you use a separate BEC?
    I changed on one sub from using the built in battery elimination circuit on the electronic speed controller to a stand alone BEC. The glitches I was having disappeared.
    Not sure if it was the ESC being glitchy or if I was taxing the built in supply. Remember to disable the power coming from the ESC (either cut or remove the red wire from ESC).
    Peace,
    Tom


    _________________
    If you can cut, drill, saw, hit things and swear a lot, you're well on the way to building a working model sub.
    david f
    david f
    AMS Treasurer


    Posts : 2395
    Join date : 2010-11-10
    Age : 73
    Location : Cumbria

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  david f Tue Mar 19, 2019 10:34 am

    Thanks Tom. This shows the setup - still a bit of a "lash-up".

    arduino - Arduino proportional control of a  piston tank - Page 2 20190310

    You can see I'm using a Micro Gyro ESC. The BEC is well specified but I usually favour a separate switch-mode power supply, for the reasons you give. In this case, I'm trying to save space. The "issues" do seem to be triggered by servo movements.

    There are still some other software issues though. The fail-safe occasionally doesn't!

    David
    david f
    david f
    AMS Treasurer


    Posts : 2395
    Join date : 2010-11-10
    Age : 73
    Location : Cumbria

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  david f Thu Mar 21, 2019 9:00 am

    A bit more investigation. Servo movements were causing the Arduino to reset.

    I have disconnected the BEC in the Micro Gyro speed controller and moved to a separate switch mode power supply (this has some large electrolytic capacitors in it to buffer any voltage drop.)

    This works better but I'm still getting occasional problems with the failsafe in the Arduino software not working. Interestingly the original PIC controller board is working well in these circumstances. (If you look back in the threads, this board was developed and built to be very tough and well protected.)

    Some conclusions:

    - It is interesting how often built in BECs in speed controllers  don't work well in submarines. Too much demand from servos?

    - I will use the PIC controller board for now. (The sailing season is getting very close!)

    - Still some work needed on the Arduino version of the software in combination with the commercial H Bridges  but that is a better winter activity! (I've made a note in Github to this effect.)

    David


    Last edited by david f on Mon Mar 25, 2019 9:24 am; edited 1 time in total
    avatar
    tsenecal
    Guest


    Posts : 305
    Join date : 2015-04-01

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  tsenecal Fri Mar 22, 2019 2:37 pm

    David,

    i find that 99% of all ESC BECs that we use (car/boat escs with reverse) are built to handle the load of a single standard size servo... which basically makes them useless for anything other than a 1/10 scale or smaller r/c car.
    david f
    david f
    AMS Treasurer


    Posts : 2395
    Join date : 2010-11-10
    Age : 73
    Location : Cumbria

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  david f Thu Mar 05, 2020 2:30 pm

    Just to say that I have now tested this software in the "wet" in a real model submarine and it works well.

    I have posted the latest software to Github, for anyone to use:

    https://github.com/rdforrest/submarine-proportional-pistontank

    This version includes a "winch" control option, developed  for something I'm working on.

    I am still getting some problems with my Arduino Nano clones having code corrupted and having to be re-programmed.

    (I have had the same problems with Nanos used with Tim S's Telemetry.)

    I still think that power supply is the problem. I am using a separate power supply (I would never use a speed controller BEC) and I have recently moved back to analogue from switch mode but still with these corruption problems.

    LATER EDIT> I have just checked and it was actually a switch mode power supply in the model. I have installed an analogue one now, so lets see.

    LATER, LATER EDIT ! (March 2020) An analogue power supply failed to solve the corrupt code problem. However I think I may have solved the problem by using a genuine Arduino rather than a clone. This seems to be holding up well so far and without out all the input signal protection I had installed on the clone.

    David
    david f
    david f
    AMS Treasurer


    Posts : 2395
    Join date : 2010-11-10
    Age : 73
    Location : Cumbria

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  david f Tue Jan 02, 2024 11:24 am

    This is a pm conversation with Stefan over the Christmas period. (Published with his permission.)
    If anyone has experience of using a Pro Micro/Leonardo in this sort of application please post on here.

    Hi David,
    after some search i found your thread about the arduino controlled piston tank controller.
    Unfortunately i cant get it to be compilated, neither for my favourite Pro Micro Boards nor the Nano as described in the comments. I tried the Piston_4g.ino as well as the latest Piston_Winch_Pump_controller-2.7 but i always get error messages after compiling.
    Would you be so kind and point me to the right direction to get this thing working?

    Thanks and best regards
    Stefan

    Hi Stefan,
    I am pleased that you are following my work and I'm sorry you are having compilation problems.
    I assume that you are using the Arduino IDE (which version?) and you have downloaded the a,b,c etc routines into the tabs.
    What error messages are you getting when you compile?
    I seem to remember that I used someone's pulse measurement routine for which I paid a small sum. I wonder if that could be the problem. (The supplier is mentioned in the comments.)
    Has anyone else tried this routine and has anyone else had problems , which I know can be very frustrating!
    But many thanks for your interest.
    David
    A pm with Stefan over the Chrisdtmas period. (Published with his pewrmission.)

    Hi David,
    thanks for your kind answer.
    After i extracted "Piston_Winch_Pump_controller-2.7" and started "Piston_Winch_Pump_controller-2.7.ino" i got a message that "eRCaGuy_Timer2_Counter.h" is missing. So i downloaded it (you can download it for a small donation) and saved in the "Piston_Winch_Pump_controller-2.7" folder. Now i have the four .ino files and the .h file. After compilation i get an "exit status 1 eRCaGuy_Timer2_Counter.h: No such file or directory" error. Then i changed <eRCaGuy_Timer2_Counter.h> into "eRCaGuy_Timer2_Counter.h". Now i can compile it, i dont know why it didnt worked the first time. Unfortunately it only compiles for Nano, but not for Pro Micro/Leonardo. I get an "'TCCR2A' was not declared in this scope" error, so i tried different Input Pins in b_setup. Nothing worked. Do you have any clue what could be wrong? I am using the 1.8.12 IDE.

    Best regards
    Stefan

    PS: BTW, i started a little project about Leveller/depth controller with Arduino. I am pretty new to this and still struggling. Please visit https://www.theassociationofmodelsubmariners.com/t2041-cheap-arduino-auto-leveler#12265

    Hi Stefan,
    Very good that you have got it working with the Nano. Unfortunately I don't have any experience of the other processors.
    If you would allow us to publish this correspondence publicly on the Forum, someone else may come up with the answer?
    Happy New Year by the way,
    David
    C-3PO
    C-3PO


    Posts : 95
    Join date : 2018-11-21
    Location : Northamptonshire UK

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  C-3PO Tue Jan 02, 2024 11:49 am

    Real quick glance at info - so hope what I quote is correct.

    Arduino Pro Micro - According to the datasheet ATMega32U4 has four timers:

       Timer0 controls pin functions OC0A, OC0B
       Timer1 controls pin functions OC1A, OC1B, OC1C
       Timer3 controls pin functions OC3A
       Timer4 controls pin functions OC4A, OC4B, OC4D and inverted !OC4A, !OC4B, !OC4D

    The eRCGUY library works using timer2

    Nano/Uno uses ATmega328P which has 3 timers
    Timer/Counter0
    Timer/Counter1
    Timer/Counter2

    So square peg round hole!!!

    Regards
    C-3PO

    david f and geofrancis like this post

    avatar
    geofrancis


    Posts : 282
    Join date : 2021-09-24

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  geofrancis Tue Jan 02, 2024 4:39 pm

    C-3PO wrote:Real quick glance at info - so hope what I quote is correct.

    Arduino Pro Micro - According to the datasheet ATMega32U4 has four timers:

       Timer0 controls pin functions OC0A, OC0B
       Timer1 controls pin functions OC1A, OC1B, OC1C
       Timer3 controls pin functions OC3A
       Timer4 controls pin functions OC4A, OC4B, OC4D and inverted !OC4A, !OC4B, !OC4D

    The eRCGUY library works using timer2

    Nano/Uno uses ATmega328P which has 3 timers
    Timer/Counter0
    Timer/Counter1
    Timer/Counter2

    So square peg round hole!!!

    Regards
    C-3PO


    There was similar issues when working with the 32u variants of openlrs hardware. the 32u is only compatible with the 328/168 at a high level in arduino. Once you start using avr specific commands it breaks.

    david f likes this post

    avatar
    17b


    Posts : 8
    Join date : 2023-06-19

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  17b Wed Jan 03, 2024 8:19 pm

    C-3PO wrote:Real quick glance at info - so hope what I quote is correct.

    Arduino Pro Micro - According to the datasheet ATMega32U4 has four timers:

       Timer0 controls pin functions OC0A, OC0B
       Timer1 controls pin functions OC1A, OC1B, OC1C
       Timer3 controls pin functions OC3A
       Timer4 controls pin functions OC4A, OC4B, OC4D and inverted !OC4A, !OC4B, !OC4D

    The eRCGUY library works using timer2

    Nano/Uno uses ATmega328P which has 3 timers
    Timer/Counter0
    Timer/Counter1
    Timer/Counter2

    So square peg round hole!!!

    Regards
    C-3PO

    Thanks Jonathan!
    I just wanted to use the spare Leonardos i have lying around. In the meantime i found a sketch from a dutch modeller who works like a charm. There are some minor modifications i have to make, but right now it works. Maybe i will give Davids sketch a second chance by using a nano. However i will post my results when i am ready.

    Cheers
    Stefan

    david f and geofrancis like this post

    avatar
    freek
    Guest


    Posts : 9
    Join date : 2015-05-20

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Have one running also!

    Post  freek Wed Jan 17, 2024 7:24 pm

    Interesting! The submarine Auguste Picard that I brought to Papplewick pumping station in 2023 has an arduino tank controller, made for me by Lex Verkuijl in the Netherlands. it’s worked well now for a couple of years!

    Dutch build log with forces on the arduinonstuff here.

    https://www.modelbouwforum.nl/threads/proportionele-zuigertank-met-arduino.272842/

    david f likes this post

    david f
    david f
    AMS Treasurer


    Posts : 2395
    Join date : 2010-11-10
    Age : 73
    Location : Cumbria

    arduino - Arduino proportional control of a  piston tank - Page 2 Empty Re: Arduino proportional control of a piston tank

    Post  david f Thu Feb 08, 2024 1:37 pm

    Hi Freek,

    Nice to hear from you again! (We met at Papplewick last year.)

    Thanks also for the link to the Piston tank - very interesting , particularly once I engaged the translate to English button!

    I am relieved that Lex finally went back to using Hall switches. ( I have always found them OK.) I was a bit disappointed that he used relays rather then than H bridges for motor switching - a bit "clunky" (literally!) in my opinion. But a very nice project.

    Hope to see you and that really different (and beautifully performing) Piccard submarine soon.

    David

      Current date/time is Thu Mar 28, 2024 11:35 pm