ATHexapodController

class lsst.ts.athexapod.ATHexapodController(log=None)

Bases: object

Implements wrapper around ATHexapod server.

Parameters
loglogging.Logger or None

Provide preconfigured log or None to create a default one.

Attributes
hoststr

The address of the host.

portint

The port to connect to.

timeoutfloat

The regular timeout.

long_timeoutfloat

The longer timeout for actions which move the hexapod.

readerasyncio.StreamReader

The asynchronous reader.

writerasyncio.StreamWriter

The asynchronous writer.

lockasyncio.Lock

The lock on the connection.

loglogging.Logger

The log for this class.

Attributes Summary

is_connected

Check if connected to the controller.

Methods Summary

activate_soft_limit([x, y, z, u, v, w])

Set the software limits as active or not.

check_active_soft_limit()

Return parsed response for checking if software limit is active.

check_offset([x, y, z, u, v, w])

Return parsed check offset response.

connect()

Connect to hexapod controller.

controller_ready()

Return parsed controller ready response.

disconnect()

Disconnect from hexapod controller.

getPivotPoint()

Return parsed pivot point response.

get_clv()

Return parsed response for closed loop velocity.

get_error()

Return get error response.

get_high_position_soft_limit()

Return parsed higher position software limit response.

get_low_position_soft_limit()

Return parsed lower position software limit response.

get_position_unit()

Return parsed position unit response.

get_sv()

Return parsed response for system velocity.

motion_status()

Return parsed motion status string.

offset([x, y, z, u, v, w])

Set the offset of the Hexapod.

on_target()

Return parsed on target response

position_changed()

Return parsed position changed response.

real_position()

Return parsed real position string

reference()

Perform a reference in all axes.

referencing_result()

Return parsed referencing result response.

set_clv([x, y, z, u, v, w])

Set the closed loop velocity.

set_high_position_soft_limit([x, y, z, u, v, w])

Set the higher position software limit.

set_low_position_soft_Limit([x, y, z, u, v, w])

Set lower position software limit.

set_pivot_point([x, y, z])

Set the pivot point of the Hexapod.

set_position([x, y, z, u, v, w])

Set position of Hexapod.

set_sv(velocity)

Set the system velocity.

stop_all_axes()

Stop all axes.

target_position()

Return parsed target position response.

write_command(cmd[, has_response, num_line])

Send command to hexapod controller and return response.

Attributes Documentation

is_connected

Check if connected to the controller.

Returns
connectedbool

Methods Documentation

async activate_soft_limit(x=True, y=True, z=True, u=True, v=True, w=True)

Set the software limits as active or not.

(p. 229) Set Soft Limit

Activates or deactivates the soft limits that are set with NLM (p. 212) and PLM (p. 214).

