How I solved my Yaw issue.

The story.

I always had yaw not being stable, not even in hover. It was bouncing left and right even with no input.

Also different YAW_OPTIONS in APM_config.h yeld to bad results. It was either too strong, or too slow. It always had really big overshooting like if PID was tto high. I decreased P till I almost had no control, but the left-right problem was still there.

Something I've noticed is that in the Planner, MAg was not steady as it was in previous NG code. It looked like it was giving +/- 1 degree in an interval similar to what I was experiencing in flight. It is not much, that's why I've never gave too much importance, bu apparently this was enough to yaw my copter.

 

The solution. 

So finally looking into the code I have noticed the _kp_yaw(0.8) in the DCM constructor. 

Since this is used to correct drift of Gyro Z:

_omega_P += _error_yaw * _kp_yaw; // Adding yaw correction to proportional correction vector.

, I thought it could be a problem of a too high drift correction, resulting in a bouncing of the value due to the normal mag noise.

So I lowered to _kp_yaw to 0.35 ( I tried also 0.1 but in the planner I saw really slow compass movement when stabilizing after quick movement) lowered my P yaw to 0.3 and set my YAW_OPTION to 0 in APM_config.

 

Flying like that was like Night and Day difference! I still see a little (very little) yaw corrections, but now yaw is very nice! It is responsive, precise and stops when I let the sticks. Just like old days! :)

 

Beware, this was good for my setup, but could be a good start point for everybody having this kind of issue.

 

Now the question.

Since I understand this issue could affect non "standard" frames/motors (even though I think also standard frames could be affected) could it be possible to make this a runtime variable adjustable via mission planner?

 

My setup:

Arducopter frame (using only center frame parts), ALU arms with a motor to motor length of 50cm.

Motors: KDA 20-22L. Props EPP 10x4.5 (soft) 

 

Hope this could help somebody else.

Cheers,

Emile

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • At the moment this is what has worked for me but I had not much time to test so it is just a starting point :

     

    _kp_yaw to 0.35 (defined in libraries/ap_dcm/ap_dcm.h (beware you have to change it in you arduino/libraries also.)

    YAW PID:

    P 0.25

    I: 0.01

    D 0.09

     

    Roll pitch PIDs are the ones I had better result with without loosing too much authority:

    P 0.38

    I 0.025

    D 0.17

     

    I could rise D to 0.18 but it gets a little too slow to react to commands.

    If you want to get the best result and have a knob on Channel 6 you can set the #define CHANNEL_6_TUNING to CH6_DCM_Y to test the _kp_yaw. be sure to test the values in CLI->test>tune

    I have used to test low, mid and high values since I only have a three pos switch on my 6th channel and i helped me to understand that I didn't want to go higher than the default 0.8

    :-)

    Last thing I only tested YAW_OPTION 0 in APM_config so I don't really know what are the results with other options.

    Cheers,

    E.

     

  • Hi Emile,

     

    I'm having similar problems and I have also seen the noise in my compass +-1 º. I have a frame similar to yours, 50cm with KDA20-22L. Can you share your PIDs or at least the relevant changes from default values?

     

    I'll give your solution a try and report here.

     

    Thanks.

  • 3D Robotics
    Check out AC 2.0.25, which has a much improved yaw function. It may be that the official code is now closer to what you came up with.
  • Nice detective work.
  • Hi Emile,

    I just tried yesterday the 2.0.25, and same as you, after trying different yaw options, I ended up using option 2, using option 0 kept my Octo turning CW, with option 1 it was too strong. I'll give it a go!
    thanks,
    Dani
This reply was deleted.

Activity

DIY Robocars via Twitter
RT @a1k0n: @SmallpixelCar @diyrobocars It's just something that's easy to track with chroma keying. I ended up using different colors on th…
Monday
DIY Robocars via Twitter
Monday
DIY Robocars via Twitter
RT @TinkerGen_: "The Tinkergen MARK ($199) is my new favorite starter robocar. It’s got everything — computer vision, deep learning, sensor…
Nov 23
DIY Robocars via Twitter
Nov 23
DIY Robocars via Twitter
RT @roboton_io: Join our FREE Sumo Competition 🤖🏆 👉 https://roboton.io/ranking/vsc2020 #sumo #robot #edtech #competition #games4ed https://t.co/WOx…
Nov 16
DIY Drones via Twitter
First impressions of Tinkergen MARK robocar https://ift.tt/36IeZHc
Nov 16
DIY Robocars via Twitter
Our review of the @TinkerGen_ MARK robocar, which is the best on the market right now https://diyrobocars.com/2020/11/15/first-impressions-of-tinkergen-mark-robocar/ https://t.co/ENIlU5SfZ2
Nov 15
DIY Robocars via Twitter
RT @Ingmar_Stapel: I have now explained the OpenBot project in great detail on my blog with 12 articles step by step. I hope you enjoy read…
Nov 15
DIY Robocars via Twitter
RT @DAVGtech: This is a must attend. Click the link, follow link to read the story, sign up. #chaos2020 #digitalconnection #digitalworld ht…
Nov 15
DIY Robocars via Twitter
RT @a1k0n: Got a new chassis for outdoor races (hobbyking Quantum Vandal) but I totally didn't expect that it might cause problems for my g…
Nov 11
DIY Drones via Twitter
First impressions of the Intel OpenBot https://ift.tt/36qkVV4
Nov 10
DIY Robocars via Twitter
Nov 9
DIY Robocars via Twitter
Excellent use of cardboard instead of 3D printing! https://twitter.com/Ingmar_Stapel/status/1324960595318333441
Nov 7
DIY Robocars via Twitter
RT @chr1sa: We've got a record 50 teams competing in this month's @DIYRobocars @donkey_car virtual AI car race. Starting today at 10:00am…
Nov 7
DIY Robocars via Twitter
Nov 6
DIY Robocars via Twitter
RT @a1k0n: Car's view, using a fisheye camera. The ceiling light tracking algorithm gave me some ideas to improve ConeSLAM, and having grou…
Nov 5
More…