Jim0000

  • *
  • 33
Unstable throttle response and roll/pitch oscillations.
« on: June 18, 2020, 09:22:29 am »
I have a home made quadcopter using a CC3D flight controller and 2212 motors and cheap 30 amp ESC from Banggood. I set it up using the LibrePilot set up wizard, following the instructions from Painless360 in his very good video.
The very first hover test I did in the dark one night after working on it, it appeared to be almost manageable. I was able to move slightly right, left, forward etc.
However, on subsequent flight, it appeared to gradually become more and more difficult to even hover safely.
During these test flights when I first set this craft up, I never managed to control the throttle response sufficiently stable enough to do any more than two or three very short hovers.
Eventually, it got to the stage that with my thumb off the throttle stick, it would increase in RPM and begin to accelerate skywards. When I moved the throttle down to save it, it would plummet and crash down hard.
I have since found the throttle curve option which is intended to ameliorate this in this site:  https://sites.google.com/site/hubmartin/electronics/cc3d-librepilot-for-dummies
I adjusted a throttle curve in LibrePilot similar to the one in the screenshot on the page above to make the lower end of the stick operation softer, or less sensitive.
I also programmed in a similar curve in the throttle channel of my Taranis X9D Plus transmitter.

This appears to have improved the throttle sensitivity but not solved the instability of the output to the four motors.

I am now able to arm the craft, then throttle up very slowly and cautiously until it lifts a few inches off the ground. It will hover for a second or two before beginning to oscillate in the roll vector and pitch vector. Then, if I leave the throttle untouched, it will begin to accelerate the motors, oscillate with increased frequency until it does a 180 degree flip to the inverted position before hitting the ground upside down.
The only way I can avoid the flip is to back off on the throttle a second or so after lift off, before the oscillations become too violent and drop the quad back to the grass.
I have read through the "Fix Instant Flip and Learn to Fly" thread.
I have gone through the LibrePilot set up Wizard multiple times.

Should I start fiddling with the txPID settings?
Or would it be relevant to put some expo in the roll and pitch vectors, as in the second screenshot attached?
(actually, that does not seem relevant, as the pitch and roll oscillations begin to occur with any movement of the right stick in mode 2).
Otherwise, I have run out of ideas.

Can someone please assist?

Jim.
If the rain stops tomorrow, I could go through this exercise and do a short video of this behavior.
« Last Edit: June 18, 2020, 11:44:17 am by Jim0000 »

Re: Unstable throttle response and roll/pitch oscillations.
« Reply #1 on: June 18, 2020, 12:00:35 pm »
I don't know about the accelerating skyward, that actually sounds like D term oscillation, but you shouldn't have that problem with default PIDs (I don't think...)

My first guess is that you are using PWM@50Hz for your ESC protocol.  Go to the Output page and set it to PWM@490Hz if so.

I would normally recommend that you change it to PwmSync, but you will probably need to recalibrate your ESCs to use Max=1900 instead of 2000 to use PwmSync.  If you follow these instructions, you will be able to use ether PWM or PwmSync.
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058743/ESC+Calibration

Jim0000

  • *
  • 33
Re: Unstable throttle response and roll/pitch oscillations.
« Reply #2 on: June 18, 2020, 12:20:45 pm »
Thanks for the assistance Cliff.
I changed the update rate to 490 hz in all four channels. Is this what you meant?
Before and after screenshots attached.

I will try this first before changing the second option.
I am charging the battery again in preparation for (another) ESC calibration. Even though I have done it multiple times.
« Last Edit: June 18, 2020, 12:39:35 pm by Jim0000 »

Jim0000

  • *
  • 33
Re: Unstable throttle response and roll/pitch oscillations.
« Reply #3 on: June 18, 2020, 01:44:04 pm »
I just went through the ESC calibration following the instructions on the link you provided above.
All went well until step #26.
The motors did not stop when I unchecked the "Test Outputs" box.

Re: Unstable throttle response and roll/pitch oscillations.
« Reply #4 on: June 18, 2020, 09:34:15 pm »
For ESCs:
Min=fixed setting = 1000 = Motor off (motor off because of ESC calibration)
Max=fixed setting = 1900 = Motor 100% (motor 100% because of ESC calibration)
Neutral=the setting you change = somewhere around 1080 = motors running slowly but reliably

I suspect that you adjusted Min when you should have adjusted Neutral.  :)

