Hi all,
I've been experiencing some more weird behaviour from pid
controllers and filters.
I had a pid controller that was working ok (but had some room for
further fine-tuning) but after amending the config and re-loading
the autopilot it seemed to be working randomly. I reverted back to
the original values and re-loaded again but still got the same
random behaviour.
Along with this I was also monitoring a moving-spike filter that was
filtering the output from the pid controller, but which I wasn't
actually using, and saw it appear to start oscillating at around a
value of zero even though the pid controller output, and therefore
the filter input, had swung over and clamped to one of it's max/min
limits. If I disabled the pid controller the filter immediately
started to work correctly and the filter out swung to match the
input. Re-enabling the pid controller resulted in the filter
oscillation resuming even though the pid controller output didn't
seem to change.
Also, as I was thinking about this I noticed that the oscillating
output seemed to be slowly drifting towards the correct value and
couldn't help wonder if re-loading the autopilot was creating new
instances of the pid controller without removing the old ones.
I've had a look at the relevant code but as I'm not up on c++ I'm
not sure about what I'm looking at but at lines 798-802 there's:
void FGXMLAutopilot::reinit() {
components.clear();
init();
build();
}
I could find init() & build() and thought that components.clear()
must be what removes old instances and must be a more generic
function. However, when I grepped through the SimGear & FlightGear
source the only occurrence I could find of this function was at
that single point in xmlauto.cxx. I then searched for
components.clear() in C/C++ reference manuals on the web and didn't
find anything there either. Perhaps I just wasn't looking in the
right place though.
In any case, it seems strange to me that if components.clear() is a
generic function, it's only used in this one place in the entire
SG/FG source.
I might be barking up the wrong tree entirely here, but I can't see
what else might be causing the behaviour I'm seeing.
LeeE
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel