Arduino to ESC.

Anything to do with programing the Arduino Platform.
Post Reply
Geomaracon
Posts: 7
Joined: Nov 18th, 2014, 11:25 am

Arduino to ESC.

Post by Geomaracon »

Hey guys,

Anyone able to tell me if multiple ESC can be controlled independently from one arduino?? Or how people have gotten around this issue?

Thanks.
User avatar
olegodo
Posts: 222
Joined: Aug 30th, 2013, 9:47 am
Location: Bergen, Norway

Re: Arduino to ESC.

Post by olegodo »

Yes you can. An ESC needs a PWM signal to work. The different arduino boards has pins that can do this (the UNO has six, the Mega has 14) so if a board has sic PWM capable pins you could control six ESCs :)
There is a lot of information and tutorials about this on YouTube and the Web oin general
User avatar
Moki
Posts: 119
Joined: Oct 21st, 2014, 2:19 am
Location: The Netherlands

Re: Arduino to ESC.

Post by Moki »

Not sure about the Arduino, but on a Raspberry Pi, you can connect extra PWM's using I2C boards.
I am sure, something like that can be done with Arduino also.

If Arduino has I2C, you can add for example the Adafruit board with 16 PWM's... (even add 5 of them to one Rasp PI.)
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: Arduino to ESC.

Post by KR2_Diving »

Geomaracon wrote:Hey guys,

Anyone able to tell me if multiple ESC can be controlled independently from one arduino?? Or how people have gotten around this issue?

Thanks.
Absolutely!
Look into the SERVO.h library for the Arduino. This is exactly what you need!

As for the Extended module that allows for MORE servo connections:
If Arduino has I2C, you can add for example the Adafruit board with 16 PWM's... (even add 5 of them to one Rasp PI.)


Arduino does have an I2C interface... i have seen demos where there are over 90 servos connected to one arduino!

I have posted some code on my build pages on this forum if you wanted to see some examples!

Best of luck!
rossrov
Posts: 383
Joined: Feb 28th, 2013, 5:01 pm
Location: Australia

Re: Arduino to ESC.

Post by rossrov »

Geomaracon: http://arduino.cc/en/reference/servo. Maybe you are wondering how a microcontroller with only 3 timer/counters can do more servos (or ESCs in this case) than there are timer/counters? Actually, in the case of the Uno, only one of the timer/counters is used by the servo library function. The library code switches the pin(s) you have attached high and low to generate the PWM you want for each pin you have attached in your program.
I guess the servo function must load a value for lets say the servo 1 pin into the timer, setting that pin high for the required time, then low, then the library code moves on to the next servo pin, loads a value for that servo into the timer and the process goes on like that. If that is the case then when using the library servo library it is time that limits the number of servos or ESCs that can be used, not hardware.
Geomaracon
Posts: 7
Joined: Nov 18th, 2014, 11:25 am

Re: Arduino to ESC.

Post by Geomaracon »

Thanks guys. Plenty of food for thought there! I am hoping to control 6 thrusters with a PS2 controller, may be a long shot but I like the intuitive nature of how those controllers work. Anyone can pick it up and go! Things coming along nicely, have frame and thruster mounting sorted along with some high quality diver mounted cameras and actual ROV led light systems. Waiting on motors and ESC'S now. Once they arrive I will be waiting on some divine intervention with regards to my lack of Arduino and programming knowledge!! Hope to have first revision of the ROV in the water by early February so long as I don't get sidetracked by work!


Any input or suggestions are really welcome. I'd love to see what others are doing!

Thanks again for all the replies!
User avatar
KR2_Diving
Posts: 391
Joined: Aug 30th, 2012, 11:43 am
Location: Currently: NW Suburbs of Chicago. Originally: NE Wisconsin

Re: Arduino to ESC.

Post by KR2_Diving »

Hey Geomaracon!
Sounds like you have a pretty clear goal in mind!! Best of luck!

If you are looking for some good references, check out Bill Porters library for the PS2 controller...

I am using Porters library and it seems to fit the bill.
I have tried to document my build as much as possible, and it would seem we are both on the same track! Hope my notes help!
book.jpg
book.jpg (110.66 KiB) Viewed 7826 times
If you are new to Arduino, I would HIGHLY recommend THIS book.
Geomaracon
Posts: 7
Joined: Nov 18th, 2014, 11:25 am

Re: Arduino to ESC.

Post by Geomaracon »

Thanks KR2!
CLYON
Posts: 35
Joined: Dec 2nd, 2012, 8:52 am

Re: Arduino to ESC.

Post by CLYON »

Another book that I would highly recommend is The Arduino Cookbook by Michael Margolis. It has "recipes" for almost everything you would need for your ROV. Controlling motors, sensors, Arduino to Arduino communication, displays, etc. are included. You could get it on Ebay and save some cash maybe. I have this book and also the one above. Both have enough info to get you into all kinds of trouble!

http://www.amazon.com/Arduino-Cookbook- ... 1449313876

Chuck
Post Reply