Stuck tuning and I want to learn more about flash logs

I am having trouble performing an auto-tune and have a couple theories that I am hoping yall can help with.

Also, I have been reading and working with the wiki doc and been trying to knock out everything in order, but find myself jumping around. Is that bad, should I be going in the order it is laid out in or is it okay to jump around?

In any case I have passed the acceleramator and compass calibration, but when I try auto-tune in the roll axis, i get a “auto-tune fail, cant level” error in mission planner. I have auto-trimmed and have enabled one harmonic notch filter, plus manually tuned the PID rate, mostly in the roll axis, via channel 6, so the craft is flying pretty decent i.e. no oscillations and hovering decent in stab mode.

This is why I am confused as to why the auto-tune is failing. My theory is that the compass/gps module could be better. I am using a M7, but I see that there are much better ones available e.g. Holybro M9N, so I am thinking on upgrading.

My immediate goal is to perform successsful precision lands i.e. travel some distance autonomously, detect an ArUco marker, and land on it within some minimal range.

My frame is a F450 with readyToSky 2212-920 kv motors, 1045 props, and a 3s 3000 mah lipo, which only allows approx 10 min flight. Any suggestions on battery or harware to get more flight time is greatly needed and welcomed.

I have all of that connected to a pixhawk 2.4.8 flight controller and a RPi 4 combo. I also have a RPi camv2 and Leddar One range finder on the under carriage of the craft.

Here, is a doc with several flight logs from last month (May 2023). I am a begginer, so I still get tripped up looking at the logs, but I definetly want to learn. If someone could please help me read the logs so I can get a good tune on this craft I would be very grateful!

The link has an access requirement. Remove that for assistance. Also, if there is more than one log identify which one is relevant or post only one log. Nobody will go thru multiple logs searching for a posted problem.

Sorry about that! I just opened it up… I would say that the most recent flights (logs with the date/title: 2023-05-29, at the bottom of the doc) would be the best to look at because thats when I experienced strange behavior. I am pretty sure that looking at the log at the very bottom will give some useful info.

When the auto tune feature wouldnt run, I decided to start testing scripts that invoke the dronekit api. The take0ff_and_land function worked, but then when I tried to give it movement commands, the drone yawed instead of pitching to move left. I will look at my code to make sure I understand the command better i.e. global and local frames, but I am still wondering why auto tune is not working. I think vibrations are minimal, so I am confused why it says that it is not level.

Not. That log has Auto Tune running, not useful. And you don’t want aggression at 0.07, set it back to default.
Make a Hover flight in AltHold for a minute or so. Post a link to that log and only that log. In the mean time the tinkering you did with the Rate PID’s is not going to work. Set the P&I values equal (back to default). Set these so the Notch filter settings can be checked:
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4
And set this:
INS_ACCEL_FILTER,10

Okay, this one should be better: here

I hope I didnt forget anything…

@dkemxr, I think I did forget one thing. I did not set the PI back to default before this hover (I did set the other four though). Idk if that makes a difference. I will repost another 1min althld hover with all five params. Thanks for the help @dkemxr!

I think we see reduced autotune aggression based on some of Andy’s videos where he settles on 0.08 for desired outcome. The nuance missed is that he tunes the hell out of the filters, allowing for a much more aggressive tune, which he then tames slightly with the autotune aggression parameter.

2 Likes

Very interesting @Yuri_Rage… you guys think it might be best I start from the top? Reset everything to default and start over? Or do you think I can pick up and focus on only filters? I know I have to reset the params @dkemxr said to, but do you think a complete factory reset is in order?

You can work with what you have. Set the Rate Pitch/Roll P term back to default (.135) and change these:
PSC_ACCZ_I,0.64
PSC_ACCZ_P,0.32
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_REF,0.31

Then make another hover flight. There is motor output oscillation now but it could be from the Rate P term.

1 Like

Yes, I think that can work well for smaller quads where the Filters, and ATC_ACCEL_P/R_MAX, have been jacked way above what the Initial Tune Parameters suggest. On larger craft all I mostly see is a poor Auto Tune if the aggression is too low.

1 Like

Interesting… I am assuming that for motor output you are expanding the RCOU dropdown and plotting C1,…,C4? If so, does the non-overlapping curves mean that there is oscillation? Intuitively, I imagine that all four motor curves should overlap in a hover, I don’t know if my logic is correct though. Please correct me if I am wrong.

I have also completed another hover, this time with PI rates back at default and the four other params you mentioned set accordingly. Here is the bin.

@dkemxr, thanks again for help… it is greatly appreciated!

Right. This actually doesn’t look terrible. There is some mechanical Yaw bias you really can’t do anything about with that frame. If comes from arm twist probably.

To answer your other question you can’t add any additional weight with a bigger battery. The average PWM output here is already ~1600µs on the high side.

1 Like

This is really cool! I love how much info is at our disposal… we can get a very good idea of what the heck is going on a deep level. I hate that “in the dark” feeling only when there is nothing I can do about it.

Can I ask whats the sign of a yaw bias? Is the giveaway the unequal output between motors of the same spin direction (1 and 2) and those with an opposite spin direction (3 and 4)?

Exactly right. It’s usually seen on frames with round arms and either the motor mounts or arms are twisted. But on those F450 plastic frames some distortion isn’t surprising. It could be really cheap props too. Replace them with some decent ones, they don’t have to be expensive CF.

1 Like

Thank you for taking the time and also sharing the wisdom @dkemxr!

I am wondering why the max values on the motor outputs are so different… 3&4 are above 1800 but 1&2 are at approx. 1600. That cant be normal, can it?

You also mentioned oscillations from the motor output way earlier… are those still there, even after the second hover when I set the PI back to default?

It’s not normal. I would replace the props. Did you at least balance them?

The oscillation seen now (reduced) is just from a lack of tuning.

No, I didnt balance them, but Ive been researching it. I guess I need to grab a prop balancer? What do you think of these, do you use either of these:

most expensive

Medium price

cheapest

Does prop balancing have to be a very precise thing? Will I only hurt myself by going with the cheap version?

I have had the cheap one for years, it works fine. Balancing is mandatory unless they are small multiblade. 10” props you have to do it. Sanding lightly works well.

1 Like

Ahhh icic. Im going to do that asap!

I also have found something a bit strange. One of the motors seems stiffer than the rest. The two motors with a higher max output, 3 & 4, turn smoothly when I turn with my hand, but motor 1 seems more stiff. I hope I am not imagining things lol.

I have a couple spare motors, so I was thinking on swapping it out and reposting a hover log. If I swap it out, do I have to recalibrate the esc or take any other steps, or are they pretty much ready to go?

…………………………,

No.

1 Like

Hey @dkemxr, question. You said earlier that on the plastic F450 frames some distortion isn’t surprising, does that apply to the official DJI ones too?

I have several types of props coming, of different brands, to test which set will give the best results i.e. reduce the current yaw imbalance, but I was also wondering if I should grab some new arms as well. Ive read that the official DJI arms are more rigid than the clone F450s, which is what I have, so I was thinking on grabbing the official ones from eBay. The ardupilot doc also says to stay away from those clones and get the official components.

Do you think it is worth exploring upgraded components with this F450 frame (with the official DJI arms), or do you think this style of frame is fundamentally flawed? I have been looking into better 2212 motors for this frame, but if it is fundamentally flawed, then I think it would be best to go another route, with respect to frame.