Page 1 of 1

How can I tune the Servo component refresh rate ?

Posted: Tue May 21, 2013 2:57 pm
by Mathy
Hello,

In the RC world, we have now ESC that can accept higher PPM refresh rate than simple servo motor ( 50Hz ).
High end ESC can accept 400Hz input.

How and where can I tune this refresh rate in the custom component ?
I looked into the custom code utility but I don't understand anything.

I think it is about this peace of code but I don't know how the %a, %b and %c value are defined ?
Subsidiary question, how do you call those things ? Arguments right ?

#define MX_SERVO_CCPR1H %a / 2
#define MX_SERVO_CCPR1L %b / 2
#define MX_SERVO_T1CON %c

Thank you for your help.

Re: How can I tune the Servo component refresh rate ?

Posted: Tue May 21, 2013 3:19 pm
by Benj
Hello,

Not 100% sure this will work but changing the defines to this may help.

Code: Select all

#define MX_SERVO_CCPR1H %a / 16
#define MX_SERVO_CCPR1L %b / 16
This basically takes the 50Hz and multiplies the interrupt rate by 8 to give you 400Hz.

Re: How can I tune the Servo component refresh rate ?

Posted: Tue May 21, 2013 7:57 pm
by dazz
HI Mathy
Can you be a bit more specific as to what you need to do as you're wanting to control an ESC, also what esc is it as most rc esc's use pwm input. is the Uc going to control the esc or do you want to control it with a pot ect

Regards
Dazz