在 raspberry pi 上设置 leadshine DM860 双极驱动电机
setup leadshine DM860 bipolar driver motor on raspberry pi
所以,我想在 raspberry pi 3 上使用我的 leadshine DM860 双极驱动器,我使用 https://makezine.com/2014/03/19/driving-big-stepper-motors-with-arduino/ 中的指南(我已经在 arduino 上尝试过并且它正在工作,我使用代码 'Nema34_potensiometer.ino') 但它没有用。所以这是我的代码示例:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
#GPIO.setup(26,GPIO.OUT)
GPIO.setup(21,GPIO.OUT)
GPIO.setup(20,GPIO.OUT)
#GPIO.output(26,True)
GPIO.output(21,False)
#GPIO.output(21,GPIO.LOW)
microStep = 0
while True:
GPIO.output(20,True)
#time.sleep(1)
GPIO.output(20,False)
time.sleep(1)
microStep = microStep + 1
print(microStep)
GPIO.cleanup()
驱动程序和树莓派之间的接线如下所示:
所以,我应该在 raspberry pi 上做什么配置?谢谢
编辑:
我更改控制信号连接器(P1)接口,我选择连接到PNP信号。似乎 arduino 和 raspberry pi 之间有不同的方式,它们如何向连接到其 GPIO 引脚或 I/O 引脚
的每个 sensor/device 提供电源和信号波
我更改控制信号连接器(P1)接口,我选择连接到PNP 信号。似乎 arduino 和 raspberry pi 之间有不同的方式,它们如何为连接到其 GPIO 引脚或 I/O 引脚
的每个 sensor/device 提供电源和信号波
所以,我想在 raspberry pi 3 上使用我的 leadshine DM860 双极驱动器,我使用 https://makezine.com/2014/03/19/driving-big-stepper-motors-with-arduino/ 中的指南(我已经在 arduino 上尝试过并且它正在工作,我使用代码 'Nema34_potensiometer.ino') 但它没有用。所以这是我的代码示例:
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
#GPIO.setup(26,GPIO.OUT)
GPIO.setup(21,GPIO.OUT)
GPIO.setup(20,GPIO.OUT)
#GPIO.output(26,True)
GPIO.output(21,False)
#GPIO.output(21,GPIO.LOW)
microStep = 0
while True:
GPIO.output(20,True)
#time.sleep(1)
GPIO.output(20,False)
time.sleep(1)
microStep = microStep + 1
print(microStep)
GPIO.cleanup()
驱动程序和树莓派之间的接线如下所示:
所以,我应该在 raspberry pi 上做什么配置?谢谢
编辑:
我更改控制信号连接器(P1)接口,我选择连接到PNP信号。似乎 arduino 和 raspberry pi 之间有不同的方式,它们如何向连接到其 GPIO 引脚或 I/O 引脚
的每个 sensor/device 提供电源和信号波我更改控制信号连接器(P1)接口,我选择连接到PNP 信号。似乎 arduino 和 raspberry pi 之间有不同的方式,它们如何为连接到其 GPIO 引脚或 I/O 引脚
的每个 sensor/device 提供电源和信号波