Sign in to follow this  
n4gix

XML speed switch....

Recommended Posts

Hi, I guess I can't see the forest for the trees! I am trying to make a speed switch on the autopilot panel that, when clicked, will make the aircraft go to the airspeed set by the airspeed bug on the AI. Typical. Seems like it should be straight forward. However, every time I click on the speed switch, the engine goes to idle! I can see the throttle move downward to the idle position.I've tried a great number of A:,L:, and K: variable combinations andnone have solved this problem. There are more than 15 K: variables that are related to speed. I initially thought maybe I had to set thevalue first. So I rotated the bug with an (L:variable,enum), and then gave this value to (>K:AP_SPD_VAR_SET). It didn't work!The speed switch gives a 1 to (A:Autopilot Airsped Hold, bool).Anyone have any ideas?Thanks, Don(L:Have_Brain, bool) if{ 1 (>K:Smart,bool) els( 1 (>K:Dumb,bool) }

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

You're best source for XML examples is right on your hard drive... Examine the .CAB files for the default a/c! :)Here's the "Speed Hold" from the B747.cab:- - - (A:Autopilot airspeed hold, bool) - - - - - 0 (>L:Mach-IAS select, bool) 0 (>K:AP_PANEL_SPEED_HOLD)Notice the command is: 0 (>L:Mach-IAS select, bool) 0 (>K:AP_PANEL_SPEED_HOLD) This may easily be modified to omit the L: variable, if you are not using a Mach-IAS switch. 0 (>K:AP_PANEL_SPEED_HOLD)

Share this post


Link to post
Share on other sites

Hi Bill, thanks for the quick response. However, I have tried that code and it gives the same result. Infact, I set everything up in my panel relating to airspeed exactly asin the 747. Including the autothrottle switch. All to no avail! Theother switches work just fine.Am I missing something? I keep thinking that this should be simple and that I am making some stupid little mistake. On the other hand, I have several freeware aircraft that do the same thing when the IAS switch is clicked. Is this a problem?Cheers, Don

Share this post


Link to post
Share on other sites

Make sure that the appropriate entries are in the aircraft.cfg file:[autopilot]autopilot_available = 1flight_director_available = 1default_vertical_speed = 1800.0autothrottle_available = 1autothrottle_arming_required = 1autothrottle_max_rpm = 90autothrottle_takeoff_ga = 1pitch_takeoff_ga = 8;

Share this post


Link to post
Share on other sites

Thanks Bill, but I checked that already. Not the problem.Cheers, Don

Share this post


Link to post
Share on other sites

Hi,If you are willing to show your code here, then we can have a look at and test it and may be give some advice.Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Thanks Jan, I am using 3 airspeed related files. The airspeed and autothrottle switches are the same as the B747, minus all references to Mach. I have included the 3rd switch, the AI, below.However, these switches work fine in the B747, but not in myaircraft. Similarily, the B747 switches in my aircraft give the sameresult. This being the engines spooling to idle when the autopilot airspeed hold switch is toggled.I can see the throttle arm "physically" go to the idle position, which can not be changed without turning it off.(L:Ind Switch,bool)(A:Airspeed barber pole,knots)(A:Airspeed select indicated or true,knots)(A:Autopilot airspeed hold var, knots)(A:Autopilot airspeed hold var, knots)"TOOLTIPTEXT_AIRSPEED_KNOTS"(>K:AP_SPD_VAR_DEC)(>K:AP_SPD_VAR_INC)I appreciate any help!Cheers, Don

Share this post


Link to post
Share on other sites

