SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By norrisj15
#157407
Hello all,

Let's just start by saying that I'm very new to the Arduino scene(and this website), but I'm working on a project for a class in mechanical engineering and need some minor guidance. (They don't very much teach the electric side of the engineering world to us mechE's)

The end goal is to control 4 DC motors, independently, through Arduino code.

To start, I just want to set up a single motor to get it going. I have Exceed 18A ESC( http://www.hobbypartz.com/07e-flyfun-18a.html )and Exceed brushless motor( http://www.hobbypartz.com/86ma54-2205-4500kv.html ) all being powered currently by a 11.1V 4000mA 20C battery (want to change this out for a power supply, but just using the battery for testing. Not what psu to buy as 4 motors would draw near 20 amps running at 9000 rpm that is desired for the project).

I've been referencing the following guides:
(1) https://forum.sparkfun.com/viewtopic.php?f=32&t=32036
(2) http://techvalleyprojects.blogspot.com/ ... orial.html

for starting to arm a single ESC, but it doesn't seem to be working correctly. Upon running the code from guide 2, the motor would continue to beep repeatedly non-stop while the motor jittered back and forth in very minor like 1 degree increments. I believe after reading the ESC manual that this pattern was that the battery voltage is either too low or too high. This would make no sense to me as the ESC is rated for 5.6 to 16.8V.

Any help is appreciated on either the PSU question or arming the esc and getting the motors spinning.

Thanks
By MichaelN
#157432
Standard RC signals are a pulse between 1 and 2 milliseconds wide, every 20 milliseconds. To arm the ESC you need to provide 1ms wide pulses, which equates to minimum speed (2ms equates to maximum speed). The number of required pulses is unknown, but I’d suggest 10 to 50 pulses should work.

Do you have a logic analyser or oscilloscope you can use to measure the pulses?
norrisj15 wrote:...want to change this out for a power supply, but just using the battery for testing. Not what psu to buy as 4 motors would draw near 20 amps running at 9000 rpm that is desired for the project).
I’d suggest a computer power supply should work, and will be your cheapest option (they typically provide a large proportion of their power on the +12V line). You’ll probably need to add a load resistor to convince the power supply to start – Google will reveal what others have done.

PS: my personal favorite online hobby store is www.hobbyking.com. Lots of active forums and reveiews, and very good prices.
By norrisj15
#157589
Thanks for the input. I figured out the PSU situation. One of the E-shops on campus had a 12V 30Amp PSU that I have been allowed to use for the remainder of the project. I'm going to solder a bunch of connections tomorrow and then I'll try to run the arming code I have again. If it doesn't work I'll be back.

Also, I do have an oscilloscope to measure the pulses.
By norrisj15
#157628
Image

How does this wiring diagram look?
Red = power
Black = ground
Green = signal

Do I need a load resistor?
By MichaelN
#157635
norrisj15 wrote:How does this wiring diagram look?
Red = power
Black = ground
Green = signal

Do I need a load resistor?
You need to make sure the GND of the Arduino is tied to the GND of the 7.4V PSU. Depending on the power supply and length of the power leads, you might like to add some capacitors close to the ESCs. These would need to be low ESR types to handle the ripple current. I suggest you try it without them first.

No need for a load resistor - that was just if you were trying to use a computer power supply.
By norrisj15
#157941
So I'm having a rough time arming these bad boys. Basically, I have one esc hooked up with a motor and the power supply. I turn on power and hear 3 quick "Beep beep beep" then it sits for 2 seconds or so and then beeps roughly 1 beep per second.

These are the ESC's if anyone needed reference:
http://www.hobbypartz.com/07e02-proton-18a.html
Also, this is the manual for the ESC's.
http://site.exceedrc.com/resource/produ ... manual.pdf


I've been trying to mess with these two pieces of code from these sites.
https://forum.sparkfun.com/viewtopic.php?f=32&t=32036
http://techvalleyprojects.blogspot.com/ ... -code.html

