How to read logs

Hello again,

I was hoping that a few of you could give me some tips on the order of operations when reviewing a log for a general health assessment of a drone that flies but it might not fly the best. Could you give me a general guide of the things you check first and interpreting what you find. My general flow starts with ATT->DesRoll and Roll and checking to see if the drone is tracking decently and sometimes I pull up CTUN->Alt in conjunction so I can see the the altitude (I also check pitch in the same way). I don’t really know what other tabs might be useful for the tuning process.

Attached is an example log file from a recent flight (The first flight was an autotune, the second flight is the new tune given from the autotune).
My interpretation by looking at the pitch and roll is that the drone needs more ATC_RAT_RLL_D and ATC_RAT_PIT_D because there is a bunch of steady state oscillations and there seems to be a bit of an overshoot when an angle is commanded. I also looked in PSCN and PSCE and it looks like the position control isn’t great and I would add more PSC_VELXY_D and PSC_VELXY_I because it looks like the VN overshoots TVN (adding D) and doesn’t track steady state very well (Add I).

Are my interpretations at all accurate and what other things would be on you list of things to check in this particular case and in general. I took one controls class in college where we were controlling the position of a ping pong ball in a tube using a fan at the bottom. All the PID controls in that case were mostly intuitive and easy to get right, but with tuning drones, especially in arducopter where there are over a thousand parameters that each build on top of each other, it gets a bit complicated and I don’t really know where to start most of the time.

PS: I have read the arducopter documentation on tuning, and it is helpful, just not enough.

Thank you!

Log file:
https://drive.google.com/file/d/1YecyumCxVOCf8NMqUHY4nARFHQ4-WKvh/view?usp=sharing

You’re on the right track. I always start with ATT.DesPitch/Roll vs ATT.Pitch/Roll. That will give you a good idea of what’s going on. If there’s trouble then you can go further.

Yes, there’s certainly still some pitch and roll oscillations going on. Before getting too carried away I would suggest the following:
1- Update to the latest stable firmware. There’s been some specific changes regarding the cube that may help your tuning.
2- Do another test flight in alt-hold with INS_LOG_BAT_OPT,4 and INS_LOG_BAT_MASK,1. This will give you the data to look at FFT logs so the notch filter can be setup.
3- Re-run autotune on all 3 axis. Set AUTOTUNE_AGGR,0.1. Then we can look at the logs again and decide what needs to be further improved.

Other things I look at in the logs include:
-vibrations (as low as possible, but hopefully below 10 or 15)
-motor outputs (the should all be reasonably even, not oscillating too much, not at max or min values)
-Rates (also looking for signs of oscillations. May be a sign that the PID values need to be decreased)

Of course there’s lots more but then it depends on what you’re looking for.

1 Like

Thank you for the quick response! Unfortunately I have 3rd party hardware that only plays nice with 4.15, so I’m stuck there. I will enable the recommended parameters for the FFT.

Is there any advice on reading the ATT.DesPitch/Roll vs ATT.Pitch/Roll? If so do you have any example screenshots and reasoning why a parameter needs to be changed?

Thank you!

With that earlier version firmware, you cant set INS_LOG_BAT_OPT,4
Use INS_LOG_BAT_OPT,0 for gathering pre-filter data, then
INS_LOG_BAT_OPT,2 for gathering post-filter data after the HNOTCH has been set up.

At this point, the best advice I have is to follow along many of the posts on the site here for tuning advice. Look for replies from Shawn and Dave giving tuning advice. What I did (and still do) is look at the log in question in a thread and try to understand why they suggested what they did and the outcomes are. That will give you plenty more examples and situations than I could drum up in one post.

Here’s a good recent example: I "think" my tune is close

1 Like

In your case perhaps this isn’t the best indicator of how bad the tune is. Rate Des/actual shows a phase shift that could be a big problem. Perhaps take the advice given in the other thread and review your Gyro filter setting. Then work on the Notch filter, then set aggression back to default and then run Auto Tune again.

I was just using that as an example, I am more looking for a general order of operations to look through a log and what you guys are looking at when you suggest parameters to adjust.

I think everyone with experience at this may follow a bit different path. From initial build I do this:
Vibration levels need to be low. Under 30 as stated in the Wiki is way too high a bar IMO
Set the Initial Tuning Parameters and set INS_ACCEL_FILTER to 10Hz
Configure to collect data for the notch filter.
Set MOT_SPIN parameters from Motor Test.
Make a short hover flight in AltHold.
Review log for Motor output oscillation and if present reduce the Rate PID’s until it’s gone or reduced.
Set the PSC_ACCZ P&I values from MOT_THST_HOVER
Configure the Notch filter.
Run Auto Tune. Or not, I typically manual tune.
Review Desired/actual Pitch and Roll. They should track w/o significant under/overshoot.
Review Rate Pitch/Roll out. Should be less than 0.1 peak.
Review Desired/actual Rate Pitch and Roll. If these track the Tune is good. This can be a challenge.

1 Like

Agreed.

I would add that when looking at the motor outputs look for any signs of torque offsets or splits. Ie: CW motors spinning notably faster (or slower) than the CCW motors.

Autotune works great, until it doesn’t. Any tips here for quashing a rate oscillation when the Desired/Actual Pitch&Roll are tracking well?

1 Like

A good guide for this is Andy’s 7" LR “getting the perfect tune” section (Video 24). It’s time consuming and he’s using successive Auto Tunes to tweak the values while running thru a range of filter settings.

1 Like