Board index FlightGear Development Aircraft

Bug in VSI?

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Bug in VSI?

Postby tcbetka » Sat Mar 10, 2007 3:57 pm

Hello guys...

I am running the latest stable Win32 version (v0.9.10) and have put together high-quality IFR panels for the C172 and C182. These are based upon the ATC instruments available in the 'instruments' folder in the download. However a couple of bugs seem to be present, and I wonder if these are present in the CVS version.

1) At start-up, the VSI is pegged off-scale (high) and the Property Tree shows >5000fpm, but then fairly quickly (within 10 seconds or so) decreases towards zero. Eventually it does stabilize near zero and remains there, functioning normally. Adding power to start the take-off roll while the indicated VS is decreasing seems to have no effect on the rate of needle decrease. The function of the gauge does seem to be normal during all phases of flight.

2) Also at startup, the turn coordinator ball is well off to the left side of the instrument. When you add power to start the take-off roll, the ball flips back & forth from one side to the other several times, and then stabilizes in the center of the instrument in the proper position. It then seems to function correctly during the remaining departure roll and the rest of the flight.

Curt told me a possible fix for the turn coordinator, but I do not remember it (sorry Curt!). However, as I am planning to upgrade to the CVS version on Ubuntu, I don't want to dive too deeply into these issues if they have already been addressed and debugged in a later version. But I am working on the 172 and 182 as (potentially) FAA-certifiable emulations, so these things will need to be addressed if they have not already been fixed.

So if anyone has any tips for me, I would certainly appreciate it. Thanks in advance.

TB
MD, CFII, A&P
(Aero Eng Student)
tcbetka
 
Posts: 18
Joined: Wed Feb 07, 2007 3:15 am
Location: Green Bay, WI

Postby tcbetka » Sun Mar 11, 2007 2:32 pm

I have been researching this a bit, and found this very intersting link:

http://www.embedded.com/2000/0010/0010feat3.htm

I wonder if the VSI problem isn't analogous to an integrator windup problem? Take a look at figure 15 (see the index of figures at the bottom of the page).

Here's the source code for the VSI:


Code: Select all
// vertical_speed_indicator.cxx - a regular VSI.
// Written by David Megginson, started 2002.
//
// This file is in the Public Domain and comes with no warranty.

#include <simgear/math/interpolater.hxx>

#include "vertical_speed_indicator.hxx"
#include <Main/fg_props.hxx>
#include <Main/util.hxx>


VerticalSpeedIndicator::VerticalSpeedIndicator ( SGPropertyNode *node )
    : _internal_pressure_inhg(29.92),
      name("vertical-speed-indicator"),
      num(0),
      static_port("/systems/static")
{
    int i;
    for ( i = 0; i < node->nChildren(); ++i ) {
        SGPropertyNode *child = node->getChild(i);
        string cname = child->getName();
        string cval = child->getStringValue();
        if ( cname == "name" ) {
            name = cval;
        } else if ( cname == "number" ) {
            num = child->getIntValue();
        } else if ( cname == "static-port" ) {
            static_port = cval;
        } else {
            SG_LOG( SG_INSTR, SG_WARN, "Error in vertical-speed-indicator config logic" );
            if ( name.length() ) {
                SG_LOG( SG_INSTR, SG_WARN, "Section = " << name );
            }
        }
    }
}

VerticalSpeedIndicator::VerticalSpeedIndicator ()
    : _internal_pressure_inhg(29.92)
{
}

VerticalSpeedIndicator::~VerticalSpeedIndicator ()
{
}

// Here is where I think the problem is, as the instrument initializes at >5000 fpm climb (TB, 3/10/07)
void
VerticalSpeedIndicator::init ()
{
    string branch;
    branch = "/instrumentation/" + name;
    static_port += "/pressure-inhg";

    SGPropertyNode *node = fgGetNode(branch.c_str(), num, true );
    _serviceable_node = node->getChild("serviceable", 0, true);
    _pressure_node = fgGetNode(static_port.c_str(), true);
    _speed_node = node->getChild("indicated-speed-fpm", 0, true);

                                // Initialize at ambient pressure
    _internal_pressure_inhg = _pressure_node->getDoubleValue();
}

// I think this must be the 'integrator' function, given the 'dt' variable (TB, 3/10/07).
void
VerticalSpeedIndicator::update (double dt)
{
                                // model taken from steam.cxx, with change
                                // from 10000 to 10500 for manual factor
    if (_serviceable_node->getBoolValue()) {
        double pressure = _pressure_node->getDoubleValue();
        _speed_node
            ->setDoubleValue((_internal_pressure_inhg - pressure) * 10500);
        _internal_pressure_inhg =
            fgGetLowPass(_internal_pressure_inhg,
                         _pressure_node->getDoubleValue(),
                         dt/6.0);
    }
}

// end of vertical_speed_indicator.cxx




I think the problem might be in the init() function, but need to look at it some more. Anyone else have any ideas?

TB
MD, CFII, A&P
(Aero Eng Student)
tcbetka
 
Posts: 18
Joined: Wed Feb 07, 2007 3:15 am
Location: Green Bay, WI


Return to Aircraft

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Kafovofa, YandexBot [Bot] and 1 guest