Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

High RPM Stepper motor compatible with Motor Shield V2?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

High RPM Stepper motor compatible with Motor Shield V2?

by StudioEJ on Thu Mar 28, 2019 4:48 am

Hi, I'm currently running a Mercury bipolar Steeper Motor from an Arduino Uno/Adafruit Motor Shield V2:
Mercury bipolar Steeper Motor SM-42BYG011-25
200 steps for a rotation (1.8 degrees)
12 Volts
0,23 N.m (kg/cm) Torque

Using the Arduio library's Stepper Test sketch, it works fine and I can control the motor's direction, steps, etc.
But, the rpm is not high enough for my project - I'm using Double coil steps and setting the rpm high but it doesn't increase beyond about 60rpm (at a rough estimation). (There is no manufacturer's information, but on forums it's described as 60rpm or 180rpm max, at 12v.)
I'd like to keep things simple if possible but I need a higher rpm (500-1000rpm?). I've looked at other Steppers and can't find one with clear evidence that it will run ok and faster with the Adafruit Motor Shield.
What I'd like to do is just swap the Mercury with another faster motor. Can anyone recommend a compatible, and faster motor that doesn't require I increase the voltage or use a different Motor Shield?
Of course, if there's anything in the Sketch that could change to increase the speed beyond 60rpm, then please let me know, but I think the issue is the limits of this motor. Thanks.

StudioEJ
 
Posts: 3
Joined: Wed Mar 27, 2019 12:39 pm

Re: High RPM Stepper motor compatible with Motor Shield V2?

by adafruit_support_bill on Thu Mar 28, 2019 6:14 am

The limitation is not the motor - it is the i2c bus speed. See this thread for details:

viewtopic.php?f=31&t=57041&p=292119

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

Re: High RPM Stepper motor compatible with Motor Shield V2?

by StudioEJ on Thu Mar 28, 2019 7:28 am

Thanks, that's really good to know. I've added that line to the Sketch and it's improved the speed. But one more question, the setspeed() command doesn't produce the effect I expect. I have established 800rpm as the optimum, but the motor isn't running at 800rpm. More like 200rpm.
If I reduce the setspeed, it slows the motor down, if I increase it it doesn't seem to go faster. Why is this?
And do you have any advice about what to set as the most effective (fastest, quietest) setspeed?
Thanks.
Here's the relevant bit of the Sketch:

void setup() {

Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");

AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz
TWBR = ((F_CPU /500000l) - 16) / 2; // Change the i2c clock to 400KHz
myMotor->setSpeed(800); // rpm
}

StudioEJ
 
Posts: 3
Joined: Wed Mar 27, 2019 12:39 pm

Re: High RPM Stepper motor compatible with Motor Shield V2?

by adafruit_support_bill on Thu Mar 28, 2019 7:48 am

the setspeed() command doesn't produce the effect I expect. I have established 800rpm as the optimum, but the motor isn't running at 800rpm. More like 200rpm.

SetSpeed is not particularly accurate as a speed control. It does not take into account the communication overhead, so the error gets progressively worse at higher step-rates. This is all explained in detail in the thread linked above.

You can get more accurate speed control using the AccelStepper library. https://github.com/adafruit/Adafruit_Mo ... tSpeed.ino

if I increase it it doesn't seem to go faster. Why is this?

You can't increase the step-rate beyond the capabilities of the communication bus.

Code: Select all | TOGGLE FULL SIZE
And do you have any advice about what to set as the most effective (fastest, quietest) setspeed?

The fastest speed can be achieved using the "quickstep" hack as described in the thread linked above.
The quietest speed depends on a number of factors - most importantly the relationship of the step-rate relative to the resonant frequencies of the motor and mechanical systems it is connected to. If the step-rate is a harmonic of one of the resonant frequencies, the resulting vibrations can create noise.

Using the interleave or microstep stepping modes will help reduce the resonance. But it will also further limit your maximum step-rate.

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

Re: High RPM Stepper motor compatible with Motor Shield V2?

by StudioEJ on Thu Mar 28, 2019 7:54 am

