On Wed, 4 Feb 2004 13:28:39 -0600, David Culp <[EMAIL PROTECTED]> wrote:

Beat me to it :) Here are two other calculations you'll need, vertical speed
error and mach error.


    // Calculate vertical speed error
    static SGPropertyNode *target_vert_speed
        = fgGetNode( "/autopilot/settings/vert-speed-fpm", true );
    static SGPropertyNode *vert_speed
        = fgGetNode( "/velocities/vertical-speed-fps", true );
    static SGPropertyNode *vs_error
        = fgGetNode( "/autopilot/internal/vert-speed-error-fpm", true );

    vs_error->setDoubleValue( target_vert_speed->getDoubleValue() -
                              vert_speed->getDoubleValue() * 60.0);

    // Calculate mach error
    static SGPropertyNode *target_mach
        = fgGetNode( "/autopilot/settings/mach", true );
    static SGPropertyNode *mach
        = fgGetNode( "/velocities/mach", true );
    static SGPropertyNode *mach_error
        = fgGetNode( "/autopilot/internal/mach-error", true );

    mach_error->setDoubleValue( target_mach->getDoubleValue() -
                                       mach->getDoubleValue() );

Dave

I think this is taking it one step too far. We don't need to calculate vertical speed error, that is done inside the controller (when you use "/velocities/vertical-speed-fps" ans input and "/autopilot/settings/vert-speed-fps" as reference).


The reason for the heading bug error calculation was to make the turning to the heading bug more intelligent. If we had used current heading as input and heading bug as reference to a controller it would have turned right all the way from 10 deg to 350 deg through 180 deg, insted of just turning left from 10 to 350. Our solution was to figure out how many degrees left (negative) or right (positive) we need to turn.

--
Roy Vegard Ovesen

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to