Real-time Plotting of Rate Achieved vs. Desired Values

Hello all,

I feel like I must be missing the forest for the trees here, but is there an existing MAVLink message that contains the desired attitude rates? I’d like to be able to do real-time plots (via MAVLink Inspector in QGC) of the achieved vs. desired values, for tuning the inner loops - the GCS_PID_MASK parameter only handles the attitude loops, if I’m not mistaken?

Alternatively, how are people tuning the rate loops, other than using the autotuner? Fly, step inputs, shut down, pull/review logs, repeat?

Thanks!

Regards,
-Luke

Well… Now I feel a bit stupid. Rereading documentation and doing a bit of testing, the PID message is for the rate loops. I don’t know why I thought it was for attitude; got my wires crossed there.

Obviously, the logical follow-up question is can I do the exact same plot except for the attitude setpoints? (i.e. I tune the inner/rate loops, now I want to tune the outer/attitude loops?) Again, I see the achieved vs. desired attitude variables in the onboard logs - are those downlinked?

Regards,
-Luke

Hopefully this isn’t rude, but by way of a bump, I’ll try and clarify my question:
Is there a MAVLink message that is currently implemented in Arducopter that includes the equivalent data to the DataFlash log parameters ATT.DesRoll, ATT.DesPitch, ATT.DesYaw?

Edited, I keep asking dumb questions - obviously, the pitch/roll/yaw is downlinked, but still interested in the setpoint values (and any means to plot them in real time, using MP, QGCS, et al.)

Regards,
-Luke

Ah. After going line-by-line through the MAVLink Inspector list, I realized that the attitude setpoints are contained in NAV_CONTROLLER_OUTPUT.

This will definitely help next time I’m tuning - not being able to look at comparisons of setpoints vs. actuals without landing and pulling logs was a significant drawback, coming from Paparazzi.

Regards,
-Luke

Mission Planner offers exactly the functionality you desire via GCS_PID_MASK and the tuning function on the main tab.

But isn’t the GCS_PID_MASK only to tune the rate loops? Is there a bit/parameter to switch it over to attitude?

(Per the edit in the first message, I thought it was the other way around, and unfortunately, I can’t edit the thread title.)

Regards,
-Luke

In Mission Planner you select Tuning on the map area
image

Then you double-click on the resulting graph and there’s many things to select
including basic attitude and PIDs
image
image

Yes, I’m well aware, and in fact, the attitude setpoints are in that list, but not under PIDs, but instead under nav_pitch, nav_roll, nav_bearing.

Per the MAVLink documentation (and verified by test) the GCS_PID messages only display rate-loop-related values, and I was not able to find any references to being able to switch that.

Regards,
-Luke

Luke you are correct that feature is missing. Care to do a GitHub pull request?

Ps are you aware of our work in system identification? Copter: Simulink Model and init scripts for Copter-4.3 by fbredeme · Pull Request #22354 · ArduPilot/ardupilot · GitHub

Sure, I’ll write something up, though end of the day, the nav controller messages do provide the basic functionality I was looking for. I’ll definitely take a look at the system ID work.

Thanks!

Regards,
-Luke