as well as this simple piece
#include <Servo.h>

Servo myservo;


void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
myservo.write(0);
delay(3000);
}


void loop()
{
myservo.write(160);
delay(1000);
myservo.write(0);
delay(1000);
}

Any help would be appreciated!
By norrisj15
#157943
Here's an idea of what I'm dealing with. You can see the arduino is plugged into the PC and is grounded to the ground distribution block which is out of the shot. I have 1 of the ESC's hooked up to pin 9 on the arduino. One of the motors, seen above, is plugged into an ESC, which is powered via the PSU.

Image


Here's the PSU I'm using. Got it set to roughly 7.4V(checked with a DMM).

Image
By MichaelN
#157963
norrisj15 wrote:I turn on power and hear 3 quick "Beep beep beep" then it sits for 2 seconds or so and then beeps roughly 1 beep per second.
Sounds like it's waiting for a series of valid "minimum" pulse widths (1ms wide). Have you hooked up an oscilloscope to check the pulses you're sending? Have you tested it with an RC transmitter / receiver instead of the Arduino?
By norrisj15
#157974
Sounds like it's waiting for a series of valid "minimum" pulse widths (1ms wide). Have you hooked up an oscilloscope to check the pulses you're sending? Have you tested it with an RC transmitter / receiver instead of the Arduino?
The goal is to program it via the arduino. Correct me if I'm wrong, but if I arm the ESC's with a transmitter won't' I have to re-arm them every time I put power to the ESC's? Basically, if I arm them with a transmitter will they be good to go on programming them?

I think the oscilloscope idea is good. I can't get one till tomorrow, but I'll look into what I'm actually sending from the arduino.
By norrisj15
#157986
The ESC's have all been armed! It was a very dumb mistake. After staring at it for a long time, I realized that the ESC transmitter connector was not connected to ground. I plugged all the ESC's transmitter connectors into the ground of the Arduino board (using a breadboard) and bam it works. Got all 4 motors spinning successfully.
By MichaelN
#157987
norrisj15 wrote:Correct me if I'm wrong, but if I arm the ESC's with a transmitter won't' I have to re-arm them every time I put power to the ESC's? Basically, if I arm them with a transmitter will they be good to go on programming them?
The idea was to make sure the ESCs hadn't been damaged, and that the rest of the wiring was OK. Good to hear you got them going :)
By webuser
#161712
norrisj15 wrote:Hello all,

Let's just start by saying that I'm very new to the Arduino scene(and this website), but I'm working on a project for a class in mechanical engineering and need some minor guidance. (They don't very much teach the electric side of the engineering world to us mechE's)

The end goal is to control 4 DC motors, independently, through Arduino code.

To start, I just want to set up a single motor to get it going. I have Exceed 18A ESC( http://www.hobbypartz.com/07e-flyfun-18a.html )and Exceed brushless motor( http://www.hobbypartz.com/86ma54-2205-4500kv.html ) all being powered currently by a 11.1V 4000mA 20C battery (want to change this out for a power supply, but just using the battery for testing. Not what psu to buy as 4 motors would draw near 20 amps running at 9000 rpm that is desired for the project).

I've been referencing the following guides:
(1) https://forum.sparkfun.com/viewtopic.php?f=32&t=32036
(2) http://techvalleyprojects.blogspot.com/ ... orial.html

for starting to arm a single ESC, but it doesn't seem to be working correctly. Upon running the code from guide 2, the motor would continue to beep repeatedly non-stop while the motor jittered back and forth in very minor like 1 degree increments. I believe after reading the ESC manual that this pattern was that the battery voltage is either too low or too high. This would make no sense to me as the ESC is rated for 5.6 to 16.8V.

Any help is appreciated on either the PSU question or arming the esc and getting the motors spinning.

Thanks
Try seeing this link, theres a way also to look at how you would get a pulse to arm a Servo or an ESC similarly

https://www.youtube.com/user/fnjyusername