Roll/pitch movement after punch out
« on: August 15, 2017, 02:36:34 am »
I recently enabled AlwaysStablizedWhenArmed so I can reduce throttle to 0 and have roll/pitch/yaw authority for acro flying.

My problem is that if I go full throttle to gain a bunch of altitude and then drop to 0 throttle, the quad pitches backward and rolls right.

I read somewhere that increasing the motor idle speed a bit eliminated the problem for someone. So I changed my motor idle speed from 1030 to 1045. The quad still has the same pitch/roll behaviour when throttle is reduced to 0 after a punch out.

Can anyone provide insight regarding what other configuration changes might play a factor in the quad maintaining its attitude when throttle is reduced to 0 after a full throttle altitude climb?

Re: Roll/pitch movement after punch out
« Reply #1 on: August 15, 2017, 02:50:35 am »
It sounds like I-term windup on a quad that has mismatched power on the arms.

One or more of your motors/ESCs/props is stronger than one or more of you motors/ESCs/props.

I assume that all your motors, ESCs, and props(L/R) are identical and that ESCs all have the same firmware (and settings), if not, make them the same (or read below).

I would start by calibrating all ESCs at the same time to make sure the top ends are set correctly as that would cause what you mention.
https://librepilot.atlassian.net/wiki/display/LPDOC/ESC+Calibration

You can (/ should be able to) reduce your stronger motors to the same strength as your weakest motor by reducing the Max for the stronger motors on the Output page.  You may have to reduce it a fairly large amount to get it to actually reduce because of deadband at the top end.  Refer to previous link about removing top end deadband too.  Trial and error or some sort of thrust measurement device...  I would guess that your back right motor is the strongest.  I bet you can tell by (CAREFULLY) running up one motor at a time with the Output page "Test Outputs" option.  You can't always go by RPM though (like if it is a prop difference).

Re: Roll/pitch movement after punch out
« Reply #2 on: August 15, 2017, 03:17:59 am »
It sounds like I-term windup on a quad that has mismatched power on the arms.

One or more of your motors/ESCs/props is stronger than one or more of you motors/ESCs/props.

I assume that all your motors, ESCs, and props(L/R) are identical and that ESCs all have the same firmware (and settings), if not, make them the same (or read below).

I would start by calibrating all ESCs at the same time to make sure the top ends are set correctly as that would cause what you mention.
https://librepilot.atlassian.net/wiki/display/LPDOC/ESC+Calibration

You can (/ should be able to) reduce your stronger motors to the same strength as your weakest motor by reducing the Max for the stronger motors on the Output page.  You may have to reduce it a fairly large amount to get it to actually reduce because of deadband at the top end.  Refer to previous link about removing top end deadband too.  Trial and error or some sort of thrust measurement device...  I would guess that your back right motor is the strongest.  I bet you can tell by (CAREFULLY) running up one motor at a time with the Output page "Test Outputs" option.  You can't always go by RPM though (like if it is a prop difference).

Thanks for the advice. While testing out my quad with ASWA enabled and experiencing the above mentioned issue I crashed and damaged one of my ESCs (Kingkong 260 FPV, super brittle frame, ESCs mounted on bottom of frame, very silly design). Once my new ESC is delivered I'll try calibrating all ESCs with the link you provided.

Since it's an RTF kit all of the motors, ESCs, and props are the same (Kingkong 2204 2300kV motors, Kingkong 12A ESCs, Kingkong 6040 props).

Just to be clear, the quad rolls right and pitches backwards just for a split second. It stabilizes, but not at the same attitude the quad had when I reduced throttle to 0. Would the fact that it just does it for a moment, not continually, still lead you to believe it is mismatched power, or could this be fixed by tuning the i-Term? (I have little experience tuning PIDs. I think the quad feels sloppy, so I used some PIDs someone posted for the same quad which they said flew very well)

Re: Roll/pitch movement after punch out
« Reply #3 on: August 15, 2017, 06:06:13 am »
"I" term is needed and you would have to reduce it to zero to get rid of this (don't do it).

try in order till it is fixed (but not over and over)
1 - Calibrate ESCs
2 - remove ESC upper deadband (same link)
3 - reduce power of stronger motors to match weaker motors

rad2014

  • *
  • 17
Re: Roll/pitch movement after punch out
« Reply #4 on: August 15, 2017, 12:52:01 pm »
Make sure it is not a hardware problem, as mentioned TheOtherCliff.
If you are sure, it is not a hardware issue try following. Raise "I" term for pitch and roll as high as possible. The pitch and roll instabilty during fast throtle changes is a common behaviour and raising "I" term should help. I use "I" term 200 for example.

In Betaflight there is a feature called "Antigravity" - it raises "I" term when the throttle control changes quickly.

Re: Roll/pitch movement after punch out
« Reply #5 on: August 15, 2017, 02:52:36 pm »
Make sure it is not a hardware problem, as mentioned TheOtherCliff.
If you are sure, it is not a hardware issue try following. Raise "I" term for pitch and roll as high as possible. The pitch and roll instabilty during fast throtle changes is a common behaviour and raising "I" term should help. I use "I" term 200 for example.

In Betaflight there is a feature called "Antigravity" - it raises "I" term when the throttle control changes quickly.

I'm not sure if it's a hardware problem or not. The quad flies well, other than the fact I haven't tuned PIDs. It feels equally responsive on all axes, which my guess would be that all ESCs/motors are functioning normally. It's just that it dips back and to the right slightly when I drop throttle completely before ASWA stabilizes it.

When you say raise "I" term to 200, where does the decimal fall? I'm a little confused as to why there are so many numbers after the decimal.

rad2014

  • *
  • 17
Re: Roll/pitch movement after punch out
« Reply #6 on: August 15, 2017, 08:07:39 pm »
According  to you desctription it really looks that your "I" term needs to be tuned.
Sorry for 200 confusion. 200 it is on the Basic Configuration View, in the Advanced it is 0.02000

As an example see my config below:




Re: Roll/pitch movement after punch out
« Reply #7 on: August 16, 2017, 02:23:26 am »
"I" term is needed and you would have to reduce it to zero to get rid of this (don't do it).

try in order till it is fixed (but not over and over)
1 - Calibrate ESCs
2 - remove ESC upper deadband (same link)
3 - reduce power of stronger motors to match weaker motors

Thanks! I'll recalibrate all ESCs once my new one is delivered.

Re: Roll/pitch movement after punch out
« Reply #8 on: August 16, 2017, 02:28:14 am »
According  to you desctription it really looks that your "I" term needs to be tuned.
Sorry for 200 confusion. 200 it is on the Basic Configuration View, in the Advanced it is 0.02000

This really helps, thanks!

Once my new ESC is on and calibrated I'll try raising I-term as you suggest.

I've been searching for a resource on tuning PIDs in LibrePilot but can find anything outside of AutoTune and EasyTune (I can't use either and must use manual tuning in GCS). Do you know of anything that shows how adjusting the PID values will affect flight characteristics and what amount should be changed at a time? It seems like there's tons of resolution and I'm not sure how much or how little to change at a time.

Re: Roll/pitch movement after punch out
« Reply #9 on: August 16, 2017, 03:53:48 am »
If they are really bad, multiply or divide by say 1.5

When you are really close and just want to tweak the last bit, multiply or divide by 1.1 or even 1.05

Mateusz

  • *
  • 808
Re: Roll/pitch movement after punch out
« Reply #10 on: August 16, 2017, 09:20:15 am »
Do you know of anything that shows how adjusting the PID values will affect flight characteristics and what amount should be changed at a time?

I think this is pretty video good tutorial if you want to tune each gain one by one, video shows when it's too little and too much and how to determine this in quad behaviour

LP has dual-loop PID controller. You should only tune your inner loop. Basically inner loop alone is used when flying rate only, whereas both inner and outer loops are used when flying attitude. Even if you test attitude, you should focus on inner loop PIDs which affects everything. So just assume that's the only thing you tune for both rate and attitude modes.

Hope that helps!

rad2014

  • *
  • 17
Re: Roll/pitch movement after punch out
« Reply #11 on: August 16, 2017, 12:17:34 pm »
The best tutorials provides Joshua Bardwell on his Youtube channel. It is focused on Betaflight, but the principles are the same for all flight controllers. He has a series called Practical PID Tuning https://www.youtube.com/playlist?list=PLwoDb7WF6c8ldO8tz0IUi9FNcJdvE2Mhe and PID Tuning Masterclass https://www.youtube.com/playlist?list=PLwoDb7WF6c8mTH6A4HyzPPdX5lsvEwBeA.