Discussion - Acro flight performance enhancements
I just tried betaflight, wow! Very impressive, so locked in compared to fp-pid. It felt like i became a twice as good pilot!
Could we get this performance in inav? Why having to compromise between nav and acro performance! :stuck_out_tongue_winking_eye: The default looptime on betaflight is 500 and even i could notice a difference when switching to 1000 like i have on inav. 500 made it feel a little bit more sharp. Would it be possible to get inav to run at 500 on F3 targets?
But the most important difference is that the attitude was so locked in! Perhaps i'm a terrible tuner but no matter what i do i can't get the attitude to be locked in on fp-pid, and to high I-gains starts to ruin the performance... Is there to much anti-windup or what is going on here? Attitude on betaflight was very locked in even on 1000 looptime. Fp-pid changes the attitude all the time without me telling it to, that makes acro flying very hard.
As usual i'm more than happy to make my custom builds and flight test them, just give me some ideas on what to try! What else could we borrow from betaflight to improve acro flight?
If you want to have much better performance for acro:
- set gyro_lpf=188HZ
- set gyro_soft_lpf_hz=100
- set dterm_lpf_hz=50
- set gyro_sync=ON
- set gyro_sync_denom=1
@DzikuVx Thanks! :smile: I will do a test flight tomorrow!
My biggest problem is the changing attitude though. For example when i go fast from side-to-side using only roll, pitch and yaw will change attitude, but this does not really happen in betaflight. It would be interesting to hear what you, or @digitalentity think the reason is for the unstable attitude and what can be done about it...?
It would also be helpful if i could convert the defaults of betaflight mwrewrite into fp-pid, does anyone know how that can be calculated?
For attitude.... More I? I have around 60 on roll and 90 on pitch.
42hz for gyro is noise proof but barely flyable. 98 is compromise. 188 is afair what betaflight uses. And what are your P?
gyro_lpf = 98HZ set p_roll = 35 set i_roll = 80 set d_roll = 80
My P was 50 when my quad was 150g heavier. AUW now is 500g, with 6 inch props and 4s battery. I did try I at 100 but i started getting bounce-back and it just didn't feel right.
I plan to try cleanflight tomorrow to see how that feels...
Lower looptimes tend to tolerate vibrations better. You might want to adjust your filtering settings on D and gyro.
Blackbox logs will help debug. Possibly too low P and too high D, hard to guess.
We can't have looptime faster than 1000 at the moment - requires changes to scheduler code and decoupling of gyro, accelerometer reads, PID controller and motor updates.
Will work in that direction after configuration refactoring PR is merged.
Can you post compete dump here?
This blackbox log should be decent, i was flying fast side-to-side using only roll, that's when i had the issues with the attitude wandering about. https://www.dropbox.com/s/4yog9m5wd8mht51/blackbox_log_2016-05-17_163714_pedestrian-limit-test?dl=0
Dump: https://www.dropbox.com/s/bk9fovvj8n7gd6t/2016-05-16_x3_theladder?dl=0
Is it possible to convert between fp-pids and the pids of mwrewrite or luxfloat? That way i can compare with the same pid-tuning.
I just tried cleanflight 12.0, and it also felt very good, the main difference is that the attitude doesn't drift. When doing quick roll manuvers, pitch and yaw stays the same. When doing yaw pirouttes, pitch/roll stays the same, this is not my experince with inav...
I need to try inav again now and see how big the difference really is, and do some more tuning, but something feels wrong here, cleanflight with default settings should not be better than inav for acro, right?
@theArchLadder Just some observations in your BB log. At the end of a roll command - roll (and pitch) stick are centered - we see the roll gyro and the rolling copter overshooting several times with reducing amplitude. Some gain is too high.
Before the roll you made the copter climb with throttle. Then throttle is reduced to get a roll with low hight loss. However, throttle gets so low, that two motors are more or less stopping during the roll. Looking at the 4 motor graphs, the rpm are not controlled symetrically. Two curves have a sharp Peak. The lower ones get cut in a plateau and cannot be reduced as far as the other two are incresed.
Although there is no rc command, pitch and yaw come alive due to the asymmetrical rpm changes of the 4 motors.

