class SangaboardThing(BaseStage): (source)
Constructor: SangaboardThing(thing_server_interface, port, **kwargs)
A Thing to manage a Sangaboard motor controller.
Internally, this uses the pysangaboard package from PyPi. This imports as sangaboard. As pysangaboard does not support some features added to the Sangaboard firmware v1 (LED flashing, aborting moves, etc) this functionality is accessed by directly querying the serial interface.
| Method | __enter__ |
Connect to the sangaboard when the Thing context manager is opened. |
| Method | __exit__ |
Close the sangaboard connection when the Thing context manager is closed. |
| Method | __init__ |
Initialise SangaboardThing. |
| Method | check |
Error/warn if firmware doesn't meet requirements/recommendations. |
| Method | set |
Flash the LED to identify the board. |
| Method | set |
Make the current position zero in all axes. |
| Instance Variable | axis |
Used to convert coordinates between the program frame and the hardware frame. |
| Instance Variable | moving |
Whether the stage is in motion. |
| Instance Variable | sangaboard |
Undocumented |
| Method | _estimate |
Calculate the expected duration of a move with the given displacement. |
| Method | _hardware |
Make a absolute move in the coordinate system used by the sangaboard. |
| Method | _hardware |
Make a relative move in the coordinate system used by the sangaboard. |
| Method | _hardware |
Start a relative move. |
| Method | _hardware |
Stop any motion of the stage as soon as possible. |
| Method | _hardware |
Read position from the stage and set internal attribute _hardware_position. |
| Method | _poll |
Determine if the stage is still moving. |
| Instance Variable | _hardware |
Undocumented |
| Instance Variable | _sangaboard |
Undocumented |
| Instance Variable | _step |
Undocumented |
Inherited from BaseStage:
| Method | get |
Return a tuple containing (x, y, z) position. |
| Method | invert |
Invert the direction setting of the given axis. |
| Method | jog |
Make a relative move that may be interrupted by a future jog. |
| Method | move |
Make an absolute move. Keyword arguments should be axis names. |
| Method | move |
Make a relative move. Keyword arguments should be axis names. |
| Method | move |
Move to the location specified by an (x, y, z) tuple. |
| Method | update |
Update the position property from the stage. |
| Class Variable | backlash |
The number of steps to elimate backlash. The sign sets the direction. |
| Property | axis |
The names of the stage's axes, in order. |
| Property | position |
Current position of the stage. |
| Property | thing |
Summary metadata describing the current state of the stage. |
| Method | _apply |
Undocumented |
| Method | _get |
Get the next JogCommand from the jog queue. |
| Method | _jog |
Execute jog commands in a background thread. |
| Method | _move |
Make a movement with backlash correction. |
| Method | _send |
Send a jog command to the background jog thread. |
| Class Variable | _axis |
Undocumented |
| Instance Variable | _backlash |
Undocumented |
| Instance Variable | _hardware |
Undocumented |
| Instance Variable | _jog |
Undocumented |
| Instance Variable | _jog |
Undocumented |
| Instance Variable | _jog |
Undocumented |
type[ BaseException], _exc_value: BaseException | None, _traceback: TracebackType | None):
(source)
¶
Close the sangaboard connection when the Thing context manager is closed.
lt.ThingServerInterface, port: str | None = None, **kwargs: Any):
(source)
¶
Initialise SangaboardThing.
Initialise the "Thing", but do not initialise an underlying Sangaboard object from pysangaboard until the Thing context manager is started.
| Parameters | |
thinglt.ThingServerInterface | Undocumented |
port:str | None | The serial port for the Sangaboard. Optional, this is used to stop the Sangaboard object querying available devices. |
**kwargs:Any | Any other keyword arguments to be passed to the Sangaboard class |
Error/warn if firmware doesn't meet requirements/recommendations.
Raise a Runtime Error if the version is below REQUIRED_VERSION
Log a warning if the version is below RECOMMENDED_VERSION
Flash the LED to identify the board.
This is intended to be useful in situations where there are multiple Sangaboards in use, and it is necessary to identify which one is being addressed.
Make the current position zero in all axes.
This action does not move the stage, but resets the position to zero. It is intended for use after manually or automatically recentring the stage.
Start a relative move.
This starts the stage moving, but does not wait for the move to complete. It sets self.moving to True: resetting it is the responsibility of the calling code.
Read position from the stage and set internal attribute _hardware_position.
_hardware_position should only be set in this function.
Determine if the stage is still moving.
This also sets moving if the status has changed.
| Returns | |
bool | whether the stage is still moving. |