0

Nema 17 Stepper Microstep Max Speed
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Nema 17 Stepper Microstep Max Speed

by wcndave on Fri Mar 29, 2019 4:15 am

I have a motor shield 1438 and nema 17 stepper 324.

With the standard: Adafruit_MotorShield.h

Code: Select all | TOGGLE FULL SIZE
myMotor->setSpeed(40);  // rpm   
myMotor->step(100, FORWARD, MICROSTEP);


Setting the speed higher doesn't actually move it faster. Does anyone know what the max microstep value is.

I want to move something very smooth, and fast, and don't need a great deal of torque.

It would seem that a 3d printer that uses the same motors can move pretty fast.

I have searched, but not found much that's directly related.

Thanks!
wcndave
 
Posts: 10
Joined: Wed May 21, 2014 7:34 am

Re: Nema 17 Stepper Microstep Max Speed

by adafruit_support_bill on Fri Mar 29, 2019 5:58 am

This topic has been discussed a lot in the forums. The maximum step rate of the shield is limited by the speed of the i2c bus. If you increase the i2c bus speed to 400KHz, you can reach about 773 steps/sec. See this thread for details.
viewtopic.php?f=31&t=57041&p=292119&hilit=quickstep+numbers#p291894

I want to move something very smooth, and fast

The shield is probably not your best choice then. Something like the DRV8833 will give you higher step rates. https://www.adafruit.com/product/3297

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

Re: Nema 17 Stepper Microstep Max Speed

by wcndave on Fri Mar 29, 2019 6:13 am

adafruit_support_bill wrote:This topic has been discussed a lot in the forums. The maximum step rate of the shield is limited by the speed of the i2c bus. If you increase the i2c bus speed to 400KHz, you can reach about 773 steps/sec. See this thread for details.
viewtopic.php?f=31&t=57041&p=292119&hilit=quickstep+numbers#p291894

I want to move something very smooth, and fast

The shield is probably not your best choice then. Something like the DRV8833 will give you higher step rates. https://www.adafruit.com/product/3297


Thanks, I did look through the boards, and couldn't find quite what I was after, however I am sure it's there!

I actually just received my TB6612, which I was going to use in the final thing, due to it's size. As this is listed on the page you suggested, as a higher voltage version of the same thing, I assume that's going to work, so I will give it a try.

Many thanks!
wcndave
 
Posts: 10
Joined: Wed May 21, 2014 7:34 am

Re: Nema 17 Stepper Microstep Max Speed

by adafruit_support_bill on Fri Mar 29, 2019 6:30 am

The TB6612 breakout should work also. These are the same driver as on the shield. But without the PCA9865 PWm chip. Since you would be controlling the TB6612 directly rather than through the PCA9685, you are not constrained by the i2c speed.

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

Re: Nema 17 Stepper Microstep Max Speed

by wcndave on Fri Mar 29, 2019 7:50 am

adafruit_support_bill wrote:But without the PCA9865 PWm chip.


When you say this, does that mean I can't drive the stepper with PWM? It seems to have a PWM input on the circuit. Also, the stepper library doesn't seem to have the options for MICROSTEP, and DOUBLE etc.... I read the 6612 tutorial, however there the PWM inputs are just set to high. Sorry if there are dumb questions, I have been searching for this for quite a while over the last week or so...
wcndave
 
Posts: 10
Joined: Wed May 21, 2014 7:34 am

Re: Nema 17 Stepper Microstep Max Speed

by adafruit_support_bill on Fri Mar 29, 2019 8:19 am

Basic stepping does not require PWM. PWM is only needed for microstepping. There are PWM pins on your Arduino which can be used with the board. But, as you say, the Arduino stepper library does not have support for microstepping.

If microstepping is a requirement, you might want to consider one of the stepper drivers from www.Pololu.com. Some of those have native microstepping capabilities. But keep in mind that your max speed using microstepping is going to be slower.

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

Re: Nema 17 Stepper Microstep Max Speed

by wcndave on Fri Mar 29, 2019 5:17 pm

adafruit_support_bill wrote:Basic stepping does not require PWM. PWM is only needed for microstepping. There are PWM pins on your Arduino which can be used with the board. But, as you say, the Arduino stepper library does not have support for microstepping.


Thanks, you've been really helpful, appreciate it.

I got the 6612 over the 8833, because on the 8833 page it specifically says "For higher voltages, check out the TB6612", so I didn't realise.

Given I have a 6612 in front of me, and need something for tomorrow, and it does have a set of pwm pins, I tried just setting them using pwm from arduino micro, and it seems to do something.

Values down to 64 continue to work, and deliver what sounds like, and feels like, a smoother turn.

