stepseries.commands – Device Commands
Messages to send to the device.
This module provides dataclass objects that act as templates for you to ‘fill in’ with data. This allows you to focus on WHAT to send, not how.
Some commands will have an extra response_cls attribute. This
attribute is used internally in the library, but may be useful for you.
It holds the response type, not the actual device response.
All commands that control automatic reporting of the device’s internal
state changes have an extra callback attribute. This attribute is a
shortcut to automatically register a callback to handle incoming
responses from the device.
- class stepseries.commands.Activate(motorID: int, state: bool)[source]
Enables or disables the electromagnetic brake.
stepseries.commands.EnableElectromagnetBrakemust be enabled for this command to have an effect.Executable Timing
Always
- class stepseries.commands.EnableBusyReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable the automatic reporting of busy status changes.
Executable Timing
Always
- class stepseries.commands.EnableDirReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable the automatic reporting of direction changes.
Executable Timing
Always
- class stepseries.commands.EnableElectromagnetBrake(motorID: int, enable: bool)[source]
Enable or disable electromagnetic brake operation.
Not to be confused with
stepseries.commands.Activatewhich activates or deactivates the brake.While enabled, the controller will reply with
ERROR_BRAKE_ENGAGEDif a movement command is sent without releasing the brake.Executable Timing
Always
- class stepseries.commands.EnableHiZReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable the automatic reporting of HiZ status changes.
Executable Timing
Always
- class stepseries.commands.EnableHomeSwReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable the automatic reporting of home switch changes.
Also see
stepseries.commands.EnableSwEventReport.Executable Timing
Always
- class stepseries.commands.EnableLimitSwReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable automatic reporting of limit switch changes.
STEP400 OnlyExecutable Timing
Always
- class stepseries.commands.EnableLowSpeedOptimize(motorID: int, enable: bool)[source]
Enable or disable low speed optimization.
At very low speeds with minimal drive voltage, motors tend to have difficulty maintaining smooth operation due to phase current distortion. This optimizer attempts to compensate for that. When enabled, the minimum speed of the speed profile is forced to zero.
See the datasheet for more details.
Executable Timing
Stopped
- response_cls
alias of
LowSpeedOptimizeThreshold
- class stepseries.commands.EnableMotorStatusReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable the automatic reporting of motor op changes.
The reports are sent when the motor changes its current op like acceleration, constant speed, deceleration or stopping.
Executable Timing
Always
- response_cls
alias of
MotorStatus
- class stepseries.commands.EnableOverCurrentReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable the automatic reporting of overcurrent events.
Overcurrent events are sent whenever the motor driver exceeds the configured threshold. This threshold can be set using
stepseries.commands.SetOverCurrentThreshold.When overcurrent draw is detected, the device automatically enters a HiZ state with or without notification.
This report is enabled by default.
Executable Timing
Always
- response_cls
alias of
OverCurrent
- class stepseries.commands.EnableServoMode(motorID: int, enable: bool)[source]
Enable or disable servo mode (position tracking mode).
It is not possible to send other control commands such as
stepseries.commands.Runorstepseries.commands.GoTowhen in this mode.Executable Timing
Always
- class stepseries.commands.EnableStallReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable the automatic reporting of stall events.
The threshold can be set with
stepseries.commands.SetStallThreshold.Executable Timing
Always
- class stepseries.commands.EnableSwEventReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable the automatic reporting of home switch changes.
While very similar to
stepseries.commands.EnableHomeSwReportwhich polls the motor driver for the status of the home switch, this report essentially “listens” for a notification from the motor driver chip. This report is able to detect the closure of the home switch in under 1ms.Executable Timing
Always
- class stepseries.commands.EnableThermalStatusReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable the automatic reporting of thermal statuses.
Thermal status events are sent whenever the motor driver exceeds certain temperature thresholds. Note that these thresholds are different between the STEP400 and STEP800.
Two thresholds will automatically shut down the driver or device when crossed and the corresponding motor(s) will be placed into a HiZ state with or without notification. It is HIGHLY recommended to put the included heatsinks on each motor driver chip to avoid hitting these thermal thresholds.
This report is enabled by default.
Executable Timing
Always
STEP400:
TH_STATUS
Description
Enable Threshold
Disable Threshold
0
Normal
1
Warning
135°C
125°C
2
Bridge shutdown
155°C
145°C
3
Device shutdown
170°C
130°C
STEP800:
TH_STATUS
Description
Enable Threshold
Disable Threshold
0
Normal
1
Warning
130°C
130°C
2
Bridge shutdown
160°C
130°C
- response_cls
alias of
ThermalStatus
- class stepseries.commands.EnableUvloReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable the automatic reporting of undervoltage events.
Undervoltage lockouts (UVLO) occur when the voltage supply to the motor falls below the UVLO turn-off threshold. In this state, the motor cannot be operated. UVLO will be reset when the voltage supply again rises above that threshold.
This report is enabled by default.
Executable Timing
Always
- class stepseries.commands.Free(motorID: int)[source]
Releases both the motor and brake.
Warning
If any load is attached to the motor, it will no longer be held when this command is sent.
stepseries.commands.EnableElectromagnetBrakemust be enabled for this command to have an effect.Executable Timing
Always
- class stepseries.commands.GetAdcVal(motorID: int)[source]
Retrieves
ADC_OUTregister values for a motor.ADC_OUTstores the 5-bit AD-converted voltage reading from the ADC pin on the motor driver chip. In the STEP400, this pin is pulled up with a 10kΩ resistor wired directly to the LIMITSW connector. In the STEP800, this pin is tied to GND and will always be 0V.Note
This command is only meant for debugging purposes. Most users should avoid this command.
Executable Timing
Always
- class stepseries.commands.GetBemfParam(motorID: int)[source]
Retrieves the BEMF compensation register.
Executable Timing
Always
- class stepseries.commands.GetBrakeTransitionDuration(motorID: int)[source]
Retrieve the brake transition duration.
Due to the physical transition time of the brake, the motor needs to be engaged to cover this period which this command retrieves.
Executable Timing
Always
- response_cls
alias of
BrakeTransitionDuration
- class stepseries.commands.GetBusy(motorID: int)[source]
Retrieve the busy status of a motor.
Executable Timing
Always
- class stepseries.commands.GetConfigName[source]
Retrieve the name of the microSD config file on the controller.
Executable Timing
Always
- response_cls
alias of
ConfigName
- class stepseries.commands.GetConfigRegister(motorID: int)[source]
Retrieves the CONFIG register values for a motor.
This register stores information about motor, alaram, and switch statuses.
Note
This command is only meant for debugging purposes. Most users should avoid this command.
Executable Timing
Always
- response_cls
alias of
ConfigRegister
- class stepseries.commands.GetDecayModeParam(motorID: int)[source]
Retrieves the current control algorithm parameters.
STEP400 OnlyExecutable Timing
Always
- response_cls
alias of
DecayModeParam
- class stepseries.commands.GetDir(motorID: int)[source]
Retrieve the current direction of a motor.
Executable Timing
Always
- class stepseries.commands.GetElPos(motorID: int)[source]
Retrieve the current electrical position of the motor.
Executable Timing
Always
- class stepseries.commands.GetFullstepSpeed(motorID: int)[source]
Retrieves the switch threshold of microstepping to fullstepping.
Executable Timing
Always
- response_cls
alias of
FullstepSpeed
- class stepseries.commands.GetGoUntilTimeout(motorID: int)[source]
Retrieve the timeout for
stepseries.commands.GoUntil.Executable Timing
Always
- response_cls
alias of
GoUntilTimeout
- class stepseries.commands.GetHiZ(motorID: int)[source]
Retrieve the HiZ status of a motor.
Executable Timing
Always
- class stepseries.commands.GetHomeSw(motorID: int)[source]
Retrieve the status of the home switch.
Executable Timing
Always
- class stepseries.commands.GetHomeSwMode(motorID: int)[source]
Retrieve the configured mode for the home switch.
Executable Timing
Always
- response_cls
alias of
HomeSwMode
- class stepseries.commands.GetHomingDirection(motorID: int)[source]
Retrieve the homing direction for a motor.
Executable Timing
Always
- response_cls
alias of
HomingDirection
- class stepseries.commands.GetHomingSpeed(motorID: int)[source]
Retrieve the homing speed for a motor.
Executable Timing
Always
- response_cls
alias of
HomingSpeed
- class stepseries.commands.GetHomingStatus(motorID: int)[source]
Retrieve the homing status of a motor.
Executable Timing
Always
- response_cls
alias of
HomingStatus
- class stepseries.commands.GetKval(motorID: int)[source]
Retrieves the four KVAL parameters for a specified motor.
Executable Timing
Always
- class stepseries.commands.GetLimitSw(motorID: int)[source]
Retrieve the status of the limit switch.
STEP400 OnlyExecutable Timing
Always
- class stepseries.commands.GetLimitSwMode(motorID: int)[source]
Retrieve the configured mode for the limit switch.
STEP400 OnlyExecutable Timing
Always
- response_cls
alias of
LimitSwMode
- class stepseries.commands.GetLowSpeedOptimizeThreshold(motorID: int)[source]
Retrieve the low speed optimization threshold.
Executable Timing
Always
- response_cls
alias of
LowSpeedOptimizeThreshold
- class stepseries.commands.GetMark(motorID: int)[source]
Retrieve the MARK position.
Executable Timing
Always
- class stepseries.commands.GetMicrostepMode(motorID: int)[source]
Retrieves the configured microstepping mode for a motor.
Executable Timing
Always
- response_cls
alias of
MicrostepMode
- class stepseries.commands.GetMinSpeed(motorID: int)[source]
Retrieve the minimum speed of the speed profile.
Executable Timing
Always
- class stepseries.commands.GetMotorStatus(motorID: int)[source]
Retrieve the current op status of a motor.
Executable Timing
Always
- response_cls
alias of
MotorStatus
- class stepseries.commands.GetOverCurrentThreshold(motorID: int)[source]
Retrieve the overcurrent threshold for a motor.
Executable Timing
Always
- response_cls
alias of
OverCurrentThreshold
- class stepseries.commands.GetPosition(motorID: int)[source]
Retrieve the current position of the motor.
Alternatively,
stepseries.commands.SetPositionReportIntervalcan be configured to periodically send the current position.Executable Timing
Always
- class stepseries.commands.GetPositionList[source]
Retrieve the current positions for ALL motors.
Alternatively,
stepseries.commands.SetPositionListReportIntervalcan be configured to periodically send the current position.Executable Timing
Always
- response_cls
alias of
PositionList
- class stepseries.commands.GetProhibitMotionOnHomeSw(motorID: int)[source]
Retrieve if motion towards the homing direction is disabled when the home switch is activated.
Executable Timing
Always
- response_cls
alias of
ProhibitMotionOnHomeSw
- class stepseries.commands.GetProhibitMotionOnLimitSw(motorID: int)[source]
Retrieve if motion in the opposite of the homing direction is disabled when the limit switch is activated.
STEP400 OnlyExecutable Timing
Always
- response_cls
alias of
ProhibitMotionOnLimitSw
- class stepseries.commands.GetReleaseSwTimeout(motorID: int)[source]
Retrieve the timeout for
stepseries.commands.ReleaseSw.Executable Timing
Always
- response_cls
alias of
ReleaseSwTimeout
- class stepseries.commands.GetServoParam(motorID: int)[source]
Retrieve the servo PID control parameters.
Executable Timing
Always
- response_cls
alias of
ServoParam
- class stepseries.commands.GetSpeed(motorID: int)[source]
Retrieve the current motor speed.
Executable Timing
Always
- class stepseries.commands.GetSpeedProfile(motorID: int)[source]
Retrieves all three speed profile settings.
Executable Timing
Always
- response_cls
alias of
SpeedProfile
- class stepseries.commands.GetStallThreshold(motorID: int)[source]
Retrieve the stall threshold for a motor.
Executable Timing
Always
- response_cls
alias of
StallThreshold
- class stepseries.commands.GetStatus(motorID: int)[source]
Retrieves the status of the motor driver chip on the device.
This status includes the op status of the motor, alarms and, switches.
Note
This command is only meant for debugging purposes. Most users should avoid this command.
Executable Timing
Always
- class stepseries.commands.GetThermalStatus(motorID: int)[source]
Retrieves the thermal status of motor.
Note that these thresholds are different between the STEP400 and STEP800.
Executable Timing
Always
STEP400:
TH_STATUS
Description
Enable Threshold
Disable Threshold
0
Normal
1
Warning
135°C
125°C
2
Bridge shutdown
155°C
145°C
3
Device shutdown
170°C
130°C
STEP800:
TH_STATUS
Description
Enable Threshold
Disable Threshold
0
Normal
1
Warning
130°C
130°C
2
Bridge shutdown
160°C
130°C
- response_cls
alias of
ThermalStatus
- class stepseries.commands.GetTval(motorID: int)[source]
Retrieves the configuration for all four TVAL parameters.
STEP400 OnlyExecutable Timing
Always
- class stepseries.commands.GetTval_mA(motorID: int)[source]
Retrieves the configuration for all four TVAL parameters.
Unlike
stepseries.commands.GetTval, this returns the actual current values (in mA), not the register values.STEP400 OnlyExecutable Timing
Always
- class stepseries.commands.GetUvlo(motorID: int)[source]
Retrieves the current state of UVLO.
Executable Timing
Always
- class stepseries.commands.GetVersion[source]
Retrieve the current firmware version of the controller.
Executable Timing
Always
- class stepseries.commands.GoHome(motorID: int)[source]
Send this motor to its origin (zero) point.
Executable Timing
Not Busy
- class stepseries.commands.GoMark(motorID: int)[source]
Send this motor to its MARK positon.
Executable Timing
Not Busy
- class stepseries.commands.GoTo(motorID: int, position: int)[source]
Moves to the specified position in the shortest route possible.
-2097152 and 2097151 are next to each other in the driver chip, like how 0 and 360 are on a circle. This means if you specify 2097000 and the motor is currently at -2097000, then the motor will move to -2097152, then 2097151, and finally 2097000.
Alternatively,
stepseries.commands.GoToDircan be used to specific the direction in addition to the position.Keeps the motor in the ‘BUSY’ state until the specified position has been reached.
Executable Timing
Not Busy
- class stepseries.commands.GoToDir(motorID: int, DIR: bool, position: int)[source]
Moves to specified position in the specified direction.
-2097152 and 2097151 are next to each other in the driver chip, like how 0 and 360 are on a circle. As an example, if you specify 2097000, True (forward) and the motor is currently at -2097000, then the motor will move to -2000000, then 0, and finally 2097000.
Alternatively,
stepseries.commands.GoTowill automatically determine the shortest route (around that ‘circle’).Keeps the motor in the ‘BUSY’ state until the specified position has been reached.
Executable Timing
Not Busy
- class stepseries.commands.GoUntil(motorID: int, ACT: bool, speed: float)[source]
Run a motor until the HOME switch activates or times out.
The motor will run at the speed and direction according to the
speedparameter.By default, the motor will soft stop unless if
stepseries.commands.SetSwModeis set to 0.The timeout for this command can be set using
stepseries.commands.SetGoUntilTimeout.This command is not influenced by
stepseries.commands.SetHomingSpeedorstepseries.commands.SetHomingDirection.The motor is kept in a BUSY state until this command finishes.
Executable Timing
Always
- class stepseries.commands.HardHiZ(motorID: int)[source]
Immediately stops the motor.
When stopped, the motor’s excitation is released. If the electromagnetic brake is enabled, then the brake is put into a hold state before excitation is released. Transitions to HiZ after excitation is released. Remains in the BUSY state until the motor stops.
Executable Timing
Always
- class stepseries.commands.HardStop(motorID: int)[source]
Immediately stops the motor.
After stopping, the motor is kept in an excited state if it was originally in a HiZ state.
If it was in servo mode, then the mode will be released.
Executable Timing
Always
- class stepseries.commands.Homing(motorID: int)[source]
Start homing the motor.
The motor will start moving towards the origin point and then stop when the HOME switch activates. The motor will then slowly reverse until the HOME switch releases. The home point will be set to this point.
This command is essentially the combined functionality of
stepseries.commands.GoUntilandstepseries.commands.ReleaseSw.Homing direction and speed can be set with
stepseries.commands.SetHomingDirectionandstepseries.commands.SetHomingSpeed, respectively; or configured with the Config Tool.If the motor does not reach the HOME switch before
stepseries.commands.SetGoUntilTimeoutor release the HOME switch beforestepseries.commands.SetReleaseSwTimeout, then the controller will halt the motor’s movements.Executable Timing
Always
- class stepseries.commands.Move(motorID: int, step: int)[source]
Move the motor the specified number of steps.
Keeps the motor in the ‘BUSY’ state until the specified steps has been reached.
Executable Timing
Stopped
- class stepseries.commands.OSCCommand[source]
An abstract class meant to be implemented by OSC command objects.
If implementing your own command, it must inherit this class.
- class stepseries.commands.OSCGetCommand[source]
A command that only performs get functions on the device.
- class stepseries.commands.OSCSetCommand[source]
A command that only performs set functions on the device.
- class stepseries.commands.ReleaseSw(motorID: int, ACT: bool, DIR: bool)[source]
Move at a minimum speed until the HOME switch releases.
On release, the controller will hard stop the motor and then process the motor’s position according to
ACT.The timeout for this command can be set using
stepseries.commands.SetReleaseSwTimeout.This command is not influenced by
stepseries.commands.SetHomingSpeedorstepseries.commands.SetHomingDirection.The motor is kept in a BUSY state until this command finishes.
Executable Timing
Always
- class stepseries.commands.ReportError(enable: bool, callback: Optional[Callable[[...], None]] = None)[source]
Enable or disable automatic reports for command errors.
Executable Timing
Always
- class stepseries.commands.ResetDevice[source]
Resets the entire device.
A programmatic version of physically pressing the RESET button.
Executable Timing
Always
- class stepseries.commands.ResetMotorDriver(motorID: int)[source]
Resets the specified motor driver chip and resets defaults.
Note
This command is only meant for debugging purposes. Most users should avoid this command.
Executable Timing
Always
Deprecated
- class stepseries.commands.ResetPos(motorID: int)[source]
Resets the motor’s position to 0.
Executable Timing
Always
- class stepseries.commands.Run(motorID: int, speed: float)[source]
Run the motor at a constant speed.
The motor follows the configured speed profile set with
stepseries.commands.SetSpeedProfile.Keeps the motor in the ‘BUSY’ state until
speedhas been reached.Executable Timing
Always
- class stepseries.commands.SetAcc(motorID: int, acc: float)[source]
Sets the acceleration of the speed profile.
Executable Timing
Stopped
- class stepseries.commands.SetBemfParam(motorID: int, INT_SPEED: int, ST_SLP: int, FN_SLP_ACC: int, FN_SLP_DEC: int)[source]
Sets the BEMF compensation register.
BEMF only applies when the motor controller is in voltage mode. This goes without saying BEMF always applies on the STEP800.
Executable Timing
Always
- class stepseries.commands.SetBrakeTransitionDuration(motorID: int, duration: int)[source]
Duration to keep the motor activated while the brake transitions.
Due to the physical transition time of the brake, the motor needs to be engaged to cover this period.
Executable Timing
Always
- class stepseries.commands.SetCurrentMode(motorID: int)[source]
Switch a specific motor into current mode.
STEP400 OnlyNote
The STEP800 is always in voltage mode and cannot be switched.
Executable Timing
Always
- class stepseries.commands.SetDec(motorID: int, dec: float)[source]
Sets the deceleration of the speed profile.
Executable Timing
Stopped
- class stepseries.commands.SetDecayModeParam(motorID: int, T_FAST: int, TON_MIN: int, TOFF_MIN: int)[source]
Sets the current control algorithm parameters.
STEP400 OnlyDecay mode only applies when the motor controller is in current mode. This goes without saying decay mode never applies on the STEP800.
Executable Timing
HiZ
- class stepseries.commands.SetDestIP[source]
Set the destination IP address for the device’s responses.
Query replies, internal state reports, or command errors are sent to this destination IP. Typically this is the IP address of your computer. Upon receipt, the device will reply with a
stepseries.responses.DestIP. object.Until this command is sent, no OSC messages will be sent from the device with the exception being
responses.Booted. The Config Tool allows you to configure whether the device should wait for this command.Note: The library will return before
stepseries.responses.DestIPis received. This behavior will be changed in a future update.Executable Timing
Always
- class stepseries.commands.SetElPos(motorID: int, newFullstep: int, newMicrostep: int)[source]
Set the electrical position of the motor.
Microstepping is expressed as step/128 and the value must match the current microstep mode.
Executable Timing
Stopped
- class stepseries.commands.SetFullstepSpeed(motorID: int, fullstepSpeed: float)[source]
Sets the threshold when microstepping switches to full stepping.
Executable Timing
Always
- class stepseries.commands.SetGoUntilTimeout(motorID: int, timeOut: int)[source]
Set the timeout for
stepseries.commands.GoUntil.If the HOME switch is not activated before this timeout, then the controller stops the motor’s movements. Specify 0 to disable the timeout.
Can also be configured with the Config Tool.
Executable Timing
Always
- class stepseries.commands.SetHomeSwMode(motorID: int, SW_MODE: bool)[source]
Configure whether to stop immediately on home switch release.
Executable Timing
HiZ
- class stepseries.commands.SetHomingDirection(motorID: int, direction: bool)[source]
Sets the homing direction for homing.
Can also be configured with the Config Tool.
Executable Timing
Always
- class stepseries.commands.SetHomingSpeed(motorID: int, speed: float)[source]
Set the homing speed for a motor.
Can also be configured with the Config Tool.
Executable Timing
Always
- class stepseries.commands.SetKval(motorID: int, holdKVAL: int, runKVAL: int, accKVAL: int, decKVAL: int)[source]
Sets the configuration for all four KVAL parameters.
KVAL only applies when the motor controller is in voltage mode. This goes without saying KVAL always applies on the STEP800.
Executable Timing
Always
- class stepseries.commands.SetLimitSwMode(motorID: int, SW_MODE: bool)[source]
Configure whether to stop immediately on limit switch activated.
STEP400 OnlyExecutable Timing
Always
- class stepseries.commands.SetLowSpeedOptimizeThreshold(motorID: int, lowSpeedOptimizationThreshold: float)[source]
Set the threshold for phase current distortion compensation.
At very low speeds with minimal drive voltage, motors tend to have difficulty maintaining smooth operation due to phase current distortion. This optimizer attempts to compensate for that.
Note
Make sure to enable this optimizer with
stepseries.commands.EnableLowSpeedOptimize.Executable Timing
Motor is stopped
- class stepseries.commands.SetMark(motorID: int, MARK: int)[source]
Set the MARK register to an arbitrary position.
This register allows you store one position. Each write overwrites the last position set to this register.
Executable Timing
Always
- class stepseries.commands.SetMaxSpeed(motorID: int, maxSpeed: float)[source]
Set the maximum speed of the speed profile.
Executable Timing
Always
- class stepseries.commands.SetMicrostepMode(motorID: int, STEP_SEL: int)[source]
Sets the microstepping mode.
Voltage mode allows microstepping up to 1/128 which is also the default. Current mode only allows microstepping up to 1/16.
Executable Timing
Always
- class stepseries.commands.SetMinSpeed(motorID: int, minSpeed: float)[source]
Sets the minimum speed of the speed profile.
Also used for the motor speed of
stepseries.commands.ReleaseSw.If
stepseries.commands.EnableLowSpeedOptimizeis enabled, the this is automatically set to zero.Executable Timing
Stopped
- class stepseries.commands.SetOverCurrentThreshold(motorID: int, OCD_TH: int)[source]
Sets the overcurrent detection threshold.
Note that these thresholds are different between the STEP400 and STEP800.
Executable Timing
Always
- class stepseries.commands.SetPosition(motorID: int, newPosition: int)[source]
Overwrites the motor’s current position.
Executable Timing
Stopped
- class stepseries.commands.SetPositionListReportInterval(interval: int, callback: Optional[Callable[[...], None]] = None)[source]
Periodically send the current positions of all motors.
When enabled,
stepseries.commands.SetPositionReportIntervalwill be disabled.Executable Timing
Always
- interval: int
Time interval between reports.
When set to 0, this reporting is disabled.
Valid Range
0-2147483647 [ms]
Default
0 [ms]
- response_cls
alias of
PositionList
- class stepseries.commands.SetPositionReportInterval(motorID: int, interval: int, callback: Optional[Callable[[...], None]] = None)[source]
Periodically send the current position of a motor.
When enabled,
stepseries.commands.SetPositionListReportIntervalwill be disabled.Executable Timing
Always
- class stepseries.commands.SetProhibitMotionOnHomeSw(motorID: int, enable: bool)[source]
Prohibit motion towards the homing direction when the home sensor is activated.
The direction to the origin point can be configured using the Config Tool or with
stepseries.commands.SetHomingDirection.Executable Timing
Always
- class stepseries.commands.SetProhibitMotionOnLimitSw(motorID: int, enable: bool)[source]
Prohibit motion in the opposite direction of the homing direction when the limit sensor is activated.
The direction to the origin point can be configured using the Config Tool or with
stepseries.commands.SetHomingDirection.STEP400 OnlyExecutable Timing
Always
- class stepseries.commands.SetReleaseSwTimeout(motorID: int, timeOut: int)[source]
Set the timeout for
stepseries.commands.ReleaseSw.If the HOME switch is not releaseed before this timeout, then the controller stops the motor’s movements. Specify 0 to disable the timeout.
Can also be configured with the Config Tool.
Executable Timing
Always
- class stepseries.commands.SetServoParam(motorID: int, kP: float, kI: float, kD: float)[source]
Configure the servo PID control parameters.
Executable Timing
Always
- class stepseries.commands.SetSpeedProfile(motorID: int, acc: float, dec: float, maxSpeed: float)[source]
Sets multiple speed profile settings at once.
Acceleration, deceleration and max speed can all be set at once using this command.
Executable Timing
Stopped
- class stepseries.commands.SetStallThreshold(motorID: int, STALL_TH: int)[source]
Sets the stall detection threshold.
Note that these thresholds are different between the STEP400 and STEP800.
Executable Timing
Always
- class stepseries.commands.SetTargetPosition(motorID: int, position: int)[source]
Set the target position to go to when in servo mode.
stepseries.commands.EnableServoModemust be enabled for this command to have an effect.Executable Timing
Always
- class stepseries.commands.SetTargetPositionList(position1: int, position2: int, position3: int, position4: int, position5: Optional[int] = None, position6: Optional[int] = None, position7: Optional[int] = None, position8: Optional[int] = None)[source]
Set the target positions of all motors at once.
Note
If using the STEP400, positions 5-8 do not need to be configured.
- class stepseries.commands.SetTval(motorID: int, holdTVAL: int, runTVAL: int, accTVAL: int, setDecTVAL: int)[source]
Sets the configuration for all four TVAL parameters.
STEP400 OnlyTVAL only applies when the motor controller is in current mode. This goes without saying TVAL never applies on the STEP800.
Executable Timing
Always
- class stepseries.commands.SetVoltageMode(motorID: int)[source]
Switch a specific motor into voltage mode.
STEP400 OnlyNote
The STEP800 is always in voltage mode and cannot be switched.
Executable Timing
Always
- class stepseries.commands.SoftHiZ(motorID: int)[source]
Stops the motor according to the speed profile.
When stopped, the motor’s excitation is released. If the electromagnetic brake is enabled, then the brake is put into a hold state before excitation is released. Transitions to HiZ after excitation is released. Remains in the BUSY state until the motor stops.
Executable Timing
Always
- class stepseries.commands.SoftStop(motorID: int)[source]
Stops the motor according to the speed profile.
After decelerating and stopping, the motor is kept in an excited state if it was originally in a HiZ state. Remains in the BUSY state until the motor stops.
If it was in servo mode, then the mode will be released.
Executable Timing
Always
stepseries.exceptions – Device Errors
Custom exceptions raised by this library.
stepseries.responses – Device Responses
Messages received from the device.
- class stepseries.responses.AdcVal(*args, **kwargs)[source]
The ADC_OUT register value from the motor driver chip.
- class stepseries.responses.BemfParam(*args, **kwargs)[source]
Register values for the BEMF parameter.
- class stepseries.responses.Booted(*args, **kwargs)[source]
Sent when the device (re)starts.
This message is sent regardless if
stepseries.commands.SetDestIPhas been recieved. By watching for this message, you can determine when the device restarts even if unexpectedly.When the firmware has started and an ethernet uplink is confirmed, this message will be sent.
This is a broadcast message meaning it is sent to all devices on the subnet (address
255.255.255.255). If this is unacceptable for your network, you can disable it via the Config Tool.
- class stepseries.responses.BrakeTransitionDuration(*args, **kwargs)[source]
The transitional duration when switching the brake mode.
- class stepseries.responses.ConfigName(*args, **kwargs)[source]
Metadata about the configuration file.
- class stepseries.responses.ConfigRegister(*args, **kwargs)[source]
The 16-bit CONFIG register value from the motor driver.
- class stepseries.responses.DecayModeParam(*args, **kwargs)[source]
Register values (parameters) for the current control algorithm.
- class stepseries.responses.DestIP(*args, **kwargs)[source]
Confirmation
stepseries.commands.SetDestIPhas been recieved.
- exception stepseries.responses.ErrorCommand(*args, **kwargs)[source]
Sent if an error is detected while executing a command.
Can be enabled or disabled with
stepseries.commands.ReportError.- errorText: str
errorText
Description
CommandIgnored
The command is currently not executable. Also refer to the
Timingsection.MotorIdNotMatch
Motor ID is not appropriate.
BrakeEngaging
A motion command was sent while the electromagnetic brake was active.
HomeSwActivating
A motion command to move in the homing direction was sent while the home sensor is active.
LimitSwActivating
A motion command to move in the opposite of the homing direction was sent while the limit sensor is active.
GoUntilTimeout
Timed out while executing
/goUntilcommand.ReleaseSwTimeout
Timed out while executing
/releaseSwcommand.InServoMode
Received a command which can not be executed while servo mode.
- exception stepseries.responses.ErrorOSC(*args, **kwargs)[source]
Sent if any error is detected in the OSC command.
- class stepseries.responses.FullstepSpeed(*args, **kwargs)[source]
The threshold when microstepping switches to full-step mode.
- class stepseries.responses.GoUntilTimeout(*args, **kwargs)[source]
The timeout duration for the
stepseries.commands.GoUntilcommand.
- class stepseries.responses.HomeSw(*args, **kwargs)[source]
The status of the HomeSw, whether open or closed.
- class stepseries.responses.HomeSwMode(*args, **kwargs)[source]
The switch mode as described in
stepseries.commands.SetHomeSwMode.
- class stepseries.responses.HomingDirection(*args, **kwargs)[source]
The motor rotating direction when homing.
- class stepseries.responses.HomingSpeed(*args, **kwargs)[source]
The speed the motor will run when homing.
- class stepseries.responses.HomingStatus(*args, **kwargs)[source]
Documentation: https://ponoor.com/en/docs/step-series/osc-command-reference/automatically-sent-messages-from-step-400/#homingstatus
- class stepseries.responses.LimitSw(*args, **kwargs)[source]
The status of the LimitSw, whether open or closed.
- class stepseries.responses.LimitSwMode(*args, **kwargs)[source]
The switch mode as described in
stepseries.commands.SetHomeSwMode.
- class stepseries.responses.LowSpeedOptimizeThreshold(*args, **kwargs)[source]
The threshold to enable low speed optimization.
- class stepseries.responses.MicrostepMode(*args, **kwargs)[source]
The microstep mode of the motor.
- class stepseries.responses.OSCResponse(*args, **kwargs)[source]
An abstract class meant to be implemented by OSC resp objects.
- class stepseries.responses.OverCurrent(*args, **kwargs)[source]
Documentation: https://ponoor.com/en/docs/step-series/osc-command-reference/automatically-sent-messages-from-step-400/#overcurrent
- class stepseries.responses.OverCurrentThreshold(*args, **kwargs)[source]
The threshold of over current in mA.
- class stepseries.responses.Position(*args, **kwargs)[source]
The ABS_POS register value aka “the motor’s current position”.
- class stepseries.responses.PositionList(*args, **kwargs)[source]
The current position of all motors at once.
STEP400 users:
position5-8will be None since there are only four drivers on the board.
- class stepseries.responses.ProhibitMotionOnHomeSw(*args, **kwargs)[source]
Whether motion towards the homing direction is permitted when HomeSw is active.
- class stepseries.responses.ProhibitMotionOnLimitSw(*args, **kwargs)[source]
Whether motion to the opposite of the homing direction is permitted when LimitSw is active.
- class stepseries.responses.ReleaseSwTimeout(*args, **kwargs)[source]
The timeout duration for the
stepseries.commands.ReleaseSwcommand.
- class stepseries.responses.SpeedProfile(*args, **kwargs)[source]
The acc, dec, and maxSpeed of the speed profile.
- class stepseries.responses.Stall(*args, **kwargs)[source]
Documentation: https://ponoor.com/en/docs/step-series/osc-command-reference/automatically-sent-messages-from-step-400/#stall
- class stepseries.responses.StallThreshold(*args, **kwargs)[source]
The stall detection threshold in mA.
- class stepseries.responses.Status(*args, **kwargs)[source]
The STATUS of a motor.
Refer to STATUS in the datasheet for the information contained in the registers. Some bits are latched and reset when the STATUS registers are read out. Because the firmware constantly reads these registers, they are immediately reset. It is possible to setup event to be reported depending on the data read, so please use those commands.
STEP400 Bits
STEP800 Bits
Configuration Command
UVLO
UVLO
UVLO_ADC
N/A
Not implemented
OCD
OCD
STALL_A, STALL_B
STEP_LOSS_A, STEP_LOSS_B
CMD_ERROR
WRONG_CMD, NOTPREF_CMD
stepseries.commands.EnableCommandErrorReportTH_STATUS
TH_WRN, TH_SD
SW_EVN
SW_EVN
MOT_STATUS
MOT_STATUS
SW_F
SW_F
BUSY
BUSY
HIZ
HIZ
- class stepseries.responses.SwEvent(*args, **kwargs)[source]
Sent when the specified motor’s HomeSw drops from HIGH to LOW.
- class stepseries.responses.ThermalStatus(*args, **kwargs)[source]
The thermal status of a motor driver chip.
The thresholds between the STEP400 and STEP800 do vary.
- thermalStatus: int
STEP400:
Range
Description
Set Threshold
Release Threshold
0
Normal
N/A
N/A
1
Warning
135°C
125°C
2
Bridge Shutdown
155°C
145°C
3
Device Shutdown
170°C
130°C
STEP800:
Range
Description
Set Threshold
Release Threshold
0
Normal
N/A
N/A
1
Warning
130°C
130°C
2
Bridge Shutdown
160°C
130°C
- class stepseries.responses.Tval_mA(*args, **kwargs)[source]
All four TVALs together but in mA, not register values.
stepseries.step400 – STEP400 Device
4 axis stepper motor driver with and Ethernet interface.
- class stepseries.step400.STEP400(id: int, address: str = '10.0.0.100', port: int = 50000, server_address: str = '0.0.0.0', server_port: int = 50100)[source]
Send and receive data from a STEP400 motor driver.
Note
It is recommended to create a default message handler for this driver. Here is an example:
>>> from stepseries.step400 import STEP400 >>> >>> def default_handler(message) -> None: ... print(message) ... >>> driver = STEP400(0, '10.1.21.56') # Your IP and dip ID here >>> driver.on(None, default_handler)
- Parameters
id (int) – The id set by the DIP switches on the device.
address (str) – The ip address of the device. Defaults to 10.0.0.100.
port (int) – The local port the device is listening on. Defaults to 50000.
server_address (str) – The ip address of the server (this machine). Should always be 0.0.0.0. Defaults to 0.0.0.0.
server_port (int) – The port the server is listening on. Defaults to 50100.
add_id_to_args (bool) – Whether to add id to address and server_port (the default behavior on the device). Defaults to True.
stepseries.step800 – STEP800 Device
8 axis stepper motor driver with Ethernet interface.
- class stepseries.step800.STEP800(id: int, address: str = '10.0.0.100', port: int = 50000, server_address: str = '0.0.0.0', server_port: int = 50100)[source]
Send and receive data from a STEP800 motor driver.
Note
It is recommended to create a default message handler for this driver. Here is an example:
>>> from stepseries.step800 import STEP800 >>> >>> def default_handler(message) -> None: ... print(message) ... >>> driver = STEP800(0, '10.1.21.56') # Your IP and dip ID here >>> driver.on(None, default_handler)
- Parameters
id (int) – The id set by the DIP switches on the device.
address (str) – The ip address of the device. Defaults to 10.0.0.100.
port (int) – The local port the device is listening on. Defaults to 50000.
server_address (str) – The ip address of the server (this machine). Should always be 0.0.0.0. Defaults to 0.0.0.0.
server_port (int) – The port the server is listening on. Defaults to 50100.
add_id_to_args (bool) – Whether to add id to address and server_port (the default behavior on the device). Defaults to True.
- get(command: OSCGetCommand, with_callback: bool = True, wait: bool = True) Union[OSCResponse, List[OSCResponse]][source]
Send a ‘get’ command to the device and return the response.
Note
The responses are also sent to each applicable callback.
If a ParseError is received, then it will be raised. The raw response can be retrieved via the response attribute of the error.
- Parameters
command (OSCGetCommand) – The completed command template (stepseries.commands).
with_callback (bool) – Send the response to callbacks as well (defaults to True).
wait (bool) – Wait for a response from the device if True, otherwise return without waiting for a response (defaults to True).
- Raises
TypeError – command is not an OSCSetCommand.
InvalidCommandError – command cannot run on a STEP800.
- set(command: OSCSetCommand) None[source]
Send a ‘set’ command to the device.
- Parameters
command (OSCCommand) – The completed command template (stepseries.commands).
- Raises
TypeError – command is not an OSCSetCommand.