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.
How can I tune the Servo component refresh rate ?
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: How can I tune the Servo component refresh rate ?
Hello,
Not 100% sure this will work but changing the defines to this may help.
This basically takes the 50Hz and multiplies the interrupt rate by 8 to give you 400Hz.
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 / 16Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: How can I tune the Servo component refresh rate ?
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
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
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php