Jump to content
Sign in to follow this  
A320SimPilot

Axis Double assignment

Recommended Posts

Hello

Can I make a double assignment on a joystick axis where only one of the two is energized depending on whether a condition is met or not?

For example, i would like to assign brakes and spoilers to my joystick axis.  Brakes on the ground (AGL 0 or near 0) and spoilers when AGL>0.  Is this possible?

Share this post


Link to post
Share on other sites
1 hour ago, A320SimPilot said:

Hello

Can I make a double assignment on a joystick axis where only one of the two is energized depending on whether a condition is met or not?

For example, i would like to assign brakes and spoilers to my joystick axis.  Brakes on the ground (AGL 0 or near 0) and spoilers when AGL>0.  Is this possible?

Only with scripts. You create one single assignment, and that calls a script. In the script use the script variable to read the value from the axis and then actuate the desired axis event depending on your condition.

Untested, off the top of my head.

Script title : AutoSpoilerBrakes
Script group: Test
Script code: (A:PLANE·ALT·ABOVE·GROUND,·Feet)·0·==·if{·(L:Test-AutoSpoilerBrakes)·(>K:AXIS_SPOILER_SET)·}·els{·(L:Test-AutoSpoilerBrakes)·d·(>K:AXIS_LEFT_BRAKE_SET)·(>K:AXIS_RIGHT_BRAKE_SET)·}

This script you assign to the axis (it is in the Events list) and set Axis Min = -16383 and Axis Max = 16383, Rounding "int".

Be careful with the naming. When you rename the group or the script you have to rename the script variable too (L:Test-AutoSpoilerBrakes) this is "(L:scriptgroup-scripttitle)"
Also, be mindful that you may have to change the condition - PLANE ALT ABOVE GROUND is, as far as I know, the distance between the ground and the datum reference point of the aircraft 3D model (=not the "bottom of the wheels") You may have to compensate for that, for example "when alt above ground is less than 20 feet")

But - don't you need spoilers and brakes at the same time upon touchdown?

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
17 hours ago, Lorby_SI said:

Only with scripts. You create one single assignment, and that calls a script. In the script use the script variable to read the value from the axis and then actuate the desired axis event depending on your condition.

Untested, off the top of my head.

Script title : AutoSpoilerBrakes
Script group: Test
Script code: (A:PLANE·ALT·ABOVE·GROUND,·Feet)·0·==·if{·(L:Test-AutoSpoilerBrakes)·(>K:AXIS_SPOILER_SET)·}·els{·(L:Test-AutoSpoilerBrakes)·d·(>K:AXIS_LEFT_BRAKE_SET)·(>K:AXIS_RIGHT_BRAKE_SET)·}

This script you assign to the axis (it is in the Events list) and set Axis Min = -16383 and Axis Max = 16383, Rounding "int".

Be careful with the naming. When you rename the group or the script you have to rename the script variable too (L:Test-AutoSpoilerBrakes) this is "(L:scriptgroup-scripttitle)"
Also, be mindful that you may have to change the condition - PLANE ALT ABOVE GROUND is, as far as I know, the distance between the ground and the datum reference point of the aircraft 3D model (=not the "bottom of the wheels") You may have to compensate for that, for example "when alt above ground is less than 20 feet")

But - don't you need spoilers and brakes at the same time upon touchdown?

Thank you for this.  I installed it during cruise  but unfortunately I have brakes while in the air.  I have to wait to land and see if i will have spoilers (the opposite from what i want)

To answer your question, no i don't ... brakes and spoilers work automatically  upon touchdown in the A320, you just have to arm them 🙂

Edited by A320SimPilot

Share this post


Link to post
Share on other sites
7 minutes ago, A320SimPilot said:

(the opposite from what i want)

You are right, the script is backwards. Let's make that "everything above 30 feet means spoilers". That should also compensate for any CG to ground offset in the AGL variable.

(A:PLANE·ALT·ABOVE·GROUND,·Feet)·30·>·if{·(L:Test-AutoSpoilerBrakes)·(>K:AXIS_SPOILER_SET)·}·els{·(L:Test-AutoSpoilerBrakes)·d·(>K:AXIS_LEFT_BRAKE_SET)·(>K:AXIS_RIGHT_BRAKE_SET)·}

7 minutes ago, A320SimPilot said:

you just have to arm them

It is entirely possible that the script will override that and disarm + lower the spoilers. A lot more code may be necessary. But the "above 30 feet" thing should compensate for that as well, because you won't thouch the speed brakes lever at that point anyway - right?

I still think that you need some other assignment that will lower the speed brakes when you've slowed down. Because as long as you are on the ground, the lever will no longer control them?

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
3 minutes ago, Lorby_SI said:

You are right, the script is backwards. Let's make that "everything above 30 feet means spoilers". That should also compensate for any CG to ground offset in the AGL variable.

(A:PLANE·ALT·ABOVE·GROUND,·Feet)·30·>·if{·(L:Test-AutoSpoilerBrakes)·(>K:AXIS_SPOILER_SET)·}·els{·(L:Test-AutoSpoilerBrakes)·d·(>K:AXIS_LEFT_BRAKE_SET)·(>K:AXIS_RIGHT_BRAKE_SET)·}

It is entirely possible that the script will override that and disarm + lower the spoilers. A lot more code may be necessary.

Yesssss

I have spoilers now, i am approaching for landing.  Will let you know if there is an issue with the disarming

Thank you so much!!!

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...