Oscillations

Hello All,Got a new rudder/elevator easystar back in the air today, and when I switched to fly-by-wire it didn't roll-over and dive! Making progress.The stabilization appears to be working, but it's over-correcting itself. The nose wobbles in a 12" circle when activated.I've read through the manual, and searched on here, and it appears that I need to learn more about PID gains to reduce pitch and roll.This is going to be my next stab in the dark. In looking at other *.h files, what I'm trying doesn't appear to be necessary, but it's where the docs seem to be pointing me.pitch_P, pitch_Iroll_P, roll_IDo the sensors have to be completely level at startup? ie: can the plane be leaning on a wingtip? I'm using FMA XY sensors for my XY and Z, and they're as level and plumb as I can make them on velcro tape.Thanks for any tips!//ROLL GAINS//5-1#define roll_abs .2 //Set point absolute...(Not Used)//5-3#define roll_P .17 //roll PID proportional .35 stock//5-3#define roll_I .17 //roll PID integrator .35 stock//5-4#define roll_min -25 //PID output limit in servo degrees//5-5#define roll_max 25 //PID output limit in servo degrees//5-6#define roll_Integrator_max 10 //Limit the integrator, to avoid overshoots//5-7#define roll_Integrator_min -10//PITCH GAINS//6-1#define pitch_P .32 //Pitch Proportional .65 stock//6-2#define pitch_I .17 //Pitch integrator .32 stock//6-3#define pitch_min -25 //Pitch limits//6-4#define pitch_max 25//6-5#define pitch_Integrator_max 10 //Pitch integrator limits//6-6#define pitch_Integrator_min -10//6-7#define PITCH_COMP .30 //<------Very important, Pitch compensation vs. Roll bank angle.

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

Join diydrones

Email me when people reply –

Replies

  • Alright, got another flight in. Still doesn't want to come around for RTL or waypoints. Oscillations were solved, so I'm going to start a new thread.
  • here's my rudder and sensor placement

    IMG_4611.jpg


    IMG_4613.jpg


    I'll check my Tx programmer, and see if I can see what kind of values I'm using.

    JC
  • Hi,

    about servo travel I use the same usual servo travel as from the RC tx that is:

    #define SERVO_AILE_MAX 2100 //Range of Ailerons
    //3-2
    #define SERVO_AILE_MIN 900
    //3-3
    #define SERVO_ELEV_MAX 2100 //Range of Elevator
    //3-4
    #define SERVO_ELEV_MIN 900

    About the gains this are mine. I use them with my EZ*. It flies pretty well, but it depends on which behavior you want, a gentle flight mission or a race with a lot of turns and altitude change.

    //HEADING GAINS
    //4-1
    #define head_P .7 //Heading error proportional (same used to move the rudder)... DO not add too much or you will oscillate left and right. (drunk driver effect)
    //4-2
    #define head_I .3 //heading error integrator. Do not add too much or you will overshoot.
    //4-3
    #define head_D 0 //Derivative not used, but someday....
    //4-4
    #define head_error_max 45 //35 The maximum output in degrees to control the roll setpoint
    //4-5
    #define head_error_min -45 //-35 The min output in degrees to control the roll setpoint

    //ROLL GAINS
    //5-1
    #define roll_abs .2 //Set point absolute...(Not Used)
    //5-3
    #define roll_P .50 //roll PID proportional
    //5-3
    #define roll_I .35 //roll PID integrator
    //5-4
    #define roll_min -45 //PID output limit in servo degrees
    //5-5
    #define roll_max 45 //PID output limit in servo degrees
    //5-6
    #define roll_Integrator_max 15 //Limit the integrator, to avoid overshoots
    //5-7
    #define roll_Integrator_min -15

    //PITCH GAINS
    //6-1
    #define pitch_P .8 //Pitch Proportional
    //6-2
    #define pitch_I .6 //Pitch integrator
    //6-3
    #define pitch_min -25 //Pitch limits
    //6-4
    #define pitch_max 25
    //6-5
    #define pitch_Integrator_max 15 //Pitch integrator limits
    //6-6
    #define pitch_Integrator_min -15
    //6-7
    #define PITCH_COMP .30 //<------Very important, Pitch compensation vs. Roll bank angle.

    Btw. I use a big rudder simply adding to the original the top fixed portion, cut horizontally like an "equilibrator" (don't know the exact therm).

    Hope this will be useful...

    Ric
  • .17 on the P and .0 on the I is the trick for me on pitch and roll.

    The thing flies like a dart. Crazy stuff.

    Guess I'll stick the GPS in next and try the RTL / Waypoints.
  • Got it in the air this morning. Wow, it was really close.

    The roll seems fine now, but it still wants to porpoise a bit, I'm going to take the pitch_P to .17 and see what happens.
  • Developer
    I have never used ardupilot, however the gains you have selected seem a bit off. A general rule of thumb is to use no more than half of the P for I

    Ex
    roll_P = 1;
    roll_I = 0.5; //no greater than 0.5

    With that being said.....Roll shouldn't need any integral (I) gain or pitch for that matter assuming you have the plane trimmed out (which you should). I don't know why Jordi has these defaults as what they are but I can almost garuntee that the reason your controller is unstable is because of the integral term. I would set it at zero and you should be all set. If you do want to use a little integral keep in around 1/10th of P for almost all applications and never over 1/2

    -Beall
  • Developer
    The sensors do not need to be perfectly level at startup, but the z axis sensor does need to be pointing more or less vertical. Do not stand over the plane during startup or your body IR signature will impact the initial IR calibration....

    Yes, you need to play with the 4 PID gains you have listed. Finding the best values for your setup is what you see referred to as "tuning".
This reply was deleted.

Activity