On 04/08/2011 10:40 PM, Catherine James wrote:
> Recently, I've been spending a good bit of time attempting to program all of 
> my most-used aircraft so that I can engage and disengage the autopilot 
> through the joystick.  I've been able to get this to work on the Seneca II 
> with a short nasal script in Nasal/SenecaII.nasal that sets the 
> /autopilot/CENTURYIII/controls and /autopilot/CENTURYIII/locks properties 
> appropriately.  Silly me, I though it would be a simple matter to port the 
> working code over to the Comanche PA-24-250 (w/ CIII autopilot).
>
> Unfortunately, the structure of the nasal scripts of the PA24 bears very 
> little resemblance to that of the Seneca II.  Although the relevant autopilot 
> properties are the same for both planes, the flow of control is not.  For 
> example, turning on the autopilot roll axis control with the plane on the 
> ground is harmless in the Seneca, but will cause a nasal crash in the (stock, 
> unmodified) Comanche, and turning the autopilot off again will not recover.  
> (The ailerons will be locked permanently at 0 until you restart.)  The 
> routine that crashes is action-sim.nas, a file that doesn't even exist in the 
> Seneca. It contains an update_actions() script that is looped repeatedly, 
> updating positions of control surfaces, etc.  With the autopilot on, the 
> script attempts to get the appropriate aileron position from the autopilot, 
> but it returns null and then cause a setValue() error when it blindly tries 
> to set the actual aileron position to that null.  The same thing
>   happens if I turn on the autopilot in flight by using the joystick to 
> change the /autopilot/CENTURYIII/controls properties through a script.
>
> Is there a general file and scripting structure that it is recommended to 
> follow for implementing aircraft?  It's very challenging to learn to 
> understand and modify aircraft implementations when the general arrangement 
> of files is so different from one to the next.
>
>
How are you "turning on the roll axis" and how are you "turning off the 
autopilot".  I just tried to reproduce your failures and did not have 
the problems you describe.  I am the author of the pa24-250.  The model 
assumes that you are using the switches via the picks.  The nasal code 
replicates the behavior described in the "Century III Autopilot Flight 
System Pilot's Operating Handbook".  You used to be able to download a 
PDF of this from Century.  This is no longer the case.
There are logical relations between the four switches that are included 
in the model.  If you are changing the "locks" outside the Nasal models, 
you will most likely create a state that is not possible via the model 
code and also not accurate according to the referenced manual.


------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to