Thanks, very helpful.

I'll try out the quickstep hack.

StudioEJ
 
Posts: 3
Joined: Wed Mar 27, 2019 12:39 pm

Re: High RPM Stepper motor compatible with Motor Shield V2?

by radhardened on Wed Apr 10, 2019 8:04 pm

When I try to speed up my stepper motor by inserting
Code: Select all | TOGGLE FULL SIZE
TWBR = ((F_CPU /400000l) - 16) / 2; // Change the i2c clock to 400KHz
in the setup() function after begin() in StepperTest.ino, I get this error when I try to compile:
StepperTest:30: error: 'TWBR' was not declared in this scope
TWBR = ((F_CPU /500000l) - 16) / 2; // Change the i2c clock to 400KHz
^
exit status 1
'TWBR' was not declared in this scope

I'm using the Adafruit Motor Shield V2 Library version 1.0.5 and version 1.8.5 of the Arduino IDE on Ubuntu running on an x86_64 architecture, if any of that matters.

radhardened
 
Posts: 21
Joined: Wed Aug 01, 2012 6:05 pm

Re: High RPM Stepper motor compatible with Motor Shield V2?

by adafruit_support_bill on Thu Apr 11, 2019 5:47 am

What Arduino/Arduino compatible board are you compiling for?

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

Re: High RPM Stepper motor compatible with Motor Shield V2?

by radhardened on Thu Apr 11, 2019 1:46 pm

I'm compiling for the Feather HUZZAH ESP8266, with the DC Motor + Stepper FeatherWing Add-on on top.

radhardened
 
Posts: 21
Joined: Wed Aug 01, 2012 6:05 pm

Re: High RPM Stepper motor compatible with Motor Shield V2?

by adafruit_support_bill on Thu Apr 11, 2019 1:56 pm

The code in the guide is for an Arduino UNO with an Atmega 328 MCU. The ESP8266 is a completely different processor architecture.

I think it is supported in the Wire library now. Try using this instead:
Code: Select all | TOGGLE FULL SIZE
  Wire.setClock(400000L);

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

Re: High RPM Stepper motor compatible with Motor Shield V2?

by radhardened on Thu Apr 11, 2019 9:49 pm

Thanks! That worked for a few minutes - I wasn't able to get more than ~20 rpm (no load) from the 28BYJ-48 stepper motor I'm using, but I think it was a little faster than before. Then it stopped working, and the DC motor I previously had working with a different sketch on the DC Motor + Stepper FeatherWing Add-on is also not running now; no vibration or movement at all. Could I have broken the FeatherWing by doing this?

radhardened
 
Posts: 21
Joined: Wed Aug 01, 2012 6:05 pm

Re: High RPM Stepper motor compatible with Motor Shield V2?

by adafruit_support_bill on Fri Apr 12, 2019 5:39 am

A 28BYJ-48 should be a relatively easy load for the Motor Wing. Are you using the 5v or the 12v version? What are you using as a motor power supply?

If you post some photos of soldering and connections to the Wing, we'll see if we can spot any problems there.

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

Re: High RPM Stepper motor compatible with Motor Shield V2?

by radhardened on Fri Apr 12, 2019 2:32 pm

It's the 5v version. Here's my setup:

Downloads8.jpg
power supply
Downloads8.jpg (118.46 KiB) Viewed 1244 times


Recently Updated.jpg
Feather and FeatherWing connections
Recently Updated.jpg (141.85 KiB) Viewed 1244 times

radhardened
 
Posts: 21
Joined: Wed Aug 01, 2012 6:05 pm

Re: High RPM Stepper motor compatible with Motor Shield V2?

by adafruit_support_bill on Sat Apr 13, 2019 6:06 am

Your headers on the WIng are not installed correctly. The short side of the pins should be inserted from the bottom of the board and they should be soldered from the top. Inserting the headers from the top as you have them will not make reliable electrical contact.
https://learn.adafruit.com/adafruit-ste ... g/assembly

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

Please be positive and constructive with your questions and comments.