Hi,As far as i could see the first 4 elements are of no importance for the gauge (switch and airspeed needles).The AP_IasKnob will rotate when clicking + or -, but in a strange way.If you want to see the knob rotate while choosing speed you better can use something like: (G:Var1)and adding to the click:"TOOLTIPTEXT_AIRSPEED_KNOTS" (>K:AP_SPD_VAR_DEC) (G:Var1) -- (>G:Var1) (>K:AP_SPD_VAR_INC) (G:Var1) ++ (>G:Var1) Then the knob rotates and the airspeed is set meanwhile.If you want a switch just to switch between several modes like N1 or EPR, you can make the AP_SPD_VAR_INC and AP_SPD_VAR_DEC dependant of the position of that, say SPD switch: (L:spd,enum) 0 == if{ 1 (>L:spd,enum) } els{ 0 (>L:spd,enum) }In the click add then:"TOOLTIPTEXT_AIRSPEED_KNOTS" (L:spd,enum) 1 == if{ (>K:AP_SPD_VAR_DEC) (G:Var1) -- (>G:Var1) }"> (L:spd,enum) 1 == if{ (>K:AP_SPD_VAR_INC) (G:Var1) ++ (>G:Var1) }Now you only can set airspeed when the SPD switch is on.etc. etc.Hope this is what you mean,Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Thanks Jan. Sorry if I was not as clear as I should have been. The problem is that when I click on the IAS hold switch on the autopilot the airspeed does not go to the slected speed (airspeed bug), butinstead goes to idle speed. The throttle arm on the popup goes to idle and does not respond to mouse or joystick inputs (as it should).Deleting the autothrottle did not alter the outcome.Unfortunately your code produced the same result as mine. I don't think it is the code, per se, because I can replace the default B747 airspeed files with mine and they work as expected. On the other hand, if the default B747 gauges are put into my aircraft,the engines go to idle when the IAS hold switch is clicked. It seems as if something in my aircraft is interferring with the process. Maybe something in the autopilot panel? Basic airspeed setup? Cheers, DOn

Share this post


Link to post
Share on other sites

Do you accidentaly use somewhere the code:0 (>K:AXIS_THROTTLE_SET) or 0 (>K:AP_SPD_VAR_SET) ??Btw. i use (>K:AP_PANEL_MACH_HOLD) and (>K:AP_PANEL_SPEED_HOLD) without any problem and i have a very complicated autopilot.Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Hi Jan, just to let you know that I always have to learn things the hard way. The other night I found a line at the bottom of the AUTOPILOT section of the aircraft.cfg which read:Autothrottle_max_RPM=90.00000 I changed the 90 to the max RPM of the engine and, VIOLA!, it works like a charm. Thanks again to you and to Bill for your time and help!!!Don

Share this post


Link to post
Share on other sites

>Autothrottle_max_RPM=90.00000 >>I changed the 90 to the max RPM of the engine and, VIOLA!, it>works like a charm. >>Thanks again to you and to Bill for your time and help!!!Heh! There's a "gotcha" for sure. Someone apparently thought that was a percentage scalar and not an actual RPM value... :) Probably meant to limit the Autothrottle to a max N1 of 90%, but instead set it to not really run at all!I thought you were using one of the default AP sections in that aircraft.cfg file. Anyway, I'm glad you sorted it out now! :)

Share this post


Link to post
Share on other sites

Hey Bill, Thanks, I'm glad too! Seems to be more to it though. For example, an interesting point is that 3 of the default jets (maybe the others) have the same line in their AUTOPILOT section and it is set to 90. Perhaps with turbojets it really does mean 90% of N1, and really does work. This line is not in the default prop aircraft.cfg such as the C208 and the King Air. However, in my single engine turoprop aircraft it is required since deleting the line had the same affect as setting it to 90. So why is this line needed by the jets, and my turboprop, but not by other similar aircraft? And why is it set at 90 for turbojets, but not for my aircraft? I'm not going to spend any time trying to answer these questions, but they sure leave me wondering.A lesson learned may be to check this line if your airspeed hold switch does not work properly.Cheers, Don

Share this post


Link to post
Share on other sites

Well, according the the SDK, that is SUPPOSED to be a %'age value, but it sure doesn't work that way!Autothrottle_max_rpmautothrottle_max_rpm = 90This sets the maximum engine speed, in percent, that the autothrottle will attempt to maintain.Autothrottle_takeoff_gaautothrottle_takeoff_ga=1Setting this flag to 1 enables takeoff / go-around operations with the autothrottle.max_throttle_ratemax_throttle_rate=0.10This value sets the maximum rate at which the autothrottle will move the throttle position. In the example, the maximum rate is set to 10% of the total throttle range per second.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this