PIDtoolbox icon indicating copy to clipboard operation
PIDtoolbox copied to clipboard

PIDToolbox cant read BF 4.04

Open jasc76 opened this issue 5 years ago • 26 comments

Hi

I tried to analyse a BF4.04 Log Name/Version: 4.0.4 Binär: betaflight_4.0.4_MAMBAF722.hex Datum: 01-07-2019 14:36

The csv is created and PTB reads it and the progress bar disappears but then PTB just hangs Tried a older Log on the same computer and works fine

Regards Jan

jasc76 avatar Jul 07 '19 05:07 jasc76

Can u upload the logfile so I can take a look?

bw1129 avatar Jul 07 '19 11:07 bw1129

here it is FC is mamba 722 mini frame: Diatone Exorcist sadly no Gyro scaled...forgot :-) PIDs / Filters all BF 4.0.4 stock Motors Flywoo 2207 btfl_002.zip

jasc76 avatar Jul 07 '19 11:07 jasc76

I have no issue opening on v0.23. What version are you using?

Screen Shot 2019-07-07 at 11 02 49 AM

bw1129 avatar Jul 07 '19 15:07 bw1129

yes 0.23

Did you try session 2 ?

grafik I hear the windows "bing" sound and progress bar shows 100% (see picture) but it never finishes

jasc76 avatar Jul 07 '19 15:07 jasc76

yes. Log 1 top, log 2 bottom.

Screen Shot 2019-07-07 at 12 37 19 PM

bw1129 avatar Jul 07 '19 16:07 bw1129

try grabbing the latest exe again from https://github.com/bw1129/PIDtoolbox/releases You dont have to download runtime again, just grab PIDtoolbox.exe and replace yours with this one.

bw1129 avatar Jul 07 '19 16:07 bw1129

Did that, doesnt help. After selecting the session PTB works (cpu+ram) when Progress bar is at 100% I get the windows notification sound, cpu+ram drops to 0 but nothing else happens

jasc76 avatar Jul 07 '19 18:07 jasc76

Other logs work, also session 1

jasc76 avatar Jul 07 '19 18:07 jasc76

it's working on 0.23 on both my Windows and Mac machines. Not sure what to say, but there's nothing I can do on my end if all is aok here, and I've not heard other reports of any issues. 0.30 will be released in the coming weeks so maybe give that a try, and hopefully that works for ya. that's about all I can say at this point.

bw1129 avatar Jul 07 '19 22:07 bw1129

Thanks for your effort! Then, I guess, my Computer has an issue...

jasc76 avatar Jul 08 '19 03:07 jasc76

the same problem for me. stucks at converting (progress bar instantly goes 1/3 and nothing) on both my mac and windows pcs

version 0.23

m013 avatar Jul 17 '19 09:07 m013

@m013 Can you upload the log file? I’ll take a look.

bw1129 avatar Jul 17 '19 10:07 bw1129

@bw1129 , sure.

main.zip

m013 avatar Jul 17 '19 11:07 m013

@m013, ah ha. I've had this happen to me before. for some reason blackbox records a whole bunch of dud log files woth no information, amongst the few real log files that are near the end. the problem arises when blackbox_decode.exe (part of BB tools) only extracts up to the first ~30 logs and will not convert numbers higher than this. Im not sure quite why, but I have to ask about this potential issue to the developers of blackbox_decode.exe, and/or why blackbox records these junk files. This might be a new issue for betaflight. I will look into it. I should mention, I had the same problem on earlier versions of BF. I have a hunch that onboard logging devices add an empty log file to the onboard flash every time the copter is plugged in, and unless a log recording is selected, it just leaves the empty log on there. blackbox_decode.exe might be just programmed to ignore anymore than ~30 logfiles, presuming that this would not be possible memorywise. anyway, let me look into it. image

bw1129 avatar Jul 17 '19 15:07 bw1129

I have been getting this crap data since forever on fcs with onboard memory chips. Bb explorer and plasmatree pid analyzer recognize it correctly tho

m013 avatar Jul 17 '19 16:07 m013

This is now happening to me on certain log files.

