Micro step not working

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
keviin55
 
Posts: 3
Joined: Wed Sep 15, 2021 3:59 am

Micro step not working

Post by keviin55 »

Hello, I wanted to control a stepper motor using the Adafruit Raspberry Pi Hat. This is the stepper I am using https://www.amazon.de/gp/product/B06XRF ... UTF8&psc=1. Every thing is working fine, but not the micro stepping. I am using a 12V 2A power supply. If I try to do a micro step the motor start biping. Is it a problem with the motor or I am missing something with the code? This is a code example

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

Code: Select all

"""Simple test for using adafruit_motorkit with a stepper motor"""
import time
from math import *
import board
from adafruit_motorkit import MotorKit
from adafruit_motor import stepper

kit = MotorKit(i2c=board.I2C())
kit.stepper1.onestep(direction=stepper.FORWARD, style=stepper.MICROSTEP)
I also tried to make multiple steps and set some delay, but same problem

Code: Select all

    for i in range(stepsNumber):
        kit.stepper1.onestep(direction=stepper.FORWARD, style=stepper.MICROSTEP)
        time.sleep(1 / sqrt(i + 60))

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”