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.EnableElectromagnetBrake must be enabled for this command to have an effect.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

state: bool

0

Motor engaged, brake released

1

Motor released, brake engaged

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

enable: bool

If True, enable the reporting.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Busy

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

enable: bool

If True, enable the reporting.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Dir

class stepseries.commands.EnableElectromagnetBrake(motorID: int, enable: bool)[source]

Enable or disable electromagnetic brake operation.

Not to be confused with stepseries.commands.Activate which activates or deactivates the brake.

While enabled, the controller will reply with ERROR_BRAKE_ENGAGED if a movement command is sent without releasing the brake.

Executable Timing

Always

enable: bool

If True, enable the brake.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

enable: bool

If True, enable the reporting.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of HiZ

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

enable: bool

If True, enable the reporting.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of HomeSw

class stepseries.commands.EnableLimitSwReport(motorID: int, enable: bool, callback: Optional[Callable[[...], None]] = None)[source]

Enable or disable automatic reporting of limit switch changes.

STEP400 Only

Executable Timing

Always

enable: bool

If True, enable the reporting.

Default

False

motorID: int

STEP400

1-4, 255

response_cls

alias of LimitSw

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

enable: bool

If True, enable the optimizer.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

enable: bool

If True, enable the reporting.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

enable: bool

If True, enable the reporting.

Default

True

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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.Run or stepseries.commands.GoTo when in this mode.

Executable Timing

Always

enable: bool

If True, enable servo mode.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

enable: bool

If True, enable the reporting.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Stall

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.EnableHomeSwReport which 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

enable: bool

If True, enable the reporting.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of SwEvent

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

enable: bool

If True, enable the reporting.

Default

True

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

enable: bool

If True, enable the reporting.

Default

True

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Uvlo

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.EnableElectromagnetBrake must be enabled for this command to have an effect.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

class stepseries.commands.GetAdcVal(motorID: int)[source]

Retrieves ADC_OUT register values for a motor.

ADC_OUT stores 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

motorID: int

STEP400

1-4, 255

response_cls

alias of AdcVal

class stepseries.commands.GetBemfParam(motorID: int)[source]

Retrieves the BEMF compensation register.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of BemfParam

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of BrakeTransitionDuration

class stepseries.commands.GetBusy(motorID: int)[source]

Retrieve the busy status of a motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Busy

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of ConfigRegister

class stepseries.commands.GetDecayModeParam(motorID: int)[source]

Retrieves the current control algorithm parameters.

STEP400 Only

Executable Timing

Always

motorID: int

STEP400

1-4, 255

response_cls

alias of DecayModeParam

class stepseries.commands.GetDir(motorID: int)[source]

Retrieve the current direction of a motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Dir

class stepseries.commands.GetElPos(motorID: int)[source]

Retrieve the current electrical position of the motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of ElPos

class stepseries.commands.GetFullstepSpeed(motorID: int)[source]

Retrieves the switch threshold of microstepping to fullstepping.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of FullstepSpeed

class stepseries.commands.GetGoUntilTimeout(motorID: int)[source]

Retrieve the timeout for stepseries.commands.GoUntil.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of GoUntilTimeout

class stepseries.commands.GetHiZ(motorID: int)[source]

Retrieve the HiZ status of a motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of HiZ

class stepseries.commands.GetHomeSw(motorID: int)[source]

Retrieve the status of the home switch.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of HomeSw

class stepseries.commands.GetHomeSwMode(motorID: int)[source]

Retrieve the configured mode for the home switch.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of HomeSwMode

class stepseries.commands.GetHomingDirection(motorID: int)[source]

Retrieve the homing direction for a motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of HomingDirection

class stepseries.commands.GetHomingSpeed(motorID: int)[source]

Retrieve the homing speed for a motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of HomingSpeed

class stepseries.commands.GetHomingStatus(motorID: int)[source]

Retrieve the homing status of a motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of HomingStatus

class stepseries.commands.GetKval(motorID: int)[source]

Retrieves the four KVAL parameters for a specified motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Kval

class stepseries.commands.GetLimitSw(motorID: int)[source]

Retrieve the status of the limit switch.

STEP400 Only

Executable Timing

Always

motorID: int

STEP400

1-4, 255

response_cls

alias of LimitSw

class stepseries.commands.GetLimitSwMode(motorID: int)[source]

Retrieve the configured mode for the limit switch.

STEP400 Only

Executable Timing

Always

motorID: int

STEP400

1-4, 255

response_cls

alias of LimitSwMode

class stepseries.commands.GetLowSpeedOptimizeThreshold(motorID: int)[source]

Retrieve the low speed optimization threshold.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of LowSpeedOptimizeThreshold

class stepseries.commands.GetMark(motorID: int)[source]

Retrieve the MARK position.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Mark

class stepseries.commands.GetMicrostepMode(motorID: int)[source]

Retrieves the configured microstepping mode for a motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of MicrostepMode

class stepseries.commands.GetMinSpeed(motorID: int)[source]

Retrieve the minimum speed of the speed profile.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of MinSpeed

class stepseries.commands.GetMotorStatus(motorID: int)[source]

Retrieve the current op status of a motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of MotorStatus

class stepseries.commands.GetOverCurrentThreshold(motorID: int)[source]

Retrieve the overcurrent threshold for a motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of OverCurrentThreshold

class stepseries.commands.GetPosition(motorID: int)[source]

Retrieve the current position of the motor.

Alternatively, stepseries.commands.SetPositionReportInterval can be configured to periodically send the current position.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Position

class stepseries.commands.GetPositionList[source]

Retrieve the current positions for ALL motors.

Alternatively, stepseries.commands.SetPositionListReportInterval can 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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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 Only

Executable Timing

Always

motorID: int

STEP400

1-4, 255

response_cls

alias of ProhibitMotionOnLimitSw

class stepseries.commands.GetReleaseSwTimeout(motorID: int)[source]

Retrieve the timeout for stepseries.commands.ReleaseSw.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of ReleaseSwTimeout

class stepseries.commands.GetServoParam(motorID: int)[source]

Retrieve the servo PID control parameters.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of ServoParam

class stepseries.commands.GetSpeed(motorID: int)[source]

Retrieve the current motor speed.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Speed

class stepseries.commands.GetSpeedProfile(motorID: int)[source]

Retrieves all three speed profile settings.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of SpeedProfile

class stepseries.commands.GetStallThreshold(motorID: int)[source]

Retrieve the stall threshold for a motor.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Status

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of ThermalStatus

class stepseries.commands.GetTval(motorID: int)[source]

Retrieves the configuration for all four TVAL parameters.

STEP400 Only

Executable Timing

Always

motorID: int

STEP400

1-4, 255

response_cls

alias of Tval

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 Only

Executable Timing

Always

motorID: int

STEP400

1-4, 255

response_cls

alias of Tval_mA

class stepseries.commands.GetUvlo(motorID: int)[source]

Retrieves the current state of UVLO.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Uvlo

class stepseries.commands.GetVersion[source]

Retrieve the current firmware version of the controller.

Executable Timing

Always

response_cls

alias of Version

class stepseries.commands.GoHome(motorID: int)[source]

Send this motor to its origin (zero) point.

Executable Timing

Not Busy

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

class stepseries.commands.GoMark(motorID: int)[source]

Send this motor to its MARK positon.

Executable Timing

Not Busy

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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.GoToDir can 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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

position: int

Valid Range

-2097152 - 2097151

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.GoTo will 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

DIR: bool

True for forward, False for backward.

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

position: int

Valid Range

-2097152 - 2097151

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 speed parameter.

By default, the motor will soft stop unless if stepseries.commands.SetSwMode is set to 0.

The timeout for this command can be set using stepseries.commands.SetGoUntilTimeout.

This command is not influenced by stepseries.commands.SetHomingSpeed or stepseries.commands.SetHomingDirection.

