From: Jon S. B. <js...@ha...> - 2006-01-22 14:01:49
|
> Hi, > > I've tried to get the normalized surface positions working for the F-16 > and after some testing I managed to do so. But there is one thing that I > don't fully understand; > > For the F-16 I calculate the normalized surface position based on the > pilots input and the current forces on the aircraft using a PID > controller. Then I use the outcome to scale the aero surfaces. But to > get the animation working it is not enough to name the summer "Rudder > Pos Norm" (which should create fcs/rudder-pos-norm) like this: > > <summer name="Rudder Pos Norm"> > </summer> > > But I actually have to scale back the fcs/rudder-pos-rad property using: > > <aerosurface_scale name="Rudder Normalized"> > <input>fcs/rudder-pos-rad</input> > <domain> > <min>-1</min> > <max>1</max> > </domain> > <range> > <min>-0.524</min> > <max>0.524</max> > </range> > <output>fcs/rudder-pos-norm</output> > </aerosurface_scale> > > Which is basically the reverse of the aerosurface_scale to get the > position i degrees and radians. Is there any good reason for that? > > Erik First, I suspect that your "Rudder Normalized" component is not quite set up right for what I think you want to do. What you have right now is: <aerosurface_scale name="Rudder Control"> <input>fcs/yaw-command</input> <range> <min>-0.524</min> <max>0.524</max> </range> <output>fcs/rudder-pos-rad</output> </aerosurface_scale> <aerosurface_scale name="Rudder Normalized"> <input>fcs/rudder-pos-rad</input> <domain> <min>-1</min> <max>1</max> </domain> <range> <min>-0.524</min> <max>0.524</max> </range> <output>fcs/rudder-pos-norm</output> </aerosurface_scale> If I understand your intention correctly, the Rudder Control component takes the fcs/yaw-command input (which I assume ranges from -1 to +1) and rescales it to the range -0.524 to +0.524, setting the rudder-pos-rad property to that scaled value. Subsequently, the Rudder Normalized component takes the rudder-pos-rad value and scales it again to the same range, assuming an input range of -1 to +1. I think that's not what you intended to do. The domain is the assumed input span, the range is the desired (output) scaling span. In the Rudder Control component you imply that the input will be somewhere between -1 and +1 (normalized) - since that is the default domain and you don't explicitly state a domain - and you give the output range as -0.524 to +0.524. However, in the Rudder Normalized component, you formally state that you expect the input span to that component to be a normalized input (-1 to +1), and then to scale that input to a range that spans -0.524 to +0.524. I believe you want to take the rudder position in radians and scale that back to the range -1 to +1 to get a normalized rudder position. That would be done like this (i.e. you have it backwards): <aerosurface_scale name="Rudder Normalized"> <input>fcs/rudder-pos-rad</input> <domain> <min>-0.524</min> <max>0.524</max> </domain> <range> <min>-1</min> <max>1</max> </range> <output>fcs/rudder-pos-norm</output> </aerosurface_scale> You are right that this doesn't seem to be the shortest way to specify a normalized output. In your component that acts as the input to the rudder control component, I believe that you calculate the normalized rudder command already: <summer name="yaw command"> <input>fcs/yaw-rate-p</input> <input>fcs/yaw-rate-i</input> <input>fcs/yaw-rate-d</input> <clipto> <min>-1</min> <max>1</max> </clipto> </summer> At one point, I had tried to do what you suggested, name the above summer as "rudder-pos-norm" (or, "Rudder Pos Norm"). As you discovered, that does not work. It is because the fcs/rudder-pos-norm property already exists as a formal, pre-defined, FCS property. However, the way to get around that - and really the proper way to do it, anyhow - is to add an <output> element at that point: <summer name="yaw command"> <input>fcs/yaw-rate-p</input> <input>fcs/yaw-rate-i</input> <input>fcs/yaw-rate-d</input> <clipto> <min>-1</min> <max>1</max> </clipto> <output>fcs/rudder-pos-norm</output> </summer> This should preclude the need for the final aerosurface_scale component. Jon |