Manuals/T-JOY
From ZaberWiki
[edit] Disclaimer
Zaber’s devices are not intended for use in any critical medical, aviation, or military applications or situations where a product's malfunction or failure could cause personal injury, death, or damage to equipment. Zaber disclaims any and all liability for injury or other damages resulting from the use of our products.
[edit] Specifications
The following specifications are specific to T-JOY devices
| Current Draw: | 50 mA |
| Joystick Controllable Axes: | 3 |
| User Configurable Buttons: | 5 |
| Visual Feedback: | Power LED (green) and Com LED (yellow) |
| Dimensions: | 200 x 122 x 102 mm (L x W x H) |
| Weight: | 350g |
[edit] Compatibility
| Device | Firmware version | Compatibility |
| T-CON | All | None |
| All T-Series except T-CON | 1.00 to 4.99 | None |
| All T-Series except T-CON | 5.00 to 5.03 | Partial* |
| All T-Series except T-CON | 5.04 and up | Full |
* T-Series devices with firmware version 5.00 to 5.03 may be used with the T-JOY, however their command set lacks two useful instructions that were added in version 5.04: Save Current Postion, and Go To Saved Position. These instructions are particularly useful in conjunction with the T-JOY since any button on the T-JOY may be programmed to issue these instructions to all connected units in order to store and recall a position in 3 dimensional space.
[edit] Firmware Version Information
The version of firmware installed on any Zaber T-Series device can be determined by issuing command #51. A three-digit number will be returned. Assume 2 decimal places (ex a reply of 504 indicates firmware version 5.04). This user’s manual applies only to T-JOY devices with firmware version 5.04 and up. This is the most recent version as of this printing; however newer firmware versions may have since been released. Due to the addition of new features, newer versions of firmware may not be 100% compatible with older versions. For more information on firmware versions that may have been released since the printing of this manual, please check the support section of Zaber’s website where user’s manuals for all versions of firmware are posted for download.
[edit] Precautions
Zaber devices are precision instruments and must be handled with care. Avoid using excessive force or rapid motion when manipulating the joystick or buttons. Do not force the connectors; when properly aligned, only a gentle force should be needed to achieve connection.
[edit] Initial Setup and Testing
When you first receive your T-JOY, you may wish to perform a few simple steps to familiarize yourself with its operation. First you will need a power supply. If you did not order one with your device, you will require a power supply with output voltage between 10 and 16V DC. The power input accepts a standard 2.1mm center positive connector. Most unregulated 12V AC-to-DC adapters output around 16V under light current draw, dropping to 12V at their rated current. Some may output higher voltages and will not be suitable. The chosen power supply must also be rated to handle the maximum total current draw of the devices connected to it. For example, if you have one T-JOY joystick and 2 T-LA28A actuators daisy-chained together with a single power supply, you will need at least 690 mA (50mA for the joystick and 320 mA for each actuator). The current draw of each device is given in the specifications section of the user’s manual for the device. When powering long chains of devices, we recommend connecting a power supply to every second or third device in the chain to reduce the current through the data cables.
Once you have a working power supply, you can test the operation of the T-JOY. Connect the power supply to the joystick and ensure that the green LED turns on indicating power. Move the joystick from left to right, forward and back, and rotate the handle counterclockwise and clockwise. Also try pressing the buttons. As you perform each of these actions you should notice the yellow LED blinking indicating communications are taking place. Each blink corresponds to a single instruction being sent by the joystick.
This is the extent of the testing you can perform without connecting other devices to interpret and execute the instructions being sent by the T-JOY, or connecting a computer to communicate with the T-JOY.
[edit] Installation
During normal operation, the T-JOY joystick does not need to be connected to a computer, however, it must be connected to a computer initially in order to change it’s settings (for example to change button functions from the defaults or to change what additional devices will be controlled by each axis of the joystick). Devices that will be used with the joystick must also be connected so that the computer may issue a renumber instruction which assigns all connected devices a unique device number. This is necessary so that the T-JOY can direct instructions to the appropriate device to control the correct axis of motion.
Connect the device to a computer as follows:
| Installation | ||
1. Plug the Mini-DIN to D-Sub serial adapter into your computer’s serial port and plug the longer T-JOY data cable (male end) into the adapter. You may need to use a cable extension to reach your computer. There is no need to power-down or reboot the computer. USB-to-RS232 converters are available if you have no RS232 serial port.
2. Connect at least one additional T-Series device to the shorter T-JOY data cable (female end). Connect the power plug of your power supply (2.1mm center positive) to the power connector of the T-JOY. The green LED should light on the T-JOY and any connected T-Series devices (note: not all T-Series devices have LEDs). Depending on the number of devices connected, you may need to connect additional power supplies. We recommend connecting a power supply to every second or third device to reduce current draw through the data cables.
3. Install a demo program from the included CD, or download one from the support section of our website http://www.zaber.com. Follow the instructions in the readme file to install and run the program. As a simple first test, try entering these instructions:
- Renumber all devices - Device:0, Cmd:2, Data:0
- Home device 2 - Device:2, Cmd:1, Data:0
[edit] Control Through The RS-232 Serial Port
All T-Series devices use the same RS232 communications protocol. Your communications settings must be: 9600 baud, no hand shaking, 8 data bits, no parity, one stop bit. The yellow LED will light when there is activity on the RS232 lines. You may use this feature to determine which COM port you are connected to. We recommend using the sample Visual Basic program included with Zaber products. This program also contains source code that you can use as an example for writing your own custom code.
Important: The first time you connect a device to your computer you must issue a renumber instruction to assign each device a unique identifier you must issue a renumber instruction. This should be done after all the devices in the daisy-chain are powered up. In older firmware versions (prior to version 5xx) you must issue a renumber instruction after each powerup. In firmware 5xx and up, the device number is stored in non-volatile memory and will persist after powerdown, so you need only issue the renumber instruction when you add new devices to the chain, or rearrange the order of the devices, however it does no harm to issue the renumber instruction after every powerup. You must not transmit any instructions while the chain is renumbering or the renumbering routine may be corrupted. Renumbering takes less than a second, after which you may start issuing instructions over the RS232 connection.
All instructions consist of a group of 6 bytes. They must be transmitted with less than 10 ms between each byte. If the device has received less than 6 bytes and then a period longer than 10 ms passes, it ignores the bytes already received. We recommended that your software behave similarly when receiving data from the devices, especially in a noisy environment like a pulsed laser lab.
The following table shows the instruction format:
- Byte 1 - Device #
- Byte 2 - Command #
- Byte 3 - Data - Least Significant Byte (LSB)
- Byte 4 - Data
- Byte 5 - Data
- Byte 6 - Data - Most Significant Byte (MSB)
The first byte is the device number in the daisy-chain. Device number 1 is the closest device to the computer and device number 2 is next and so on. If the number 0 is used, all the devices in the chain will process the accompanying command simultaneously.
The second byte is the command number. Bytes 3, 4, 5, and 6 are data in long integer, 2’s complement format with the least significant byte transmitted first. How the command data are interpreted depends on the command. Complete details are given in the command reference on the following page.
[edit] Examples:
- Renumber all devices: 0x00, 0x02, 0x00, 0x00, 0x00, 0x00
- Set Active Axis (command #25): 0x00, 0x1C, 0x01, 0x00, 0x00, 0x00
- Set Axis Velocity Profile (command #28): 0x00, 0x19, 0x02, 0x00, 0x00, 0x00
If you are using Zaber’s demo software, you will only see 3 entry fields: Device#, Command#, and Data. The Device# and Command# fields accept integer values while the value you enter into the Data field can be signed. The value in the data field is converted by the software to 4 separate bytes and then gets sent to the device.
Most instructions cause the device to reply with a return code. It is also a group of 6 bytes. The first byte is the device #. Byte #2 is the instruction just completed or 255 (0xFF) if an error occurs. Bytes 3, 4, 5 and 6 are data bytes in the same format as the instruction command data.
[edit] Quick Command Reference
The following table offers a quick command reference for joystick products. For convenience, you may sort the table below by instruction name, command number, or reply number. Follow the links to view a detailed description of each instruction.
| Instruction Name | Command# | Command Data | Command Type | Reply Data |
|---|---|---|---|---|
| Reset | 0 | Ignored | Command | None |
| Renumber* | 2 | New Number | Command | Device Id
|
| Set Active Axis* | 25 | Axis | Setting | Axis |
| Set Axis Device Number* | 26 | Device Number | Setting | Device Number |
| Set Axis Inversion* | 27 | Invert Status | Setting | Invert Status |
| Set Axis Velocity Profile* | 28 | Velocity Profile | Setting | Velocity Profile |
| Set Axis Velocity Scale* | 29 | Maximum Velocity | Setting | Maximum Velocity |
| Load Event Instruction | 30 | Key Event | Command | Key Event |
| Return Event Instruction | 31 | Key Event | Command | Event Instruction |
| Calibrate Joystick* | 33 | Calibration Mode | Command | Calibration Mode |
| Restore Settings* | 36 | Peripheral Id | Command | Peripheral Id |
| Set Device Mode* | 40 | Mode | Setting | Mode |
| Set Alias Number* | 48 | Alias Number | Setting | Alias Number |
| Lock Settings* | 49 | Lock Status | Command | Lock Status |
| Return Device Id | 50 | Ignored | Read-Only Setting | Device Id |
| Return Firmware Version | 51 | Ignored | Read-Only Setting | Version |
| Return Power Supply Voltage | 52 | Ignored | Read-Only Setting | Voltage |
| Return Setting | 53 | Setting Command Number | Command | Setting Value |
| Echo Data | 55 | Setting Number | Command | Setting Value |
| Error | 255 | n/a | Reply | Error Code |
* The settings for these commands are saved in non-volatile memory, i.e. the setting persists even if the device is powered down. To restore all settings to factory default, use command 36.
[edit] Detailed Command Reference
[edit] Reset - Cmd 0
| Instruction Name | Reset |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 0 |
| Command Type | Command |
| Command Data | Ignored |
| Reply Data | None |
| Persistence | n/a |
| Summary | Sets the device to its power-up condition. |
This sets the device to its power-up condition. It has the same effect as unplugging and restarting the device.
[edit] Special Note
All non-volatile settings (i.e. Device Number, Joystick Calibration, etc.) are saved and are not affected by reset or power-down.
[edit] Renumber - Cmd 2
| Instruction Name | Renumber |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 2 |
| Command Type | Command |
| Command Data | New Number |
| Reply Data | Device Id |
| Persistence | Non-Volatile |
| Summary | Assigns new numbers to all the devices in the order in which they are connected. |
If sent to device number 0, the command data is ignored and all devices will renumber. The device closest to the computer becomes device number 1. The next device becomes number 2 and so forth. If sent to a device number other than 0, then specified device will reassign itself the device number in the command data. Renumbering takes about 1/2 a second during which time the computer must not send any further data. The device number is stored in non-volatile memory so you can renumber once and not worry about issuing the renumber instruction again after each power-up.
[edit] Set Active Axis - Cmd 25
| Instruction Name | Set Active Axis |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 25 |
| Command Type | Setting |
| Command Data | Axis |
| Reply Data | Axis |
| Persistence | Non-Volatile |
| Summary | Sets the active axis. |
This setting specifies which axis of a joystick is the active access. Valid Axis values are:
- 0 - All axes
- 1 - Axis 1
- 2 - Axis 2
- 3 - Axis 3
Subsequent changes to any axis settings will apply only to the active axis. Axis settings for the active axis can be changed with the follow instructions:
- Set Axis Device Number (Command #26)
- Set Axis Inversion (Command #27)
- Set Axis Velocity Profile (Command #28)
- Set Axis Velocity Scale (Command #29)
The three axes on the joystick are defined as follows:
- Axis #1: Right is positive. Left is the negative.
- Axis #2: Forward is positive. Back is negative
- Axis #3: Clockwise is positive. Counter-clockwise is negative.
For example, to set the maximum velocity of axis number 2, first issue the Set Active Axis (#25) command with data of 2 to make axis number 2 the active axis. Then issue the Set Axis Velocity Scale (#29) command using the desired maximum velocity as data. Subsequent “Set Axis…” commands will also apply to the axis number 2 until the user sets a different axis to be the active axis, or powers off the joystick. The joystick’s current active axis can be returned by issuing the Return Setting (#53) command, with data of 25.
The active axis affects the behavior of commands 26 through 29. This setting is stored in non-volatile memory and will persist after power-down or reset.
[edit] Set Axis Device Number - Cmd 26
| Instruction Name | Set Axis Device Number |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 26 |
| Command Type | Setting |
| Command Data | Device Number |
| Reply Data | Device Number |
| Persistence | Non-Volatile |
| Summary | Sets the device number to be controlled using the active axis. |
This command sets what device number you wish to control using the active axis. For example, suppose you would like to assemble a 3-axis system where:
- Joystick axis 1 (right / left) controls device #3.
- Joystick axis 2 (forward / back) controls device #4, but with the motion inverted.
- Joystick axis 3 (clockwise / counterclockwise) controls device #2.
First, connect the joystick and the three additional T-Series devices (we have shown three T-LS devices below) in a daisy-chain as follows:
Issue the Renumber (#2) command from the computer. After renumbering (less than 1 second) the joystick will become device #1, and the remaining devices will become devices #2, #3, and #4. Now commands may be issued to the joystick to set the desired behavior. The command sequence is as follows:
| Device | Command | Data | Explanation of command |
| 0 | 2 | 0 | Renumber. After connecting the daisy chain as shown above, issue this command to all devices. Each device should reply. The T-JOY3 will be device #1, and subsequent devices will be #2, #3 and #4. |
| 1 | 25 | 1 | Set axis number 1 to be the active axis. Subsequent “Set Axis…” commands will apply to the active axis. |
| 1 | 26 | 3 | Set the active axis (#1) to control device #3. |
| 1 | 25 | 2 | Set axis number 2 to be the active axis. |
| 1 | 26 | 4 | Set the active axis (#2) to control device #4. |
| 1 | 27 | -1 | Set the active axis (#2) to be inverted. Forward will become the negative direction, and backward will become the positive direction. |
| 1 | 25 | 3 | Set axis number 3 to be the active axis. |
| 1 | 26 | 2 | Set the current axis (#3) to control device #2. |
note: This setting affects only the active axis. See the Set Active Axis (#25) command for instruction on how to select an axis. This setting is stored in non-volatile memory and will persist after power-down or reset. Valid command data numbers are between 0 and 254; Byte 3 is the device number.
Command #36, may be used to restore factory default settings. The factory default settings for axis control are as follows:
- Axis #1 controls Device #2
- Axis #2 controls Device #3
- Axis #3 controls Device #4
[edit] Set Axis Inversion - Cmd 27
| Instruction Name | Set Axis Inversion |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 27 |
| Command Type | Setting |
| Command Data | Invert Status |
| Reply Data | Invert Status |
| Persistence | Non-Volatile |
| Summary | Inverts the active joystick axis. |
Sometimes it is desirable to invert one or more axes to create a more intuitive user interface. The Set Axis Inversion (#27) command allows the user to set the invert status of the active axis. Use Invert Status = 1 to set the current axis to non-inverted, use Invert Status = -1 to set the current axis to inverted. Use Invert Status = 0 to toggle between invert and non-invert (the Invert Status of the reply will still be either 1 or -1).
See the Set Active Axis (#25) instruction for information on how to select an axis. Each axis can be inverted independently of the other two axis. See command #26 for an example of how to invert a particular axis.
| Direction of Manipulation of Joystick | Direction of Motion of Affected device | ||
| Axis | Manipulation | Non-inverted | Inverted |
| 1 | Left (negative) | Negative | Positive |
| 1 | Right (positive) | Positive | Negative |
| 2 | Back (negative) | Negative | Positive |
| 2 | Forward (positive) | Positive | Negative |
| 3 | Counter-Clockwise (negative) | Negative | Positive |
| 3 | Clockwise (positive) | Positive | Negative |
What constitutes positive or negative motion depends on the device; see the user’s manual for the device in question. The default axis inversion setting for all joystick axes is non-inverted.
[edit] Set Axis Velocity Profile - Cmd 28
| Instruction Name | Set Axis Velocity Profile |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 28 |
| Command Type | Setting |
| Command Data | Profile Number |
| Reply Data | Profile Number |
| Persistence | Non-Volatile |
| Summary | Sets the relationship between the angle of the active joystick axis and the velocity of the device. |
This setting allows the user to select the desired relationship between the angular displacement of the active joystick axis and the velocity of the device controlled by that axis.
When the joystick is displaced from the neutral position, the T-JOY3 reads the angular position and calculates how fast and in which direction the corresponding devices should be instructed to move. There are three different velocity profile numbers that can be requested:
1 – Linear 2 – Squared (factory default) 3 – Cubed
The maximum velocity is set by the Set Axis Velocity Scale (#29) command. Squared and cubed curves offer finer control at slow speeds, but still allow maximum velocity when the joystick is fully deflected.
[edit] Set Axis Velocity Scale - Cmd 29
| Instruction Name | Set Axis Velocity Scale |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 29 |
| Command Type | Setting |
| Command Data | Maximum Velocity |
| Reply Data | Maximum Velocity |
| Persistence | Non-Volatile |
| Summary | Sets the velocity scale of the active axis. |
This command is used to set the velocity scale of the active axis. The data represents the desired maximum velocity corresponding to full displacement of the joystick. When the joystick is moved away from the neutral position, the displacement is translated into Move At Constant Velocity instruction which is sent to the device associated with the displaced axis. See the user’s manual for the device in question for more information on the Move At Constant Velocity instruction.
The velocity scale setting works in conjunction with the velocity profile setting. See the Set Axis Velocity Profile (#28) command for more detail.
Setting the velocity scale to 0, will disable the active axis. This prevents the joystick from sending any instructions in response to displacement of that axis. This is useful when the user wants to execute a program from the computer, and does not want the joystick to be accidentally moved.
The default velocity scale for all three axes is 2922.
[edit] Load Event Instruction - Cmd 30
| Instruction Name | Load Event Instruction |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 30 |
| Command Type | Command |
| Command Data | Key Event |
| Reply Data | Key Event |
| Persistence | n/a |
| Summary | Loads the next instruction as the event-triggered instruction specified in the Command Data. |
After issuing this instruction, the next instruction received will be saved in non-volatile memory and will persist as the event-triggered instruction associated with the indicated key event even after power-down or reset.
This command is used to program the keys on a joystick to send any arbitrary instruction. There are five keys on the joystick. There are 4 key events that the joystick will detect:
- Event 1 - Key depressed
- Event 2 - Key released before hold time
- Event 3 - Key not yet released when hold time elapses
- Event 4 - Key released after hold time
The hold time is preset to 1 second and cannot be changed by the user.
Each of the 4 key events may be programmed to trigger a single instruction. It can be seen that pressing and releasing a key will result in a sequence of key events that will be either 1-2 or 1-3-4 depending when the key is released. Instructions associated with key events are called event-triggered instructions. When any key event occurs, an event-triggered instruction will be sent by the T-JOY device to all T-Series devices downstream (away from the computer) in the daisy-chain.
If an event-triggered instruction is addressed to device 0 (all devices) or is addressed to the device number of the T-JOY, then the T-JOY will execute the instruction itself. If the instruction is addressed to device 255, then the T-JOY will neither send nor execute the instruction. This provides a method for disabling a key event.
The Load Event-Triggered Instruction (#30) command is used to specify the key event that you wish to attach an instruction to. The Command Data required is:
Command Data = Key * 10 + Event
Where:
- Key is a number from 1 to 5 corresponding to the Key location
- Event is a number from 1 to 4 corresponding to the Key Event
The instruction received immediately after the Load Event Triggered Instruction command will be the event-triggered
instruction associated with the specified key event. Note that this next instruction will not be executed by the T-JOY, but
will be stored for execution whenever the corresponding key event is detected. This instruction will also pass un-hindered
to any devices that may be downstream (away from the computer) from the T-JOY. For this reason, we recommended disconnecting
downstream devices from the joystick before loading or returning event-triggered instructions.
The following table shows the default event-triggered instructions associated with each key event:
| Key | Event 1 | Event 2 | Event 3 | Event 4 |
| 1 | 11 | 12 | 13 | 14 |
| 2 | 21 | 22 | 23 | 24 |
| 3 | 31 | 32 | 33 | 34 |
| 4 | 41 | 42 | 43 | 44 |
| 5 | 51 | 52 | 53 | 54 |
Having four different key events for each key makes the T-JOY very flexible. Here are a few examples.
| Key | Event | Key Event | Default Instruction | Description |
| (Device, Command, Data) | ||||
| 1 | 1 | 11 | (255, 255, 0) | - |
| 1 | 2 | 12 | (0, 23, 0) | Stop all devices |
| 1 | 3 | 13 | (0, 1, 0) | Home all devices |
| 1 | 4 | 14 | (255, 255, 0) | - |
| 2 | 1 | 21 | (1, 55, 0) | Echo the number 0 |
| 2 | 2 | 22 | (1, 55, 1) | Echo the number 1 |
| 2 | 3 | 23 | (1, 55, 2) | Echo the number 2 |
| 2 | 4 | 24 | (1, 55, 3) | Echo the number 3 |
| 3 | 1 | 31 | (255, 255, 0) | - |
| 3 | 2 | 32 | (0, 18, 0) | Go to stored position 0 |
| 3 | 3 | 33 | (0, 16, 0) | Store current position 0 |
| 3 | 4 | 34 | (255, 255, 0) | - |
| 4 | 1 | 41 | (255, 255, 0) | - |
| 4 | 2 | 42 | (0, 18, 1) | Go to stored position 1 |
| 4 | 3 | 43 | (0, 16, 1) | Store current position 1 |
| 4 | 4 | 44 | (255, 255, 0) | - |
| 5 | 1 | 51 | (255, 255, 0) | - |
| 5 | 2 | 52 | (0, 18, 2) | Go to stored position 2 |
| 5 | 3 | 53 | (0, 16, 2) | Store current position 2 |
| 5 | 4 | 54 | (255, 255, 0) | - |
Example 1: Programming a single key to store and return to a position:
Each key can be programmed to provide different functionality depending on how long the key is held down. Key event 3 can be programmed to trigger the “Store Current Position” instruction, and key event 2 can be programmed to trigger the “Go To Stored Position” instruction. With such a setup, the user can use the joystick to move an XYZ stage to a desired position, then hold down the key for more than 1 second to store the current position of the stage. After moving the stage around some more, the user can return to the stored position by quickly pressing and releasing the same key. For a description of the “Store Current Position” and “Go To Stored Position” instructions, please see the user’s manual of the product in question. Assuming that the joystick is device #1, the programming sequence to program key 3 to provide this functionality would be as follows:
| Device | Command | Data | Explanation of command |
| 1 | 30 | 31 | Program key 3, event 1 to trigger the instruction… |
| 255 | 0 | 0 | …“do nothing” |
| 1 | 30 | 32 | Program key 3, event 2 to trigger the instruction… |
| 0 | 18 | 6 | …“All devices, Go To Stored Position, in slot #6” |
| 1 | 30 | 33 | Program key 3, event 3 to trigger the instruction… |
| 0 | 16 | 6 | …“All devices, Store Current Position, in slot #6” |
| 1 | 30 | 34 | Program key 3, event 4 to trigger the instruction… |
| 255 | 0 | 0 | …”do nothing” |
Example 2: Programming two keys to control the motion of an additional device:
You can program two keys to control the motion of an additional device. In the following sequence of commands, key 1 and key 2 are programmed to control device 5, an additional device beyond devices 2, 3, and 4 which are controlled by joystick manipulation. After executing this sequence of instructions, key 1 can be used to move device 5 in the positive direction, slowly at first, but faster if you hold the key down for longer than 1 second. Key 2 will exhibit the identical behavior but with motion in the negative direction. When either key is released the motion will stop. Assuming that the joystick is device #1, the programming sequence is as follows:
| Device | Command | Data | Explanation of command |
| 1 | 30 | 11 | Program key 1, event 1 to trigger the instruction… |
| 5 | 22 | 1000 | …“Device 5, Move at Constant Velocity, 1000” |
| 1 | 30 | 12 | Program key 1, event 2 to trigger the instruction… |
| 5 | 23 | 0 | …“Device 5, Stop” |
| 1 | 30 | 13 | Program key 1, event 3 to trigger the instruction… |
| 5 | 22 | 4000 | …“Device 5, Move at Constant Velocity, 4000” |
| 1 | 30 | 14 | Program key 1, event 4 to trigger the instruction… |
| 1 | 23 | 0 | …“Device 5, Stop” |
| 1 | 30 | 21 | Program key 2, event 1 to trigger the instruction… |
| 5 | 22 | -1000 | …“Device 5, Move at Constant Velocity, -1000” |
| 1 | 30 | 22 | Program key 2, event 2 to trigger the instruction… |
| 5 | 23 | 0 | …“Device 5, Stop” |
| 1 | 30 | 23 | Program key 2, event 3 to trigger the instruction… |
| 5 | 22 | -4000 | …“Device 5, Move at Constant Velocity, -4000” |
| 1 | 30 | 24 | Program key 2, event 4 to trigger the instruction… |
| 5 | 23 | 0 | …“Device 5, Stop” |
Example 3: Programming keys to trigger an action on the computer
Sometimes you may want a key event on the joystick to trigger more complicated tasks than just sending a single instruction. You may also wish to have a key event on the joystick trigger certain actions on the computer (if one is connected). The Echo Data (#55) command exists for this purpose.
When the T-JOY receives the Echo Data (#55) command with any arbitrary data, the T-JOY will send a reply that is simply an echo of the instruction, including data. If you program one of the joystick’s key events to trigger an Echo Data command addressed to the device number of the joystick itself, then when the key event occurs, the joystick will do two things: 1. it will send the Echo Data instruction to downstream devices and 2. it will attempt to process the instruction itself. If the instruction is addressed to the device number of the T-JOY, then none of the downstream devices will respond to it. The T-JOY however will send an Echo Data reply (with the same data as the instruction) to the computer.
The user can write an application to run on the computer which will interpret the Echo Data reply as an indication that a key event has occurred. Different key events can trigger Echo Data instructions with different data so the user’s application on the computer can detect individual key events and take appropriate action (whatever the user decides that may be).
[edit] Return Event Instruction - Cmd 31
| Instruction Name | Return Event Instruction |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 31 |
| Command Type | Command |
| Command Data | Key Event |
| Reply Data | Event Instruction |
| Persistence | n/a |
| Summary | Returns the the event-triggered instruction associated with the key-event. |
This command is used to return to the user the event-triggered instruction currently associated with a particular key-event. See the Load Event-Triggered Instruction (#30) for more information on definition of key events and event-triggered instructions.
To return the event-triggered instruction associated with a particular key event, issue the Return Event Instruction (#31) command to the joystick with data as follows:
Command Data = Key * 10 + Trigger
Where:
- Key is a number from 1 to 5 corresponding to the key location
- Event is a number from 1 to 4 corresponding to the key event
The reply will be comprised of the device, command and data of the event-triggered instruction associated with the specified key event. Note that as far as the computer is concerned, the reply will appear to come from whatever device the event-triggered instruction is addressed to, which may not be the joystick. We recommend that all additional devices be disconnected from the joystick before loading or returning event-triggered instructions to avoid confusion.
[edit] Calibrate Joystick - Cmd 33
| Instruction Name | Calibrate Joystick |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 33 |
| Command Type | Command |
| Command Data | Calibration Mode |
| Reply Data | Calibration Mode |
| Persistence | n/a |
| Summary | Calibrates the joystick by adjusting the limits and the dead-bands. |
This instruction is used to calibrate a joystick. There are two sets of calibration variables: limits and dead-bands. Limits define the maximum angular displacement of all axes of manipulation. Dead-bands define the area around the neutral position of the joystick where no action should occurs. Dead-bands are useful to adjust the sensitivity of the joystick to vibration or accidental movement from the neutral position. Acceptable Calibration Mode values are: 0, 1, or 2. Mode 1 is for calibrating the maximum limits. Mode 2 to is for calibrating the deadband. Mode 0 exits the calibration routine.
The T-JOY is pre-calibrated before shipping so that it should work well right out of the box. Note that restoring default settings using command #36 will have no affect on the joystick calibration. There is no default calibration since each joystick has slightly different properties that prevent a single set of settings from working well on all devices.
The joystick should work well as calibrated. We do not recommend re-calibrating it unless you encounter problems such as motion occurring while the joystick is in the neutral position, or an inability to reach maximum velocity even with the joystick fully displaced.
To calibrate the limits, follow these steps:
- Issue command 33, data 1 to put joystick in “calibrate limits” mode
- Move joystick all the way to the left and all the way to the right
- Move joystick all the way back and all the way forward
- Turn joystick knob all the way counter-clockwise and all the way clockwise
- Issue command 33, data 0 to save the measured limit parameters
To calibrate the dead-band, follow these steps:
- Issue command 33, data 2 to put joystick in “calibrate dead-band” mode
- Wiggle joystick slightly to the left and right of the neutral position. Try to move only within the limits of the slack. Do not move past the point where resistance begins.
- Wiggle joystick slightly backward and forward of the neutral position
- Turn joystick knob slightly counter-clockwise and clockwise from the neutral position
- Issue command 33, data 0 to save the measured limit parameters
[edit] Restore Settings - Cmd 36
| Instruction Name | Restore Settings |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 36 |
| Command Type | Command |
| Command Data | Peripheral Id |
| Reply Data | Peripheral Id |
| Persistence | Non-Volatile |
| Summary | Restores the device settings to the factory defaults. |
This command should be issued with a Peripheral Id of 0 to return the device to factory default settings. This instruction is very useful for troubleshooting. If the device does not appear to function properly, it may be because some of the settings have been changed. This instruction will restore the settings to default values. For a table of default settings, see Appendix A. All settings affected by this instruction are stored in non-volatile memory and will persist after power-down or reset.
[edit] Special Note
This command should be issued with Data of 0 to return the device to factory default settings. This command is very useful for troubleshooting. If the unit does not appear to function properly, it may be because some of the settings have been changed. Command 36 will restore the settings to default values.
[edit] Set Device Mode - Cmd 40
| Instruction Name | Set Device Mode |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 40 |
| Command Type | Setting |
| Command Data | Mode |
| Reply Data | Mode |
| Persistence | Non-Volatile |
| Summary | Sets the Mode for the given device. |
[edit] Special Note
This command allows setting several options. Each option is controlled by a single bit within the command data. Most software you will encounter, including most of our demo software, represents all 4 data bytes as a single decimal value rather than specifying each bit individually. To determine what decimal value to use requires a basic understanding of how the data is represented in binary. The command data may be considered as a single 32-bit binary value. The least significant bit is bit_0, the next is bit_1, the next is bit_2, and so on up to the most significant bit_31. Each bit may have a value of either 1 or 0.
The corresponding decimal representation of this 32-bit data is given by:
Decimal value = (bit_0 * 1) + (bit_1 * 2) + … + (bit_n * 2n) + … + (bit_31 * 2^31)
Each bit controls a single mode option as described in the table below. To determine the data value to use with the Set Device Mode command, simply determine the desired value of each bit (1 or 0), and calculate the decimal value using the above formula. Note that not all 32 bits are currently used. Any unused or reserved bits should be left as 0.
For example, suppose you want all mode bits to be 0 except for bit_0 (disable autoreply), bit_14 (disable power LED), and bit_15 (disable serial LED). The Set Device Mode instruction should be sent with data calculated as follows:
Command Data = 2^20 + 2^214 + 2^215 = 1 + 16384 + 32768 = 49153
Note that each instance of the Set Device Mode command overwrites ALL previous mode bits. Repeated commands do not have a cumulative effect. For example, suppose you send a Set Device Mode command with data of 1 to disable auto-replies. If you then send another Set Device Mode command with data of 16384 to disable the power LED, you will re-enable auto-replies since bit_0 in the 2nd instruction is 0.
The T-JOY has a default mode setting of 0 (all bits are 0).
| Bit_n | 2n | Description |
| bit_0 | 1 | Disable Auto-reply A value of 1 disables ALL replies except those to “return” commands (commands 50 and higher). The default value is 0 on all devices. |
| bit_1 | 2 | Reserved |
| bit_2 | 4 | Reserved |
| bit_3 | 8 | Reserved |
| bit_4 | 16 | Reserved |
| bit_5 | 32 | Reserved |
| bit_6 | 64 | Enable Logical Channels Mode A value of 1 enables the Logical Channels Mode. In this mode of communication, only bytes 3 through 5 are used for data. Byte 6 is used as an Id byte that the user can set to any value they wish. It will be returned unchanged in the reply. Logic Channel Mode allows the user application to monitor communication packets individually to implement error detection and recovery. The default value is 0 on all devices. |
| bit_7 | 128 | Reserved |
| bit_8 | 256 | Reserved |
| bit_9 | 512 | Reserved |
| bit_10 | 1,024 | Reserved |
| bit_11 | 2,048 | Reserved |
| bit_12 | 4,096 | Reserved |
| bit_13 | 8,192 | Reserved |
| bit_14 | 16,384 | Disable Power LED A value of 1 turns off the green power LED. It will still blink briefly, immediately after powerup. |
| bit_15 | 32,768 | Disable Serial LED A value of 1 turns off the yellow serial LED. |
[edit] Set Alias Number - Cmd 48
| Instruction Name | Set Alias Number |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 48 |
| Command Type | Setting |
| Command Data | Alias Number |
| Reply Data | Alias Number |
| Persistence | Non-Volatile |
| Summary | Sets an alternate device number for a device. |
This setting specifies an alternate device number for a device (in addition to its actual device number). By setting several devices to the same alias number, you can control groups of devices with a single instruction. When you send an instruction to an alias number, all devices with that alias number will execute the instruction and reply using their actual device numbers. To remove an alias, simply set the devices alias number to zero. Valid alias numbers are between 0 and 254. To avoid confusion, it is best to choose an alias greater than the number of devices connected.
This setting is stored in non-volatile memory and will persist after power-down or reset.
[edit] Lock Settings - Cmd 49
| Instruction Name | Lock Settings |
|---|---|
| Firmware Version | 5.07 and up |
| Command Number | 49 |
| Command Type | Command |
| Command Data | Lock Status |
| Reply Data | Lock Status |
| Persistence | Non-Volatile |
| Summary | Locks or unlocks all non-volatile settings. |
Sometimes it is desirable to lock all non-volatile settings to prevent them from being changed inadvertently. After changing all settings as desired, settings can be locked by sending this instruction with a Lock Status of 1. Subsequent attempts to change any non-volatile setting (ex. changing the speed, command 42) will result in an Error Response with an error code of 3600 (settings locked).
How the Restore Settings instruction behaves when the settings are locked depends on the firmware version. In version 5.07 issuing a Restore Settings instruction while the settings are locked will result in an Error Response with an error code of 3600 (settings locked). This behavior was found to confuse many customers so in version 5.08 and up, the behavior was changed such that regardless of the current lock status, issuing a Restore Settings instruction will always return setting values to factory default values and leave settings in an unlocked state.
Settings can also be unlocked by sending the Lock instruction with a Lock Status of 0.
[edit] Return Device Id - Cmd 50
| Instruction Name | Return Device Id |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 50 |
| Command Type | Read-Only Setting |
| Command Data | Ignored |
| Reply Data | Device Id |
| Persistence | n/a |
| Summary | Returns the Id code for the type of device connected. |
This causes the device to return an identification code indicating the type of device connected. See http://www.zaber.com/wiki/T-Series/Device_Ids for a table of device Ids for all Zaber products.
[edit] Return Firmware Version - Cmd 51
| Instruction Name | Return Firmware Version |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 51 |
| Command Type | Read-Only Setting |
| Command Data | Ignored |
| Reply Data | Version |
| Persistence | n/a |
| Summary | Returns the firmware version installed on the device. |
This setting indicates the firmware version installed on the device. A decimal is assumed before the last two digits. For example, 502 indicates firmware version 5.02.
[edit] Return Power Supply Voltage - Cmd 52
| Instruction Name | Return Power Supply Voltage |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 52 |
| Command Type | Read-Only Setting |
| Command Data | Ignored |
| Reply Data | Voltage |
| Persistence | n/a |
| Summary | Returns the voltage level of the device's power supply. |
This setting indicates the voltage level of the device's power source. A decimal is assumed before the last digit. For example, a value of 127 indicates 12.7 V. Note that the internal voltage measurement is not very accurate. Don't be alarmed if the indicated voltage is slightly different from your measurements.
[edit] Return Setting - Cmd 53
| Instruction Name | Return Setting |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 53 |
| Command Type | Command |
| Command Data | Setting Number |
| Reply Data | Setting Value |
| Persistence | n/a |
| Summary | Returns the current value of the setting specified in the Command Data. |
This causes the device to return the current value of the setting number specified in the command data. Valid setting numbers are the command numbers of any "Set..." instruction. The device will reply using the command number of the specified setting (as if a command to change the setting had just been issued) but the setting will not be changed.
For example, command #43 is the "Set Acceleration" instruction. Therefore if you wish to return the current value of the acceleration setting, simply send the Return Setting instruction with data of 43. The device will reply with command #43 and data equal to the setting value.
[edit] Echo Data - Cmd 55
| Instruction Name | Echo Data |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 55 |
| Command Type | Command |
| Command Data | Data |
| Reply Data | Data |
| Persistence | n/a |
| Summary | Echos back the same Command Data that was sent. |
This causes the device to echo back the same Command Data that was sent.
[edit] Special Note
This instruction is a useful one to use as an event-triggered instruction associated with a key event. It can be used to allow the computer (if one is connected) to detect a key press on the joystick. For more details see the Load Event-Triggered Instruction (#30) command.
[edit] Reply-only Reference
In general, a T-series device will reply to an instruction using the same command number as the instruction itself. However, there are occasions (such as when the user turns the potentiometer) when the device may transmit data without first receiving a request from the controlling computer. This type of reply may be considered to be a triggered reply as opposed to a requested reply. In this case the device uses a “reply-only” command number to distinguish the reply from those requested by the controlling computer. The meanings of these replies and their corresponding data are given below.
[edit] Error - Cmd 255
| Instruction Name | Error |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 255 |
| Command Type | Reply |
| Command Data | n/a |
| Reply Data | Error Code |
| Persistence | n/a |
| Summary | Indicates to the user that an error has occurred. |
This reply indicates that an error has occurred. The error code returned in the data indicates the type of error. The device may send an error code as a reply to an invalid instruction, or it may autonomously send an error code as a triggered reply (i.e. not in response to an instruction). The error code is typically the command number of the instruction that caused the error, but not always.
[edit] Error Codes for T-Joy
| Error Code | Description |
| 14 | Power supply voltage too low. |
| 15 | Power supply voltage too high. |
| 25 | Set Active Axis – Data out of range. Must be 1, 2, or 3. |
| 26 | Set Axis Unit Number – Data out of range. Must be between 0 and 254 inclusive. |
| 27 | Set Axis Inversion – Data out of range. Must be 0, 1, or -1. |
| 28 | Set Axis Velocity Profile – Data out of range. Must be 0, 1, 2, or 3. |
| 29 | Set Axis Velocity Scale – Data out of range. Must be between 0 and 65535. |
| 30 | Load Event-Triggered Instruction – Data out of range. See command #30 for valid range. |
| 31 | Return Event-Triggered Instruction – Data out of range. See command #31 and #30 for valid range. |
| 33 | Calibration – Data out of range. Must be 0, 1, or 2. |
| 36 | Restore / Lock / Unlock Settings – Data out of range. Must be 0, 2768033, or 3308672 |
| 40 | Set Mode - One or more of the Mode Bits is invalid. |
| 48 | Set Alias – Data out of range. Must be between 1 and 254 inclusive. |
| 53 | Return setting – Data out of range. Must be a valid setting number. |
| 64 | Command number not valid in this firmware version |
| 255 | Another command is currently executing and cannot be pre-empted by the new command. Please wait till the old command is finished executing, or issue a command with pre-emptive priority. |
| 3600 | Settings locked. The most recent instruction required changing setting values, but the settings are locked. See command 36 for details on locking and unlocking settings. |
[edit] Troubleshooting T-JOY Devices
| Symptom | Check |
|---|---|
| Green LED does not come on | Check the A/C wall plug, the 12V adapter and its connection to the device. If the power is coming over the data cable, check the mini din connector for bent or broken pins. |
| Green LED flashes | The power supply voltage is outside the range of 10 to 16V. It may either be too low or too high. Some unregulated 12 V adapters may produce in excess of 16 V. If the number of devices connected on a single 12 V adapter exceeds its current capability, the voltage may drop below 10 V. You may experience this problem when many motors on a single supply move together. The load may exceed the maximum current available, causing the voltage to drop. If you experience this problem with a single device on a single unregulated 12V supply rated at over 300 mA, then the problem is probably that the supply voltage is too high. |
| Communications do not seem to work, the amber light does not come on or flash | Make sure that you are on the correct com port. Check the baud rate, hand shaking, parity, stop bit, etc. Check the cable and adapter for bent or broken pins. Make sure you do not have a null modem adapter or cable in the line. The serial to mini-din adapter comes in many varieties and many have different pin connections. Check the adapter for continuity on the proper pins by consulting the adapter pin-out diagram below. If you encounter the problem when trying to control the device with your own software, try using one of the demo programs from our website to verify that the hardware is functioning properly. |
| The amber light comes on briefly when sending a command, but the device does not reply. | Check baud rate, hand shaking, parity, stop bit, etc. Make sure that your software does not transmit any control characters like line feed, spaces or something else. The device numbers may not be what you think they are. Issue a renumber command, make sure that the computer does not transmit anything else while the devices renumber. Check that you transmit 6 bytes and that the device number and command are valid. If you encounter the problem when trying to control the device with your own software, try using one of the demo programs from our website to verify that the hardware |
| The device does not send replies but otherwise works. | If you encounter the problem when trying to control the device with your own software, try using a demo program from our website to verify that the hardware is functioning properly. Make sure that the receiving part of your code or commercial package is correct. Check baud rate, etc. Check connectors for bent or broken pins. |
| The device sometimes returns fewer than 6 bytes. | This problem usually indicates a problem with the settings for your serial port. Some serial ports are set to automatically recognize and remove specific control characters such as carriage returns when they appear in the RS232 receive buffer. When this happens, it appears as though the device has not sent enough bytes, but really the controlling computer has just removed some before you could read them. You will need to change the serial port settings to fix the problem. |
| Moving the joystick causes no motion. The green LED is on, and the yellow LED blinks when I move the joystick. | The joystick may not be configured correctly to control the devices daisy-chained to it. i.e. the joystick may be trying to communicate to a device number that is different than the device numbers of the devices connected. Try the following steps: - Verify that each device in the daisy chain works individually. |
| Moving the joystick causes no motion. The green LED is on, but the yellow LED stays off. | One of the following conditions could cause this symptom: -The joystick axis could have been disabled, by setting the velocity scale to 0. Solution: re-enable the joystick axis by setting the velocity scale to a non-zero value. |
[edit] Warranty and Repair
All Zaber products are backed by a one-month satisfaction guarantee. If for any reason you are not satisfied with your purchase, send it back to Zaber Technologies Inc. within one month of the purchase date for a refund. A restocking fee of the greater of $100 or 5% will be applied to cover administration and customs fees charged to us. Goods must be in brand new condition with no marks. T-series devices are also guaranteed for one year or 50,000 cycles, whichever comes first. During this period Zaber will repair or replace faulty units free of charge. Customers with devices in need of repair should contact Zaber to obtain an RMA form which must be filled out and returned to receive an RMA number. The RMA form also contains instructions for packing and returning the device.
[edit] Email Updates
If you would like to receive our email newsletter including product updates and promotions, please sign up online at http://www.zaber.com (news section). Each newsletter typically includes a promotional offer worth at least $100. We do not send more than 4 newsletters per year.
[edit] Contact Information
Contact Zaber Technologies Inc by any of the following methods:
| Phone | 1-604-276-8033 (direct)
1-888-276-8033 (toll free in North America) |
|---|---|
| Fax | 1-604-648-8033 |
| 2891 Steveston Hwy, Richmond, BC, Canada, V7E 2J1 | |
| Web | http://www.zaber.com |
| Please visit our website for up to date email contact information. |
[edit] Appendix A: Default Settings
| Setting | Cmd# | T-JOY3 |
| Device Id | na* | 3003 |
| Mode | 40 | 0 |
| Alias** | 48 | 0 |
Notes:
* The device Id is not user configurable. It can however be returned using command #50.
** Aliases are not reset to 0 by command #36. To set an alias back to 0, you must use the set alias command #48.
[edit] Appendix B: Device Specifications
For complete device specifications for T-JOY actuators please see our website.

