(Document Sharing) - Stepper Motor Drive Experiment - QuecPython - Quectel Forums
(Document Sharing) - Stepper Motor Drive Experiment - QuecPython - Quectel Forums
com
This article mainly describes the use of ec600x to drive the stepper motor controller to drive the stepper motor.
Hardware description
Module driven stepper motor requires stepper motor controller:
Stepping motor
Experimental equipment
(1) ENA enable control pin enables the driver to drive the motor. The level varies according to the driver model.
(2) Dir direction control pin to determine clockwise or counterclockwise. The level varies according to the driver
model.
(3) Pul step pulse pin to pulse the controller. According to the subdivision set, there are different pulse numbers
to step a step angle. The subdivision setting is the driver dial switch setting.
Pin connection
(1) Connect the 24V power supply, and the specific voltage shall be determined according to the actual stepping
motor driver specification.
(2) Connect the driver and stepper motor. The specific wiring mode is determined according to the actual
specifications of stepper motor driver and stepper motor.
A+ a item a +
A- C item a -
B+ B item B +
B- D item B -
(3) Connect the driver and ec600x development board. The specific voltage is determined according to the
actual stepping motor driver specification.
The stepper motor driver can be connected by common anode / common cathode, and we use common anode
here
Software design
def delay_250us():
for i in range(310):
pass
ENABLE_MOTOR = 0x1
DISABLE_MOTOR = 0x0
dev_log = None
def reset(self):
self.env_pin.write(DISABLE_MOTOR)
self.dir_pin.write(DIR_ANTI_CLOCKWISE)
if self.pul_pwm is not None:
self.pul_pwm.close()
def disable_pwm(self):
self.pul_pwm.close()
pass
self.reset()
pass
def test_ebf_smd4805():
log.basicConfig(level=log.DEBUG)
# log.basicConfig(level=log.INFO)
ebf_smd4805_dev = ebf_smd4805()
ebf_smd4805_dev.init(step=1.8, divstep=2)
for i in range(2, 10):
ebf_smd4805_dev.run(i, Duration=1000, dir=DIR_CLOCKWISE)
print("test_ebf_smd4805 Function exit,!!!")
pass
if __name__ == "__main__":
# creat a thread Check key status
test_ebf_smd4805()