Replies

  • That's correct when switching modes, but not at startup. trim_radio() does not check the TRIM_AUTO parameter (but it should!) so when called by startup_ground() it resets the values every time. The following code says it all:

    From radio.pde:

    static void trim_radio()
    {
    for (uint8_t y = 0; y < 30; y++) {
    read_radio();
    }

    trim_control_surfaces();
    }

    static void set_mode(byte mode)
    {
    if(control_mode == mode) {
    // don't switch modes if we are already in the correct mode.
    return;
    }
    if(g.auto_trim > 0 && control_mode == MANUAL)
    trim_control_surfaces();
    ...
    • The same in arduplane 3.0.3 ... I have a flying wing.Servos is connected to buddybox output, one of buddybox inputs reads APM outputs, another (master) reads receiver outputs. This setup is REAL manual and failsafe from anything can happen in APM (in visibility range, of course). To have flaperon mix in REAL manual mode, I made mix in radio on ch1 and ch2. To tel APM roll and pitch, on the radio I setup some channels, that copy roll and pitch stick movements (no mix) - ch5, ch6. ch7 connected to buddybox master/slave selecting channel, ch8 - to APM mode change channel, ch3 - to buddybox and APM by Y cable.

      Trim values on receiver and APM differs, so, i I have to set trims on radio and on APM manually....

      After some days of testing realised, that after every reboot APM trims changes. First tought was that my APM board is faulty, but the same scenario repeted on second board. After that I found this post.... This is real bug, lasting two years !

      I decided to recompile, but where to find source for 3.0.3 release ? I only managed to find for 3.0.4 beta.

  • Moderator

    From Tridge: That is controlled by the TRIM_AUTO parameter. It defaults to zero, meaning it does not copy trim values when you switch out of manual. That default was chosen because if you don't know it will happen and you have some elevator or aileron stick applied when you change out of manual you get very bad trim. 


    So when TRIM_AUTO is 1 then every time you switch out of manual the trim values will be used for the other modes but your sticks must be at neutral when you switch.

  • I commented on this here: http://diydrones.com/forum/topics/apm2-pid-settings-reset-after-pow...

    You need to comment out this line in the ArduPlane firmware:

    In system.pde:

    // read the radio to set trims
    // ---------------------------
    trim_radio(); // This was commented out as a HACK. Why? I don't find a problem.

    Compile and upload and your trim values will stay as what you set them

  • Developer

    Gregmaan,

        I'm not an ArduPlane expert, I'm on the ArduCopter side but I think the radio trims are all set when you do the Radio Calibration through the mission planner.  I think gyro offsets are captured at start-up but everything else (i.e. radio trims, accelerometer offsets) are done when you configure the board.

This reply was deleted.

Activity