ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Change output from 490hz to 50hz in Automatic ESC calibration

Open levinemax opened this issue 13 years ago • 6 comments

Automatic ESC calibration output rate needs to be change from 490hz to 50hz. In some ESC calibrating at 490hz result in recording wrong low end point.

levinemax avatar Jan 22 '13 14:01 levinemax

+1 To calibrate my Simonk ESCs, I need to lower Throttle very fast.

SirAlex avatar Jan 23 '13 20:01 SirAlex

Just add in radio.pde

  // Set 50Hz PWM rate
  motors.set_update_rate(50);

before output_min() at this block

    }else{
        // did we abort the calibration?
        if(g.esc_calibrate == 1)
            g.esc_calibrate.set_and_save(0);

        // Set 50Hz PWM rate
        motors.set_update_rate(50);

        // send miinimum throttle out to ESC
        output_min();
    }

Code checked on 2.9, works fine with my Simonk ESC

SirAlex avatar Jan 24 '13 08:01 SirAlex

 Thanks for the report and code snippit.

SirAlex, Are you sure we should slow it down at that point? It seems to me that you'll end up with a 50hz motor rate when you haven't done the ESC calibration. I think we should instead put it into the init_esc() function in setup.pde. I've made this change in trunk...maybe someone could give it a try?

rmackay9 avatar Jan 25 '13 02:01 rmackay9

Sorry, Actually I'm added code there:

        }else{
            cliSerial->printf_P(PSTR("ESC Calibration active: passing throttle through to ESCs.\n"));
            // clear esc flag
            g.esc_calibrate.set_and_save(0);

            // Set 50Hz PWM
            motors.set_update_rate(50);

            // block until we restart
            init_esc();
        }

Yes, your code changes must work, but I'm not tested it.

SirAlex avatar Jan 25 '13 08:01 SirAlex

Ah, excellent. should be equivalent to what i've checked into master so we should be good for 2.9.1. txs again.

rmackay9 avatar Jan 25 '13 08:01 rmackay9

Confirming closed, works as intented.

zmoothrc avatar Jan 26 '13 17:01 zmoothrc