1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ALT Set in 100's and 1000's

Discussion in 'Gauges' started by lionheart, 26 Aug 2015.

  1. lionheart

    lionheart

    Joined:
    24 Oct 2005
    Messages:
    8,123
    Country:
    us-arizona
    Can one have ALT setting code that will set in 100's and another that sets in 1000's increments?

    For instance, I can only find AP_ALT_VAR_INC and AP_ALT_VAR_DEC

    Can one write; AP_ALT_VAR_INC_100 and AP_ALT_VAR_INC_1000?


    Bill
    LHC
     
  2. spokes2112

    spokes2112

    Joined:
    2 Nov 2010
    Messages:
    197
    Country:
    us-wisconsin
    Left click = +/- 100 while right click = +/- 1000

    Code:
    <Click Kind="LeftSingle+RightSingle" Repeat="Yes">(M:Event) 'LeftSingle' scmp 0 == if{
    (A:AUTOPILOT ALTITUDE LOCK VAR, feet) 100 - }
    els{ (A:AUTOPILOT ALTITUDE LOCK VAR, feet) 1000 - }
    0 max (&gt;K:AP_ALT_VAR_SET_ENGLISH)</Click>
    
    <Click Kind="LeftSingle+RightSingle" Repeat="Yes">(M:Event) 'LeftSingle' scmp 0 == if{
    (A:AUTOPILOT ALTITUDE LOCK VAR, feet) 100 + }
    els{ (A:AUTOPILOT ALTITUDE LOCK VAR, feet) 1000 + }
    60000 min (&gt;K:AP_ALT_VAR_SET_ENGLISH)</Click>
     
    antaris and rpmc like this.
  3. lionheart

    lionheart

    Joined:
    24 Oct 2005
    Messages:
    8,123
    Country:
    us-arizona
    Brilliant! Many thanks Sir.
     
  4. COBS

    COBS

    Joined:
    31 Aug 2009
    Messages:
    416
    Country:
    australia
    This is what I use in AP ,
    the mouse wheel enables rapid setting .
    Just another way to do it.

    Code:
            <!--ALT SET-->
    <Macro Name="Plus1000">
    (A:AUTOPILOT ALTITUDE LOCK VAR,feet) 1000 +
    </Macro>
    
    <Macro Name="Minus1000">
    (A:AUTOPILOT ALTITUDE LOCK VAR,feet) 1000 -
    </Macro>
    
    <Macro Name="Button1">(M:Event) 'RightSingle' scmp 0 == if{ (>K:AP_ALT_VAR_INC) }
            (M:Event) 'LeftSingle' scmp 0 ==  if{ (>K:AP_ALT_VAR_DEC) }
            (M:Event) 'WheelUp' scmp 0 == if{ @Plus1000 (>K:AP_ALT_VAR_SET_ENGLISH) }
            (M:Event) 'WheelDown' scmp 0 == if{ @Minus1000 (>K:AP_ALT_VAR_SET_ENGLISH) }</Macro> 
        <Area Left="171" Top="62" Width="60" Height="25">
      <Tooltip>Set ALT</Tooltip>
      <Click Kind="LeftSingle+RightSingle+WheelUp+WheelDown" Repeat="Yes">@Button1</Click>
      <Cursor Type="Hand" />
      </Area>
    Cheers
    Karol
     
  5. lionheart

    lionheart

    Joined:
    24 Oct 2005
    Messages:
    8,123
    Country:
    us-arizona
    Many thanks Karol.
     
  6. delivery guy

    delivery guy

    Joined:
    31 Jan 2010
    Messages:
    1,498
    Country:
    unitedstates
    COBS can you make a wheel rate increase with custom lvars with max limits. Tried a few methods with the samples below with no luck.

    (L:custom,number) @@Minus - 100 max (>L:custom,number)
    (L:custom,number) @PLUS + 1799 min (>L:custom,number)

    (L:custom,number) -- @Minus100 max (>L:custom,number)
    (L:custom,number) ++ @PLUS1799 min (>L:custom,number)
     
  7. COBS

    COBS

    Joined:
    31 Aug 2009
    Messages:
    416
    Country:
    australia
    There probably would be several ways of doing that,
    you could even have a series of graded click zones , such as ,
    Code:
    (A:AUTOPILOT ALTITUDE LOCK VAR,feet) 7000 +
    (A:AUTOPILOT ALTITUDE LOCK VAR,feet) 5000 +
    (A:AUTOPILOT ALTITUDE LOCK VAR,feet) 3000 +
    (A:AUTOPILOT ALTITUDE LOCK VAR,feet) 1000 +
    But I'm sure there would be better ways , never tried to speed it up beyond the 1,000' wheel function .

    Cheers
    Karol
     
  8. delivery guy

    delivery guy

    Joined:
    31 Jan 2010
    Messages:
    1,498
    Country:
    unitedstates
    I now want to write a custom AUTOPILOT ALTITUDE LOCK VAR for a new project and the same issue i need rapid tuning. This is for the Model.Def so not sure we can use a Macro. I see above how a macro for a 2D gauge will work.

    Just like my old post above i need a way to rapid tune for LVARS. Can this be done? Is there a working sample you can share?
     
    Last edited: 19 Apr 2017
  9. COBS

    COBS

    Joined:
    31 Aug 2009
    Messages:
    416
    Country:
    australia
    Where you would put " @Macro Title" in the Switch function , replace it with the full code contents of that Macro .

    Have you considered doing 3 switch functions , such as ,
    (1) single click area ,
    Left click = +/- 100
    Middle click = +/- 1000
    Right click = +/- 10000

    or

    (2) 3 click areas , each left click
    100....... 1000.....10000

    Both the above would be easy to do , you would repeat
    (>K:AP_ALT_VAR_SET_ENGLISH) for each of the 1000 and 10000 .
    similar to Post #4 above only Macro contents in full into the Click .

    All above switches should have REPEAT , so that you click and hold .

    One problem with rapid REPEAT tuning is that it is all too easy to overshoot your required input altitude figure , very frustrating !!!

    Cheers
    Karol
     
  10. COBS

    COBS

    Joined:
    31 Aug 2009
    Messages:
    416
    Country:
    australia
    I realised that to implement (1) in my previous post would require 6 different Click kind , that's too many for the operator to remember.

    I reduced it to just ,
    +/_ 100
    and
    +/- 10000
    then I got rid of the Macros and tested it in my autopilot , works a treat !

    Clicking and holding down the 100 (ft ) increments very rapidly , so the +/_ 1000 was not necessary .
    the Wheel up / Wheel down for 10,000 ( ft ) sets large changes nicely .
    Basically you have a Coarse and fine adjustment available , and it's all very rapid .

    Tested code is ,
    Code:
            <!--ALT SET-->
        <Area Left="171" Top="62" Width="60" Height="25">
      <Tooltip>Set ALT</Tooltip>
      <Click Kind="LeftSingle+RightSingle+WheelUp+WheelDown" Repeat="Yes">
            (M:Event) 'RightSingle' scmp 0 == if{ (>K:AP_ALT_VAR_DEC) }
            (M:Event) 'LeftSingle' scmp 0 ==  if{ (>K:AP_ALT_VAR_INC) } 
            (M:Event) 'WheelUp' scmp 0 == if{ (A:AUTOPILOT ALTITUDE LOCK VAR,feet) 10000 + (>K:AP_ALT_VAR_SET_ENGLISH) }
            (M:Event) 'WheelDown' scmp 0 == if{ (A:AUTOPILOT ALTITUDE LOCK VAR,feet) 10000 - (>K:AP_ALT_VAR_SET_ENGLISH) }</Click>
      <Cursor Type="Hand" />
      </Area>
    Cheers
    Karol

    PS ;
    Where I have used 10,000 ( ft ) I presume that you could use any figure ie; 5,000 ( ft) .
     
    Last edited: 19 Apr 2017
  11. delivery guy

    delivery guy

    Joined:
    31 Jan 2010
    Messages:
    1,498
    Country:
    unitedstates
    I already aware i can use different click options for getting the task done. But it sure would be awesome to have rapid tuning since default coding has it for 3D gauges.

    If i have to go this route i think your last suggestion for 5,000 feet per click would be the way to go.

    And according to what your saying i can't have rapid tuning in the model.def xml code?
     
  12. vololiberista

    vololiberista

    Joined:
    24 Aug 2009
    Messages:
    1,396
    Country:
    italy
    This is the mouse code for the steering tiller on the VC10. The mouse wheel is rolled backwards and forwards with each click being an increment so to speak which you can see in the code.
    Code:
    <Mouse>
    <Tooltip>Nose Wheel Tiller</Tooltip>
    <Area Left="0" Top="0" Width="120" Height="138">
        <Cursor Type="Hand"/> 
    <Click Kind="LeftSingle+RightSingle+WheelDown+WheelUp">
    
    (M:Event) 'LeftSingle' scmp 0 == if{ (A:GROUND VELOCITY, knots) 60 &lt; 1 (>L:steering_lock,bool) }
    
    (M:Event) 'WheelDown' scmp 0 == if{ (A:GROUND VELOCITY, knots) 60 &lt; (L:steering_lock,bool) 1 == and
    if{ (L:steering,number) 0.02268 + (>L:steering,number) (L:steering,number) + 16384 * (>K:RUDDER_SET) } }
    
    (M:Event) 'RightSingle' scmp 0 == if{ 1 (>K:RUDDER_CENTER) 0 (>L:steering_lock,bool) 0 (>L:steering,number) }
    
    (M:Event) 'WheelUp' scmp 0 == if{ (A:GROUND VELOCITY, knots) 60 &lt; (L:steering_lock,bool) 1 == and
    if{ (L:steering,number) 0.02268 - (>L:steering,number) (L:steering,number) + 16384 * (>K:RUDDER_SET) } }
        </Click>
        </Area>
    </Mouse>
     
  13. COBS

    COBS

    Joined:
    31 Aug 2009
    Messages:
    416
    Country:
    australia
    Regards your " .....to have rapid tuning since default coding has it for 3D gauges."
    How does that work ?
    For example you might want to set the autopilot to 31,100' , how do you stop the rapid tuning on that exact altitude ?

    I have never dealt with model.def xml code , but my guess is that it would be possible to have a working rapid tuning in it .

    Cheers
    Karol
     
  14. delivery guy

    delivery guy

    Joined:
    31 Jan 2010
    Messages:
    1,498
    Country:
    unitedstates
    I forgot that altitude set or lock goes by 100 feet. So don't really need rapid tuning although it would be nice.
    I have a working code so L/R Click is 1000 feet and Wheel is 100 feet. And it does not take long to just use the wheel.
    No need for 5000.
    Thanks for the help.

    The reason i wanted to go custom for this digital altitude set gauge is because FSX does not let you use altitude hold mode with altitude set mode off.
    So this way if the switch for the selector is off i can tell the default code to be zero so the autopilot will not capture the altitude in the display.
    And when the switch is back on then the custom value will send itself to the default value and the altitude can capture.
    This aircraft has SPD hold and VS hold that can be used without ALT/SEL mode on. So this solution works perfectly.
     
  15. spokes2112

    spokes2112

    Joined:
    2 Nov 2010
    Messages:
    197
    Country:
    us-wisconsin
    FWIW -
    The first three commands set the current altitude to the alt select window.
    The last four allow an alt set window to be at whatever one wants and once engaged the AP will try for that alt.

    (>K:AP_ALT_HOLD)
    (>K:AP_ALT_HOLD_OFF)
    (>K:AP_ALT_HOLD_ON)

    (>K:AP_PANEL_ALTITUDE_HOLD)
    (>K:AP_PANEL_ALTITUDE_OFF)
    (>K:AP_PANEL_ALTITUDE_ON)
    (>K:AP_PANEL_ALTITUDE_SET)
     
  16. delivery guy

    delivery guy

    Joined:
    31 Jan 2010
    Messages:
    1,498
    Country:
    unitedstates
    I remember learning this 2 times in the past and forgot as i have not really ever needed it until now.
    Now that you reminded me it all makes sense.
    My beta friend and I decided to keep this new custom LVar method due to how we like how it tunes the altitude setting and since we have several modes that turn on the altitude hold it's easier on the coding to use our custom method to enable disable the capture mode.
     
    Last edited: 22 Apr 2017
  17. delivery guy

    delivery guy

    Joined:
    31 Jan 2010
    Messages:
    1,498
    Country:
    unitedstates
    Spokes i am trying this method you posted for the first time as we might not use the custom Lvar for the altitude selector.
    But when i turn on the (>K:AP_PANEL_ALTITUDE_HOLD) it's still capturing the altitude from the selector.
    Any reason why? Do i need to add code to the aircraft.cfg? Or edit something else?

    Re reading your post i am confused. Because this statements says different than what your saying. I never heard of the current altitude being inputed to the selector.
    KEY_AP_PANEL_ALTITUDE_ON Turns altitude hold mode on (without capturing current altitude)

    I want the autopilot to ignore any value in the altitude selector. This statement makes me think that. We need a mode that turns off any capture mode. But still holds the VS setting.
     
  18. delivery guy

    delivery guy

    Joined:
    31 Jan 2010
    Messages:
    1,498
    Country:
    unitedstates
    Bill Leaming posted this from another post and this makes more sense. Which means this has nothing to do with what we need.
    So i think we are going to keep using our new custom system which is almost finished.
    This option just prevents the current altitude to be captured so you can enter a new value. I am not even sure I have used an aircraft that uses this option.:mischievo

    Use the following pair when you have an altitude preselected.

    AP_PANEL_ALTITUDE_ON
    .....Turns altitude hold mode on (without capturing current altitude)
    AP_PANEL_ALTITUDE_OFF
    .....Turns altitude hold mode off

    Use the following pair when you want immediate, current altitude hold.
    AP_ALT_HOLD_ON
    .....Turns altitude hold mode on (captures current altitude)
    AP_ALT_HOLD_OFF
    .....Turns off altitude hold mode
     
  19. rcbarend

    rcbarend

    Joined:
    3 Apr 2014
    Messages:
    202
    Country:
    netherlands
    Maybe some more explanation (as far as I'm aware, but someone will correct me if I'm wrong) for the default AP AltHold and V/S-Hold functions..

    First, the only difference between AP_PANEL_ALTITUDE_ON and AP_ALT_HOLD_ON is:
    - AP_PANEL_ALTITUDE_ON will hold the altitude currently in the altitude Selector A:AUTOPILOT ALTITUDE LOCK VAR
    - AP_ALT_HOLD_ON does the same, except that it (automatically) will first set A:AUTOPILOT ALTITUDE LOCK VAR to the current altitude (hence holding the current altitude).

    Second, as far as I know, FSX doesn't have an independant V/S-Hold; so without AP-Master ON and AltHold ON, the V/S selector does nothing.
    There simply isn't any event that sets V/S-hold.
    But you can easily simulate a V/S-hold function by:
    - Write a very low value (like 0) when V/S should be negative, or a very high value (like 50000) when V/S should be positive, with event AP_ALT_VAR_SET_ENGLISH
    - event AP_PANEL_ALTITUDE_ON
    - Write the calculated V/S (or current V/S) to the V/S selector, with event AP_VS_VAR_SET_ENGLISH

    After that, the simpilot can freely change the V/S Selector with mouseclicks generating events AP_VS_VAR_INC and AP_VS_VAR_DEC.
    Of course you have to add some logic to the ALtHold button and AltHold Selector clickspots and displays, because if you implement a V/S-Hold function this way, AltHold should appear to be OFF for the pilot (while it's actually ON) and the ALtHold Selector display (0 or 50000) has no meaning to the pilot.

    Rob
     
  20. delivery guy

    delivery guy

    Joined:
    31 Jan 2010
    Messages:
    1,498
    Country:
    unitedstates
    We tested both autopilot hold events and both seem to have no difference with this aircraft setup. The AP_ALT_HOLD_ON is not taking the current altitude and entering it into the selected altitude. So i wonder if there is a default aircraft that this can be tested on.

    Your right and we made our own custom Lvar to send the value to the default A:AUTOPILOT ALTITUDE LOCK VAR. This allows us to have the ALT/SEL independent.
    But you have to be careful and make sure you put this code into the model.def so there is no flooding. And yes we tell the AP_ALT_VAR_SET_ENGLISH to be zero when off.
    But we found if you use this event AP_ALT_VAR_SET_ENGLISH you can have issues with the AP_VS_VAR_SET_ENGLISH changing from a positive value to a negative value if the aircraft is higher than the selected altitude value. And the reason for this is because we do not have a autopilot pitch trim wheel for pitch. We have a system where you pitch the aircraft then send the vertical speed to the AP_VS_VAR_SET_ENGLISH to hold pitch. And since we are not updating the values they can get reversed based on your current altitude and the selected altitude.

    So we make sure the code is hard coded and the AP_ALT_VAR_SET_ENGLISH value is zero until the pitch modes are on. Now the value will stay positive. Hard to explain but once you design the system then test it then you will find out why we had to work this out until we came up with a solution.

    Another way to explain it is if you have a pitch of 800FPM up and your altitude is higher than the selected altitude and you turn the ALT/SEL on and have the custom LVAR send a value to the AP_ALT_VAR_SET_ENGLISH set code the system is going to think we need to descend and take the 800FPM and make it -800FPM. So just make sure the alt hold mode is on before any values can be sent to the AP_ALT_VAR_SET_ENGLISH set code. This way no matter what altitude your at AP_VS_VAR_SET_ENGLISH set is saying to hold this value.
     

Share This Page