Author Topic: Connecting a speed controller to an Arduino  (Read 7732 times)

0 Members and 1 Guest are viewing this topic.

Offline MegaTopic starter

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Connecting a speed controller to an Arduino
« on: December 16, 2007, 07:42:38 AM »
Hi,

On my attic I found this electronic speed controller:


See also: https://shop.graupner.de/webuerp/servlet/AI?ARTN=7196&SessionCheck=4711&language=en.

I was wondering how to connect this ESC to my Arduino board. If I connect my 7.2V battery pack to the ESC, the
servo-like connector of the ESC will deliver 5V which could power the Arduino.

The question is how to connect the control pin (orange wire of the servo-like connector).
Should I control this ESC like a servo, so firing pulses at 50 Hz and modifying the width of the pulses to control the voltage that goes
to the motors, or should I use one of the Arduino PWM pins in high frequency to control the ESC.

It would also be great if someone could point me to a datasheet of a ESC like this.

Any ideas?

Thanks, Mega
« Last Edit: December 16, 2007, 07:52:38 AM by Mega »
Visit my robotics blog at http://megabotblog.blogspot.com/

paulstreats

  • Guest
Re: Connecting a speed controller to an Arduino
« Reply #1 on: December 16, 2007, 08:46:40 AM »
The data sheet is on the link that you posted.

I dont think it works with PWM, Just a high/medium/low voltage for the different functions (that look like they have to be pre calibrated for your system)

I would say that you are better off not using it, it seems to be designed specially for radio controlled cars.

Offline MegaTopic starter

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Re: Connecting a speed controller to an Arduino
« Reply #2 on: December 16, 2007, 08:58:39 AM »
Quote
The data sheet is on the link that you posted.
Unfortunately this referred manual does not say anything about the interface of the speed controller...

Quote
I would say that you are better off not using it, it seems to be designed specially for radio controlled cars.
I hoped this speed controller would be a good way to control my HummBot car which contains a high current (upto 50A) DC motor.
Visit my robotics blog at http://megabotblog.blogspot.com/

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: Connecting a speed controller to an Arduino
« Reply #3 on: December 16, 2007, 02:52:20 PM »
you should be able to control it in exactly the same ways as a servo.

sounds like a good solution to me.


dunk.

Offline MegaTopic starter

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Re: Connecting a speed controller to an Arduino
« Reply #4 on: December 17, 2007, 10:03:18 AM »
Quote
you should be able to control it in exactly the same ways as a servo.

sounds like a good solution to me.

That's what I tried. I sent pulses every 20ms and by varying the length of the pulses I expected the
voltage on the output wires to change. But so far no success.
But I don't give up yet, I'll give it another try!
Visit my robotics blog at http://megabotblog.blogspot.com/

Offline MegaTopic starter

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Re: Connecting a speed controller to an Arduino
« Reply #5 on: December 17, 2007, 01:00:06 PM »
The main reason for exploring this ESC is that I want to control a high current motor with my Arduino board.

This is the engine I would like to control with an Arduino:
http://www.modelsport.co.uk/?CallFunction=ShowSpecification&ItemID=18376

During normal usage it draws 7.9A, with high ballast is draws up to 50A!

This won't work with your average H-bridge IC like the l293...

Any suggestions on how to control such a high current DC motor (in case the ESC experiment fails) ?
Visit my robotics blog at http://megabotblog.blogspot.com/

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Connecting a speed controller to an Arduino
« Reply #6 on: December 17, 2007, 04:32:49 PM »
Quote
That's what I tried. I sent pulses every 20ms and by varying the length of the pulses I expected the
voltage on the output wires to change. But so far no success.
if you hook up a servo instead, the servo works, right? if the servo works, the ESC should . . .

unless there is a reason it was in the attic ;)

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Re: Connecting a speed controller to an Arduino
« Reply #7 on: December 17, 2007, 05:03:06 PM »
make sure you have teh ground, +, and signal wires correct, cause diferent servos/esc have diferent plugs
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline MegaTopic starter

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Re: Connecting a speed controller to an Arduino
« Reply #8 on: December 18, 2007, 12:17:33 PM »
Quote
if you hook up a servo instead, the servo works, right? if the servo works, the ESC should . . .

unless there is a reason it was in the attic Wink

Yep, if I hook up a servo the same way, it works. But the ESC does not...

I'm sure the ESC is not broken since I tested it with the original receiver and transmitter.
I did some measurements with this and found that the red and brown wires send 5V from the ESC to the receiver,
and the orange wire sends 0.29V from the receiver to the ESC when the transmitter is in the full forward position and sends
0.16V to the ESC if the transmitter is in the full backward position. The output of the ESC to the motor varies from -7.2V to +7.2V as expected.