Jim0000

  • *
  • 33
Re: Unstable throttle response and roll/pitch oscillations.
« Reply #5 on: June 19, 2020, 02:23:04 am »
I got it flying quite stable now, thanks Cliff.
It appears that the 490hz refresh rate correction fixed it.
I now need to learn to fly it.

More later...............before I mark this thread as solved. Will test fly a few more time.........have to go out now.

Thanks.

Jim.

Jim0000

  • *
  • 33
Re: Unstable throttle response and roll/pitch oscillations.
« Reply #6 on: July 02, 2020, 11:11:09 am »
I have read some of the Wiki and found a few tips. One that I employed was to soft mount the flight controller.
I also fitted an undercarriage which got it off the ground 100mm to facilitate takeoffs better.

I am able to do limited hovering and moving around a bit. However, I still have a problem with regulating the height/throttle control. I have to right onto it and "chase" it staying in sync with the alternate tendency to shoot upwards or plop down on the ground.
I have added some expo curve in the Flight Controller throttle channel and also, in my Taranis X9D plus throttle channel.
Maybe it needs more?

Suggestions and criticisms welcome.

Jim.

Re: Unstable throttle response and roll/pitch oscillations.
« Reply #7 on: July 02, 2020, 10:44:49 pm »
I leave the throttle ratchet on the stick (some people remove the clicker mechanism) and the trick is to understand that the quad will be slowly climbing on one click and the very next lower click it will be slowly descending.  I don't use expo, but it can help.  You should try to quickly figure out about where it hovers and only move it up or down one click at a time from there and react quickly with small amounts to "get ahead of it"

At one time, I thought that the soft mounts were the way to go because it fixed a problem I had with one quad.  I started to install these on each new build until I ran into problems that they cause.  Each build is a little different, but there is a motor RPM where the soft mount resonates and it causes more problems.  I now always hard mount and carefully balance my props.

Carefully balance your props!!!  Really!

Even after balancing the props with a magnetic balancer I do this to fine tune the balance.  The following prop balancing is dangerous, but it works well for me.  Accept the risk if you want to try it.  Some quads are too powerful to hold in your hand at high power.  I would only hold in my hand with low RPM non-sharp plastic props, never with fibreglass or carbon props.  Transmitter not needed.

Take props off and connect a long USB cable and install a flight battery.  Go to Output page and enable Test Outputs.  Get used to playing with the sliders, the link check boxes, keyboard Home and End keys to run the individual motors at various speeds.  Home and End (and arrow keys) work with whatever slider you last clicked on.  Put props back on.  You can either hold quad in your hand as you carefully power up one motor (I recommend using the arrow keys), or you can tie it down to the floor or a bench.  In either case you can either use your hand to feel the vibrations or use the Scopes page to view accels (and gyros). Find the RPM where it vibrates the worst.  Mark a blade with a marker for reference.  I add a small piece of black electrical tape to the middle of a prop blade and see if it gets better or worse.  You can change the size of the piece or move it in or out to change balance.  This works well on my ~9000 RPM (1000KV at 3S=12V would be 12000 RPM unloaded, but the prop loads it down) setups, but tape will come off of high RPM setups and you will need to file down the heavy prop tip instead.

Re: Unstable throttle response and roll/pitch oscillations.
« Reply #8 on: July 02, 2020, 11:18:01 pm »
Improper PID tuning can cause "anything above zero throttle to climb on a multicopter that climbs at half power" and the only way to get it down is to use zero throttle (motors off) and let it fall.  If you are using an auto-leveling mode like Attitude, you can blip it before it hits to slow it down and thus stair step it back down almost all the way to the ground from high.

I believe this is usually caused by an interaction between LP's automatic throttle changes when executing large differences in motor thrust (quick flips) ... and PID D term yaw oscillation.

If your throttle stick is 100% and in addition you tell it to do a quick flip, it will reduce the throttle to as low as 50% to do the flip so it can command some motors to 0% and others to 100%.  Control and stabilization take precedence over throttle.  Likewise, if using only 1% power and you command a quick flip it will increase throttle to as much as 50%.  This is how a PID oscillation turns 1% power into 50% power.  If the quad climbs at 50% power, and it has this problem, it will climb at 1% power.

It is also true that if the quad is weak enough to not climb at 50% power, that if you have this issue, it will not climb at all, not even at full stick, since this issue basically constantly commands the throttle to 50%.

