class SangaboardThing(BaseStage): (source)
Constructor: SangaboardThing(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 | flash |
Flash the LED to identify the board. |
| Method | sangaboard |
Return the wrapped sangaboard.Sangaboard instance. |
| Method | set |
Make the current position zero in all axes. |
| Method | update |
Read position from the stage and set the corresponding property. |
| 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 | _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. |
| Instance Variable | _hardware |
Undocumented |
| Instance Variable | _sangaboard |
Undocumented |
| Instance Variable | _sangaboard |
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 | 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. |
| 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 |
| Class Variable | _axis |
Undocumented |
Initialise SangaboardThing.
Initialise the "Thing", but do not initialise an underlying Sangaboard object from pysangaboard until the Thing context manager is started.
| Parameters | |
port:str | The serial port for the Sangaboard. Optional, this is used to stop the Sangaboard object querying available devices. |
| **kwargs | Any other keyword arguments to be passed to the Sangaboard class |
int = 10, dt: float = 0.5, led_channel: Literal[ 'cc'] = 'cc'):
(source)
¶
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.
Return the wrapped sangaboard.Sangaboard instance.
This is protected by a threading.RLock, which may change in future.
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.
lt.deps.CancelHook, block_cancellation: bool = False, **kwargs: Mapping[ str, int]):
(source)
¶
Make a absolute move in the coordinate system used by the sangaboard.
lt.deps.CancelHook, block_cancellation: bool = False, **kwargs: Mapping[ str, int]):
(source)
¶
Make a relative move in the coordinate system used by the sangaboard.