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.
Who is online?
In total there are 5 users online :: 0 Registered, 0 Hidden and 5 Guests
None
Most users ever online was 180 on Tue Nov 05, 2019 6:03 am
Latest topics
Search
Most Viewed Topics
Statistics
Our users have posted a total of 12536 messages in 1992 subjects
We have 1021 registered users
The newest registered user is Mike Echo
Similar topics
+4
salmon
C-3PO
tsenecal
timgarrod
8 posters
Arduino proportional control of a piston tank
tsenecal- Guest
- Posts : 322
Join date : 2015-04-01
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.
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- AMS Treasurer
- Posts : 2412
Join date : 2010-11-10
Age : 74
Location : Cumbria
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
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- AMS Treasurer
- Posts : 2412
Join date : 2010-11-10
Age : 74
Location : Cumbria
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
David
salmon- AMS Forum Owner
- Posts : 312
Join date : 2011-09-02
Age : 64
Location : Las Vegas, Nevada - USA
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
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- AMS Treasurer
- Posts : 2412
Join date : 2010-11-10
Age : 74
Location : Cumbria
Thanks Tom. This shows the setup - still a bit of a "lash-up".
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
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- AMS Treasurer
- Posts : 2412
Join date : 2010-11-10
Age : 74
Location : Cumbria
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
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
tsenecal- Guest
- Posts : 322
Join date : 2015-04-01
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.
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- AMS Treasurer
- Posts : 2412
Join date : 2010-11-10
Age : 74
Location : Cumbria
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
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- AMS Treasurer
- Posts : 2412
Join date : 2010-11-10
Age : 74
Location : Cumbria
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
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- Posts : 95
Join date : 2018-11-21
Location : Northamptonshire UK
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
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
geofrancis- Posts : 325
Join date : 2021-09-24
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
17b- Posts : 9
Join date : 2023-06-19
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
freek- Guest
- Posts : 9
Join date : 2015-05-20
- Post n°38
Have one running also!
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/
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- AMS Treasurer
- Posts : 2412
Join date : 2010-11-10
Age : 74
Location : Cumbria
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
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
Wed Dec 04, 2024 7:26 am by geofrancis
» Robbe Seawolf V2
Wed Dec 04, 2024 7:17 am by geofrancis
» Futaba -868/915mhz equipment
Tue Oct 29, 2024 4:46 pm by tsenecal
» RC Drift Gyro for pitch control
Sun Oct 20, 2024 2:04 pm by geofrancis
» WW2 mini sub build
Thu Oct 17, 2024 2:34 pm by geofrancis
» sonar data link
Mon Oct 14, 2024 4:31 pm by geofrancis
» ExpressLRS - 868/915 Mhz equipment
Fri Oct 11, 2024 8:58 pm by Marylandradiosailor
» Flight controllers as sub levelers
Fri Oct 11, 2024 8:14 pm by geofrancis
» 868/915 Mhz as a viable frequency for submarines.
Thu Oct 10, 2024 3:21 am by tsenecal