Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble understanding blackbox log
#1
Hi,

I'm new to tuning and I'm having trouble understanding what I'm seeing in my blackbox log. I'm not totally unfamiliar with control theory (from college) though which is why the part of the from the image below seems strange to me:

[Image: 2jo4o7A.png]

Can someone explain to me why the P-Part would dip into the wrong direction here? From my understanding, it should be directly proportional to the PID_Error above and always have the oppsite sign as PID_P(t) = -K_p * e(t). Is there anything special going on in the cleanflight controllers, such as filters or something?

I have attached the full blackbox log and variable dump below.

Besides any info on the above I'm of course also glad for any tips regarding the tune of the copter.

Thanks,
w0_op


Attached Files Thumbnail(s)
   

.txt   dump.txt (Size: 10.46 KB / Downloads: 254)
.zip   CLFL_BLACKBOX_LOG_20171227_135835.bin.zip (Size: 548.34 KB / Downloads: 146)
Reply
Login to remove this ad | Register Here
#2
At the point where the P-term starts to become positive, the Error has reached zero and is starting to switch from positive to negative. At the time, you are commanding pitch back at 24 degrees/second. The PID controller achieves the commanded pitch rotation but begins to overshoot, therefore the error is now negative instead of positive and the P-term moves to counter the overshoot.

All this happens in 0.1 seconds.

It's impossible to say anything about your tune as you don't actually do any flying in the log.
Reply
#3
Thanks, but I'm not sure I understand. At the point marked in the screenshot both P-component and error are negative. From my understanding this should never happen. If there was overshoot, the error would oscilate the same way as the P value (just with inverse sign). There also shouldn't be any phase delay because the P-term is time-invariant in a PID controller.

There is flying in the log, although it's admittedly not very much/real-world as I currently don't have the space to do that.
Reply
#4
You're running an F1 based flight controller at 1KHz loop time and 1KHz gyro sampling. At the same time, you are also running two gyro notch filters, the PT1 gyro filter and both Biquad and notch filter on the D-term.

That adds up to some considerable delay. When you look at how short a time the error and pid sum are both the same sign, it's a very short time. The pid sum gets the same sign as the error at sample 28093. This ends at sample 28121. So, the same sign condition exists for 28 thousandths of a second.

You're also flying in self levelling mode, so there are corrections being applied based on the accelerometer data (which is also filtered) that you can't see in the black box log.

So, what you're seeing is the effect of running some very demanding filter algorithms on a flight controller that is horribly underpowered for the job and where some of the inputs are hidden by the fact that you are using a self levelling flight mode.
[-] The following 2 users Like unseen's post:
  • w0_op, Tom BD Bad
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Help Help needed - blackbox file samples to finetune Flight time prediction model whiterabbit 1 211 25-Jul-2023, 12:20 AM
Last Post: whiterabbit
  8 hours in having trouble making sharp turns nicolomaserati 5 614 19-Jan-2021, 07:42 PM
Last Post: nicolomaserati
  Help Eachine Novice III trouble RTe 1 758 19-Oct-2020, 07:02 PM
Last Post: whitecube
  Trouble Tuning 2.5" 1106 DYS F4 - D term noise? x91qLt7 10 1,555 25-Jun-2018, 04:23 AM
Last Post: x91qLt7
  i-term stair step blackbox line?? nitro20% 6 1,439 18-Jan-2018, 01:51 PM
Last Post: Oscar


Login to remove this ad | Register Here