I got interested in the SamplingADC Method for measuring small coils and made some tests...
So far it is amazing and finally I got the purpose of the additional capacitor during calibration
To facilitate the measurements with this method I modified my super simple SMD test pads adapter to fit the 20nF capacitor.
Now I'm curious to see how the m-firmware will behave since it doesn't support this methos.
Hey Marcus, thank you again for the development of the Servo test function on the m-firmware.
In this days I used it alot to match few servos and test some ESC for brushless motors I was working on.
To better fit my needs I modifyed the sweep mode of the Servo test in the extras.c file to go all the way from 0.5ms to 2.5ms during sweep (instead of 1ms to 2ms).
If someone is interested I copyed the code below.
Mauro
//Sweep mode Servo test MAX Limits
{
uint16_t Temp; /* temp. value */
/*
* hints:
* - the OCF0A interrupt flag is cleared automatically
* - interrupt processing is disabled while this ISR runs
*/
/* toggle values for PWM */
#define SERVO_LEFT_MAX (((CPU_FREQ / 10000) * 5) / 16) /* 1.0ms */
#define SERVO_RIGHT_MAX (((CPU_FREQ / 10000) * 25) / 16) /* 2.0ms */
//#define SERVO_LEFT_NORM (((CPU_FREQ / 10000) * 10) / 16) /* 1.0ms */ //Mauro
//#define SERVO_RIGHT_NORM (((CPU_FREQ / 10000) * 20) / 16) /* 2.0ms */ //Mauro
/*
* update PWM pulse length (Timer1)
*/
Temp = OCR1B; /* get current compare value */
if (SweepDir == 1) /* forward */
{
Temp += SweepStep; /* add step */
if (Temp >= SERVO_RIGHT_MAX) /* exceeded upper limit */ //Mauro
{
Temp = SERVO_RIGHT_MAX; /* limit */ //Mauro
SweepDir = 2; /* change direction */
}
}
else /* backward */
{
Temp -= SweepStep; /* substract step */
if (Temp <= SERVO_LEFT_MAX) /* exceeded lower limit */ //Mauro
{
Temp = SERVO_LEFT_MAX; /* limit */
SweepDir = 1; /* change direction */ //Mauro
}
}
OCR1B = Temp; /* set new compare value */
#undef SERVO_LEFT_MAX
#undef SERVO_RIGHT_MAX
//#undef SERVO_LEFT_NORM //Mauro
//#undef SERVO_RIGHT_NORM //Mauro
}