|
From: leee <le...@sp...> - 2009-11-06 16:39:09
|
On Friday 06 Nov 2009, Curtis Olson wrote: > On Fri, Nov 6, 2009 at 9:32 AM, James Turner wrote: > > On 6 Nov 2009, at 14:47, dave perry wrote: > > > It seems to me it should be possible in controls.nas to > > > choose between the two values for aileron and two values for > > > elevator based on an agreed upon autopilot properties. To do > > > this, one needs to be able to access the joystick axis value. > > > > This is one of the reasons I had to make the autobrakes be C++ > > code, and make some other unpleasant changes - we're missing a > > layer of abstraction between 'input system output properties' > > and 'FDM input properties'. I found there's many joystick > > config files that expect full ability to mess with the > > /controls properties - which seems reasonable. > > > > What's not reasonable is that the FDMs read the same properties > > directly, which makes life hard for auto[pilot|brake|etc] > > systems. For YASim, it's bearable, since the 'input' control > > properties are defined in the aircraft XML files (so I redefine > > the YAsim brake inputs to be / > > autopilot/autobrake/left-brake-output instead of > > /controls/left-brake, for example), but for JSBSim I needed to > > change the glue C++ code to stop it reading FGControls > > directly, if the autobrakes are active. (Yuck!) > > > > I'm not sure what the solution is - I think it's to create a > > tree of 'fdm-input' properties analogous to /controls, which is > > not touched by any joystick scripts / external inputs / etc, > > and which by default is simply a copy of the /controls values, > > but which the autopilot (and similar systems) can manipulate. > > > > That's exactly what my C++ autobrake currently does, btw, and > > this was necessary to be able to correctly implement the > > interaction between autobrake input and pilot over-ride inputs; > > namely that any pilot control input automatically disarms the > > autobrake system. > > Hi James, > > I think your analysis is pretty much dead on. We are missing a > layer of abstraction. Ideally, the raw control inputs would be > fed into a separate branch of the property tree, and then the > actual control surface positions would be sent to the FDM. This > would allow us to create fly by wire systems that translate > inputs to outputs in arbitrary ways. For simple aircraft with > direct mechanical controls (or for aircraft where all the flight > controls and control surface modeling is handled at the FDM > layer), we could have a simple FBW module that just does a 1-to-1 > copy of the values. > > In the case of JSBSim aircraft, perhaps there's a way to > implement autobrakes entirely within JSBsim and work around the > problem in this particular case? > > Regards, > > Curt. As I've mentioned, we can already do this using autopilot filters. The only real problem that I hit was that YASim absolutely requires the /controls/flight/elevator-trim input axis to be bound to the <hstab> Flap0 YASim control element, otherwise the solver will fail because it assumes no elevator control. I think this was probably just a dumbness check, to ensure that some elevator control was possible, but in any case, it's possible to work around it. I've attached a diagram (exported in PDF format) that I made to help me keep track of an FBW type autopilot config that I was working on, to give an idea of how you can route JS inputs using filters. LeeE |