How to make ESC Calibration Program

Hello

I am making a program to perform the calibration of the now ESC.

This video in the reference, has created a program

① turn on the power.
② Enter the maximum output value of the PWM
③ Enter the minimum output areas of PWM
UsedESC:simonk esc 12a

However, my program made did not work.

Please tell me something good way.

int main ()
{
PWM pwm;

if (check_apm ()) {
    return 1;
}

if (! pwm.init (PWM_OUTPUT)) {
    fprintf (stderr, ".? Output Enable not set Are you root \ n");
    return 0;
}

pwm.enable (PWM_OUTPUT);
pwm.set_period (PWM_OUTPUT, 50);

while (true) {
    pwm.set_duty_cycle (PWM_OUTPUT, SERVO_MAX);
    sleep (10);
    pwm.set_duty_cycle (PWM_OUTPUT, SERVO_MIN);
}

return 0;

}

First of all you are doing a while true loop that will constantly go from max to min immediately to max, which will not help you in calibration.

Also you delay is really short in the order of 10ms…

Dale

As of now underlying kernel driver for Navio 2 that generates PWM needs to be fed with data at least every 100ms. It’s not documented. Sorry. It is a safety feature that is to be handled differently but you should be aware of it if you’re tinkering around at the moment. It won’t be a problem to adapt the program to this feature.

Dale is also correct about the program flow. It does indeed needs fixing! Sorry for the late answer. I haven’t been noticing this thread up until now.

Thank you both of them

Turn on the power, it is initialized to the minimum value from the maximum value.
However, the motor does not work

Detail

Please tell me if you have any cause if.