bipolar stepper motor driver and Raspberry

Discussion on projects that are created by users and posted on mikroElektronika website.
Post Reply
Author
Message
cavitand33
Posts: 1
Joined: 04 Apr 2017 18:36

bipolar stepper motor driver and Raspberry

#1 Post by cavitand33 » 04 Apr 2017 18:52

Dear users,

I am trying to use the Mikroelectronika bipolar stepper connected to a raspberry using python. The motor moves but the move is not clean. Sometimes it moves one step forward and then backward canceling the net move...and I don't understand why...
my code in python is very simple and I don't understand where is the glitch! I use the examples written in Basic provided on this website.
Any help is welcome...
best
Francois


#!/usr/bin/python
import sys
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BOARD)
GPIO.setup(11,GPIO.OUT)
GPIO.setup(10,GPIO.OUT)
GPIO.setup(12, GPIO.OUT)
GPIO.setup(16, GPIO.OUT)
GPIO.setup(18, GPIO.OUT)
GPIO.setup(22, GPIO.OUT)
GPIO.setup(24, GPIO.OUT)


#--------------------------------------
GPIO.output(24, 1) #direction
GPIO.output(16, 1) #rst
GPIO.output(10, 0) #en
GPIO.output(11, 0) #step
GPIO.output(12, 1) #SLEEP
GPIO.output(18, 0) #MS2
GPIO.output(22, 0) #MS1



i=0
while i < 100:
print i

GPIO.output(11, 0)
time.sleep(0.1)
GPIO.output(11, 1)
time.sleep(0.1)

i+=1

GPIO.cleanup()

Post Reply

Return to “User Projects”