In a roll with high throttle setting, two motor rpm are maxed out. This results in an oscillation in the pitch and even in the yaw directions (yellow gyro curve is yaw, turquise gyro curve is pitch).

@Ralf-W Thanks! Do you have any idea what's wrong with my pids? To me it looks like i-gain might be to high but i'm not that good at pid tuning
My blackbox denom is way to high in that log, problem is though, if i have it at 1-2 my black box fills up super quick... I guess i can do som super short flights and look at the blackbox.
@theArchLadder I updated my comment. Please have a second look at it.
I am still no expert in tuning, but I would start reducing the I-gain, too. And even the D-gain can be set to Zero, just to make analysis easier.
@Ralf-W Oh wow, thank you very much for that detailed analysis!
I think i figured out how to change the pid scaling to match betaflight. I will try betaflight defaults and see what happens...
Hmm, tried some more betaflight and this time tuned only p so that it barely had any oscillations, default p=45 and i ended up with p=20, and it actually seemed to fly well so perhaps i have been using way to high pids... I guess it makes sense since my quad is lighter than the average fpv racer, and has 6 inch props.
Still not sure why both cleanflight and betaflight seems to hold attitude better than inav during agressive acro flying, when i use stock pids on all of them...
EDIT: Did some tuning with inav, feels different from betaflight while tuning, oscillations are slower and i find it harder to tune to fly well. Time to play with some lowpass filters i guess
EDIT2: Used these settings gyro_lpf = 188HZ gyro_soft_lpf_hz = 100 dterm_lpf_hz = 100 I did not notice any improvement. On betaflight i use 50 for both gyro_soft and dterm, i guess betaflight does not use the gyro hardware filter anymore...
EDIT3: same 1000 looptime was used on all tests. I wish inav still had luxfloat so i could compare...
Ugh, it's a nightmare debugging this. Both cleanflight and betaflight flies good on defaults, but inav is unstable just looking at the quad during a hover, and has problem keeping attitude etc... And i have not manage to tune it to behave good
It would really help to have the same pid scaling. Both luxfloat and mwrewrite has the same scaling in both betaflight and cleanflight, so it would be helpful if inav used the same scaling.
I tried to use this: https://github.com/cleanflight/cleanflight/blob/52612ebb3a9ae4668a021a51c75de1c726977e1a/src/main/flight/pid_luxfloat.c#L70 In inav, and ended up replacing these:
#define FP_PID_RATE_P_MULTIPLIER 31.219513f // inav 40.0f // betaflight - 40.0
#define FP_PID_RATE_I_MULTIPLIER 4.092004f // inav 10.0f // betaflight - 10.0
#define FP_PID_RATE_D_MULTIPLIER 1890.629883f // inav 4000.0f // betaflight - 1000.0
Those betaflight comments are already in inav, but i think those are from before betaflight changed luxfloat scaling to match mwrewrite. I tried these scalings with cleanflight default pids, but i got lots of oscillations that i did not have in cleanflight, so perhaps i did something wrong. I think i need @digitalentity to help me get this scaling right...
Oh, i also tried to completely disable anti-windup but that didn't improve things, nothing wrong with those it seems, good :+1:
@theArchLadder Try this: https://docs.google.com/spreadsheets/d/1mX0a6yytARsZiaU6sCGKvpwXSBYjTjTwVJZiJmktKqg/edit?usp=sharing
This is atleast what DigitalEntity told me to convert from old luxfloat to new FP PID
EDIT: Use values from CLI
@theArchLadder And remember use values from CLI.
@oleost Thanks... Are those luxfloat values the old defaults? In that case this seems obsolete, fp-pid p-gain of 200 is very high compared to default 30...
No, those are my PIDs that I had on my fixed wing. So yes, they are very high and unusable on MR
@theArchLadder So you got it to fly better?
Still looks like people are having more issues with iNav and default values than with cleanflight and betaflight.