Hi,
I own a pair of ESC's called BL Control 710, a pair of 2216/25 Roxxy motors and an ArduPilot Legacy which features an ATmega328p.
The motors are connected to pins 3 and 11 on the Arduino. From what I know, these pins are running at 976.5625Hz. My ESC's are made for 10Khz. I have to say, all the pins are already soldered on the board, so no change regarding them is possible.
The problem is that I cannot command the motor with a higher frequency than 166Hz. (6ms) I suppose the problem is related to the Arduino/ESC's timing.
I'm giving here my sketch code, for a better understanding.
void setup()
{
Serial.begin(38400);
pinMode(3,OUTPUT);
pinMode(11,OUTPUT);
analogWrite(3,0);
analogWrite(11,0);
delay(3000);
}
void loop()
{
increase(0,128);
decrease(128,0);
}
byte increase(byte from, byte till)
{
for(byte i=from; i<=till; i++)
{
analogWrite(3,i);
analogWrite(11,i);
delay(6);
}
}
byte decrease(byte from, byte till)
{
for(byte i=from; i>=till; --i)
{
analogWrite(3,i);
analogWrite(11,i);
delay(6);
}
}
What could be the solution for this situation?
Thank you for the assistance,
RobertEagle
EDIT: 1.Just for the record, I don't understand why I can't command the motors with values lower than 60-80. Don't blame the real voltages, they're okay.
2.I also found I can command them with 5.85ms and 1.3ms delay.
3.Do I have to increment the duty cycle gradually, or is just a particularity generated by my Arduino's frequency?