ATHexapodController¶
- class lsst.ts.athexapod.ATHexapodController(log=None)¶
Bases:
object
Implements wrapper around ATHexapod server.
- Parameters:
- log
logging.Logger
orNone
Provide preconfigured log or None to create a default one.
- log
- Attributes:
- host
str
The address of the host.
- port
int
The port to connect to.
- timeout
float
The regular timeout.
- long_timeout
float
The longer timeout for actions which move the hexapod.
- reader
asyncio.StreamReader
The asynchronous reader.
- writer
asyncio.StreamWriter
The asynchronous writer.
- lock
asyncio.Lock
The lock on the connection.
- log
logging.Logger
The log for this class.
- host
Attributes Summary
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.
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.
Return parsed controller ready response.
Disconnect from hexapod controller.
Return parsed pivot point response.
get_clv
()Return parsed response for closed loop velocity.
Return get error response.
Return parsed higher position software limit response.
Return parsed lower position software limit response.
Return parsed position unit response.
get_sv
()Return parsed response for system velocity.
Return parsed motion status string.
offset
([x, y, z, u, v, w])Set the offset of the Hexapod.
Return parsed on target response
Return parsed position changed response.
Return parsed real position string
Perform a reference in all axes.
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.
Return parsed target position response.
write_command
(cmd[, has_response, num_line])Send command to hexapod controller and return response.
Attributes Documentation
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)).
- async check_active_soft_limit()¶
Return parsed response for checking if software limit is active.
SSL? (p. 230) Get Soft Limit Status
- 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:
- Returns:
- 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:
- comp
str
A character indicating the controller is ready or not ready.
- comp
- async disconnect()¶
Disconnect from hexapod controller.
- async getPivotPoint()¶
Return parsed pivot point response.
(p. 229) (Get Pivot Point)
Gets the pivot point coordinates.
- 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.
- 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:
- response
int
The latest error code.
- response
- async get_high_position_soft_limit()¶
Return parsed higher position software limit response.
- 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.
- async get_position_unit()¶
Return parsed position unit response.
(p. 217) Get Position Unit
Get the current unit of the position.
- 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:
- response
float
The current system velocity.
- response
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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”).
- 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”).
- 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
- 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)
- 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:
- velocity
float
The platform velocity.
- 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.
- async write_command(cmd, has_response=True, num_line=1)¶
Send command to hexapod controller and return response.