How to Write 'Click VSI Rate?' amounts?

Hey all,


How would one write the XML code for a string that states to raise and lower a Vertical Speed 'rate' amount?

Like if you are doing 400+ FPM Ascent, and you click the button to increase it (say 10 FPM) how would you write that for the command code?

I know this cant be correct, but how would you write it to 'add' to the present amount you are climbing or descending at?
10 (>AP_VS_VAR_INC)

It needs to 'add' to the amount.

Many thanks or any input on how this is done.



Bill
 
Bill,

When autopilot is on I assume..
If using the pure VS/ALT hold then your increase/decrease is limited to the 100s, no lower.
It is automatically rounded off to the nearest 100 & limited to +/- 9900 in the sim, no need for drastic measures.
XML:
<!-- INCREASE VS FROM CURRENT -->
<Click>(A:VERTICAL SPEED, feet per minute) 100 + (>K:AP_VS_VAR_SET_ENGLISH)</Click>

<!-- DECREASE VS FROM CURRENT -->
<Click>(A:VERTICAL SPEED, feet per minute) 100 - (>K:AP_VS_VAR_SET_ENGLISH)</Click>
If you need a higher resolution ( +/- ~10 fpm) then the only way i can think of is using attitude hold and deal with the pitch ref commands.. From what I barely remember :rolleyes: it can get quite complicated. Would have to look back at the F-111 code,,
Somewhere :scratchch

Roman
 
Because of the substantial delay that changes via K:AP_VS_VAR_SET_ENGLISH are actually realized in flight and register as (A:VERTICAL SPEED, feet per minute) there could be some unexpected side effects to this. For instance, using Bill's scenario, you are currently climbing at (A:VERTICAL SPEED, feet per minute) = 400. One click and (A:AUTOPILOT VERTICAL HOLD VAR, feet per minute) will be set to 500. Fine, but click again and the HOLD VAR will remain unchanged until your VSI is at least 450 (450 + 100 + rounding). Edit: Also, suppose your current vsi is 460. Now 460 + 100 + rounding = 600, an unexpected net increase of 140 (not 100).

An alternative option would be to use K:AP_VS_VAR_DEC and K:AP_VS_VAR_INC on their own. They do change (A:AUTOPILOT VERTICAL HOLD VAR, feet per minute) in increments and decrements of 100 irrespective of current vertical speed. Using mouse wheel and buttons you can get both thus:

Code:
(M:Event) 'LeftSingle' scmp 0 == (M:Event) 'WheelDown' scmp 0 == or
    if{ (&gt;K:AP_VS_VAR_DEC) } els{ (&gt;K:AP_VS_VAR_INC) }
 
Last edited:
Manfred,

Yeah, realized the same thing just before sleep.
Fine, but click again and the HOLD VAR will remain unchanged until your VSI is at least 450 (450 + 100 + rounding). Edit: Also, suppose your current vsi is 460. Now 460 + 100 + rounding = 600, an unexpected net increase of 140 (not 100).
Just an idea, a combination of both.
A little over the top, and not tested.
The very first click of AP VS up/down will set the current VSI to the AP VS var, each additional will use AP_VS_VAR_INC/DEC.
Regardless of which the timer gets restarted on each click.
Timer counts down from 5 seconds, after that, the next subsequent click will act like the first click.
Switching from AP VS Up to AP VS Down will also reset the timer, arming a "first click".

XML:
<Macro Name="Tmr">90 (>G:Var@1)</Macro> <!-- (5 seconds) SECONDS * 18 -->

<Update>
        <!-- AP VS "UP" TIMER -->
        (G:Var1) 0 != if{
            (G:Var1) -- 0 max (>G:Var1)
        }
        <!-- AP VS "DOWN" TIMER -->
        (G:Var2) 0 != if{
            (G:Var2) -- 0 max (>G:Var2)
        }
</Update>

<Area Name="AP VS UP"> <!-- INCLUDES DOWN WITH WHEEL -->
    <Cursor Type="UpArrow"/>
    <Click Repeat="Yes" Kind="LeftSingle+WheelUp+WheelDown">
        (M:Event) 'LeftSingle' scmp 0 == (M:Event) 'WheelUp' scmp 0 == || if{
            <!-- RESET THE DOWN TIMER -->
            0 (>G:Var2)
            <!-- IF THIS IS THE FIRST CLICK OR WHEEL THEN SET CURRENT VSI TO VAR, START TIMER -->
            <!-- AFTER FIRST CLICK INCREASE AP VS VAR -->
            <!-- CONTINUALLY UPDATE "UP" TIMER REGARDLESS -->
            (G:Var1) 0 == if{
                (A:VERTICAL SPEED, feet per minute) 100 + (>K:AP_VS_VAR_SET_ENGLISH) @Tmr(1)
            } els{
                (>K:AP_VS_VAR_INC) @Tmr(1)
            }        
        }
     
        (M:Event) 'WheelDown' scmp 0 == if{
            <!-- RESET THE UP TIMER -->
            0 (>G:Var1)
            <!-- IF THIS IS THE FIRST CLICK OR WHEEL THEN SET CURRENT VSI TO VAR, START TIMER -->
            <!-- AFTER FIRST CLICK DECREASE AP VS VAR -->
            <!-- CONTINUALLY UPDATE "DOWN" TIMER REGARDLESS -->
            (G:Var2) 0 == if{
                (A:VERTICAL SPEED, feet per minute) 100 - (>K:AP_VS_VAR_SET_ENGLISH) @Tmr(2)
            } els{
                (>K:AP_VS_VAR_DEC) @Tmr(2)
            }        
        }      
    </Click>
