Repository navigation
Add the OWIS_PS10 actuator plugin - #3
Merged
Merged
Conversation
The master is addressed without prefix, the slaves with their two-digit slave ID. Commands without reply are sent with write, queries with query, which raises PS10Error when the unit does not answer. Tested on COM8 with one master and three slaves.
PS10Axis drives the single axis of one PS 10 unit in physical units (mm or deg), converted with the number of microsteps per unit: init (INIT1 then ABSOL1), state, is_moving, get_position, move_abs (non-blocking) and stop. AxisState names the letters returned by ?ASTAT. Tested on the LTM60 of slave 1: 0 -> 0.5 mm -> 0, state READY after each move.
One [[ps10.axes]] block per PS 10 unit with its slave ID ('master' for the unit on USB) and the mechanical values shown by OWISoft (pitch, gear ratio, full steps per revolution, microsteps), from which the plugin computes the microsteps per unit. The default port is MOCK. The example axes are the four stages of the setup it was developed on.
steps_per_unit computes the microsteps per unit from the values shown by OWISoft, and PS10Axis.from_config builds an axis from one [[ps10.axes]] block, converting slave_id 'master' to None. Tested read-only on the four units: 20000, 10000, 5000 and 10000 steps per unit.
MockPS10Bus has the public methods of PS10Bus and simulates the commands used by PS10Axis: units start disabled in relative mode, PGO1 is ignored until INIT1, the counter moves at the PVEL velocity, an absent unit ignores commands and raises PS10Error on queries, and any other command raises PS10Error. It will back the MOCK port and the tests.
Multi-axis plugin built on PS10Axis: the axes, their units and their conversion come from the [[ps10.axes]] blocks of the configuration, the master module opens the bus (MockPS10Bus when the port is MOCK) and the slave modules share it. move_abs and move_rel send absolute targets, stop_motion stops the axis and calls move_done. move_home is not implemented yet (the reference run still has to be tested). slave_id_from_config is factored out in the wrapper. Tested with the MOCK port only: init, axis change, absolute and relative moves, stop.
Conversions of the three stage types, slave ID of the master, absent unit, no move before INIT1, and for the plugin forced on the MOCK port: init, absolute and relative moves, a target in another unit, stop_motion emitting move_done, and a slave module sharing the bus of the master.
The template now describes one translation stage on the master unit and one rotation stage on the first slave, as examples: the axes of a setup belong to the local configuration file, whose [[ps10.axes]] blocks replace those of the template. Remove the import of Config from the plugin: the configurations of the plugins are registered when pymodaq is imported, not when their utils module is.
PyMoDAQ displays an angle in degrees only when its unit contains 'degree' or the degree sign (get_unit_to_display); with 'deg' it falls back to radians, the base unit of pint.
PS10Axis.reference starts REF1=4 (approach the reference switch, release it, set the position to 0) and is_referenced reads ?REFST1. init no longer sends INIT1 to an axis that is already ready, since INIT1 clears the validity of the reference run. move_home chains the reference run and a move to the optional home_position of the axis, then calls move_done; a failed reference run is reported and leaves the axis at the switch. The simulator handles REF1 and ?REFST1. Tested on the four stages.
Docstring: compatible devices, what was tested on the hardware and with the MOCK port, versions, driver and dependence on the parameters set with OWISoft. README: description, author, instrument, installation, configuration of the axes in the local file, development.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Actuator plugin for OWIS stages driven by PS 10 control units chained on their
CANopen bus (one axis per unit, the master connected by USB).
hardware/ps10.py
two-digit slave ID. Queries raise PS10Error when a unit does not answer.
microsteps per unit computed from the values shown by OWISoft (pitch, gear
ratio, full steps per revolution, microsteps). init, absolute moves, position,
state (AxisState), stop, reference run (REF1=4) and its validity (?REFST1).
INIT1 is only sent to an axis that is not ready, since it clears the validity
of the reference run.
daq_move_OWIS_PS10.py
share it. The axes are read from the [[ps10.axes]] blocks of the configuration.
moves the axis to its optional home_position.
Tests: tests/test_owis_ps10.py, against the simulated bus.
Tested on the hardware with four PS 10-32 units (HVM100N-30-HiSM, two
LTM60-25-HSM, DMT65-DM6-HSM): init, absolute and relative moves, stop, reference
run, four axes in one Dashboard experiment sharing the bus.
Windows 11, Python 3.12, PyMoDAQ 5.3.10.