August 28, 200322 yr >In C gauges the PANEL_SERVICE_PRE_UPDATE service_id os called>every 1/18th second, so the gauge callback is a good place for>the autopilot code in C. I don't have my damping constants at>and, but 0.3 sec sounds good. There are however some variables>that change almost in the same frequency.>Arne Bartels A 0.3 second Time Constant adds a delay and phase shift to the filtered variable. A 1.0 sec TC results in a low pass filter with bandwidth of 1 rad/sec. Which is 0.156 Hz. Frequency components at 0.156 second are delayed in phase by 45 degrees. In addition, sampling at 18/sec adds an average delay of 1/36 second. That results in a linear phase shift; 36 degrees at 1 Hz. The Closed Loop bandwidth would have be be less than 1 Hz or the extra phase shifts could make it unstable. However, the 'LP filter' in a Rate FB path actually tends to compensate for delays in the 'forward path'. Of course, I could set the Time Constant to 0.1 second, or even less. An Autopilot Loop tends to filter out jitter. The AC itself tends to look like a LP filter with a TC that may be many seconds. For an ALT hold (or VS rate control) the Short Period Pitch Oscillation can be around 2/5 Hz (estimated from flight tests at jet cruise altitudes). Generally, one has to sample at a 10X or higher rate than the intrinsic frequencies involved in a feedback system for it to be reasonably stable. 18tickspersec/1.8 Hz = 10. I figure I can get reasonable ALT, etc. control with bandwidths near 1 Hz if necessary. Actually, 0.1 Hz BW would correspond to an overall 'Time Constant' of 1.59 seconds, which sounds reasonable. One really should add rate limits, etc. to keep any 'autopilot' from overbanking, etc. an AC. Also, for ILS/GS real AC autopilots vary gains, dropping them as the runway threshold is approached. Since one knows the distance from the ILS DME it should be fairly easy to set up. In the end, I calculate or estimate gains, etc. then see how the system works. Then, I start tweeking. I have never done an autopilot, but have a bit of experience with FB systems. Don't forget that FS9 has several 'PID' settings for GS and ILS in aircraft.cfg. Including limits. However, there is no guarantee that they work right. ;) "yaw_damper_gain doesn't. I may try to make a good Yaw Damper first. Something I've never seen in FS. Filtered 'incidence_beta' FB to kick the 'rudder trim' may do the job, though one would also like to limit JS rudder travel to something like +/- 5 degrees. I don't know how to do the latter.Ron
August 29, 200322 yr > (A:Ambient Pressure,atm) Pressure in Atmospheres, 1.000 at>ISA SL.>> Or, set the units to inHg, and you get 29.92... at SL. >But, you don't have to convert inHg to the normalized>"Atmosphers" in XML. Saves finding the exact conversion>factors.>> This may not be in the C tokens: "(A:Total Weight,pounds)".> You can set kg, etc. Herve' Sors got 'total weight' for his>AFSD through an undocumented FS variable via FSUIPC. Ron, in FS9 all XML variables can be readed from C in any units.There is new interface (old lookup_var also there)For example I can read token "BAROMETER PRESSURE" in inHg, milibars, atmospheres or PSI without any conversion on my sideTotal weigth also accesible now.
Create an account or sign in to comment