February 10, 20242 yr 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?
February 10, 20242 yr Commercial Member 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 February 10, 20242 yr by Lorby_SI LORBY-SI
February 11, 20242 yr Author 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 February 11, 20242 yr by A320SimPilot
February 11, 20242 yr Commercial Member 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 February 11, 20242 yr by Lorby_SI LORBY-SI
February 11, 20242 yr Author 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!!!
Archived
This topic is now archived and is closed to further replies.