The motor is kept in a BUSY state until this command finishes.

Executable Timing

Always

ACT: bool

The action to take when the HOME switch activates.

0

Set the origin (home) position here

1

Copy the current position to the MARK register

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

speed: float

The direction and speed to run.

Direction can be set by specifying a positive or negative value.

Valid Range

-15625.0 - 15625.0 [steps/s]

Default

100 [steps/s]

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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.GoUntil and stepseries.commands.ReleaseSw.

Homing direction and speed can be set with stepseries.commands.SetHomingDirection and stepseries.commands.SetHomingSpeed, respectively; or configured with the Config Tool.

If the motor does not reach the HOME switch before stepseries.commands.SetGoUntilTimeout or release the HOME switch before stepseries.commands.SetReleaseSwTimeout, then the controller will halt the motor’s movements.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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.

build() OscMessage[source]

Converts the builder to a usable OSC message.

stringify() str[source]

Converts the builder to an OSC message string.

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.SetHomingSpeed or stepseries.commands.SetHomingDirection.

The motor is kept in a BUSY state until this command finishes.

Executable Timing

Always

ACT: bool

The action to take when the HOME switch releases.

0

Set the origin (home) position here

1

Copy the current position to the MARK register

DIR: bool

True or False, depending on your environment.

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

class stepseries.commands.ReportError(enable: bool, callback: Optional[Callable[[...], None]] = None)[source]

Enable or disable automatic reports for command errors.

Executable Timing

Always

enable: bool

If True, enable the reporting.

Default

False

class stepseries.commands.ResetDevice[source]

Resets the entire device.

A programmatic version of physically pressing the RESET button.

Executable Timing

Always

response_cls

alias of Booted

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

class stepseries.commands.ResetPos(motorID: int)[source]

Resets the motor’s position to 0.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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 speed has been reached.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

speed: float

Speed to run the motor at.

Negative values run the motor in reverse. Limited by the maximum and minimum speed set in the speed profile.

Valid Range

-15625.0 - 15625.0 [steps/s]

class stepseries.commands.SetAcc(motorID: int, acc: float)[source]

Sets the acceleration of the speed profile.

Executable Timing

Stopped

acc: float

Acceleration.

Valid Range

14.55 - 59590 [steps/s/s]

Default

2000 [steps/s/s]

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

FN_SLP_ACC: int

FN_SLP_ACC register.

Valid Range

0-255

Default

41

FN_SLP_DEC: int

FN_SLP_DEC register.

Valid Range

0-255

Default

41

INT_SPEED: int

INT_SPEED register.

Valid Range

0-16383

Default

1032

ST_SLP: int

ST_SLP register.

Valid Range

0-255

Default

25

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

duration: int

Valid Range

0-10000 [ms]

Default

100 [ms]

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

class stepseries.commands.SetCurrentMode(motorID: int)[source]

Switch a specific motor into current mode.

STEP400 Only

Note

The STEP800 is always in voltage mode and cannot be switched.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

class stepseries.commands.SetDec(motorID: int, dec: float)[source]

Sets the deceleration of the speed profile.

Executable Timing

Stopped

dec: float

Deceleration.

Valid Range

14.55 - 59590 [steps/s/s]

Default

2000 [steps/s/s]

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

class stepseries.commands.SetDecayModeParam(motorID: int, T_FAST: int, TON_MIN: int, TOFF_MIN: int)[source]

Sets the current control algorithm parameters.

STEP400 Only

Decay 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

TOFF_MIN: int

TOFF_MIN register value.

Valid Range

0-255

Default

41

TON_MIN: int

TON_MIN register value.

Valid Range

0-255

Default

41

T_FAST: int

T_FAST register value.

Valid Range

0-255

Default

25

motorID: int

STEP400

1-4, 255

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.DestIP is received. This behavior will be changed in a future update.

Executable Timing

Always

response_cls

alias of DestIP

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

newFullstep: int