However it does make a whining noise, until the motor is released withe STBY pin, so I am not sure if I am damaging something, or if in fact one can just send a PWM signal to both pins. I'd guessed initially they would have to be out of phase or something, however it seems to work well...

Any thoughts?
wcndave
 
Posts: 10
Joined: Wed May 21, 2014 7:34 am

Re: Nema 17 Stepper Microstep Max Speed

by adafruit_support_bill on Sat Mar 30, 2019 1:40 pm

Values down to 64 continue to work, and deliver what sounds like, and feels like, a smoother turn.

Giving it a constant PWM will work. But all it is doing is lowering the average current delivered to the coils, so the torque will be reduced. Lower torque means less forceful steps, so the motion may feel smoother.

However it does make a whining noise, until the motor is released withe STBY pin,

That is from the PWM. The pulsing of the current creates a changing magnetic field which makes the motor vibrate. Most Arduinos and compatibles default to a PWM frequency of about 1 KHz which is in the audible range. It is not harmful to most stepper motors.

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

Re: Nema 17 Stepper Microstep Max Speed

by juro on Sat Jul 06, 2019 11:52 am

Hi,

I’m joining this discussion because I’m facing noise problems as well as speed issues with microstepping, as described here.

I’m trying to make run two steppers simultaneously at the same speed, around 90 rpm, with a Metro and an Adafruit Motor Shield V2, using the AccelStepper library to get a smooth acceleration.
The steppers I use are from Trinamic (QSH2818-51-07-12, 200 steps, Nema 11, 6.2 V, 0.67 A and 9.2 Ω phase resistance, supplied in 5 V) which is a good deal in my situation between available torque and size, cause I couldn’t work with bigger steppers than Nema 11.

These steppers are optimized for microstepping. As mentioned by the manufacturer, an audible noise might result from operating the stepper at fullstepping and low velocities.

By making them run in SINGLE mode (fullstepping), I got a raucous noise. Therefore, to avoid this problem, which matches with the comment of the manufacturer, I’ve been trying to use MICROSTEP.
Unfortunately, on the shield, as I understand, the I2C frequency of the PCA9865 can’t be raised over 1MHz (as stated in the technical datas of the chip), which isn’t even enough to reach the desired speed of 4800 microsteps/s (90 rpm) for a single stepper.
By trying to make it run anyway, the stepper runs much slower and there’s still noise, sharp this time.

The issue for me is that I’m finally going to use eight of these steppers simultaneously in an environment where such noises multiplied by eight wouldn’t be tolerable!!
To do so, I was planning to add three more Adafruit shields on the first I have, all of them controlled by my Metro. It might not sound realistic anymore due to the problems I’m facing…

By trying to find a way to solve this, I come here to some statements from the previous posts of this discussion, which are a bit confusing to me.
It seems clear that reaching the speed I need with microstepping isn’t possible with the Adafruit Shield V2 due to the frequency of the I2C clock.

As Bill stated, it would be then necessary to work with another shield, to avoid using the PWM process, insured by the PCA9865, its I2C clock frequency limiting the speed.
Then, a second statement indicates that the PWM is only needed for microstepping, and not for fullstepping.
Finally, the PWM process generates vibrations on the stepper, resulting in audible noise as well.

First of all, and sorry for my poor knowledge, but I need clarification from Bill: your advice being to avoid the PWM chip and its frequency limits to run at higher speeds with microstepping, does it mean that PWM is needed for microstepping on the Adafruit Shield V2 only, while other drivers might allow microstepping without?

Beside this, the I2C frequency being an issue for fullstepping as well, how the PWM chip works then? Does it control the current without PWM in fullstepping, its clock frequency limiting also the speed in this case?

Anyway, my final goal is to reach the speed of 90 rpm with at least one of my steppers, and with the lowest possible noise.

Therefore, I would need a driver allowing microstepping without the use of PWM, to avoid I2C frequency limits and noise issues, and that could be controlled by the AccelStepper library.
Is that possible, and what would be the right choice to make this work?

I’ve checked the links for the other drivers indicated for microstepping (6612 and 8833), but how to use them with the Arduino IDE since it seems to be only possible to code microstepping with the Adafruit Motor Shield library?

Sorry for this long and heavy message, but I really need a way to solve this!!

Thanks in advance for your help!

juro
 
Posts: 15
Joined: Wed May 29, 2019 1:00 pm

Re: Nema 17 Stepper Microstep Max Speed

by adafruit_support_bill on Sat Jul 06, 2019 12:33 pm

These steppers are optimized for microstepping. As mentioned by the manufacturer, an audible noise might result from operating the stepper at fullstepping and low velocities.