Soft limits can only be activated/deactivated when the axis is not moving (query with #5 (p. 140)).

Parameters
xbool

activate software limit for X axis.

ybool

activate software limit for Y axis.

zbool

activate software limit for Z axis.

ubool

activate software limit for U axis.

vbool

activate software limit for V axis.

wbool

activate software limit for W axis.

async check_active_soft_limit()

Return parsed response for checking if software limit is active.

SSL? (p. 230) Get Soft Limit Status

Returns
responselist of float

The current status of the software limits for each axis.

async check_offset(x=None, y=None, z=None, u=None, v=None, w=None)

Return parsed check offset response.

(p. 253) VMO? (Virtual Move)

Checks whether the moving platform of the Hexapod can approach a specified position from the current position.

Used to validate if MVR command is possible.

Parameters
xNone or float

The position to check.

yNone or float

The position to check.

zNone or float

The position to check.

uNone or float

The position to check.

vNone or float

The position to check.

wNone or float

The position to check.

Returns
responselist of float

Whether each axis can make the move.

async connect()

Connect to hexapod controller.

async controller_ready()

Return parsed controller ready response.

(p. 141) Request Controller Ready Status Asks controller for ready status (tests if controller is ready to perform a new command)

B1h (ASCII character 177) if controller is ready B0h (ASCII character 176) if controller is not ready (e.g., performing a reference move)

Returns
compstr

A character indicating the controller is ready or not ready.

async disconnect()

Disconnect from hexapod controller.

async getPivotPoint()

Return parsed pivot point response.

(p. 229) (Get Pivot Point)

Gets the pivot point coordinates.

Returns
responselist of float

The current pivot points of the Hexapod.

async get_clv()

Return parsed response for closed loop velocity.

(p. 244) (Get Closed-Loop Velocity)

If all arguments are omitted, the value of all axes commanded with VEL is queried.

Returns
responselist of float

The current closed loop velocity for each axis.

async get_error()

Return get error response.

(p. 163) Get Error Number

Get error code of the last occurred error and reset the error to 0.

Returns
responseint

The latest error code.

async get_high_position_soft_limit()

Return parsed higher position software limit response.

Returns
responselist of float

The current higher limit values.

async get_low_position_soft_limit()

Return parsed lower position software limit response.

Get the position “soft limit” which determines the low end of the axis travel range in closed-loop operation.

Returns
responselist of float

The current lower limit values.

async get_position_unit()

Return parsed position unit response.

(p. 217) Get Position Unit

Get the current unit of the position.

Returns
responselist of str

The current units of the axii.

async get_sv()

Return parsed response for system velocity.

(p. 252) Gets the velocity of the moving platform of the Hexapod that is set with VLS (p. 245).

Returns
responsefloat

The current system velocity.

async motion_status()

Return parsed motion status string.

(p. 140) Request Motion Status. Axes 1 to 8 correspond to the X, Y, Z, U, V, W, A and B axes in this order. Exception: When the “NOSTAGE” stage type is assigned to an axis (possible for axes A and B; query with the CST? (p. 152) command), this axis is not included in the bitmapped answer. In this case, it is skipped when counting the axes.

Returns
is_movingtuple of (bool, bool, bool, bool, bool, bool)
async offset(x=None, y=None, z=None, u=None, v=None, w=None)

Set the offset of the Hexapod.

(p. 215) Set Target Relative To Current Position Moves given axes relative to the last commanded target position.

Parameters
xNone or float

The position to move X axis to.

yNone or float

The position to move Y axis to.

zNone or float

The position to move Z axis to.

uNone or float

The position to move U axis to.

vNone or float

The position to move V axis to.

wNone or float

The position to move W axis to.

async on_target()

Return parsed on target response

(p. 213) Get On Target State

Gets on-target state of given axis.

if all arguments are omitted, gets state of all axes.

Returns
responselist of float

Current on target status of all axii.

async position_changed()

Return parsed position changed response.

Queries whether the axis positions have changed since the last position query was sent. Response: The response <uint> is a bit mask and returned as the hexadecimal sum of the following codes:

1 = Position of the first axis has changed 2 = Position of the second axis has changed 4 = Posiiton of the third axis has changed …

Reads response from server and returns a parsed response.

Returns
pos_changedtuple of (bool, bool, bool, bool, bool,

The value of each axis changed or not.

async real_position()

Return parsed real position string

(p. 138) Get Real Position. This command is identical in function to POS? (p. 216), but only one character has to be sent via the interface. Therefore #3 can also be used while the controller is performing timeconsuming tasks. Between the switching-on of the controller and the reference point definition of the Hexapod with FRF (p. 174), the current position of the Hexapod and axes A and B is unknown. Nevertheless, the response to #3 gives the position value 0 for all axes.

Returns
real_postuple of (float, float, float, float, float,

Positions for the X (mm), Y (mm), Z (mm), U (deg), V (deg), W (deg) axis.

async reference()

Perform a reference in all axes.

async referencing_result()

Return parsed referencing result response.

(p. 175) Get Referencing Result Axes X, Y, Z, U, V, W, A and B are considered to be “referenced” when a reference move has been successfully completed with FRF (p. 174). Axes A and B are considered to be “referenced” even if the parameter Sensor Reference Mode (ID 0x02000A00) was changed to value 1 (p. 98) with SPA (p. 224). It is necessary to change the parameter value when the connected stage is not equipped with a reference point switch and can therefore not carry out a reference move. Axes K, L and M are equipped with absolute-measuring sensors and do not need a reference move. For this reason, FRF? always responds with 1 for these axes. This controller only responds with X Y Z U V W axes.

Returns
responselist of float

The current status of axii referenced or not referenced.

async set_clv(x=None, y=None, z=None, u=None, v=None, w=None)

Set the closed loop velocity.

(p. 243) (Set Closed-Loop Velocity)

The velocity can be changed with VEL while the axis is moving.

Parameters
xNone or float

The velocity of the X axis.

yNone or float

The velocity of the y axis.

zNone or float

The velocity of the z axis.

uNone or float

The velocity of the U axis.

vNone or float

The velocity of the V axis.

wNone or float

The velocity of the W axis.

async set_high_position_soft_limit(x=None, y=None, z=None, u=None, v=None, w=None)

Set the higher position software limit.

(p. 214) Set High Position Soft Limit

Limits the high end of the axis travel range in closed-loop operation (“soft limit”).

Parameters
xNone or float

The X axis higher limit.

yNone or float

The Y axis higher limit.

zNone or float

The Z axis higher limit.

uNone or float

The U axis higher limit.

vNone or float

The V axis higher limit.

wNone or float

The W axis higher limit.

async set_low_position_soft_Limit(x=None, y=None, z=None, u=None, v=None, w=None)

Set lower position software limit.

(p. 212) Set Low Position Soft Limit

Limits the low end of the axis travel range in closed-loop operation (“soft limit”).

Parameters
xNone or float

The X axis lower limit.

yNone or float

The Y axis lower limit.

zNone or float

The Z axis lower limit.

uNone or float

The U axis lower limit.

vNone or float

The V axis lower limit.

wNone or float

The W axis lower limit.

async set_pivot_point(x=None, y=None, z=None)

Set the pivot point of the Hexapod.

(p. 227)(Set Pivot Point)

Sets the pivot point coordinates in the volatile memory. Can only be set when the following holds true for the rotation coordinates of the moving platform: U = V = W = 0

Returns
xNone or float

The pivot point of the X axis.

yNone or float

The pivot point of the Y axis.

zNone or float

The pivot point of the Z axis.

async set_position(x=None, y=None, z=None, u=None, v=None, w=None)

Set position of Hexapod.

(p. 206) Set Target Position

Execute

Send

MOV X 10 U 5

Note

Axis X moves to 10 (target

position in mm), axis U moves to 5 (target position in deg)

Parameters
xNone or float

X-axis position (in mm).

yNone or float

Y-axis position (in mm).

zNone or float

Z-axis position (in mm).

uNone or float

U-axis rotation (in deg).

vNone or float

V-axis rotation (in deg).

wNone or float

W-axis rotation (in deg).

async set_sv(velocity)

Set the system velocity.

(p. 251) (Set System Velocity)

Sets the velocity for the moving platform of the Hexapod

The velocity can only be set with VLS when the Hexapod is not moving (axes X, Y, Z, U, V, W; query with #5 (p. 140)). For axes A and B, the velocity can be set with VEL (p. 243).

Parameters
velocityfloat

The platform velocity.

async stop_all_axes()

Stop all axes.

(p. 143) Stop All Axes To confirm that this worked, #5 has to be used.

async target_position()

Return parsed target position response.

(p. 208) Get Target Position

MOV? gets the commanded positions. Use POS? (p. 216) to get the current positions.

Returns
responselist of float

The current target position.

async write_command(cmd, has_response=True, num_line=1)

Send command to hexapod controller and return response.

Parameters
cmdstr

Command to send to hexapod. A ‘newline’ character will be appended.

has_responsebool

Does the command have a response?

num_lineint

The number of expected lines/replies.

Returns
replieslist

List with the response(s) from the command.