Pages: [1]   Go Down
Author Topic: ESC- electronic speed control- brushless motor  (Read 2375 times)
0 Members and 1 Guest are viewing this topic.
Norway
Offline Offline
Jr. Member
**
Karma: 1
Posts: 71
Does it work?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello. I cant currently post at Hobbyking forum due to error.

I bought this for my pupils to be able to regulate speed of a brushless motor.

http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=659

Theres no need for direction motor control as the direction is fixed. (else I could have used a H-bridge to achieve this).

My thoughts is to send a pwm signal to input of the ESC from a pwm output of Arduino UNO and MEGA.

My consern is programming the ECS unit.

Do I need to program it initially (once)  ,in any way?

Ive seen some adv. regarding programming units for ESC's without any furhter informations. Does that ease up ,if any, programming of ESC?

Do I need to program it initially (once)  sending pwm signal from the arduino?

Thank You.


« Last Edit: January 07, 2012, 10:23:10 am by janeik » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17292
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The proper way to interface a ESC to a Arduino is using the servo library commands, not analogWrite PWM commands. ESCs are built to emulate acting just like a servo from a control point of view. Also you will need to find out the proper 'arming' commands to activate the ESC from the arduino. Arming is a safety feature on ESC that's prevents them from starting off when first powering on. Usually it's a sequence of 100% signal for one second or so, 0% for one second or so, and wait for ESC to beep signifying it's ready to accept servo speed commands. Yours may have a different sequence so read the operators manual for the ESC.

Lefty



Logged

Norway
Offline Offline
Jr. Member
**
Karma: 1
Posts: 71
Does it work?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi Lefty
Thanks for replying.
Ok, servo lib will be used then. I just think i noticed ,for the motor, said 8k PWM.
Never touched into r/c esc tuning before. It describes tuning process seen thowards a finished rc-system. I have no idea howto realize that thowards a arduino output.

Ive seen some esc tuning kits, wonder if they ease up the settings of asc, eliminating use of rc-unit?

regards

The proper way to interface a ESC to a Arduino is using the servo library commands, not analogWrite PWM commands. ESCs are built to emulate acting just like a servo from a control point of view. Also you will need to find out the proper 'arming' commands to activate the ESC from the arduino. Arming is a safety feature on ESC that's prevents them from starting off when first powering on. Usually it's a sequence of 100% signal for one second or so, 0% for one second or so, and wait for ESC to beep signifying it's ready to accept servo speed commands. Yours may have a different sequence so read the operators manual for the ESC.

Lefty




« Last Edit: January 07, 2012, 10:55:09 am by janeik » Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9541
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Previous post concerning ESCs for study.

http://www.google.com/search?q=esc+site%3Ahttp%3A%2F%2Farduino.cc%2Fforum%2Findex.php&hl=en&num=100&lr=&ft=i&cr=&safe=images
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Denmark
Offline Offline
Edison Member
*
Karma: 35
Posts: 1063
Happy Hobbyist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you look under the files tab, (in the link you provided) you can find the manual.

As far as I can see the only arming process required is that you should make a loop lasting a couple of seconds while
writing 0 or 180 using the servoLib (that should correspond to throttle stick set at 0.)


Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9541
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Servo test code you can try with the ESC. Send a 0, wait a couple of seconds, then send a 90 to see if the ESC arms (or what ever arming sequence is used with the ESC).

Code:
// zoomkat 10-22-11 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// for IDE 0022 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h>
Servo myservo;  // create servo object to control a servo

void setup() {
  Serial.begin(9600);
  myservo.writeMicroseconds(1500); //set initial servo position if desired
  myservo.attach(7);  //the pin for the servo control
  Serial.println("servo-test-22-dual-input"); // so I can keep track of what is loaded
}

void loop() {
  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the string readString
    delay(2);  //slow looping to allow buffer to fill with next character
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string
    int n = readString.toInt();  //convert readString into a number

    // auto select appropriate value, copied from someone elses code.
    if(n >= 500)
    {
      Serial.print("writing Microseconds: ");
      Serial.println(n);
      myservo.writeMicroseconds(n);
    }
    else
    {   
      Serial.print("writing Angle: ");
      Serial.println(n);
      myservo.write(n);
    }

    readString=""; //empty for next input
  }
}

Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Norway
Offline Offline
Jr. Member
**
Karma: 1
Posts: 71
Does it work?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Thank You very much for the informations. I will study them.

regards
Logged

Norway
Offline Offline
Jr. Member
**
Karma: 1
Posts: 71
Does it work?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you look under the files tab, (in the link you provided) you can find the manual.

As far as I can see the only arming process required is that you should make a loop lasting a couple of seconds while
writing 0 or 180 using the servoLib (that should correspond to throttle stick set at 0.)




Hi thanks for answer.
The inputs to uC are comming from thumbpotentiometer. Well see to it that the informations input to the servp is of values 0-180 using the thumbpot.

I hope the servolib manages upto 4 diffrent servoes. Thats something Ill have to checkout.

regards
Logged

Norway
Offline Offline
Jr. Member
**
Karma: 1
Posts: 71
Does it work?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for sharing this one.

Regards

Servo test code you can try with the ESC. Send a 0, wait a couple of seconds, then send a 90 to see if the ESC arms (or what ever arming sequence is used with the ESC).

Code:
// zoomkat 10-22-11 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// for IDE 0022 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h>
Servo myservo;  // create servo object to control a servo

void setup() {
  Serial.begin(9600);
  myservo.writeMicroseconds(1500); //set initial servo position if desired
  myservo.attach(7);  //the pin for the servo control
  Serial.println("servo-test-22-dual-input"); // so I can keep track of what is loaded
}

void loop() {
  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the string readString
    delay(2);  //slow looping to allow buffer to fill with next character
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string
    int n = readString.toInt();  //convert readString into a number

    // auto select appropriate value, copied from someone elses code.
    if(n >= 500)
    {
      Serial.print("writing Microseconds: ");
      Serial.println(n);
      myservo.writeMicroseconds(n);
    }
    else
    {   
      Serial.print("writing Angle: ");
      Serial.println(n);
      myservo.write(n);
    }

    readString=""; //empty for next input
  }
}

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, janeik

Are the codes here suitable for Atmega 2560 to try on it ?



regards.

Logged

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12048
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

One hint that might help with arming - don't expect an ESC to respond to a sudden discontinuous change in command angle -
it may assume this is due to co-channel interference and simply cut-out.  Ramp the servo.write () values up and down
smoothly (its also a lot safer, RC brushless motors are extremely high power - if connected to a propeller they can cut a finger
to the bone without the slightest problem - this is why an arming sequence is used and why it beeps before starting).

If the motor is spinning anything like a prop then goggles and gloves are _strongly_ advised.
Logged

[ I won't respond to messages, use the forum please ]

Pages: [1]   Go Up
Jump to: