Adafruit is open and shipping! Let's build back better, together!
0

Using DC & Stepper Hat with Python to operate roller blinds
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/
Please be positive and constructive with your questions and comments.

Using DC & Stepper Hat with Python to operate roller blinds

by NAP1947 on Sat Nov 21, 2020 3:35 pm

First let me say I am new with this process.
My project is to operate roller blinds using temperature, light, time of day and time of year parameters.
I have a raspberry Pi 3, 3 Nema 17 bipolar stepper motors and 2 DC & Stepper hats.
I am using a 12 vdc, 1.67A power supply for the motors.
I have one hat installed and one stepper working at this time and have a couple of questions that I have not found answers to.

First, I am using Python code from the Adafruit GitHub site, (see attachment) I have the motor setup as 200 steps per revolution, operating at 45 RPM.
The motor is very noisy and its motion is jerky.
I have tried adjusting both the RPM and steps per revolution and neither makes any change.
I have ensured all connections are good.
What I have found with internet searching has me very confused.
How do I improve this?

Second, I have measured the blind parameters as follows;
At 200 steps per revolution the blind cord moves 6.8cm per revolution.
I need to move the blinds from a start position of 0cm to a Maximum 1700cm (250 revolutions).
How do I establish these limits in Python code?

Thank you
Attachments
motorkit_stepper_simpletest.py
(234 Bytes) Downloaded 1 time

NAP1947
 
Posts: 17
Joined: Sun Mar 12, 2017 6:18 pm

Re: Using DC & Stepper Hat with Python to operate roller bli

by adafruit_support_bill on Sat Nov 21, 2020 3:40 pm

What motors are you using? "NEMA 17" is a frame size specification. It tells us where the mounting holes in the faceplate are. It doesn't tell us anything about the electrical specifications.

adafruit_support_bill
 
Posts: 79342
Joined: Sat Feb 07, 2009 10:11 am

Re: Using DC & Stepper Hat with Python to operate roller bli

by NAP1947 on Sat Nov 21, 2020 4:35 pm

Shows how little I know, the motor has the following number on it, 42STH34-0354A.

The specifications are as follows,
200 steps per revolution, 1.8 degrees per step
Coil #1: Red & Yellow wire pair. Coil #2 Green & Brown/Gray wire pair.
Bipolar stepper, requires 2 full H-bridges!
4-wire, 33 cm leads
5mm diameter drive shaft, 24mm long, with a machined flat
12V rated voltage (you can drive it at a lower voltage, but the torque will drop) at 350mA max current
28 oz*in, 20 N*cm, 2 Kg*cm holding torque per phase
35 ohms per winding

NAP1947
 
Posts: 17
Joined: Sun Mar 12, 2017 6:18 pm

Re: Using DC & Stepper Hat with Python to operate roller bli

by adafruit_support_bill on Sat Nov 21, 2020 11:26 pm

Based on the specifications, that motor should be compatible with the HAT: https://learn.adafruit.com/all-about-st ... he-stepper

Code: Select all | TOGGLE FULL SIZE
"""Simple test for using adafruit_motorkit with a stepper motor"""
import time
import board
from adafruit_motorkit import MotorKit

kit = MotorKit(i2c=board.I2C())

for i in range(100):
    kit.stepper1.onestep()
    time.sleep(0.01)

It looks like you are using the default stepping mode which is SINGLE. You should get better performance using DOUBLE.
https://learn.adafruit.com/adafruit-dc- ... -1798752-9

adafruit_support_bill
 
Posts: 79342
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.