1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 09:45:37 +03:00

Display ESC telemetry as real RPM in the OSD

The telemetry data provides eRPM/100.  Added a `motor_poles` parameter (defaulting to 14) that is used to calculate the physical RPM.

RPM = (telemetry_rpm * 100) / (motor_poles / 2)

Most motors we commonly use are 14 poles, but the user can adjust if needed for their setup.

Also calculate actual RPM for DEBUG_ESC_SENSOR_RPM, but to fit with in int16 the log value will be RPM/10.
This commit is contained in:
Bruce Luckcuck 2018-04-24 14:38:36 -04:00
parent 49f2308fd6
commit 063f3829d4
5 changed files with 6 additions and 2 deletions

View file

@ -264,7 +264,7 @@ static uint8_t decodeEscFrame(void)
frameStatus = ESC_SENSOR_FRAME_COMPLETE;
DEBUG_SET(DEBUG_ESC_SENSOR_RPM, escSensorMotor, escSensorData[escSensorMotor].rpm);
DEBUG_SET(DEBUG_ESC_SENSOR_RPM, escSensorMotor, (escSensorData[escSensorMotor].rpm * 10) / (motorConfig()->motorPolesCount / 2)); // output actual rpm/10 to fit in 16bit signed.
DEBUG_SET(DEBUG_ESC_SENSOR_TMP, escSensorMotor, escSensorData[escSensorMotor].temperature);
} else {
frameStatus = ESC_SENSOR_FRAME_FAILED;