</Area>


<Area Name="AP VS DOWN"> <!-- INCLUDES UP WITH WHEEL -->
    <Cursor Type="DownArrow"/>
    <Click Repeat="Yes" Kind="LeftSingle+WheelUp+WheelDown">
        (M:Event) 'WheelUp' scmp 0 == if{
            <!-- RESET THE DOWN TIMER -->
            0 (>G:Var2)
            <!-- IF THIS IS THE FIRST CLICK OR WHEEL THEN SET CURRENT VSI TO VAR, START TIMER -->
            <!-- AFTER FIRST CLICK INCREASE AP VS VAR -->
            <!-- CONTINUALLY UPDATE "UP" TIMER REGARDLESS -->
            (G:Var1) 0 == if{
                (A:VERTICAL SPEED, feet per minute) 100 + (>K:AP_VS_VAR_SET_ENGLISH) @Tmr(1)
            } els{
                (>K:AP_VS_VAR_INC) @Tmr(1)
            }        
        }
     
        (M:Event) 'LeftSingle' scmp 0 == (M:Event) 'WheelDown' scmp 0 == || if{
            <!-- RESET THE UP TIMER -->
            0 (>G:Var1)
            <!-- IF THIS IS THE FIRST CLICK OR WHEEL THEN SET CURRENT VSI TO VAR, START TIMER -->
            <!-- AFTER FIRST CLICK DECREASE AP VS VAR -->
            <!-- CONTINUALLY UPDATE "DOWN" TIMER REGARDLESS -->
            (G:Var2) 0 == if{
                (A:VERTICAL SPEED, feet per minute) 100 - (>K:AP_VS_VAR_SET_ENGLISH) @Tmr(2)
            } els{
                (>K:AP_VS_VAR_DEC) @Tmr(2)
            }        
        }      
    </Click>
</Area>
 
Last edited:
Thanks guys. I was testing this all day yesterday, trying different things. Working on the entire autopilot as well (having other issues with it) so my apologies for not getting back. What a day... :S

Many thanks Roman for writing that out. I'll check it out as soon as the coffee kicks in. Great to see a timer. I was going to ask about a timer (for something else) and was a little weary. Dont want to ask too much from you all.

I couldnt get anything to work though on pitch yesterday. Hopefully this will work.

I had the autopilot setup where, if you didnt know this, Autopilot in FS auto-selects 'pitch hold' when you turn on the AP Master. There is an over-ride to this in the SDK, a string you put into the AP section. I put that in to cancel 'pitch hold' as it was turning on, but not flipping the rocker. For some reason, my switch that is basically a FS rocker, will not flip on when Pitch is active, so I wrote a code block in my Autopilot Manager system that flips it on if Pitch is on and the rocker is off. That didnt work either.

So it occurred to me. Is it a bug in FS with Autopilot, that pitch hold mode doesnt 'register' even though its on when you first turn on the simulator? If so, perhaps that is why I cannot get VS or AP ATT to change. Its 'asleep' but active, or hidden from the overall FS system. That would explain why the rocker works 'and' why VS changes arent being accepted.
 
By the way, this is the string for the aircraft config that overwrites and sets your options for pitch hold;

default_pitch_mode=0 // This determines the default pitch mode when the autopilot logic is turned on. 0 = None 1 = Pitch Hold (current pitch angle) 2 = Altitude Hold (current altitude)
 
I personally like the 'pitch hold activates when AP master is switched on. Just trying to get the rocker switch to flip on when AP turns on the auto-pitch... :(
 
Bill,

Just trying to get the rocker switch to flip on when AP turns on the auto-pitch...
I believe (A:AUTOPILOT ATTITUDE HOLD, bool) will do it for you.
Keep in mind attitude hold is a "dual channel" system.
From what I can barely remember: ( low on coffee )
When the command (>K:AP_ATT_HOLD_ON) is used it also automatically turns on (>K:AP_WING_LEVELER_ON).
This is from the human clicky interface, not from the aircraft.cfg, where the lateral default mode can also be assigned.
To alleviate this behavior, on your pitch hold rocker.. ( again from a low coffee induced memory bank ) There are some other examples elsewhere in this forum.
To turn on:
<Click>(>K:AP_ATT_HOLD_ON) (>K:AP_WING_LEVELER_OFF)</Click>
To turn off:
<Click>(>K:AP_ATT_HOLD_OFF)</Click>
To toggle:
<Click>(A:AUTOPILOT ATTITUDE HOLD, bool) ! if{ (>K:AP_ATT_HOLD_ON) (>K:AP_WING_LEVELER_OFF) } els{ (>K:AP_ATT_HOLD_OFF) }</Click>

