Flip makes my quad lose yaw orientation
« on: December 28, 2016, 11:33:17 pm »
Hi,

Almost everytime I flip my quad, it loses yaw orientation and I need to correct it. It's not a problem if I am flying low, if I fly high this loss of orientation becomes dangerous and it harder to correct manually.

I have my YAW set at LibrePilot as "AxisLock", maybe chancing it to RATE would make it better?

This problem also happens when I fly very high and make a very fast descent and try to stop the vertical and horizontal movement (see attached image). Right in the BLUE dot, my quad YAW is not pointing where it should initially, it sometimes moves 30 degrees to anyside or even more.

Is there a way to fix this?

Re: Flip makes my quad lose yaw orientation
« Reply #1 on: December 29, 2016, 05:41:54 pm »
I think this is caused by a fairly large imbalance in either weight (CG) or ESC/motor/prop thrust (ESC calibration / motor KV mismatch / prop mismatch), possibly combined with ESC top end deadband.

I measured KV on some cheap supposedly identical motors and got as much as 15% difference from one motor to another.  Different brands of cheap plastic props look absolutely identical and are marked as having the same pitch, but actually have visibly different pitch.

Use AxisLock and adjust the locking range.  AxisLock will "return" to correct angle if disturbed, but only if the disturbance is within some range of degrees.  Try increasing Configuration -> Stabilization -> Expert -> MaxAxisLock for a quick fix.

At very least, calibrate your ESCs and set motor neutrals and reduce the output pulse max to remove top end deadband (#26).  Of course, you can manually check the top end deadband, or research it for your ESC firmware, but manually checking it requires measuring RPM at full power with prop on (one motor at a time).
https://librepilot.atlassian.net/wiki/display/LPDOC/ESC+Calibration

Install same KV motors.  Install same brand props.  If you don't want to do this, you could play with the motor outputs or mixing table to tell it not to use full power on the strongest motor(s).
« Last Edit: December 29, 2016, 06:07:10 pm by TheOtherCliff »

Re: Flip makes my quad lose yaw orientation
« Reply #2 on: December 29, 2016, 09:57:08 pm »
@TheOtherCliff thank you again man, you are awesome and very helpful. I have no words to thank you for your attention!

I agree with everything you said and I think that the difference in ESC/MOTOR build can cause this problem. But I disagree in one point: if that was the case, so PITCH/ROLL should not be stable and that's not correcto cause PITCH/ROLL are perfectly stable.

I am using AXISLOCK and I have no idea why AXISLOCK does not make my drone keep the same Z (yaw) orientation. The gyroscope can easily check the error in Z axis and correct it in order to keep my drone always pointing the same direction. I know Z axis suffers with drifting (which does not happen with X and Y cause it has the gravity as absolute reference) but the problem that I am having (and many people surely are also having) is a big loss of Z (yaw) orientation when doing a  very fast flip or a fast horizontal descent.

Is there any "hack" or change in LibrePilot code to keep the Z axis as fixed as possible?

Re: Flip makes my quad lose yaw orientation
« Reply #3 on: December 29, 2016, 11:16:34 pm »
The reason that these issues show up most in relation to yaw is that yaw requires a LOT of motor differential for very little control motion.

AxisLock "gives up" if the error is too large.  Adjust (increase) the point where it decides to give up is the quick fix.

AXISLOCK not working as it should
« Reply #4 on: December 29, 2016, 11:25:53 pm »
Hi,

In the X and Y axis my drone gets very well stabilized and never drifts. Of couse, X and Y have an absolute reference which is gravity, so just a gyro and accel should be enough to get a very precise positioning.

With the Z axis (yaw) things get a little less precise cause you cant rely on gravity to get an absolute reference. So, I just said this to make sure you understand that I understand that I expect yaw to have some drifting along the time.

Ok, with that in mind I make my question: I am using ATTITUDE mode with AXISLOCK at YAW, sometimes when I make a fast maneuver like a fast horizontal and vertical descent with a very strong stop at the end OR when I make very fast 2 flips in a row, my drone loses the YAW positioning, I mean, after the maneuver my drone does not point anymore to where it was pointing initially.

I am very sure there is no problem with my quad nor with CC3D cause this problem happens with my other quad too. So I ask you: why librepilot firmware cant make a quad hold a good yaw position after a strong maneuver? With pitch and roll my quad always gets very very very well stabilized even after rapid movements, but yaw loses it's orientation for about 20 or 30 degrees to one side or another.

Re: Flip makes my quad lose yaw orientation
« Reply #5 on: December 29, 2016, 11:39:35 pm »
Read previous posts for reasons.  :)