Quote
make sure you have teh ground, +, and signal wires correct, cause diferent servos/esc have diferent plugs
I double checked this and the connections are ok.
Visit my robotics blog at http://megabotblog.blogspot.com/

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Connecting a speed controller to an Arduino
« Reply #9 on: December 18, 2007, 12:56:44 PM »
Quote
I'm sure the ESC is not broken since I tested it with the original receiver and transmitter.
Is this a special receiver? Do servos work with this receiver?

Offline MegaTopic starter

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Re: Connecting a speed controller to an Arduino
« Reply #10 on: December 18, 2007, 01:05:39 PM »
Quote
Is this a special receiver? Do servos work with this receiver?
Yes, servos work with this receiver, so nothing special.
Visit my robotics blog at http://megabotblog.blogspot.com/

Offline MegaTopic starter

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Re: Connecting a speed controller to an Arduino
« Reply #11 on: December 18, 2007, 01:26:22 PM »
What I would expect is that I only have to connect the orange (signal) wire to the Arduino, since the ESC is already powered by the 7.2V battery pack that is connected to the ESC. The + and - pins would normally power the receiver, but in my case the Arduino plays the role of the receiver and does not need to be powered by the ESC...

Visit my robotics blog at http://megabotblog.blogspot.com/

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Connecting a speed controller to an Arduino
« Reply #12 on: December 18, 2007, 02:53:17 PM »
You aren't doing something right here . . .

You said:
servo works in receiver
servo works in arduino
ESC works in receiver
ESC doesnt work in arduino?!


are you sure you have grounds common on the ardiuno? meaning, is the ground on the ESC also connected to the ground on the arduino?

Offline MegaTopic starter

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Re: Connecting a speed controller to an Arduino
« Reply #13 on: December 19, 2007, 10:59:58 AM »
First of all: thanks for all your suggestions and answers. I really appreciate this!

Quote
You aren't doing something right here . . .
That's obviously true  :)

Quote
You said:
servo works in receiver
servo works in arduino
ESC works in receiver
ESC doesnt work in arduino?!


are you sure you have grounds common on the ardiuno? meaning, is the ground on the ESC also connected to the ground on the arduino?

Yes, that's all correct.
However I had overlooked one thing: the ESC needs some initialization/setup, it expects that the transmitter (in this case the Arduino) is first put in the neutral postion, after one second or more the transmitter needs to be put in the maximum position and a second or more after that the transmitter needs to be put in the minimum position.
After simulating this initialization sequence with the Arduino, the ESC seems to respond much better.

1500 us pulses now result in 0V output to the motor, 2000 us results in +7.5V and 1000 us pulses in -7.5V.
That's what I need!

The only remaining problem is that I get 0V or the maximum voltage (+/- 7.5V) and nothing in between, so when I fire lets say 1600 us pulses I still get the full +7.5V... some more testing to do...

Visit my robotics blog at http://megabotblog.blogspot.com/

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Connecting a speed controller to an Arduino
« Reply #14 on: December 19, 2007, 11:10:52 AM »
Quote
The only remaining problem is that I get 0V or the maximum voltage (+/- 7.5V) and nothing in between, so when I fire lets say 1600 us pulses I still get the full +7.5V... some more testing to do...
Actually this isn't a problem, this is how PWM works.

Voltage stays the same, its the frequency and wavelength that change. Hook it up to an oscope and you will see how it changes.

When you hook the motor up, you will see how the PWM changes the motor speed.

Offline MegaTopic starter

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Re: Connecting a speed controller to an Arduino
« Reply #15 on: December 19, 2007, 11:17:20 AM »
Quote
Actually this isn't a problem, this is how PWM works.

Voltage stays the same, its the frequency and wavelength that change. Hook it up to an oscope and you will see how it changes.

When you hook the motor up, you will see how the PWM changes the motor speed.

Ok, that makes sense. Another learning moment  :)
Thanks again!
Visit my robotics blog at http://megabotblog.blogspot.com/

Offline MegaTopic starter

  • Full Member
  • ***
  • Posts: 88
  • Helpful? 0
    • MegaBot Blog
Re: Connecting a speed controller to an Arduino
« Reply #16 on: December 19, 2007, 12:55:55 PM »
Having a working ESC, I connected the components together and I now have a first driving HummBot!

Have a look at: http://megabotblog.blogspot.com/2007/12/hummbot-drives.html
Visit my robotics blog at http://megabotblog.blogspot.com/

 


Get Your Ad Here

data_list