I recently purchased a SF2421-10B41 stepper motor and a Stepper 5 click board (TMC2208 driver IC built in) for my project, using Raspberry Pi 3B for programming, below is my sketch and the datasheet I found for the parts I used:
Sanyo Denki SF2421-10B41 Hybrid Stepper Motor
The motor power supply:
And the real connection is shown below:
Like I said in the title, my motor only gets vibration whenever I run my code in Thonny. I'll give some of the discoveries for the motor, and what I have done to fix my problem during my test:
The motor itself has 6 pins in total, I identified the 4 pins near the centre to be the two coil pairs(Orange-Blue; Red-Yellow), which has both winding resistance of 3.6Ω.
The 2 pins on the left and righthand side are the centre tap pins, but very strange is that, when I test the centre tap pin on the lefthand side with each of the 4 pins near the centre, I got no reading, this happened for the other centre tap as well. I said strange because there should be some resistance between them, I'm not sure if this means my motor is a broken one and not sure if this is the reason why my motor only vibrates and not turning.
What I've done so far:
- I've tried swapping the position between two coil pairs, that's a no use
- I've tried reversing the coils in both coil pairs, and swapping the position as well, those are no use as well
- increase the step delay (from 0.005s to 0.01s; 0.05s; 0.5s), I can feel the torque in all 4 cases, but that didn't help solving the problem
What I haven't done:
- Microstepping, I know that TMC2208 supports microstepping, but I don't know how to achieve this on this click board. The point is, the click board datasheet do gives the state for each MS pins for different step size, but the board itself doesn't has any physical MS pins, and so I don't know how to do the port mapping and therefore the coding.
- I suspect the motor itself is actually broken, so I'm planning to borrow another stepper motor from the university's lab, and see if is the motor's problem, or my problem.
Here is the two code files I got for my motor:
TMC2208.py
Import RPi.GPIO as GPIO
import time
import sys
class TMC2208(object):
def __init__(self, DIR, STEP):
self.DIR = DIR
self.STEP = STEP
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
def Run(self, clockwise=False, steps=200, stepdelay=.005, initdelay=.05):
GPIO.setup(self.DIR, GPIO.OUT)
GPIO.setup(self.STEP, GPIO.OUT)
GPIO.output(self.DIR, clockwise)
try:
for i in range(steps):
GPIO.output(self.STEP, True)
time.sleep(stepdelay)
GPIO.output(self.STEP, False)
time.sleep(stepdelay)
finally:
GPIO.output(self.STEP, False)
GPIO.output(self.DIR, False)
initDemo.py:
import TMC2208
import RPi.GPIO as GPIO
import time
import sys
direction = 23
step = 4
EN = 24
Xdirtest = TMC2208.TMC2208(direction, step)
dir_array = [True, False]
GPIO.setup(EN, GPIO.OUT)
GPIO.output(EN, GPIO.LOW)
for i in range(2):
Xdirtest.Run(dir_array[i%2], 200, .005, .05)
time.sleep(1)
GPIO.cleanup()
I know this might a very basic problem, but here I am, stuck on this step. Any help or advices will be very appreciated, so much thanks!
[UPDATE] Sticker on the motor:
[2022.12.07 UPDATE]
So I got 0A current output when I turn on the power supply, but I can still read a correct STEP signal from my rpi board under this condition.
Another issue is that, when I test the output at OA1 and OA2 with oscilloscope, the voltage output just stays around 3.3V, it's not switching on and off to drive the motor. Right now, I'm considering to use a new driver and the one I chose is DRV8825.