Hello,
for my project (trying to build a small car and later on a ship) I want to drive a powerful (brushless)motor via the Arduino. In order to do so, I need an ESC. As my father was a bit into Model cars and stuff, he has some ESCs and Brushless motors lying around that I can use.
I started off trying to find information on how to use the parts I have to get the motor working. In my understanding I have to send values to the ESC just like with a servo motor. I read as well that the cabling was the same (to the ESC). So I went ahead and connected everything as the following:
Motor (two cables, not brushless) to ESC (thick wires). ESC to battery (LiPo Battery, also two thick wires). Three thin chords from the ESC: white in the PWN pin on my Arduino, black in ground and red into the 5V.
This was all a couple weeks ago. With my Graupner SC-2001 ESC and a motor which I have no information about, I remember that The motor would either spin on full speed or not at all, but only if connected to the Arduino.
I think I used this example sketch:
#include <PWMServo.h>
PWMServo myservo; // create servo object to control a servo
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(SERVO_PIN_A); // attaches the servo on pin 9 to the servo object
//myservo.attach(SERVO_PIN_A, 1000, 2000); // some motors need min/max setting
}
void loop() {
for(pos = 0; pos < 180; pos += 1) { // goes from 0 degrees to 180 degrees, 1 degree steps
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
So today I tried the same thing again. Well, and there it goes: I started the program and the connection was bad so I fixed it. The moment the connection was good, the motor started (in contrast to what I remember,) spin slower, maybe even speed up and slow down, but then it started to smell bad and a bit of smoke came out of the motor.
Afterwards, I feel like the dumbest person, not having asked anyone earlier, but well it is how it is. I hope I did not destroy anything other than the motor. I still want to test the motor though, but not by completely ruining it. Is it safe to connect the old 2,4GHz remote and then try to test the motor?
My question is: How can I control a motor with an Arduino? I still have a Modelcraft Hurricane Pro ESC in combination with a Modelcraft Hurricane 12 T brushless motor. I do not, however, want to damage these parts as well.
If you need any more information like pictures, I definitely can provide those.
Thank you for your answers and ideas. I do appreciate them!