Edit: Jdl's post reminded me that sometimes the little shaft size adapter rings (that make the prop fit different sizes of threaded shaft/adapter) are a little loose on the shaft/adapter.  A round of electrical tape on the threaded shaft can help, but it is also good that once you tighten the prop that you leave it alone (don't loosen it) and balance it by running it.  Obviously if you loosen and retighten it, you may have to rebalance as well.  Yea, this fights with us telling you to remove props sometimes...  Sorry...
« Last Edit: July 04, 2020, 12:36:54 am by TheOtherCliff »

jdl

  • ***
  • 246
Re: Unstable throttle response and roll/pitch oscillations.
« Reply #9 on: July 03, 2020, 10:20:33 am »
I'd add one more trick for prop balancing:

There is usually one "sweet" position of prop relative to motor bell that producess less vibrations than all other possible orientations. I mark the bell (or better - use some distinctive graphic element from printed logos on the bell) for reference point and sequentially fix the prop relative to this reference point at 0, 90, 180, 270 degrees. I measure the vibrations at each of these positions. When I find the best one, I usually do two more measurements  with prop fixed at -45, +45 degress relative to this position to see if there is further improvement.

After finding the optimal prop / bell orientation I tighten the prop and do proceed with further "tape" balancing. Very good results for smaller props (6"-7") gives the 3M Blenderm tape, it is resistent to UV and virtually impossible to unstick from the prop even at higher RPMs.



I do also think your problem with hovering lays in improper PID setup. My guess is that LP default PIDs are too aggressive for some particular builds. This is not an LP issue, of course, there is no way to have defaults that fit ALL possible builds.

The default PIDs in LP (next) are: P=0.00300, I=0.0065, D=3.300e-05.

I'm currently tuning my latest build - 7" quad with 2507/1500kV motors (that used to fly smoothly and beautifully with 4S battery) to be used with 6S battery. The PIDs that were OK for 4S (P=0.00265, I=0.0135, D=3.799e-05 for pitch axis, for example) lead to almost unsteerable flight with pronounced invisible oscillations that cause the same throttle unresponsiveness. The quad is powefull, normally hovers @ 18% throttle, so the very first takeoff with 6S battery was a nasty surprise :)

After taming the PIDs, successful Autotune and further decreasing the calculated PIDs with the QuickSmooth slider, the resulted PID values are: P=0.00115, I=0.0054, D=2.0999e-05. Quad hovers and flies nice in LOS but still have to test in real FPV flight to look in HD video for unwanted vibrations.

You can see how much these PIDs differ from default ones. The default ones are just a starting poing, if you consider them not appropriate, decrease them, let's say to 0.75x (all values, for all axes) and try again. Repeat, if necessary, until the result is good enough. Once you have a relatively well flying (steerable) quad, you can process with further PIDs fine-tuning.
« Last Edit: July 03, 2020, 04:16:18 pm by jdl »

Jim0000

  • *
  • 33
Re: Unstable throttle response and roll/pitch oscillations.
« Reply #10 on: July 04, 2020, 02:47:06 am »
Excellent advice, thanks jdl and Cliff.
Especially the dynamic prop balancing and the PID settings.
I will take some time to digest all that and do the balancing, then report back.

Progress happens!

Jim.

Jim0000

  • *
  • 33
One ESC not responding to calibration.
« Reply #11 on: July 04, 2020, 03:55:47 am »
I had to replace one of my ESC after one of the flips (did not return throttle to zero quite quick enough!).
I wired it in and it was functioning for a couple of short test flies.
Now it will not respond to throttle. I tried calibrating with all the others and on it's own. Made no difference.
I removed the signal wire from the flight controller and plugged it into a servo tester. With the battery then plugged in, the motor operates as normal.

This ESC is not the same as the other three.

What should I do to correct this and get all four running please?

Jim.

Re: Unstable throttle response and roll/pitch oscillations.
« Reply #12 on: July 04, 2020, 09:47:46 am »
I would do calibration as described in wiki.  In particular I would make sure min=1000 and max=1900 and use either PWM@490 or PwmSync

https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058743/ESC+Calibration

Jim0000

  • *
  • 33
Re: Unstable throttle response and roll/pitch oscillations.
« Reply #13 on: July 04, 2020, 12:54:12 pm »
I have done that Cliff.
I will try again though............tomorrow.

Thanks,

Jim.