Those Trinamic steppers are optimized for use with the Trinamic microstepping drivers. Trinamic drivers are some of the best in the business for microstepping small motors.

The TB6612 drivers and PCS9685 on the shield are good general purpose low-cost drivers for small to medium size DC motors and steppers. They are not optimized for any particular motor characteristics.

By making them run in SINGLE mode (fullstepping), I got a raucous noise. Therefore, to avoid this problem, which matches with the comment of the manufacturer, I’ve been trying to use MICROSTEP.

MICROSTEP on the shield will reduce the step vibration. But the 1.6KHx max PWM frequency creates an audible whine with some motors. You will get much quieter operation using a dedicated microstepping driver with a higher PWM frequency like the Trinamics.

The issue for me is that I’m finally going to use eight of these steppers simultaneously in an environment where such noises multiplied by eight wouldn’t be tolerable!!
To do so, I was planning to add three more Adafruit shields on the first I have, all of them controlled by my Metro. It might not sound realistic anymore due to the problems I’m facing…

Noise would not be your only problem. The maximum aggregate step rate for all the motors combined is limited by the i2c bus speed. You will not be able to achieve 90 RPM with 8 motors.

I need clarification from Bill: your advice being to avoid the PWM chip and its frequency limits to run at higher speeds with microstepping, does it mean that PWM is needed for microstepping on the Adafruit Shield V2 only, while other drivers might allow microstepping without?

There are two fundamental limitations of the PCS9685 on the shield:
1) The speed of the i2c bus limits how many commands you can send to the chip per second. That limits the number of steps per second. Since all shields will be sharing the same i2c bus, that limits the aggregate maximum step rate of all the motors combined. Also, since microstepping requires more PCA9685 commands per step, your max step rate is slower with microstepping.

2) The maximum internal clock rate of the PCA9685 limits the PWM frequency to 1.6KHz or less. This is in the audible range and will excite resonances in some motors resulting in an audible whine.

I’ve checked the links for the other drivers indicated for microstepping (6612 and 8833), but how to use them with the Arduino IDE since it seems to be only possible to code microstepping with the Adafruit Motor Shield library?

Neither the Arduino stepper library or the AccelStepper libraries support microstepping on these chips. You would have to 'roll your own' code using analogWrite and the PWM pins on the Arduino. The old AFMotor library for the V1 shield is a good reference for how to do that. But it would require a lot of pins and a lot of code to handle 8 motors concurrently.

A better approach - although somewhat more costly - is to use a more sophisticated stepper driver with built-in microstepping. These generally can be driven with just 2 pins each: Step and direction. www.pololu.com carries a good selection of microstepping drivers.

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

Re: Nema 17 Stepper Microstep Max Speed

by juro on Tue Jul 09, 2019 6:04 am

Hello Bill,

Thank you very much for your explanation and your advice!!

I’ve been therefore checking the products of Pololu, which, as you suggested, seem to be the right solution in my case.

I would just need to clarify a couple of things, and would be glad to get once more your advice.

I’ve loaded the StepperDriver library adapted for the drivers of Pololu, to check the examples of code for these drivers.
I just wanted to make sure that this library works not only with the « Stepper Motor Drivers » of Pololu, but as well with their « Tic Stepper Motor Controllers »:

https://www.pololu.com/category/212/tic-stepper-motor-controllers

Is there any problem to use the library with these controllers?

Another wondering about this library is the possibility to code for several steppers running simultaneously.
There’s just one example related to the use of several steppers (MultiAxis), stated as « experimental », and which doesn’t really match with what I need.
Is there any possibility to do so, or my need would mean a microcontroller per stepper driver?

Thank you

juro
 
Posts: 15
Joined: Wed May 29, 2019 1:00 pm

Re: Nema 17 Stepper Microstep Max Speed

by adafruit_support_bill on Tue Jul 09, 2019 6:19 am

The TIC family of controllers is fairly new at Pololu and I don't have any hands-on experience with them yet. But they look like a well thought out set of controllers.

These controllers have on-board processors and can run semi-autonomously. You can give the controller commands to move a certain number of steps at a certain speed and it will go off and do that by itself. So running multiple motors concurrently should not be a problem.

The library for the TIC controllers is here: https://github.com/pololu/tic-arduino
And the user guide: https://www.pololu.com/docs/0J71/all

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

Re: Nema 17 Stepper Microstep Max Speed

by juro on Tue Jul 09, 2019 10:35 am

Great!
I'll study all this.

Thanks again for your precious help Bill.

Best regards

juro
 
Posts: 15
Joined: Wed May 29, 2019 1:00 pm

Please be positive and constructive with your questions and comments.