refine parameter (based on measurements)
This commit is contained in:
18
main.cpp
18
main.cpp
@ -464,15 +464,15 @@ void updateMotors()
|
|||||||
static int16_t offsetdcl{2000};
|
static int16_t offsetdcl{2000};
|
||||||
static int16_t offsetdcr{2000};
|
static int16_t offsetdcr{2000};
|
||||||
|
|
||||||
if (offsetcount < 2000) // calibrate ADC offsets
|
if (offsetcount < 20000) // calibrate ADC offsets
|
||||||
{
|
{
|
||||||
offsetcount++;
|
offsetcount++;
|
||||||
offsetrl1 = (adc_buffer.rl1 + offsetrl1) / 2;
|
offsetrl1 = (adc_buffer.rl1 + offsetrl1 * 9) / 10;
|
||||||
offsetrl2 = (adc_buffer.rl2 + offsetrl2) / 2;
|
offsetrl2 = (adc_buffer.rl2 + offsetrl2 * 9) / 10;
|
||||||
offsetrr1 = (adc_buffer.rr1 + offsetrr1) / 2;
|
offsetrr1 = (adc_buffer.rr1 + offsetrr1 * 9) / 10;
|
||||||
offsetrr2 = (adc_buffer.rr2 + offsetrr2) / 2;
|
offsetrr2 = (adc_buffer.rr2 + offsetrr2 * 9) / 10;
|
||||||
offsetdcl = (adc_buffer.dcl + offsetdcl) / 2;
|
offsetdcl = (adc_buffer.dcl + offsetdcl * 9) / 10;
|
||||||
offsetdcr = (adc_buffer.dcr + offsetdcr) / 2;
|
offsetdcr = (adc_buffer.dcr + offsetdcr * 9) / 10;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -498,8 +498,8 @@ void updateMotors()
|
|||||||
|
|
||||||
|
|
||||||
#ifdef SHUNT_4_MILLIOHM
|
#ifdef SHUNT_4_MILLIOHM
|
||||||
curL_DC *= 2.162;
|
curL_DC *= 2.276;
|
||||||
curR_DC *= 2.162;
|
curR_DC *= 2.276;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const bool chopL = std::abs(curL_DC) > (left.iDcMax.load() * AMPERE2BIT_CONV);
|
const bool chopL = std::abs(curL_DC) > (left.iDcMax.load() * AMPERE2BIT_CONV);
|
||||||
|
Reference in New Issue
Block a user