AP_ESC_Telem: log raw RPM information

This commit is contained in:
Andy Piper 2021-08-17 17:56:35 +01:00 committed by Andrew Tridgell
parent 4ecdf90470
commit 9281982b8f
2 changed files with 6 additions and 1 deletions

View File

@ -377,6 +377,8 @@ void AP_ESC_Telem::update()
float rpm = 0.0f;
get_rpm(i, rpm);
float rawrpm = 0.0f;
get_raw_rpm(i, rawrpm);
// Write ESC status messages
// id starts from 0
@ -392,6 +394,7 @@ void AP_ESC_Telem::update()
time_us : AP_HAL::micros64(),
instance : i,
rpm : (int32_t) rpm * 100,
raw_rpm : (int32_t) rpm * 100,
voltage : _telem_data[i].voltage,
current : _telem_data[i].current,
esc_temp : _telem_data[i].temperature_cdeg,

View File

@ -10,6 +10,7 @@
// @Field: TimeUS: microseconds since system startup
// @Field: Instance: ESC instance number
// @Field: RPM: reported motor rotation rate
// @Field: RawRPM: reported motor rotation rate without slew adjustment
// @Field: Volt: Perceived input voltage for the ESC
// @Field: Curr: Perceived current through the ESC
// @Field: Temp: ESC temperature in centi-degrees C
@ -21,6 +22,7 @@ struct PACKED log_Esc {
uint64_t time_us;
uint8_t instance;
int32_t rpm;
int32_t raw_rpm;
float voltage;
float current;
int16_t esc_temp;
@ -31,4 +33,4 @@ struct PACKED log_Esc {
#define LOG_STRUCTURE_FROM_ESC_TELEM \
{ LOG_ESC_MSG, sizeof(log_Esc), \
"ESC", "QBeffcfcf", "TimeUS,Instance,RPM,Volt,Curr,Temp,CTot,MotTemp,Err", "s#qvAOaO%", "F-B--BCB-" , true },
"ESC", "QBeeffcfcf", "TimeUS,Instance,RPM,RawRPM,Volt,Curr,Temp,CTot,MotTemp,Err", "s#qqvAOaO%", "F-BB--BCB-" , true },