Switching to ALT_HOLD quad is always dropping down

I had already minor issues with V2.55, but in V2.6 is got even worst. By the way I'm coming from a WII starting with 2.55 - just amazing, what a difference, worse every penny, great job guys - now trying V2.6.

Here is what I found out so far:

First I thought something is wrong in building up the "g.throttle_cruise" value. What I can see in the source code, this is the major base of the throttle value. I'm only able to hold the altitude by a positive (up) manual boost with the throttle stick. I was mistaken for a few days. I negative (down) boost was what occured. Look at the function "adjust_altitude". Changing the value for "MINIMUM_THROTTLE" in V2.6 made my situation even worst. My average "g.throttle_cruise" value is around 380.

A manual boost takes place based on the current throttle value, which is perfectly fine, but without taking the average throttle_cruise into consideration. In my case whenever I switched to ALT_HOLD I was in the range of a negative boost.

I'm planing to test following code tomorrow:

#define

THROTTLE_ADJUST 100

static

void

adjust_altitude()

{

    // we are below the average throttle positions

   if(g.rc_3.control_in <= (g.throttle_cruise - THROTTLE_ADJUST)){

         manual_boost = (g.rc_3.control_in - g.throttle_cruise) - THROTTLE_ADJUST;

         manual_boost = max(-THROTTLE_ADJUST, manual_boost);

      }

     // we are above the average throttle positions

   else if(g.rc_3.control_in >= (g.throttle_cruise + THROTTLE_ADJUST)){

         manual_boost = g.rc_3.control_in - (g.throttle_cruise + THROTTLE_ADJUST);

         manual_boost = min(THROTTLE_ADJUST, manual_boost);

     }

   else{

         manual_boost = 0;

    }

}

 

"g.throttle_cruise" is changed in Manual Throttle mode and in the "update_throttle_cruise" function which handle boost in ALT_HOLD. That's my concern a little bit, that I'm changing the whole control loop with my approach.

 

I might be totally wrong - please let me know.

Thanks for your comments in advance and sorry about my english, it's not my native language.

CHC

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

Join diydrones

Email me when people reply –

Replies

  • Some more explainations what I found. Here is a V2.6 code snippet from the function I'm planing to change:

     

    #define THROTTLE_ADJUST 225
    static void
    adjust_altitude()
    {
    if(g.rc_3.control_in <= (MINIMUM_THROTTLE + THROTTLE_ADJUST)){
    // we remove 0 to 100 PWM from hover
    manual_boost = (g.rc_3.control_in - MINIMUM_THROTTLE) - THROTTLE_ADJUST;
    manual_boost = max(-THROTTLE_ADJUST, manual_boost);

    }else if (g.rc_3.control_in >= (MAXIMUM_THROTTLE - THROTTLE_ADJUST)){
    // we add 0 to 100 PWM to hover
    manual_boost = g.rc_3.control_in - (MAXIMUM_THROTTLE - THROTTLE_ADJUST);
    manual_boost = min(THROTTLE_ADJUST, manual_boost);

    }else {
    manual_boost = 0;
    }
    }

     

    The value change of MINIMUM_THROTTLE from 130 to 200 in V2.6 is my personal setup issue. If you have a powerful setup it requires a lower throttle for hovering. Look at the conditions for maual boost - especially boost down:

     

    if(g.rc_3.control_in <= (MINIMUM_THROTTLE + THROTTLE_ADJUST)

     

    MINIMUM_THROTTLE + THROTTLE_ADJUST equal to a value of 425

     

    In case your average throttle is lower than 425 you always will get a boost down if you switch to ALT_HOLD until you rise the throttle stick a bit up.

    Hope this helps ...

    regards

    CHC

     

     

  • hi,

    i too am suffering from this problem and started a thread a few days ago (http://diydrones.com/forum/topics/v2-6-throttle-range-woes)

    the thing is that although i had this problem in my first flights with v2.5 it quickly resolved itself and flew perfectly until i installed v2.6.  i cant really compare your code to what we are flying in 2.6 right now, but really wonder what changes there are between 2.5 and 2.6 that could affect alt hold.

    so far the only thing i am aware of is the change in throttle range, have you found anything else?

    james

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…