Bf 4.0.4. Pidtoolbox v0.31.

Blackbox explorer can open and read the log file fine but pidtoolbox just hangs with no progression. Other files are no issues.

2.zip

ghost avatar Aug 26 '19 02:08 ghost

@ijustwannafly check my comment above. open in BBE, look to see if more than 30 files in drop down. if so, tis is the issue. I am still working on it, but bb_decode sets limit on # of logs to extract in a file. BF create a new blank file each time FC is enabled. only solution for this issue right now is to ensure you logging flash drive is cleared before collecting new logs.

bw1129 avatar Aug 26 '19 11:08 bw1129

I just checked my old working files and the new non-working file.

In BBE they all open properly and do not show more than 30 log files. In fact, in BBE there is no other file options in the dropdown. It does not present more than 1 log file.

The old files and the new non-working file were created with the same board. So I have been able to generate logs fine from this particular board.

The only thing that has changed is that all the pids have been set to my starting values (15, 15, 15) with 0 I and D and all other features off (anti-grav, iterm relax etc.).

Since this change I have generated 4 logs that can't be read by pidtoolbox but bbe has no issues.

ghost avatar Aug 26 '19 14:08 ghost

ah, just noticed, there is no dterm variable in that log file. try plotting dterm in BBE. It doesn't exist! Issue with BF logging??? image

bw1129 avatar Aug 26 '19 14:08 bw1129

I will try that when I am off work and back to my equipment.

This is also strange though as I recall generating logs on a dysf4pro board with 0 d term (0 d min also).

Maybe the board I am having issues with (lumenier lux f4 20x20 v3) might be adding to the issue.

I also had a thought, since bbe can open the problem files properly, could I just use bbe to export a csv file for pidtoolbox to use?

ghost avatar Aug 26 '19 16:08 ghost

@ijustwannafly it sounds like the issue is that you have d set to 0. with d = 0, it apparently does not generate a variable named axisD, and without that variable, there is nothing to plot and PIDtoolbox expects it. Sure BBE opens, but there's also nothing to see in there either, so exporting a csv from BBE would not solve the problem, besides the fact that csv files generated there are different from those generated from bb_decode in many other ways, and the later versions of PTB have moved away from that mode of functioning. Why put D at 0 to begin with??? If you just wanna see how things look with little to no D, at least set D gain =1, and the problem should disappear.

bw1129 avatar Aug 26 '19 16:08 bw1129

I will try adding 1 d term to the setup.

I am trying to do a compare of tuning methods.

One where the pids are adjusted off of defaults and the other (which is what I have been doing for a long time now) is where I set p to 15 on all axis, I and D to 0, and then I fly acro LOS to induce P gain oscillation.

However, I want to see how much oscillation exists between logging and visual/audible oscillation.

From there I intend to see how each single setting affects others.

Basically I have been manually pid tuning for years and have been satisfied with the results but I want to see how close my manual tunes get to "perfect" in the eyes of an analyzed flight.

ghost avatar Aug 26 '19 16:08 ghost

@ijustwannafly okay. that's all good. It is funny that only the D variables are not generated when set to 0. This is a betaflight logging thing. At any rate, just dont go lower than 1 on any axis. Such a low value will have no measurable impact on your results. Anyway, I may close this issue because many posts here are with reference to different things, though people are thinking it's the same thing. Also, several of them have now been solved in the latest version of Ptb. In the next version, there will be more error messages that will appear instead of just hanging to make categorizing errors easier for me.

bw1129 avatar Aug 26 '19 16:08 bw1129

@ijustwannafly I just made a little workaround to deal with the issue of crashing if dterm = 0. It will now run if dterm = 0. This will be fixed in the next version.

bw1129 avatar Aug 27 '19 14:08 bw1129

@bw1129 Cool. For now I did as you suggested and just set dterm to 1 to generate logs.

ghost avatar Aug 27 '19 14:08 ghost

@ijustwannafly you can grab the latest. It has the fix. https://github.com/bw1129/PIDtoolbox/releases/tag/v0.32

bw1129 avatar Aug 27 '19 15:08 bw1129