|
| ... | Среда, 25.12.2024, 20:51
Приветствую Вас Гость | RSS |
Autopilot, AP_SPD_VAR_INC limit
| |
GR4Jockey | Дата: Пятница, 12.08.2011, 03:14 | Сообщение # 1 |
Группа: Удаленные
| Hi all,
I am currently creating an autopilot for the Panavia Tornado. with the real aircraft when you select THROT the datum is set as the IAS at the point of selecting. You can then increase / decrease the IAS by 30 knots. This is where i am stuck hoe can this be achieved.
Image of my Autopilot Display Code for IAS (KCAS)
[code //------------------- KCAS Display
<Element> <Position X="600" Y="65"/> <Text X="150" Y="100" Length="3" Font="LCD" FontHeight="34" FontWeight="700" Color="#FF0000" Adjust="Center" VerticalAdjust="Center" Multiline="No" Luminous="1"> <String>%((>L:AP_AIS_HOLD_VAR, knots) (A:Autopilot airspeed hold var, knots))%!03d!%{end}</String> </Text> </Element>] [/code]
Code to increment the Datum IAS Code //------------------- IAS Datum Increase
<Area Left="139" Right="383" Top="54" Bottom="89"> <Cursor Type="Hand"/> <Click Kind="LeftSingle+Leave"> (M:Event) 'LeftSingle' scmp 0 == if{ 1 (>L:AP_IAS_DATUM_ADJUST,bool) (>K:AP_SPD_VAR_INC) } (M:Event) 'Leave' scmp 0 == if{ 0 (>L:AP_IAS_DATUM_ADJUST,bool) </Click> </Area>
//------------------- IAS Datum Decrease
<Area Left="139" Right="383" Top="89" Bottom="124"> <Cursor Type="Hand"/> <Click Kind="LeftSingle+Leave"> (M:Event) 'LeftSingle' scmp 0 == if{ 2 (>L:AP_IAS_DATUM_ADJUST,bool) (>K:AP_SPD_VAR_DEC) } (M:Event) 'Leave' scmp 0 == if{ 0 (>L:AP_IAS_DATUM_ADJUST,bool) </Click> </Area> So I want to limit AP_SPD_VAR_INC to IAS Datum +30 and AP_SPD_VAR_DEC to IAS Datum -30. From the image above, that would be 400 +/- 30
Can anyone help.
Thanks in advance
GR4Jockey
|
|
| |
bar_rodoy | Дата: Пятница, 12.08.2011, 03:14 | Сообщение # 2 |
Группа: Удаленные
| Why not calculate the new value, and use K:AP_SPD_VAR_SET to set it?
|
|
| |
GR4Jockey | Дата: Пятница, 12.08.2011, 03:15 | Сообщение # 3 |
Группа: Удаленные
| What I want to achieve is to be able to increase or decrease by 30 knots max in increments of 1 knot, is there a way of restricting AP_SPD_VAR_INC and AP_SPD_VAR_DEC to achieve this.
Cheers
GR4Jockey
|
|
| |
@737@ | Дата: Пятница, 12.08.2011, 03:16 | Сообщение # 4 |
Полковник
Группа: Персонал
Сообщений: 104
Награды: 0
Репутация: 0
Замечания: 0%
Статус: Не в сети
| Posted 17 June 2011 - 12:15 PM DARNIT - THE FORUM SCREWED UP MY WHOLE POST & I HAVE TO RUN,, SAVED TO A TXT FILE, WILL EDIT AND RETURN LATER - SORRY.
OK all fixed,,,
GR.4,
Yes, as TGibson said, use K:AP_SPD_VAR_SET instead of AP_SPD_VAR_INC or DEC. For instance, at the time THROT is pushed store the current airspeed. Code <Click>(A:AIRSPEED INDICATED, knots) (>L:AP_AIS_HOLD_VAR, number)</Click> <!-- MAYBE EVEN BETTER, ROUND TO THE NEAREST TEN(S) OF KNOT --> <Click>(A:AIRSPEED INDICATED, knots) 10 / near 10 *(>L:AP_AIS_HOLD_VAR, number)</Click>
|
|
| |
@737@ | Дата: Пятница, 12.08.2011, 03:16 | Сообщение # 5 |
Полковник
Группа: Персонал
Сообщений: 104
Награды: 0
Репутация: 0
Замечания: 0%
Статус: Не в сети
| Now that you have speed at the time of THROT being pushed you can do some math. Whether or knot Posted Image you want the KCAS display to be updated with the new speed reference is up to you.. ( A later deal ) Time to inc/dec some speed.
Code //------------------- IAS Datum Increase <Area Left="139" Right="383" Top="54" Bottom="89"> <Cursor Type="Hand"/> <Click Kind="LeftSingle+Leave"> (M:Event) 'LeftSingle' scmp 0 == if{ 1 (>L:AP_IAS_DATUM_ADJUST,bool) (L:AP_AIS_HOLD_VAR, number) 30 + s1 (>K:AP_SPD_VAR_SET) l1 (>L:AP_AIS_HOLD_VAR, number) } (M:Event) 'Leave' scmp 0 == if{ 0 (>L:AP_IAS_DATUM_ADJUST,bool) } </Click> </Area> //------------------- IAS Datum Decrease <Area Left="139" Right="383" Top="89" Bottom="124"> <Cursor Type="Hand"/> <Click Kind="LeftSingle+Leave"> (M:Event) 'LeftSingle' scmp 0 == if{ 2 (>L:AP_IAS_DATUM_ADJUST,bool) (L:AP_AIS_HOLD_VAR, number) 30 - s1 (>K:AP_SPD_VAR_SET) l1 (>L:AP_AIS_HOLD_VAR, number) } (M:Event) 'Leave' scmp 0 == if{ 0 (>L:AP_IAS_DATUM_ADJUST,bool) } </Click> </Area>
|
|
| |
@737@ | Дата: Пятница, 12.08.2011, 03:17 | Сообщение # 6 |
Полковник
Группа: Персонал
Сообщений: 104
Награды: 0
Репутация: 0
Замечания: 0%
Статус: Не в сети
| Knot Posted Image sure what you're trying to do here.. Code //------------------- KCAS Display <String>%((>L:AP_AIS_HOLD_VAR, knots) (A:Autopilot airspeed hold var, knots))%!03d!%{end}</String> <!-- IT SHOULD BE SOMETHING LIKE THIS --> <String>%((>L:AP_AIS_HOLD_VAR, knots))%!03d!%{end}</String> <!-- OR THIS --> <String>%((A:Autopilot airspeed hold var, knots))%!03d!%{end}</String> In your original code you have both variables listed but are not evaluating them in any way, so, (A:Autopilot airspeed hold var, knots) will always be displayed. ????
Hope this helps, not tested, so mileage may vary, watch out for spaces etc, because of the edit...
|
|
| |
capitan_cg | Дата: Пятница, 12.08.2011, 03:17 | Сообщение # 7 |
Группа: Удаленные
| You should have the answer now, but to answer your second question, there is no way to adjust the amount that the INC or DEC Event ID's change things by.
|
|
| |
GR4Jockey | Дата: Пятница, 12.08.2011, 03:18 | Сообщение # 8 |
Группа: Удаленные
| Thanks for your response, the code works however it inc / dec by 30 knots at a time instead of 1 knot at a time to a maximum of 30 knots from the IAS Datum.
Regards
|
|
| |
@737@ | Дата: Пятница, 12.08.2011, 03:19 | Сообщение # 9 |
Полковник
Группа: Персонал
Сообщений: 104
Награды: 0
Репутация: 0
Замечания: 0%
Статус: Не в сети
| Ahh, OK, kinda get what you're trying to achieve. ( Missed post #3 ) This assumes that the reference datum stays the same until the THROT button is cycled again - correct? & if so does the KCAS display shows the reference only?
Code //------------------- IAS Datum Increase <Area Left="139" Right="383" Top="54" Bottom="89"> <Cursor Type="Hand"/> <Click Kind="LeftSingle+Leave"> (M:Event) 'LeftSingle' scmp 0 == if{ 1 (>L:AP_IAS_DATUM_ADJUST,bool) (L:AP_AIS_HOLD_VAR, number) 1 + (>L:AP_AIS_HOLD_VAR, number) 30 + min (>K:AP_SPD_VAR_SET) } (M:Event) 'Leave' scmp 0 == if{ 0 (>L:AP_IAS_DATUM_ADJUST,bool) } </Click> </Area> //------------------- IAS Datum Decrease <Area Left="139" Right="383" Top="89" Bottom="124"> <Cursor Type="Hand"/> <Click Kind="LeftSingle+Leave"> (M:Event) 'LeftSingle' scmp 0 == if{ 2 (>L:AP_IAS_DATUM_ADJUST,bool) (L:AP_AIS_HOLD_VAR, number) 1 - (>L:AP_AIS_HOLD_VAR, number) 30 - max (>K:AP_SPD_VAR_SET) } (M:Event) 'Leave' scmp 0 == if{ 0 (>L:AP_IAS_DATUM_ADJUST,bool) } </Click> </Area>
|
|
| |
@737@ | Дата: Пятница, 12.08.2011, 03:19 | Сообщение # 10 |
Полковник
Группа: Персонал
Сообщений: 104
Награды: 0
Репутация: 0
Замечания: 0%
Статус: Не в сети
| Hope this helps, again watch spacing. ( sometimes the forum doesn't keep correct spacing from copy/paste.)
|
|
| |
GR4Jockey | Дата: Пятница, 12.08.2011, 03:20 | Сообщение # 11 |
Группа: Удаленные
| The IAS Datum is at the point of selecting THOT, inc and dec changes the datum by +/- 30 knots and the KCAS shows the new IAS Datum. If you deselect and select THROT again, it starts from the new IAS datum, to a maximum of 500 knots.
The idea is that if the flight requires an IAS of 400 knots as you are approaching that airspeed you select THROT and the INC / DEC alows you to make minor adjustment to arrive at the correct IAS of 400 knots.
hope this helps
Cheers
GR4Jockey
|
|
| |
GR4Jockey | Дата: Пятница, 12.08.2011, 03:20 | Сообщение # 12 |
Группа: Удаленные
| tested your new code, when i reached 400kts I selected THROT, the KCAS showed 400kts, when selecting INC the KCAS increases to 401 and will not increase further, when selecting DEC the KCAS immediately goes to 399 and will not decrease further. This seems to work as Datum +/- 1.
Cheers
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 03:21 | Сообщение # 13 |
Группа: Удаленные
| Hi,
Not tested, but try something like: Code Pressing THOT:
<Click> (L:AP_IAS_DATUM_ADJUST,bool) ! if{ 1 (>L:AP_IAS_DATUM_ADJUST,bool) (A:AIRSPEED INDICATED,knots) 10 / near 10 * (>L:AP_AIS_HOLD_VAR,number) } els{ 0 (>L:AP_IAS_DATUM_ADJUST,bool) (L:AP_AIS_HOLD_VAR,number) (>K:AP_SPD_VAR_SET) } </Click>
Inc and Dec in one button:
<Click Kind="LeftSingle+RightSingle" Repeat="Yes"> (M:Event) 'LeftSingle' scmp 0 == if{ (L:AP_IAS_DATUM_ADJUST,bool) if{ (L:AP_AIS_HOLD_VAR,number) 1 - -30 max (>L:AP_AIS_HOLD_VAR,number) (L:AP_AIS_HOLD_VAR,number) (>K:AP_SPD_VAR_SET) } els{ if you want to use speed decr. here: (>K:AP_SPD_VAR_DEC) } } (M:Event) 'RightSingle' scmp 0 == if{ (L:AP_IAS_DATUM_ADJUST,bool) if{ (L:AP_AIS_HOLD_VAR,number) 1 + 30 min (>L:AP_AIS_HOLD_VAR,number) (L:AP_AIS_HOLD_VAR,number) (>K:AP_SPD_VAR_SET) } els{ if you want to use speed incr. here: (>K:AP_SPD_VAR_INC) } } </Click>
|
|
| |
bar_rodoy | Дата: Пятница, 12.08.2011, 03:22 | Сообщение # 14 |
Группа: Удаленные
| In both mouse callbacks, the > symbol is missing:
(L:AP_AIS_HOLD_VAR, number) 1 + (>L:AP_AIS_HOLD_VAR, number)
(L:AP_AIS_HOLD_VAR, number) 1 - (>L:AP_AIS_HOLD_VAR, number)
I call the > symbol the "stuff-it" command, because what it essentialy does is "stuff" the newly calculated value back into the variable, in other words it updates the contents of the variable. :Big Grin:
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 03:22 | Сообщение # 15 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Quote (bar_rodoy) In both mouse callbacks, the > symbol is missing:
(L:AP_AIS_HOLD_VAR, number) 1 + (>L:AP_AIS_HOLD_VAR, number)
(L:AP_AIS_HOLD_VAR, number) 1 - (>L:AP_AIS_HOLD_VAR, number)
I call the > symbol the "stuff-it" command, because what it essentialy does is "stuff" the newly calculated value back into the variable, in other words it updates the contents of the variable. :Big Grin: Don't understand why the > vanishes and the text becomes green....
|
|
| |
bar_rodoy | Дата: Пятница, 12.08.2011, 03:23 | Сообщение # 16 |
Группа: Удаленные
| Oh, my reply was directed towards the example Roman gave earlier. This forum software does do some odd "coloring" on XML script though, that's a fact!
|
|
| |
Robert | Дата: Пятница, 12.08.2011, 03:24 | Сообщение # 17 |
Группа: Удаленные
| Good call FR. Bil - missed that completely, Posted Image all fixed @ post #7.
Plus all > are now >.
The question remains,, does the code work under 400 knots? ( IE 250 ) If so, then the .air file is coming into play at/around 400 knots. Math=Math
Darn XML
|
|
| |
GR4Jockey | Дата: Пятница, 12.08.2011, 03:24 | Сообщение # 18 |
Группа: Удаленные
| Thanks guys for your help, but this seems impossible to achieve, phjvh has got the closest but still not how it should be.
Once again thanks, i think i will give up on this one. need to look at terrain following.
Cheers
|
|
| |
cassini-m | Дата: Пятница, 12.08.2011, 03:25 | Сообщение # 19 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| What entry in the .air do you think might be affecting this?
|
|
| |
bar_rodoy | Дата: Пятница, 12.08.2011, 03:25 | Сообщение # 20 |
Группа: Удаленные
| May be more can be done if your wishes are a little bit more clear. Unfamiliar with the Tornado AP and systems.
|
|
| |
GR4Jockey | Дата: Пятница, 12.08.2011, 03:26 | Сообщение # 21 |
Группа: Удаленные
| Hi guys,
They say a picture equals a thousand words, so lets give it a go.
On this occasion when I select THROT it engages at 350 knots
|
|
| |
GR4Jockey | Дата: Пятница, 12.08.2011, 03:26 | Сообщение # 22 |
Группа: Удаленные
| The range of the autothrottle system on a tornado is 150kts - 0 + 30 to 500kts + 0 - 30
Below 150 it will not engage
Above 500 it will not engage.
I hope this gives a better understanding of the system
Cheers
GR4Jockey
|
|
| |
Батька_Черномор | Дата: Пятница, 12.08.2011, 03:28 | Сообщение # 23 |
Генералиссимус
Группа: Менеджер
Сообщений: 1024
Награды: 0
Репутация: 40
Замечания: 0%
Статус: Не в сети
| Hi,
No way to test it yet, but try:
push TROTH Code <Click> (L:AP_IAS_DATUM_ADJUST,bool) ! if{ (A:AIRSPEED INDICATED,knots) 150 > (A:AIRSPEED INDICATED,knots) 500 < and if{ 1 (>L:AP_IAS_DATUM_ADJUST,bool) (A:AIRSPEED INDICATED,knots) 10 / near 10 * d (>L:AP_AIS_HOLD_VAR,number) (>L:AP BASE SPEED,number) } } els{ 0 (>L:AP_IAS_DATUM_ADJUST,bool) (L:AP_AIS_HOLD_VAR,number) (>K:AP_SPD_VAR_SET) } </Click> Speed -/+ Code <Click Kind="LeftSingle+RightSingle" Repeat="Yes"> (M:Event) 'LeftSingle' scmp 0 == if{ (L:AP_IAS_DATUM_ADJUST,bool) if{ (L:AP_AIS_HOLD_VAR,number) 180 > if{ (L:AP_AIS_HOLD_VAR,number) 1 - (L:AP BASE SPEED,number) 30 - max (>L:AP_AIS_HOLD_VAR,number) (L:AP_AIS_HOLD_VAR,number) (>K:AP_SPD_VAR_SET) } els{ (L:AP_AIS_HOLD_VAR,number) 1 - 150 max (>L:AP_AIS_HOLD_VAR,number) (L:AP_AIS_HOLD_VAR,number) (>K:AP_SPD_VAR_SET) } } } (M:Event) 'RightSingle' scmp 0 == if{ (L:AP_IAS_DATUM_ADJUST,bool) if{ (L:AP_AIS_HOLD_VAR,number) 470 < if{ (L:AP_AIS_HOLD_VAR,number) 1 + (L:AP BASE SPEED,number) 30 + min (>L:AP_AIS_HOLD_VAR,number) (L:AP_AIS_HOLD_VAR,number) (>K:AP_SPD_VAR_SET) } els{ (L:AP_AIS_HOLD_VAR,number) 1 + 500 min (>L:AP_AIS_HOLD_VAR,number) (L:AP_AIS_HOLD_VAR,number) (>K:AP_SPD_VAR_SET) } } } </Click> Seems to work.....
С уважением, Батька Черномор!
http://avsim.pp.ru/publ/barddakhaev_kirill_alekseevich_batka_chernomor/8-1-0-483
|
|
| |
|