Valid Range

0 - 3

newMicrostep: int

Valid Range

0 - 127

class stepseries.commands.SetFullstepSpeed(motorID: int, fullstepSpeed: float)[source]

Sets the threshold when microstepping switches to full stepping.

Executable Timing

Always

fullstepSpeed: float

Full-step speed.

Valid Range

7.63 - 15625 [steps/s]

Default

15625 [steps/s]

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

timeOut: int

How long to wait for the HOME switch to activate.

Valid Range

0 - 4294967295 [ms]

Default

10000 [ms]

class stepseries.commands.SetHomeSwMode(motorID: int, SW_MODE: bool)[source]

Configure whether to stop immediately on home switch release.

Executable Timing

HiZ

SW_MODE: bool

If True, do not stop.

False

Hard stop the motor

True

Do not stop

Default

True

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

direction: bool

True or False, depending on your environment.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

speed: float

Speed to run at.

Valid Range

0.0 - 15625.0 [steps/s]

Default

100.0 [steps/s]

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

accKVAL: int

KVAL for accelerating the motor’s speed.

Valid Range

0-255

Default

16

decKVAL: int

KVAL for decelerating the motor’s speed.

Valid Range

0-255

Default

16

holdKVAL: int

KVAL for holding the motor’s position.

Valid Range

0-255

Default

16

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

runKVAL: int

KVAL for maintaining the motor’s speed.

Valid Range

0-255

Default

16

class stepseries.commands.SetLimitSwMode(motorID: int, SW_MODE: bool)[source]

Configure whether to stop immediately on limit switch activated.

STEP400 Only

Executable Timing

Always

SW_MODE: bool

If True, do not stop.

False

Hard stop the motor

True

Do not stop

Default

True

motorID: int

STEP400

1-4, 255

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

lowSpeedOptimizationThreshold: float

Valid Range

0.0 - 976.3 [steps/s]

Default

0 [steps/s]

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

MARK: int

Point to be set.

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

class stepseries.commands.SetMaxSpeed(motorID: int, maxSpeed: float)[source]

Set the maximum speed of the speed profile.

Executable Timing

Always

maxSpeed: float

Maximum speed.

Valid Range

15.25 - 15610 [steps/s]

Default

620 [steps/s]

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

STEP_SEL: int

The microstep mode to run the motor at.

STEP_SEL

Mode Description

0

1/1 microstep (full-step)

1

1/2 microstep

2

1/4 microstep

3

1/8 microstep

4

1/16 microstep

5

1/32 microstep

6

1/64 microstep

7

1/128 microstep

Default

1/128 microstep

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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.EnableLowSpeedOptimize is enabled, the this is automatically set to zero.

Executable Timing

Stopped

minSpeed: float

Minimum speed.

Valid Range

0 - 976.3 [steps/s]

Default

0 [steps/s]

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

OCD_TH: int

The overcurrent threshold.

STEP400:

OCD_TH

Threshold

0

312.5 mA

1

625 mA

30

9.6875 A

31

10 A

Default

15 (5A)

STEP800:

OCD_TH

Threshold

0

375 mA

1

750 mA

30

5.625 A

31

6 A

Default

7 (3A)

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

class stepseries.commands.SetPosition(motorID: int, newPosition: int)[source]

Overwrites the motor’s current position.

Executable Timing

Stopped

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

newPosition: int

Position to override with.

Valid Range

-2097152 - 2097151

class stepseries.commands.SetPositionListReportInterval(interval: int, callback: Optional[Callable[[...], None]] = None)[source]

Periodically send the current positions of all motors.

When enabled, stepseries.commands.SetPositionReportInterval will 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.SetPositionListReportInterval will 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]

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

response_cls

alias of Position

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

enable: bool

If True, disable motion in the origin direction.

Default

False

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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 Only

Executable Timing

Always

enable: bool

If True, disable motion in the LIMIT switch direction.

Default

False

motorID: int

STEP400

1-4, 255

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

timeOut: int

How long to wait for the HOME switch to activate.

Valid Range

0 - 4294967295 [ms]

Default

10000 [ms]

class stepseries.commands.SetServoParam(motorID: int, kP: float, kI: float, kD: float)[source]

Configure the servo PID control parameters.

Executable Timing

Always

kD: float

Derivative gain.

Valid Range

0-

Default

0.0

kI: float

Integral gain.

Valid Range

0-

Default

0.0

kP: float

Proportional gain.

Valid Range

0-

Default

0.06

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

acc: float

Acceleration.

Valid Range

14.55 - 59590 [steps/s/s]

Default

2000 [steps/s/s]

dec: float

Deceleration.

Valid Range

14.55 - 59590 [steps/s/s]

Default

2000 [steps/s/s]

maxSpeed: float

Maximum speed.

Valid Range

15.25 - 15610 [steps/s]

Default

620 [steps/s]

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

STALL_TH: int

The stall threshold.

STEP400:

STALL_TH

Threshold

0

312.5 mA

1

625 mA

30

9.6875 A

31

10 A

Default

31 (10A)

STEP800:

STALL_TH

Threshold

0

31.25 mA

1

62.5 mA

126

3.969 A

127

4 A

Default

127 (4A)

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

class stepseries.commands.SetTargetPosition(motorID: int, position: int)[source]

Set the target position to go to when in servo mode.

stepseries.commands.EnableServoMode must be enabled for this command to have an effect.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

position: int

Valid Range

-2097152 - 2097151

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.

position1: int

Valid Range

-2097152 - 2097151

position2: int

Valid Range

-2097152 - 2097151

position3: int

Valid Range

-2097152 - 2097151

position4: int

Valid Range

-2097152 - 2097151

position5: int = None

STEP800 only

Valid Range

-2097152 - 2097151

position6: int = None

STEP800 only

Valid Range

-2097152 - 2097151

position7: int = None

STEP800 only

Valid Range

-2097152 - 2097151

position8: int = None

STEP800 only

Valid Range

-2097152 - 2097151

class stepseries.commands.SetTval(motorID: int, holdTVAL: int, runTVAL: int, accTVAL: int, setDecTVAL: int)[source]

Sets the configuration for all four TVAL parameters.

STEP400 Only

TVAL only applies when the motor controller is in current mode. This goes without saying TVAL never applies on the STEP800.

Executable Timing

Always

accTVAL: int

TVAL for accelerating the motor’s speed.

Valid Range

0-127

Default

16

holdTVAL: int

TVAL for holding the motor’s position.

Valid Range

0-127

Default

16

motorID: int

STEP400

1-4, 255

runTVAL: int

TVAL for maintaining the motor’s speed.

Valid Range

0-127

Default

16

setDecTVAL: int

TVAL for decelerating the motor’s speed.

Valid Range

0-127

Default

16

class stepseries.commands.SetVoltageMode(motorID: int)[source]

Switch a specific motor into voltage mode.

STEP400 Only

Note

The STEP800 is always in voltage mode and cannot be switched.

Executable Timing

Always

motorID: int

STEP400

1-4, 255

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

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

motorID: int

STEP400

1-4, 255

STEP800

1-8, 255

stepseries.exceptions – Device Errors

Custom exceptions raised by this library.

exception stepseries.exceptions.ClientClosedError[source]

The client’s connection is not open.

exception stepseries.exceptions.ClientNotFoundError[source]

The requested client could not be found.

exception stepseries.exceptions.InvalidCommandError[source]

The command cannot be executed.

exception stepseries.exceptions.ParseError[source]

Failed to parse the message from the device.

exception stepseries.exceptions.StepSeriesException[source]

Base exception for the 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.

ADC_OUT: int

Range

Description

0-31

5-bit read out of the ADC_OUT register

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.BemfParam(*args, **kwargs)[source]

Register values for the BEMF parameter.

FN_SLP_ACC: int

Range

Description

0-255 (0xFF)

FN_SLP_ACC register value

FN_SLP_DEC: int

Range

Description

0-255 (0xFF)

FN_SLP_DEC register value

INT_SPEED: int

Range

Description

0-16383 (0x3FFF)

INT_SPEED register value

ST_SLP: int

Range

Description

0-255 (0xFF)

ST_SLP register value

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.Booted(*args, **kwargs)[source]

Sent when the device (re)starts.

This message is sent regardless if stepseries.commands.SetDestIP has 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.

deviceID: int

Range

Description

0-255

The device ID set by the DIP switch

class stepseries.responses.BrakeTransitionDuration(*args, **kwargs)[source]

The transitional duration when switching the brake mode.

duration: int

0.0-10000.0 ms

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.Busy(*args, **kwargs)[source]

The BUSY state of a motor.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

state: int

Range

Description

0-1

1: BUSY, 0: Not BUSY

class stepseries.responses.ConfigName(*args, **kwargs)[source]

Metadata about the configuration file.

configFileOpenSucceeded: int

If the device could open the configuration file.

configFileParseSucceeded: int

If the configuration was successfully parsed.

configName: str

Name of the configuration.

sdInitializeSucceeded: int

If the microSD card was successfully read.

class stepseries.responses.ConfigRegister(*args, **kwargs)[source]

The 16-bit CONFIG register value from the motor driver.

CONFIG: int

0-65535 (0xFFFF)

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.DecayModeParam(*args, **kwargs)[source]

Register values (parameters) for the current control algorithm.

TOFF_MIN: int

Range

Description

0-255 (0xFF)

TOFF_MIN register value

TON_MIN: int

Range

Description

0-255 (0xFF)

TON_MIN register value

T_FAST: int

Range

Description

0-255 (0xFF)

T_FAST register value

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.DestIP(*args, **kwargs)[source]

Confirmation stepseries.commands.SetDestIP has been recieved.

destIp0: int

The first octet of the IP address set.

destIp1: int

The second octet of the IP address set.

destIp2: int

The third octet of the IP address set.

destIp3: int

The fourth octet of the IP address set.

isNewDestIp: int

Indicates if the IP address has changed from what is already set.

class stepseries.responses.Dir(*args, **kwargs)[source]

The direction of a motor.

direction: int

Range

Description

0-1

1: Forward, 0: Reverse

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.ElPos(*args, **kwargs)[source]

The electrical position of the motor.

fullstep: int

Range

Description

0-3

Fullstep position

microstep: int

Range

Description

0-127

Microstep position

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

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 Timing section.

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 /goUntil command.

ReleaseSwTimeout

Timed out while executing /releaseSw command.

InServoMode

Received a command which can not be executed while servo mode.

motorID: int = None

Controller

Motor Range

STEP400

1-4

STEP800

1-8

exception stepseries.responses.ErrorOSC(*args, **kwargs)[source]

Sent if any error is detected in the OSC command.

errorText: str

errorText

Description

messageNotMatch

There is no corresponding command

oscSyntaxError

The OSC format is out of standard

WrongDataType

Wrong datatype of in argument(s)

motorID: int = None

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.FullstepSpeed(*args, **kwargs)[source]

The threshold when microstepping switches to full-step mode.

fullstepSpeed: float

7.63-15625.0 steps/s

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.GoUntilTimeout(*args, **kwargs)[source]

The timeout duration for the stepseries.commands.GoUntil command.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

timeout: int

0.0-65535.0 ms

class stepseries.responses.HiZ(*args, **kwargs)[source]

The high-impedance (HiZ) state of a motor.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

state: int

Range

Description

0-1

1: HiZ, 0: Not HiZ

class stepseries.responses.HomeSw(*args, **kwargs)[source]

The status of the HomeSw, whether open or closed.

direction: int

Range

Description

0-1

1: Forward, 0: Reverse

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

swState: int

Range

Description

0-1

1: Open, 0: Closed (detected)

class stepseries.responses.HomeSwMode(*args, **kwargs)[source]

The switch mode as described in stepseries.commands.SetHomeSwMode.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

swMode: int

Range

Description

0-1

1: HardStop interrupt, 0: Notification (no stop)

class stepseries.responses.HomingDirection(*args, **kwargs)[source]

The motor rotating direction when homing.

homingDirection: int

Range

Description

0-1

1: Forward, 0: Reverse

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.HomingSpeed(*args, **kwargs)[source]

The speed the motor will run when homing.

homingSpeed: float

0.0-15625.0 steps/s

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

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

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.Kval(*args, **kwargs)[source]

All four KVALs together.

accKVAL: int

Range

Description

0-255

KVAL when stopped

decKVAL: int

Range

Description

0-255

KVAL when stopped

holdKVAL: int

Range

Description

0-255

KVAL when stopped

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

runKVAL: int

Range

Description

0-255

KVAL when stopped

class stepseries.responses.LimitSw(*args, **kwargs)[source]

The status of the LimitSw, whether open or closed.

direction: int

Range

Description

0-1

1: Forward, 0: Reverse

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

swState: int

Range

Description

0-1

1: Open, 0: Closed (detected)

class stepseries.responses.LimitSwMode(*args, **kwargs)[source]

The switch mode as described in stepseries.commands.SetHomeSwMode.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

swMode: int

Range

Description

0-1

1: HardStop interrupt, 0: Notification (no stop)

class stepseries.responses.LowSpeedOptimizeThreshold(*args, **kwargs)[source]

The threshold to enable low speed optimization.

lowSpeedOptimizeThreshold: float

0.0 - 976.3 steps/s

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

optimizationEnabled: int

Range

Description

0-1

1: Enabled, 0: Disabled

class stepseries.responses.Mark(*args, **kwargs)[source]

The latest MARK position.

MARK: int

-2,097,152-2,097,151 steps

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.MicrostepMode(*args, **kwargs)[source]

The microstep mode of the motor.

STEP_SEL: int

Range

Description

0

Full-step

1

Half-step

2

1/4 step

3

1/8 step

4

1/16 step

5

1/32 step

6

1/64 step

7

1/128 step

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.MinSpeed(*args, **kwargs)[source]

Minimum speed of the profile.

minSpeed: float

0.0-976.3 steps/s

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.MotorStatus(*args, **kwargs)[source]

The operating status of a motor.

MOT_STATUS: int

Range

Description

0

Stopped

1

Acceleration

2

Deceleration

3

Constant Speed

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

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

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.OverCurrentThreshold(*args, **kwargs)[source]

The threshold of over current in mA.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

overCurrentThreshold: float

Controller

Range

STEP400

312.5-10000.0

STEP800

375.0-6000.0

class stepseries.responses.Position(*args, **kwargs)[source]

The ABS_POS register value aka “the motor’s current position”.

ABS_POS: int

-2,097,152-2,097,151 steps

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.PositionList(*args, **kwargs)[source]

The current position of all motors at once.

STEP400 users: position5-8 will be None since there are only four drivers on the board.

position1: int

-2,097,152-2,097,151 steps

position2: int

-2,097,152-2,097,151 steps

position3: int

-2,097,152-2,097,151 steps

position4: int

-2,097,152-2,097,151 steps

position5: int = None

-2,097,152-2,097,151 steps

position6: int = None

-2,097,152-2,097,151 steps

position7: int = None

-2,097,152-2,097,151 steps

position8: int = None

-2,097,152-2,097,151 steps

class stepseries.responses.ProhibitMotionOnHomeSw(*args, **kwargs)[source]

Whether motion towards the homing direction is permitted when HomeSw is active.

enable: int

Range

Description

0-1

1: Prohibited, 0: Allowed

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.ProhibitMotionOnLimitSw(*args, **kwargs)[source]

Whether motion to the opposite of the homing direction is permitted when LimitSw is active.

enable: int

Range

Description

0-1

1: Prohibited, 0: Allowed

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.ReleaseSwTimeout(*args, **kwargs)[source]

The timeout duration for the stepseries.commands.ReleaseSw command.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

timeout: int

0.0-10000.0 ms

class stepseries.responses.ServoParam(*args, **kwargs)[source]

The PID control gain.

kD: float

Range

Description

0.0-

Derivative gain

kI: float

Range

Description

0.0-

Integral gain

kP: float

Range

Description

0.0-

Proportional gain

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.Speed(*args, **kwargs)[source]

The current motor speed.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

speed: float

-15625.0-15625.0 steps/s

class stepseries.responses.SpeedProfile(*args, **kwargs)[source]

The acc, dec, and maxSpeed of the speed profile.

acc: float

14.55-59590.0 steps/s/s

dec: float

14.55-59590.0 stesp/s/s

maxSpeed: float

15.25-15610.0 steps/s

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

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

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.StallThreshold(*args, **kwargs)[source]

The stall detection threshold in mA.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

stallThreshold: float

Controller

Range

STEP400

312.5-10000.0

STEP800

31.25-4000.0

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

stepseries.commands.EnableUvloReport

UVLO_ADC

N/A

Not implemented

OCD

OCD

stepseries.commands.EnableOverCurrentReport

STALL_A, STALL_B

STEP_LOSS_A, STEP_LOSS_B

stepseries.commands.EnableStallReport

CMD_ERROR

WRONG_CMD, NOTPREF_CMD

stepseries.commands.EnableCommandErrorReport

TH_STATUS

TH_WRN, TH_SD

stepseries.commands.EnableThermalStatusReport

SW_EVN

SW_EVN

stepseries.commands.EnableHomeSwReport

MOT_STATUS

MOT_STATUS

stepseries.commands.EnableMotorStatusReport

SW_F

SW_F

stepseries.commands.EnableHomeSwReport

BUSY

BUSY

stepseries.commands.EnableBusyReport

HIZ

HIZ

stepseries.commands.EnableHiZReport

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

status: int

Range

Description

0-65535

STATUS register value

class stepseries.responses.SwEvent(*args, **kwargs)[source]

Sent when the specified motor’s HomeSw drops from HIGH to LOW.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

class stepseries.responses.ThermalStatus(*args, **kwargs)[source]

The thermal status of a motor driver chip.

The thresholds between the STEP400 and STEP800 do vary.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

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(*args, **kwargs)[source]

All four TVALs together.

accTVAL: int

Range

Description

0-127

TVAL during acceleration

decTVAL: int

Range

Description

0-127

TVAL during deceleration

holdTVAL: int

Range

Description

0-127

TVAL when stopped

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

runTVAL: int

Range

Description

0-127

TVAL in constant speed mode

class stepseries.responses.Tval_mA(*args, **kwargs)[source]

All four TVALs together but in mA, not register values.

accTVAL_mA: float

Range

Description

78.125 - 5000.0

TVAL during acceleration

decTVAL_mA: float

Range

Description

78.125 - 5000.0

TVAL during deceleration

holdTVAL_mA: float

Range

Description

78.125 - 5000.0

TVAL when stopped

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

runTVAL_mA: float

Range

Description

78.125 - 5000.0

TVAL in constant speed mode

class stepseries.responses.Uvlo(*args, **kwargs)[source]

The current state of undervoltage lockout of a motor.

motorID: int

Controller

Motor Range

STEP400

1-4

STEP800

1-8

state: int

Range

Description

0-1

1: UVLO, 0: No UVLO

class stepseries.responses.Version(*args, **kwargs)[source]

The firmware version burnt onto the chip.

compile_date: str

Compile date of the firmware

firmware_name: str

Name of the firmware.

firmware_version: str

Version of the firmware.

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
set(command: OSCSetCommand) None[source]

Send a ‘set’ command to the device.

Parameters

command (OSCCommand) – The completed command template (stepseries.commands).

Raises

TypeErrorcommand is not an OSCSetCommand.