AP_Logger: add limit flag to PID logs

This commit is contained in:
Peter Hall 2021-01-02 18:02:46 +00:00 committed by Andrew Tridgell
parent 69d3264e55
commit b2e1d88da8
3 changed files with 9 additions and 5 deletions

View File

@ -309,6 +309,7 @@ public:
float D;
float FF;
float Dmod;
bool limit;
};
void Write_PID(uint8_t msg_type, const PID_Info &info);

View File

@ -785,7 +785,8 @@ void AP_Logger::Write_PID(uint8_t msg_type, const PID_Info &info)
I : info.I,
D : info.D,
FF : info.FF,
Dmod : info.Dmod
Dmod : info.Dmod,
limit : info.limit
};
WriteBlock(&pkt, sizeof(pkt));
}

View File

@ -538,6 +538,7 @@ struct PACKED log_PID {
float D;
float FF;
float Dmod;
uint8_t limit;
};
struct PACKED log_Current {
@ -1069,10 +1070,10 @@ struct PACKED log_PSC {
#define ISBD_UNITS "s--ooo"
#define ISBD_MULTS "F--???"
#define PID_LABELS "TimeUS,Tar,Act,Err,P,I,D,FF,Dmod"
#define PID_FMT "Qffffffff"
#define PID_UNITS "s--------"
#define PID_MULTS "F--------"
#define PID_LABELS "TimeUS,Tar,Act,Err,P,I,D,FF,Dmod,Limit"
#define PID_FMT "QffffffffB"
#define PID_UNITS "s---------"
#define PID_MULTS "F---------"
// @LoggerMessage: ACC
// @Description: IMU accelerometer data
@ -1575,6 +1576,7 @@ struct PACKED log_PSC {
// @Field: D: derivative part of PID
// @Field: FF: controller feed-forward portion of response
// @Field: Dmod: scaler applied to D gain to reduce limit cycling
// @Field: Limit: 1 if I term is limited due to output saturation
// @LoggerMessage: PM
// @Description: autopilot system performance and general data dumping ground