Connecting to DP Series Motor Controller by Anaheim Automation in Python
Instrument Card
Anaheim Automation manufactures a variety of Stepper Motor Driver Packs with Programmable Controllers. The DPC50501 contains a single-axis bipolar microstep driver with an output capacity of 0.5 to 5 Amps, and incorporates a simple 18-command programmable controller, with a power supply in an enclosure. Models DPY50601 and DPY50611 each contain a single-axis bipolar microstep driver with an output capacity of 0.5 to 5 Amps, and a 40-command programmable controller, packaged with a power supply in an enclosure. The DPD75601 contains a single-axis bilevel driver with an output capacity of 1 to 7 Amps, and a 40-command programmable controller, with a power supply packaged in an enclosure.
Device Specification: here
Manufacturer card: ANAHEIM AUTOMATION
- Headquarters: Anaheim, US
- Yearly Revenue (millions, USD):
- Vendor Website: here
Demo: Send commands to a Polulu stepper motor driver
Connect to the DP Series Motor Controller in Python
Read our guide for turning Python scripts into Flojoy nodes.
PROTOCOLS > SCPI
from pymeasure.adapters import SerialAdapterfrom pymeasure.instruments import DPSeriesMotorController
# Create a SerialAdapter for communication with the motor controlleradapter = SerialAdapter(port='COM1', baudrate=38400)
# Create an instance of the DPSeriesMotorController instrumentmotor_controller = DPSeriesMotorController(adapter)
# Set the motor controller's addressmotor_controller.address = 1
# Set the motor controller's base speedmotor_controller.basespeed = 100
# Move the motor in the clockwise directionmotor_controller.move('CW')
# Wait for the motor to complete the movementmotor_controller.wait_for_completion()
# Stop the motormotor_controller.stop()
# Read the current motor position in stepsposition = motor_controller.step_positionprint("Current position:", position)
# Reset the motor position to 0motor_controller.reset_position()
# Close the connection to the motor controllermotor_controller.close()
This script connects to a DP Series Motor Controller using a SerialAdapter and creates an instance of the DPSeriesMotorController instrument. It then sets the motor controller’s address and base speed, moves the motor in the clockwise direction, waits for the movement to complete, stops the motor, reads the current motor position, resets the motor position to 0, and finally closes the connection to the motor controller.