T-Series/Commands/Set Device Mode/T-Series Motorized Devices

From ZaberWiki
Jump to navigation Jump to search

Warning: This is an "include" page. As such, its contents may be included in multiple other pages. To see a list of all pages that include this page, click on "What links here" in the bottom left navbar. If you make changes to this page, be sure that your changes are appropriate to all pages on which this content will be included. You are also encouraged to review our Zaber Wiki Editing Guidelines. This header will not be included in other pages.

Instruction Name Set Device Mode
Applies to T-Series motorized devices
Firmware Version 5.xx since 5.04
Command Number 40
Command Type Setting
Command Data Mode
Reply Data Mode
Safe to retry? Yes
Returns Current Position? No
Persistence Non-Volatile
Summary Sets the Mode for the given device.

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 * 2^n) + … + (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_3 (disable potentiometer), 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^3 + 2^14 + 2^15
= 8 + 16384 + 32768
= 49160

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 8 to disable the potentiometer. If you then send another Set Device Mode command with data of 16384 to disable the power LED, you will re-enable the potentiometer since bit_3 in the 2nd instruction is 0.

Most devices have a default mode setting of 0 (all bits are 0), however, there are some exceptions. See Appendix A of the user manual for a table of default settings.

Bit_n 2^n Description


bit_0 1 Disable Auto-reply
A value of 1 disables ALL replies except those to “echo”, “read”, “renumber”, and “return” commands. The default value is 0 on all devices.
bit_1 2 Enable Anti-backlash Routine
A value of 1 enables anti-backlash. On negative moves (retracting), the device will overshoot the desired position by 640 microsteps (assuming 64 microsteps/step), reverse direction and approach the requested position from below. On positive moves (extending), the device behaves normally. Care must be taken not to crash the moving payload into a fixed object due to the 640 microsteps overshoot on negative moves. The default value is 0 on all devices. See note on anti-backlash and anti-sticktion below. *
bit_2 4 Enable Anti-sticktion Routine
A value of 1 enables the anti-sticktion routine. On moves less than 640 microsteps (assuming 64 microsteps/step), the device will first retract to a position 640 microsteps less than the requested position and approach the requested position from below. Care must be taken not to crash the moving payload into a fixed object due to the 640 microsteps negative move. The default value is 0 on all devices. See section on anti-backlash and anti-sticktion below this table. *
bit_3 8 Disable Potentiometer
A value of 1 disables the potentiometer preventing manual adjustment of the device. The default value is 0 on all devices.
bit_4 16 Enable Move Tracking
A value of 1 enables the Move Tracking response during move commands. The device will return its position periodically (every 0.25 sec) when a move command is executed. The Disable Auto-Reply option above takes precedence over this option. The default value is 0 on all devices. Before firmware version 5.14, only Move at Constant Speed commands could generate tracking responses, now all move commands can.
bit_5 32 Disable Manual Move Tracking
A value of 1 disables the Manual Move Tracking response during manual moves. The Disable Auto-Reply option above takes precedence over this option. The default value is 0 on all devices.
bit_6 64 Enable Message IDs
A value of 1 enables Message IDs. 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. Message IDs allow the users application to monitor communication packets individually to implement error detection and recovery. The default value is 0 on all devices. Prior to firmware version 5.06, this feature was called "Virtual Channels Mode" and did not behave reliably. We do not recommend enabling this mode of communications unless you have firmware version 5.06 or later.
bit_7 128 Home Status
This bit is set to 0 automatically on power-up or reset. It is set automatically when the device is homed or when the position is set using command #45. It can be used to detect if a device has a valid position reference. It can also be set or cleared by the user.
bit_8 256 Disable Auto-Home
A value of 1 disables auto-home checking. Checking for trigger of home sensor is only done when home command is issued. This allows rotational devices to move multiple revolutions without re-triggering the home sensor.
bit_9 512 Reverse Potentiometer
A value of 1 reverses the direction of the travel when the potentiometer is used to control the device. This mode bit was introduced in firmware version 5.06. Prior to that it was not used.
bit_10 1,024 Reserved
bit_11 2,048 Microstepping Mode
A value of 1 enables circular phase microstepping. A value of 0 enables square phase microstepping mode. The differences are:

Circular Phase:

  • constant torque
  • smoothest operation
  • better microstep accuracy
  • only 70% torque (and lower power consumption)

Square Phase:

  • non constant torque
  • less smooth operation
  • poorer microstep accuracy
  • 100% torque achieved (and higher power consumption)
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.

*Anti-backlash and Anti-sticktion routines are designed to compensate for backlash and sticktion. The solution to backlash is to always approach a position from the same direction. The solution to sticktion is to move the device far enough away from the final position to break free of sticktion before attempting the final move. The operation of the two features are dependent on each other, and the interaction of enabling one or both of the features is described in the diagram to the right.


AntiSticktion.jpg


For each setting scenario, the starting position is denoted by the solid vertical line and the final position is denoted by the dotted vertical line. There are four possible moves for each scenario: long move positive, long move negative, short move positive and short move negative. The arrows show the path that would be traversed for each scenario.