Pi4 + Stepper HAT

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
fishyfishyfishy
 
Posts: 11
Joined: Sat Mar 21, 2020 1:11 pm

Pi4 + Stepper HAT

Post by fishyfishyfishy »

Hey all-

This may be a general motor compatibility thing, but I'm not yet smart enough to under stand those.

I have a pi 4 and the Adafruit Pi Stepper/DC motor HAT and am trying to run a stepper motor off it.

The motor runs just fine backwards, but forwards seems to jitter, skip steps, and generally just not run smoothly. I've tried several different wiring combinations and they either result in the exact same thing (backwards good, forwards bad), or no motion at all.

Code is pretty basic:

Code: Select all

def stepper_checkout():

    print('running checkout...')

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


    for i in range(100):
        kit.stepper1.onestep(direction=stepper.BACKWARD)
        time.sleep(0.01)
I've seen the same thing on two different motors:
* https://www.amazon.com/gp/product/B07TB74CL9/
* https://www.amazon.com/gp/product/B07TZTLJMT/

Would appreciate help and/or direction!

User avatar
fishyfishyfishy
 
Posts: 11
Joined: Sat Mar 21, 2020 1:11 pm

Re: Pi4 + Stepper HAT

Post by fishyfishyfishy »

ah-ha! Seems to work fine when style=stepper.DOUBLE.

Can someone explain to me why?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Pi4 + Stepper HAT

Post by adafruit_support_mike »

Double-stepping is twice as strong as single-stepping (two coils are active instead of one), so it could be related to the load on the motor. Do you have anything connected to the shaft?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Pi4 + Stepper HAT

Post by adafruit_support_bill »

Neither one of those motors are a god match for the HAT. Based on the specs, they appear to be designed for use with a current limiting 'chopper' type of driver and are likely overloading your HAT.

https://learn.adafruit.com/all-about-st ... he-stepper

User avatar
fishyfishyfishy
 
Posts: 11
Joined: Sat Mar 21, 2020 1:11 pm

Re: Pi4 + Stepper HAT

Post by fishyfishyfishy »

This was with nothing connected to the shaft.

So the adafruit pi stepper HAT is not compatible with steppers that use these 'chopper' drives? The HAT still seems to be functioning. What damage should I watch for?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Pi4 + Stepper HAT

Post by adafruit_support_bill »

Some stepper motors are designed with very low phase inductance and low phase resistance. This combination allows for higher torque, but requires a more sophisticated driver.

With a simple driver like the ones in the HAT, the low phase resistance results in too high of a current draw. The HAT will try to protect itself against brief overloads by shutting down. That typically shows up as erratic performance. It can survive overloads up to a point, but persistent overloads will cause overheating and permanent damage.

The #324 motors in the store are a good match for the HAT: https://www.adafruit.com/product/324

User avatar
fishyfishyfishy
 
Posts: 11
Joined: Sat Mar 21, 2020 1:11 pm

Re: Pi4 + Stepper HAT

Post by fishyfishyfishy »

Thanks, Bill!

I've been running the HAT with two of these out-of-spec steppers nearly continuously for more than 170 hours with no issues.

Unfortunately the 324 motor just does not provide enough torque for my application.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Pi4 + Stepper HAT

Post by adafruit_support_bill »

What are you using to power the motors?

User avatar
fishyfishyfishy
 
Posts: 11
Joined: Sat Mar 21, 2020 1:11 pm

Re: Pi4 + Stepper HAT

Post by fishyfishyfishy »

variable PSU set to about 5v and 3.5a.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Pi4 + Stepper HAT

Post by adafruit_support_bill »

At 5v, the MybotOnline motor will draw about 1.47A per phase (about 3A total) when stationary. Less when stepping.
The 17HS4401 motor will draw about 2.27A/phase (about 4.5A total) when stationary.

In general, stepper motor current draw (and pullout torque) decreases with increasing step rate. So if you keep the motors moving, you may avoid burning out the drivers on the HAT. the 3.5A current limit on your power supply is probably also helping to avoid damage.

User avatar
fishyfishyfishy
 
Posts: 11
Joined: Sat Mar 21, 2020 1:11 pm

Re: Pi4 + Stepper HAT

Post by fishyfishyfishy »

Indeed, the mybotonline motor also provided insufficient torque (looks like I need at least 0.4N*m)

I am running them at fairly high rate and disable them when they are retracted so they don't sit around at the hold current.

any thoughts on how I could get a torque-ier stepper running on this HAT? Or do I need a new controller?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Pi4 + Stepper HAT

Post by adafruit_support_bill »

Torque is roughly proportional to the electrical power supplied which is volts times amps. The HAT can handle up to 12v and 1.2A. So you will get the most out of it using motors that draw 1.2A at 12v. That would mean a motor with a phase resistance of 10 ohms.

Most "high-torque" motors have much lower phase inductance which generally implies a simiarly low phase resistance. These motors are designed to run at a higher voltage using a current limiting driver: https://learn.adafruit.com/all-about-st ... e-law-4-10

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”