If you set rates very high, this can happen because you have asked too much.  It may not be possible for your quad rotation rate to accelerate from 0 to 600 degrees per second (or -300 to +300) as fast as you are asking.  Yaw needs the most differential RPM for effect.  Motor ESC high end deadband can also cause it.

This problem doesn't happen with a quad that is configured and flown according to what it is capable of doing.

Re: Flip makes my quad lose yaw orientation
« Reply #6 on: December 30, 2016, 02:15:33 am »
@TheOtherCliff great answer! I didnt know AXISLOCK would give up correcting YAW after a certain amount of error. Maybe if I could know where to change to fix this would be nice! I see librepilot has hundreds of hundreds of variables that I can set/change, probably there is already one for setting this error. Do you have any idea of what variable name it could be? Or if is it possible to search inside all the librepilot firmware code and try to find the line where librepilot compares the error and check to give up?

Re: Flip makes my quad lose yaw orientation
« Reply #7 on: December 30, 2016, 02:22:37 am »
@TheOtherCliff I was reading around and it looks like the limit where libreplot will try to corret is 5 degree. Any idea if I can change that anyware? I also read a lot about WeakLeveling, do you think this could help instead of AXIS LOCK?

Re: Flip makes my quad lose yaw orientation
« Reply #8 on: December 30, 2016, 07:40:50 pm »
WeakLeveling is for roll/pitch, not for yaw, but it would help in that it would not ask for such violent corrections.  It would not level out very quickly though and that would probably make you crash.

Please re-read my previous response where I told you where to find the AxisLock option to change.

Re: Flip makes my quad lose yaw orientation
« Reply #9 on: January 01, 2017, 01:13:31 pm »
Happy new year my friend! I read your reply at Reply #3 and I could not find the answer to my problem. In expert tab I could see where to change the default value of 30 in MAX AXIS LOCK ANGLE to 60 or even 90 but it does not change anything in the problem I am facing, I still keeping losing yaw in violent movements.

Re: Flip makes my quad lose yaw orientation
« Reply #10 on: January 01, 2017, 04:58:34 pm »
Those settings are only effective when using AxisLock mode on yaw.  Where you using AxisLock when you increased these numbers?

You should not adjust the transmitter trims after you do transmitter wizard.  If you adjusted yaw trim, then AxisLock acts just like rate.  Go to Configuration -> Input page with quad ready to fly but disarmed and verify that yaw is sitting at the neutral value.

Re: Flip makes my quad lose yaw orientation
« Reply #11 on: January 09, 2017, 07:59:47 pm »
@TheOtherCliff yes I was using AXISLOCK when I used those numbers. It still does not make sense cause changing 30 to 60 should really be innefective cause I am seeing really big angle changes in yaw after strong movements.

I took so long to reply cause I flashed Cleanflight in my CC3D and this YAW problem disappeard completely! So it's surelly not a mal function in my CC3D, it's surelly something weird with librepilot. I flashed librepilot again, did all the configurations as previously (using axislock) and the problem came back :( :( :( :(

Re: Flip makes my quad lose yaw orientation
« Reply #12 on: January 10, 2017, 04:37:45 am »
The quad is unbalanced either from weight distribution or from unequal max thrust.  It's also possible that your props are too big and you aren't getting more thrust when it goes from say 80% to 100% power.  What motors and props are you using?

The LP firmware and default settings assume balance and power are more equal.  Your punch out maneuvers ask for say 80% on one motor and 100% on another motor and expect that the 100% motor will lift it's arm more than the 80% motor, but that doesn't happen because of the imbalance.  One quick solution would be to change the thrust curve to limit the max thrust to allow more headroom for control, but a "balanced (weight and max thrust)" quad does not need this.  Vehicle page, Throttle Curve, bring top right dot down even with the dot next to it.  CF apparently has something like this built in, but it robs power to give stability.  LP will give you the best power and control that is possible, but it needs to be better "balanced".

Re: Flip makes my quad lose yaw orientation
« Reply #13 on: January 15, 2017, 09:00:19 pm »
The issue between my cc3d and blheli esc's went away after flashing with betaflight/cleanflight. It runs perfectly now. There IS an issue with librepilot and blheli opto esc's. I've tried 3 pairs with the exact same result in librepilot. It beeps correctly but the fc led stays solid for 5 seconds then goes to fast blinking for 5 more seconds then beeps again but this beep the esc's aren't beeping together. Very unstable and throttle continues to increase then decrease on its own after moving the stick to anything above off