fix meanrpm calculation
This commit is contained in:
parent
f33fe75d89
commit
0c4d805054
|
@ -315,7 +315,7 @@ void loop() {
|
||||||
sendCMD();
|
sendCMD();
|
||||||
|
|
||||||
//Update speed and trip
|
//Update speed and trip
|
||||||
float _meanRPM=FeedbackFront.speedL_meas-FeedbackFront.speedR_meas+FeedbackRear.speedL_meas-FeedbackRear.speedR_meas;
|
float _meanRPM=(FeedbackFront.speedL_meas-FeedbackFront.speedR_meas+FeedbackRear.speedL_meas-FeedbackRear.speedR_meas)/4.0;
|
||||||
meanSpeedms=_meanRPM*wheelcircumference/60.0; // Units: 1/min * m / 60s
|
meanSpeedms=_meanRPM*wheelcircumference/60.0; // Units: 1/min * m / 60s
|
||||||
trip+=abs(meanSpeedms)* (SENDPERIOD/1000.0);
|
trip+=abs(meanSpeedms)* (SENDPERIOD/1000.0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue