Step/Direction¶
Module Support¶
Description¶
Step/Direction control is a two wire interface with two inputs: step and direction. On each low to high transition on the step line up to logic high, the module will move a set radial distance in the direction specified by the direction line. Setting the direction line high causes counter-clockwise movement, and setting the direction line low causes clockwise movement. More information on Step/Direction control can be found here.
The distance traveled on each received step pulse is defined by the Step Angle Size parameter. This value is user configurable.
Note
Unlike Hobby Protocols, while using Step/Direction control with a Fortiq-42 module, serial communication through IQUART remains available.
Note
By using Step/Direction firmware, the motor can only be controlled via Step/Direction signals. Attempts to spin, stop, or otherwise control the motor via other protocols will fail. You can still communicate with the module via IQUART or CANOpen (if available), but cannot control the module. Hobby protocols are disabled when using Step/Direction firmware.
Usage¶
IQ Control Center¶
The IQ Control Center provides the easiest way to configure Step/Direction control on your module. To do so:
Open IQ Control Center. If you have not installed the program, please follow the instructions in Getting Started with Speed Motors Using IQ Control Center.
Connect your module to IQ Control Center
Click the General tab on the left side
To configure the step size, adjust the Step angle parameter, which determines how far the motor should spin on each received step pulse
Vertiq Python API - Step/Direction Interface¶
Note
Please note that the following Step/Direction testing was performed with a Fortiq-42 module. Your exact commands may change depending on the module in use.
The Step/Direction interface can also be accessed through Vertiq’s Python API’s step_direction_input client, summarized in Vertiq’s API documentation.
If you have never used Vertiq’s Python API, you must first set up your local computer to use the Python API using the instructions found at Getting Started with Python
After completing the walkthrough, you can interact with the step_direction_input client
To read a value
print(fortiq.get("step_direction_input", "<entry_name>"))
For example, to read the value stored in angle:
print(fortiq.get("step_direction_input", "angle"))
To write a value
fortiq.set("step_direction_input", "<entry_name>", value)
For example, to set the angle_step
fortiq.set("step_direction_input", "angle_step", 0.001)
To save a value to persistent memory
fortiq.save("step_direction_input", "<entry_name>")
For example, to save the value in angle_step
fortiq.save("step_direction_input", "angle_step")