DC & Stepper Motor HAT for Raspberry Pi -- low speed/torque

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
archy587
 
Posts: 29
Joined: Wed Aug 27, 2014 12:56 pm

DC & Stepper Motor HAT for Raspberry Pi -- low speed/torque

Post by archy587 »

Hello,

I have an RPI3 with the DC & Stepper Motor HAT for Raspberry Pi. I have a motor identical to this one:
(https://www.bmisurplus.com/products/348 ... ping-motor)
with these specs:
12V, 0.44A, 45 oz-in torque, 1.8 degrees per step

I am powering the hat with a 12V 30A LED power supply.

If I run the stepperTest.py example with the following settings:

Code: Select all

myStepper = mh.getStepper(200, 1)       # 200 steps/rev, motor port #1

myStepper.setSpeed(30)                  # 30 RPM

while (True):
    myStepper.step(10000, Adafruit_MotorHAT.FORWARD, Adafruit_MotorHAT.SINGLE)

    time.sleep(1)
It doesn't seem to matter what value over 30 is sent to setSpeed(), I can never get faster than about 30 RPM out. It will go slower than 30 if I put that in...

The motor turns significantly slower when changing from SINGLE stepping mode to MICROSTEPPING mode, with the same speed setting. The torque also seems pitiful, I can easily stop the stepper with my bare fingers on the shaft, especially in SINGLE stepping mode. Torque is better in MICROSTEP mode, but still doesn't seem like its close to the rated spec.

I am familiar with pololu drivers for 3D printer steppers, which are moving at significantly higher federates than this with no problem, and torque seems much higher with similarly spec'd nema 17 motors.

My questions are:

will using non-blocking oneStep() or threading allow me to get over 30 RPM? I don't really see how since the method used above is consuming all resources just to step 10000 times...

Also, the torque seems very low, is there any current adjustment available in software or hardware?

Am I really getting the expected performance out of this hat??

thanks for any help!
Last edited by archy587 on Fri Feb 16, 2018 4:06 pm, edited 1 time in total.

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

Re: DC & Stepper Motor HAT for Raspberry Pi -- dissappointin

Post by adafruit_support_bill »

The maximum step rate is limited by a combination of the i2c bus speed and the Python overhead. It is possible to increase the i2c speed. There are several threads on the topic over at the RasPi forums.

The torque limitations are largely due to the fact that the TB6612 drivers do not have current limiting. A current limiting "chopper" type driver like the DRV8833 or DRV8871 breakouts (and many of the Pololu drivers) will be able to safely operate the motors using higher supply voltages. See this guide for more details:
https://learn.adafruit.com/all-about-st ... ve-the-law

User avatar
archy587
 
Posts: 29
Joined: Wed Aug 27, 2014 12:56 pm

Re: DC & Stepper Motor HAT for Raspberry Pi -- dissappointin

Post by archy587 »

Hi Bill, thanks for your reply.

So python has to send each individual step command over i2c one at a time? I thought the purpose of the PWM driver was to offload some of this burden.

I also thought that because the current and voltage rating of my stepper (12V, 0.44A) was well below the continuous current rating of the driver (12V, 1.2A per channel), I would have no problem reaching the spec'd torque. Are you saying that I am probably already getting the spec'd torque, but could get more out of it if I ran at higher voltage (using a driver that could do so)?

thanks for your help!

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

Re: DC & Stepper Motor HAT for Raspberry Pi -- low speed/tor

Post by adafruit_support_bill »

I thought the purpose of the PWM driver was to offload some of this burden.
Stepper motors are not driven with PWM pulses. PWM is used to modulate the current of the step pulses for microstepping. If you strip out the microstepping overhead, there will also be less i2c traffic and higher top speed. This thread discusses the same issue with respect to the Arduino Shield version of the board: viewtopic.php?f=31&t=57041&p=292119
Are you saying that I am probably already getting the spec'd torque, but could get more out of it if I ran at higher voltage (using a driver that could do so)?
Stepper torque is not a constant number. It decreases with speed. A complete motor spec will include a torque/speed curve. If only one number is quoted, it is usually the maximum torque - which is achieved as the speed approaches zero.

Torque is directly related to the current flowing through the coils. The inductance of the coils resists changes in the current flow. So at higher step rates, the average current flow is lower. Using a higher supply voltage (to increase the current flow at the beginning of a step) and a current limiting driver (to prevent overload at the end of a step), the average current is increased, yielding higher torque. https://learn.adafruit.com/all-about-st ... he-stepper

User avatar
emeflg
 
Posts: 6
Joined: Tue Mar 03, 2015 1:07 pm

Re: DC & Stepper Motor HAT for Raspberry Pi -- low speed/tor

Post by emeflg »

I have figured out a way to greatly improve the performance of the NEMA 17 .4A stepper motor connected to the Adafruit DC/Stepper Motor Hat attached to a Raspberry Pi 3.

Changing the Pi's I2C Baud Rate to 12000000 bits/second greatly improved the speed, motor vibration, and torque on the stepper motor (the default baud rate is 100000 bits/second). Instructions on how to update the baud rate for a PI can be found here:
https://richardstechnotes.BANNED.com ... ree-style/

However, I did have to add a 1 millisecond wait after sending a single step BANNED to the I2C in order to give the electro-mechanical motor time to respond. With this update I am getting 2.7 milliseconds/step. I find the HALF_STEP commanding gives the best torque however a motor rotation takes 400 rather than 200 steps thus moving at half speed.

Changing the I2C Baud Rate to 400000 bits/second also provided greatly improved stepper motor performance without the need to add a 1 millisecond wait after the commanding was sent to the I2C. With this baud rate I got 3.5 milliseconds/step. Using the default 100000 bits/second I got 11.5 milliseconds/step.

PLEASE NOTE: Changing the I2C baud rate may significantly impact the operation of other I2C devices so proceed with caution!

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

Re: DC & Stepper Motor HAT for Raspberry Pi -- low speed/tor

Post by adafruit_support_bill »

I find the HALF_STEP commanding gives the best torque however a motor rotation takes 400 rather than 200 steps thus moving at half speed.
As noted in my previous post, stepper torque decreases with step-rate. The inductance of the coils resists changes in current flow, so at high step rates, current flow and therefore torque are reduced.
With this update I am getting 2.7 milliseconds/step.
At that point, the python overhead probably exceeds the i2c overhead. With the Arduino version of the board, I was able to get under 1ms/step. But at that point the motor had no usable torque. 850 steps/sec (about 255 RPM) is about the max usable speed for the #324 motor with a constant voltage driver like the TB6612 used on the shield and Hat.

A higher-voltage power supply with a current limiting driver like the DRV8833 would improve performance at high speeds. https://learn.adafruit.com/all-about-st ... he-stepper

User avatar
emeflg
 
Posts: 6
Joined: Tue Mar 03, 2015 1:07 pm

Re: DC & Stepper Motor HAT for Raspberry Pi -- low speed/tor

Post by emeflg »

Just wanted to clarify comments regarding my observations on stepper motor performance seen on the NEMA .4A stepper motor connected to the Adafruit Motor Hat. Using java programming, I do in deed get greatly improved speed by changing the I2C baud rate to 1200000 bits/second obtaining 2.7 milliseconds/step.

My comment about better torque at HALF_STEP operation is somewhat anecdotal. Using the DOUBLE_PHASE and SINGLE_PHASE commanding I could stop the motor rotation by applying pressure on the axle using my thumb and finger. However, at HALF_STEP operation I was unable to stop the motor rotation with my thumb and finger.

I can't comment on python overhead, I don't use the python I2C interface but instead use the freely-distributed java-based Pi4J GPIO interface developed by Robert Savage. PI4J, in development for several years, is a wonderful package for java programmers. More information can be found here: http://pi4j.com.

User avatar
AdrianLeal
 
Posts: 1
Joined: Tue Oct 06, 2015 11:50 pm

Re: DC & Stepper Motor HAT for Raspberry Pi -- low speed/tor

Post by AdrianLeal »

Hi i have two of this motor hats, I'm looking for a battery pack that can supply 6 A at 12v to power both of them. When I search for batteries I find common packages being or 11.1 or 12.8 V, my question is can I power this hat with a 12.8 v battery pack or I will damage the hat, can you recommend me a light weigh battery? thanks in advance!

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

Re: DC & Stepper Motor HAT for Raspberry Pi -- low speed/tor

Post by adafruit_support_bill »

@AdrianLeal - The TB6612 drivers on the board are rated for 13.5v max. Most battery voltage ratings are 'nominal' and they will usually be somewhat higher when freshly charged. So 11.1v is probably fine. 12.8v would be pushing your luck. You can find these packs and compatible chargers at hobby-shops specializing in RC cars/planes etc. They are also available from all the major battery vendors and on Amazon.

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”