My ESCs were working fine but suddenly since yesterday, they have started to make an unknown sound. I don't understand what these beeps mean. I have attached a link to a video that has the beep sound of the ESCs. What does this beep mean?
The ESCs were calibrated to work within the range of 1000us-2000us and seemed to work fine.
It seems pretty clear, Input voltage too high or too low. If you have a meter measure the input voltage. What is it? Often caused by a battery that needs charging.
I think the error was with how I was giving the throttle input to the ESC. I had been using the servo library to generate the ESC signals but yesterday I changed the code to provide manual signals. I stored the esc_pulse values as an integer but after I change the data type of the variable to an unsigned long the issue goes away.
Data type could have been the issue because I was comparing an integer to a long to generate the ESC signals
void applyMotorSpeed() {
while ((now = micros()) - loop_timer < period);
// Update loop timer
loop_timer = now;
// Set pins #4 #5 #6 #7 HIGH
PORTD |= B11110000;
// Wait until all pins #4 #5 #6 #7 are LOW
while (PORTD >= 16) {
now = micros();
difference = now - loop_timer;
if (difference >= throttle) PORTD &= B11101111; // Set pin #4 LOW
if (difference >= throttle) PORTD &= B11011111; // Set pin #5 LOW
if (difference >= throttle) PORTD &= B10111111; // Set pin #6 LOW
if (difference >= throttle) PORTD &= B01111111; // Set pin #7 LOW
}
}
This is my code, the throttle variable was an integer and it was being compared to the difference variable which is a long