Go Down

Topic: brushless motors ,esc , quadcopters (Read 2 times) previous topic - next topic

deepu1994

Jul 29, 2012, 02:45 pm Last Edit: Jul 29, 2012, 03:39 pm by deepu1994 Reason: 1
hi,,, sorry for creating this seperate but this would be much more usefull to all my friends who are part of the arduino team...to get this info quickly...
here is my problem......
how can i check my brushless motor belonging to topstar 2400kv http://topbandmotor.en.alibaba.com/product/427426170-212087816/brushless_dc_motor.html,, and esc belonging ipeaka 40A and 45A burst for 10shttp://www.ecvv.com/product/3694372.html,,,and with my arduino uno rev3????
when i use the following code
Code: [Select]
   
#include <Servo.h>    // including the servo library
Servo motorServo;     // naming the servo as "motorServo"

void setup()
{              // runs code once on setup:
 motorServo.attach(9);   // reporting the pin motorServo is attached to
 throttle();      
}

void loop()
{              // runs code repeatedly:

 setRpm(40);
}

void throttle()
{
 motorServo.write(0);   // sets the throttle to 0
 delay(1000);           // waits one second
}

void setRpm(int spd)
{
 int rpm = map(spd, 0, 100, 0, 179);    // maps rpm to a motor-friendly number
 motorServo.write(rpm);                     // sets motor to the rpm speed
 delay(15);                                        // waits for motor to get there
}
this does not work practically but as per theory its right (verify was successful)>>>> :( :|

MarkT

Every ESC has its own arming sequence and will refuse to start up if you don't follow it - this prevents injury when tinkering with an RC plane.

Generally many ESCs will arm if the throttle is set to zero for several seconds at start up (1 second is definitely rather short) and then _ramped up_ to speed.  Sudden step changes could be break-through from another RC channel and treated as an error condition perhaps?   If you have an RC transmitter and receiver you can experiment with it to see what your ESC likes.

This sequence is more conservative and I think might have a better chance of working.  Most ESCs chirp the motor to indicate status, typically 3 beeps upon arming
Code: [Select]

  setRpm (0) ;
  delay (4000) ;
  for (i = 0 ; i <= 40 ; i++)
  {
    setRpm (i) ;
    delay (20) ;
  }


The actual throttle settings for you particular ESC you'll have to experiment with.  I definitely use the higher-resolution calls to servo.write() where you pass the pulse-width in microseconds (540 to 2400 is the valid range).
[ I won't respond to messages, use the forum please ]

deepu1994

i cant get u >>>> becoz.....according to the manual of my ipeaka esc 40A...it needs a min throttle signal to arm itself>>>> then a continuous three beep sound when armed... the if we increase the throttle signal the motor accelerates up......
in my case it arms well but when i supposed to increase the throttle it keeps in beeping continuously........

MarkT

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

deepu1994

hi tnx for u r help anyway>>> i came out of that easily with my prof advise>>>
he advised me to use the microseconds value for the esc and arm the same >>>
my esc arms at 100ms and has the highest throttle range of 2000ms......
now all is working like charm>>>>\

my next point of interest is using the gsm module and the at commands>>>>
kindly give me essential details
Code: [Select]
#include <Servo.h>
Servo motor;

void esc() {
  delay(5000);
  Serial.print("Sending lowest throttle");
  motor.writeMicroseconds(1000);
  delay(2000);
  Serial.print("Low throttle sent");
}
void setup() {
  Serial.begin(9600);
  motor.attach(9);
  Serial.print("ESC calibration started");
  esc();
  Serial.print("ESC calibration completed");
}

void loop() {
  if (Serial.available()>0) {
    int key = Serial.read();
    switch(key) {
      case '1':
      motor.writeMicroseconds(1250);
      delay(2000);
      break;
      case '2':
      motor.writeMicroseconds(1400);
      delay(2000);
      break;
      case '3':
      motor.writeMicroseconds(1750);
      delay(2000);
      break;
      case '4':
      motor.writeMicroseconds(2000);
      delay(2000);
      break;
      case '5':
      motor.writeMicroseconds(2500);
      delay(2000);
      break;
      default:
      motor.writeMicroseconds(1000);
      break;
    }
  }
}
Tjhis is the code i used for controlling the motor

Go Up