Hello,
I could start my brushless motor over an ESC with my Arduino MEGA. I tryed many combinations for arming the ESC and then to controll the speed smooth from low speed to high speed. I have a problem to understand the reaction of the motor. I try the code down. The problem is that it seems that the range is from 31 to 45 for the angle. If I set 30 there is no reaction. If I set 45 the motor is running on the top of speed. I don't understand this. In some examples I saw this:
mServo.attach(outPinPPM, pulseMin, pulseMax);
I do not set both values behind the outPinPPM. I think this is something which is an info that I need from the ESC, but I don't have an datasheet. Do anyone know something about this and could give me a tip?
Regards,
Gerd
#include <Servo.h>
Servo myservo;
void setSpeed(int speed){
// speed is from 0 to 100 where 0 is off and 100 is maximum speed
//the following maps speed values of 0-100 to angles from 0-180,
// some speed controllers may need different values, see the ESC instructions
int angle = map(speed, 0, 100, 0, 100);
myservo.write(angle);
}
void setup()
{
myservo.attach(9);
myservo.write(20);
delay(1000);
myservo.write(35);
delay(15);
myservo.write(20);
delay(3000);
}
void loop()
{
digitalWrite(13, HIGH);
myservo.write(35);
delay(1000);
myservo.write(34);
delay(1000);
myservo.write(33);
delay(1000);
myservo.write(32);
delay(1000);
myservo.write(31);
delay(1000);
myservo.write(33);
delay(1000);
myservo.write(34);
delay(1000);
myservo.write(35);
delay(1000);
myservo.write(36);
delay(10000);
myservo.write(0);
digitalWrite(13, LOW);
delay(10000);
}