Joystick Functions
The joystick is a feature of the controller that allows for manual control of motion. Through a series of configurable parameters and AeroScript functions, the output signals of a joystick can be mapped to control individual motion axes.
Joystick Configuration
I/O
The joystick consists of three buttons and up to three analog inputs. The parameters JoystickAxesSelect and JoystickSpeedSelect are used to map the buttons of the joystick to digital inputs. The parameters JoystickInput0, JoystickInput1, and JoystickInput2 are used to map the analog signals produced by joystick deflection to analog inputs. See the tables that follow for information regarding the analog and digital I/O configuration for specific drives.
The joystick features a configurable interlock via the JoystickInterlock parameter. This parameter is used to configure a digital input that must be enabled in order for the joystick to operate. If the interlock is opened at any point, joystick motion will be halted.
I/O Parameters:
- JoystickAxesSelect Parameter
- JoystickSpeedSelect Parameter
- JoystickInput0 Parameter
- JoystickInput1 Parameter
- JoystickInput2 Parameter
- JoystickInterlock Parameter
Table: Table: Joystick Buttons
Button Name | Description | Parameters |
---|---|---|
A | Use this button to cycle through axis groups that have been added by the JoystickAxisGroupAdd() function. | JoystickAxesSelect |
B | Use this button to change between the axis speeds specified by the JoystickLowSpeed and JoystickHighSpeed axis parameters. | JoystickSpeedSelect |
C | Use this button to deactivate the joystick. | JoystickAxesSelect and JoystickSpeedSelect |
Table: I/O Configuration for FLEX, iXA4, XA4, iXC2, XC2, iXC2e, XC2e, iXC4, XC4, iXC4e, XC4e, iXC6e, XC6e, iXI4, XI4, iXL2e, XL2e, iXL5e, and XL5e
Parameter Name | Input Type | Axis | Input Number |
---|---|---|---|
JoystickInput0 | Analog | The values for Axis and Input Number are different for different system configurations. | |
JoystickInput1 | Analog | ||
JoystickAxesSelect | Digital | ||
JoystickSpeedSelect | Digital | ||
JoystickInterlock | Digital |
Table: I/O Configuration for iXR3 and XR3
Parameter Name | Input Type | Axis | Input Number |
---|---|---|---|
JoystickInput0 | Analog | 0 | 0 |
JoystickInput1 | Analog | 0 | 1 |
JoystickAxesSelect | Digital | 0 | 16 |
JoystickSpeedSelect | Digital | 0 | 17 |
JoystickInterlock | Digital | 0 | 18 |
Voltage Settings
Calculate the center voltage for a joystick input by using the MinVoltage and MaxVoltage parameters. The MinVoltage and MaxVoltage defaults are set to 0V and 5V, which gives a central voltage of 2.5V. Use the Deadband parameters to specify a voltage range in which the joystick is in the center position and no motion occurs. The default Deadband parameters are set to 0.1V, which means that motion will not occur when the joystick voltage is between 2.4V and 2.6V. When you first issue the JoystickRun() function, the joystick (including Joystick Buttons A, B, and C) is not active and will not take control of the axes until all joystick analog inputs are within the deadband range.
After you issue the JoystickRun() function and the joystick is controlling the axes, Joystick Buttons B and C will function at any time. However, Button A will only function if the joystick is in the deadband when you press the button.
Voltage Parameters
- JoystickInput0MinVoltage Parameter
- JoystickInput0MaxVoltage Parameter
- JoystickInput0Deadband Parameter
- JoystickInput1MinVoltage Parameter
- JoystickInput1MaxVoltage Parameter
- JoystickInput1Deadband Parameter
- JoystickInput2MinVoltage Parameter
- JoystickInput2MaxVoltage Parameter
- JoystickInput2Deadband Parameter
Feedrate Settings
The controller supplies two speed ranges that can be configured via the JoystickLowSpeed and JoystickHighSpeed parameters. Use these parameters to set the speed of the axis when under joystick control in the specified speed range. The value of these parameters sets the maximum speed of the axis in this mode, which occurs at maximum joystick deflection. Setting the value of these parameters to a negative number reverses the direction of joystick motion on this axis.
When you activate the joystick, the joystick initially operates in the low speed range. To change between the low and high-speed ranges, use the joystick button defined by the JoystickSpeedSelect parameter (typically Joystick Button B). When the joystick is in low speed mode, the Joystick Low Speed Active bit of the TaskStatusItem.TaskStatus0 changes to ON.
Feedrate Parameters
Axis Groups
An Axis Group represents a single mapping of motion axes to joystick inputs. The JoystickInput enum represents an analog input from the joystick and is used with the JoystickAxisGroupAdd() function to configure new axis groups. If you do not add any new axis groups, you will receive a task error when you activate the joystick via the JoystickRun() function. All axis groups can be reset by issuing the JoystickAxisGroupRemoveAll() function.
enum JoystickInput
Input0 = 0 Input1 = 1 Input2 = 2 end |
function JoystickAxisGroupAdd($motionAxes[] as axis, $joystickInputs[] as JoystickInput)
Adds an axis group configuration to the joystick configuration.
Arguments
$motionAxes An array of one or more axes to control with the joystick.
$joystickInputs An array of one or more joystick inputs to use to control axes.
function JoystickAxisGroupRemoveAll()
Removes all axis group configurations from the joystick configuration.
Joystick Operation
Movement and Control
To gain control of the axes, issue the JoystickRun() function. This will transfer control of motion to the joystick on all axes in the current axis grouping. Axes that are under joystick control will be highlighted in yellow in Automation1 Studio. JoystickRun() is a blocking function, preventing further execution of the AeroScript program until one of the following occurs:
- The cancel button is pressed on the joystick.
- The joystick interlock is opened. Refer to JoystickInterlock Parameter
- Motion is aborted on an axis under joystick control.
function JoystickRun()
Activates the joystick.
Joystick Status
When the JoystickRun() function is executed, the Joystick Control bit of AxisStatusItem.AxisStatus changes to ON for each axis status that the joystick stick is controlling. While the JoystickRun() function is active and the joystick stick has entered the deadband voltage range a minimum of one time, the Joystick Active bit of TaskStatusItem.TaskStatus0 changes to ON for that task. If you are using multiple axes, all of the axes must be in the deadband range.
The joystick does not control the axes and Joystick Button A does not operate until the joystick has entered the deadband voltage range a minimum of one time. You can use Joystick Button B and Joystick Button C when the joystick is inside or outside of the deadband range.