4.5.3. Joystick control

4.5.3.1. General information

Controller accepts an input from an analog joystick with voltage in 0-3 V range. Voltage in the equilibrium (central) position and voltage in minimum and maximum position can be set to any value from the working range, if the following condition holds: minimum position < central position < maximum position. Controller uses digital representation of joystick input values: 0 V corresponds to a value of 0 and 3.3 V corresponds to a value of 10000.

To stop movement in the central position a DeadZone option is available, which is counted from the central position and measured in percent. Any joystick position inside DeadZone leads to the stopping of the movement by the controller. A larger than DeadZone deviation of the stick starts controller movement with the speed which is calculated from the deviation. The DeadZone ranges are illustrated on the following picture.

../../../_images/range25p1.png

One can reverse the joystick with a reverse flag which can be useful to keep “right joystick offset means movement to the right” correspondence for any physical orientation of the joystick and the stage.

Movement speed has an exponential dependence on joystick deviation from the center. This enables one to reach high precision through small joystick shifts and high speed through large ones. Nonlinearity parameter (Exp factor) can be varied. If the nonlinearity parameter is zero, then the motor speed will linearly depend on joystick position.

The following graph shows dependence of movement speed on joystick position for the following settings:

Central deviation 4500
Minimum deviation 500
Maximum deviation 9500
Dead zone \(10\%\)
Maximum movement speed 100
../../../_images/ExpJoystick1.png

An example of motion speed dependence on joystick deviation

Sometimes exponential joystick response which combines high accuracy and high speed is not enough. That’s why controller supports maximum speed table. User can switch between these speeds using Left-Right buttons control. In case of right key press maximum speed is changed from Max speed[i] to Max speed[i+1]. In case of left key press maximum speed is changed from Max speed[i+1] to Max speed[i]. Controller starts with i=0. There are 10 values in the speed array. If both integer and fractional parts of Max speed[x] are equal to zero then it isn’t possible to switch to this speed from Max speed[x-1]. This is made so that a user can limit speed array size. An attempt to get out of array bounds will also lead to nothing.

Controller has contact debouncing on control buttons. For keypress to register button press should last longer than 3 ms.

If joystick sits within dead zone for more than 5 seconds it will be logically considered to be out of DeadZone only when it has been physically out of DeadZone for more than 100 ms. This allows user to release joystick and to be confident that even occasional noise on joystick output won’t lead to unnecessary motor motion. While joystick is within Dead zone the controller can receive any commands from computer including motion commands, home position calibration commands, etc. If during command execution joystick is brought of Dead zone the motion command is canceled and motor is switched to joystick control. This allows the user to turn on joystick control mode and use it only when necessary.

Everything that is related to movement under the control of controller commands is also applicable to joystick movement. This includes acceleration, maximum speed limit, windings poweroff delay, magnetic brake, backlash compensation, etc. For example, if you suddenly release joystick handle and let it return into the DeadZone, then, if corresponding modes are on, controller will gradually slow the motor, make a backlash compensation motion, stop the motor, fix the motor shaft with the magnetic brake, smoothly reduce current and switch off windings power.

MaxSpeed[i] and DeadZone parameter change is described in Settings of external control devices.

Important

In Joystick control mode, the physical and virtual buttons remain in working order

Warning

Do not disconnect or connect the joystick to the switched on controller!
When disconnecting/connecting the joystick to the enabled controller, the joystick or controller will not burn, but the stages connected to the controller will start moving to the limit switches.

4.5.3.2. Connection diagram

Important

Analog inputs for joystick connection are designed for a range of 0-3.3 V. Be careful and do not exceed voltage for joystick contacts.

4.5.3.2.1. Controller board

A contact for joystick control is located on the BPC connector.

../../../_images/Joystickboard.png

Connection of joystick to the controller board via BPC connector

4.5.3.2.2. One-axis and two-axis systems

Joystick connector is available only in two-axis system. A connection diagram is shown below.

../../../_images/Joystick2axis.png

Connection of joystick to the two-axis system via D-SUB 9 pin connector