Roman
 
Thanks Roman.. Yep, I think AP_ATT_HOLD_ON is blocking 'adjustment'. The system reads the input on the rocker (clicking) but nothing happens on the ascent / descent. So its just locked up. I'll try a dual system of maybe having the rocker turn on Panel Att Hold and see what that does. I am beginning to think I may have to just have the rocker be a dummy part that doesnt do anything.. . :(

This is what I am running on it right now. I couldnt get things working and thought I would look up the airliners in FSX and see how they did things. Form the 2D popup AP panel in the big Bombardier stock plane, they have code for the VSI adjustment. It was similar to yours. I copied and incorporated it into left/right mouse clicks and wheels. It was working according to the mouse-rect tooltip, but maintained its climbout, no changed in VS.

This is what I was just testing, latest version;

Code:
   <CallbackCode>
            (M:Event) 'LeftSingle' scmp 0 ==
            (M:Event) 'WheelDown' scmp 0 == or
                if{ 0 (>L:LHC CIII PITCH ROCKER,enum)
                                                            1 (&gt;L:XMLSND6,enum)
            0 (>G:Var2)
            (G:Var1) 0 == if{
                (A:VERTICAL SPEED, feet per minute) 100 + (>K:AP_VS_VAR_SET_ENGLISH) @Tmr(1)
            } els{
                (>K:AP_VS_VAR_INC) @Tmr(1)
            }         
        }
            (M:Event) 'RightSingle' scmp 0 ==
            (M:Event) 'WheelUp' scmp 0 ==  or
                if{ 100 (>L:LHC CIII PITCH ROCKER,enum)
                                                                1 (>L:XMLSND6,enum)
            0 (>G:Var1)
            (G:Var2) 0 == if{
                (A:VERTICAL SPEED, feet per minute) 100 - (>K:AP_VS_VAR_SET_ENGLISH) @Tmr(2)
            } els{
                (>K:AP_VS_VAR_DEC) @Tmr(2)
            }         
        }       
            (M:Event) 'RightRelease' scmp 0 ==
            (M:Event) 'LeftRelease' scmp 0 == or
                                                        if{ 50 (>L:LHC CIII PITCH ROCKER,enum)
                                                              1 (>L:XMLSND6,enum) }
   </CallbackCode>
 
I personally like the 'pitch hold activates when AP master is switched on. Just trying to get the rocker switch to flip on when AP turns on the auto-pitch...
In my opinion when doing an advanced AP like the CIII it is best not to have FS's available built in logic to do anything..
Pitch hold on AP power "might" work, yet it may provide an additional headache in coding,
 
Roger that.

Pitch Hold should have been changeable... I have a talent at finding bugs in the sim, and limitations. I choose planes that require things that the sim doesnt seem to be designed for. The fuel system in the early Learjets is a prime example.... :S

Here is the new version animation section for the VC part 'rocker' for Pitch control;

Code:
   <CallbackCode>
            (M:Event) 'LeftSingle' scmp 0 ==
            (M:Event) 'WheelDown' scmp 0 == or
                if{ 0 (>L:LHC CIII PITCH ROCKER,enum)
                                                            1 (&gt;L:XMLSND6,enum) }
            (M:Event) 'RightSingle' scmp 0 ==
            (M:Event) 'WheelUp' scmp 0 ==  or
                if{ 100 (>L:LHC CIII PITCH ROCKER,enum)
                                                                1 (>L:XMLSND6,enum) }
            (M:Event) 'RightRelease' scmp 0 ==
            (M:Event) 'LeftRelease' scmp 0 == or
                                                        if{ 50 (>L:LHC CIII PITCH ROCKER,enum)
                                                              1 (>L:XMLSND6,enum) }
   </CallbackCode>
I took out all the AP coding. Its only the click sound and basic animation input command now.
 
Just had another great idea (no snide remarks please) - how about we add a settable animated 'bug' to our VSI indicating the AUTOPILOT VERTICAL HOLD VAR we want the AP to use? See the HSI on the left in the pic below, with its 'bug' set to N/North? That identical bug added to the VSI on the right plus a suitable twiddle knob (mouse regions on the dial even?? The mind boggles!!), like for the HSI? Okay, it's probably been done already...

 
That is brilliant, Manfred. That would be a cool feature and for testing would show you whats going on. Would also be cool to add a red diode light on it that is invisible normally and would illuminate when active.
 
Top