landerson5733
Posts: 5
Joined: Wed Jun 18, 2014 8:08 am

Help increasing rpm of stepper motor

Wed Jun 18, 2014 8:20 am

Hello!

I am currently working on a project that requires a stepper motor spinning very fast. I was hoping for 1000rpm. I have a Raspberry Pi connected to the Easydriver stepper motor (https://www.sparkfun.com/products/10267).
My power supply: (DC 12V 2A)
http://www.amazon.com/gp/product/B006NT ... UTF8&psc=1

I also bought this stepper motor:
http://www.amazon.com/Phase-Single-JQF5 ... s=JQF57Y56

Which is advertised as 1000 rpm. I have only 4 of the 6 wires hooked up to the easydriver. Using the wiringPi library, I wrote a small c program which makes the motor spin. The delay is at 1 which Is close to the smallest I can get it.

Currently, the highest rpm i can get is around 100.

Can anyone help me get this motor to spin faster? Any help is greatly appreciated! Let me know if I there is more info that I can provide.

Thanks!!

RaspISteve
Posts: 98
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Help increasing rpm of stepper motor

Wed Jun 18, 2014 10:58 pm

Years ago I had a need to run a stepper fast and could only get there by ramping the speed up from slow. At full speed a simple tap on the shaft would stall the motor so I was running the thing too fast. It may be in your case the voltage on the coils doesn't reach the point where enough current can flow to move the armature. I was using 30volts with a control to boost the voltage at every step as being the only way to get the speed I needed. It is likely your simple driver isn't able to drive enough current at the step rate you're demanding. It's all about coil inductance and current rise times. More volts are needed to push the necessary current.
Share and Enjoy.

landerson5733
Posts: 5
Joined: Wed Jun 18, 2014 8:08 am

Re: Help increasing rpm of stepper motor

Thu Jun 19, 2014 1:33 am

Oh cool! Thank you for the reply! So basically what you are saying is that I should look into getting a different driver that can output higher voltage instead of the EasyDriver, and maybe an even higher voltage power supply, right? What I am really looking to get is to make the stepper motor move from 0 - 90 or 180 degrees very quick. Kinda like a baseball swing. I think the motor I bought has enough torque to accomplish that, it just doesnt move fast enough. I am open to suggestions on different motors as long as they will have enough torque to spin something fairly big. I figure 5Kgcm is the minimum I would need (just by asumption, havent done the math yet).

User avatar
joan
Posts: 14482
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Help increasing rpm of stepper motor

Thu Jun 19, 2014 3:24 am

Your code?

How many steps per revolution?

How fast may the stepper be pulsed?

RaspISteve
Posts: 98
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Help increasing rpm of stepper motor

Thu Jun 19, 2014 5:53 am

If you attempt to step too fast you will leave the armature behind and it will stall so you have to ramp the speed up and down carefully else you will loose the position of the armature. Getting the right step motor driver is very important when you depart from the very simple applications. This forum isn't really the best place to outline what you should be doing.

Really slick applications use high torque motors in a closed loop control system. Put simply you have quadrature encoder on the motor output and watch where it gets to as you control the current into the motor. There is a whole load of physics to get through and complex control theory. Remember, you have the mass of the system and response times to consider. You can't simply start or stop it without a cost. The bigger the mass or target speed then the bigger the costs, complexity of driver and power supply. It is not just a software problem.
Share and Enjoy.

User avatar
joan
Posts: 14482
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Help increasing rpm of stepper motor

Thu Jun 19, 2014 7:36 am

Given that there is little information in the OP I wouldn't like to guess where the problems might be.

landerson5733
Posts: 5
Joined: Wed Jun 18, 2014 8:08 am

Re: Help increasing rpm of stepper motor

Thu Jun 19, 2014 6:22 pm

Hey!
RaspISteve, Since I want my motor to spin only 90 or 180 degrees, there is not much time to ramp up to speed. Does this mean that a stepper motor is not the right choice for this application? Maybe a DC motor with an encoder to start and stop it at the right spot is a better choice? I was really hoping a stepper could accomplish this. I will do some research on different drivers and update if I think I found a solution.

A little more info as requested by joan.

The motor is 200 steps/rev or 1.8degrees
As for how fast the stepper can be pulsed, I am unsure. How do I figure this info out? (Sorry)

This is basically my code (pulling from memory as I dont have it in front of me):

#include <wiringPi.h>
int main (void){
wiringPiSetupGpio() ;
pinMode (23, 1) ;
pinMode(24, 1);

digitalWrite(23, 1);

int i;
int j;
for (i = 0; i < 100; i++) { //100 revolutions
for(j = 0; j < 200; j++){//200 steps, 1 revolution
digitalWrite (24, 0) ;
delay (1) ;
digitalWrite 24, 1) ;
delay (1) ;
}
}
return 0 ;
}

User avatar
joan
Posts: 14482
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Help increasing rpm of stepper motor

Thu Jun 19, 2014 7:06 pm

You are using delay which is in units of milliseconds. So you are giving 500 pulses per second, or 2.5 revs per second which is 150 RPM.

Try using delayMicroseconds(200). That should give 2500 pulses per second, or 750 RPM.

Does the speed increase?

landerson5733
Posts: 5
Joined: Wed Jun 18, 2014 8:08 am

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 5:29 am

Alright, Thanks for the tip! I used delayMicroseconds(200) and the motor kind of just made a high pitch noise,around 400 It just vibrates. I played with it and found that 650 was about the lowest I could go to get it to reliably spin to the correct spot. Much lower and it skips. At 650, it does spin fairly fast. About 200 rpm.
Can I still get this motor to spin faster without warming up to speed? It kind of seems from a software side, that this is the best I can do plus or minus a few rpms. Should I get a driver that sends higher volts?
Thanks for the help so far!

User avatar
joan
Posts: 14482
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 5:40 am

landerson5733 wrote:Alright, Thanks for the tip! I used delayMicroseconds(200) and the motor kind of just made a high pitch noise,around 400 It just vibrates. I played with it and found that 650 was about the lowest I could go to get it to reliably spin to the correct spot. Much lower and it skips. At 650, it does spin fairly fast. About 200 rpm.
Can I still get this motor to spin faster without warming up to speed? It kind of seems from a software side, that this is the best I can do plus or minus a few rpms. Should I get a driver that sends higher volts?
Thanks for the help so far!
I don't know if the voltage would make a difference.

Given that software is under your control I'd try a ramp first to see if you can get anywhere approaching the theoretical speed.

For testing purposes it's probably more useful to know what speed you can reach rather than how quickly you can get there.

Something like.

Code: Select all

#define MINDELAY 250

for (delay=2000; delay>=MINDELAY; delay -= 50)
{
   for (steps=0; steps<50; steps++)
   {
      digitalWrite (24, 0) ;
      delayMicroseconds (delay) ;
      digitalWrite 24, 1) ;
      delayMicroseconds (delay) ;
   }
}
while (1)
{
   digitalWrite (24, 0) ;
   delayMicroseconds (MINDELAY) ;
   digitalWrite 24, 1) ;
   delayMicroseconds (MINDELAY) ;
}

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 7:58 am

Since I want my motor to spin only 90 or 180 degrees
Maybe a different approach would be better.

If you just want to move between 0, 90 and 180 and back again - then what you need is a servo motor.

But assuming you want to turn 90, then another 90, then another 90 etc how about just arranging 4 solenoids around your motor shaft and selectively push them up and down to stop an arm on the motor from turning .

So you start up with 1st one up and motor arm hard against stop
power motor then move solenoid down so arm move to solenoid stop 2 switch motor off and then put solenoid 1 back up again.

This way, you'll get to each position as fast as possible

And much more fun to do :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

PiGraham
Posts: 3671
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 9:09 am

90 degrees increments in what time?
1000rpm maximum rotational speed is irrelevant if you are not continuously rotating. You want to make a 90 degree step, from stationary 0 degrees to stationary 90 degrees in what time?
What are you moving? You need to know the angular inertia to calculate the torque required to accelerate the load. Other factors may limit performance, but for a rigid body with low friction inertia is likely to be dominant.

User avatar
Cancelor
Posts: 757
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 9:49 am

90 degrees = 0.25 of a revolution

1000rpm = 16.666 revolutions per second or 66.666 90 degree increments.

or one 90 degree increment in 0.015 of a second.

QED
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 10:02 am

Only if already moving :)
It won't do it in 0.015secs from a standing start if it has any appreciable maths

DEQ :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

PiGraham
Posts: 3671
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 10:11 am

Cancelor wrote:90 degrees = 0.25 of a revolution

1000rpm = 16.666 revolutions per second or 66.666 90 degree increments.

or one 90 degree increment in 0.015 of a second.

QED
That might be what the OP means, but better to get it from the source. It's already clear there is no 1000rpm here.
landerson5733 wrote:Hey!
RaspISteve, Since I want my motor to spin only 90 or 180 degrees, there is not much time to ramp up to speed.

User avatar
joan
Posts: 14482
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 10:21 am

It doesn't sound like a stepper will be a practical solution to the OP's problem, although I'm not sure we know the details. Sounds like he might need a fly-wheel arrangement and a clutch which can be rapidly engaged to transfer energy from the flywheel to the "bat".

PiGraham
Posts: 3671
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 10:25 am

An indexing cam mechanism might be appropriate.

https://www.youtube.com/watch?v=-6YArfCFUQw

User avatar
joan
Posts: 14482
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 10:33 am

PiGraham wrote:An indexing cam mechanism might be appropriate.

https://www.youtube.com/watch?v=-6YArfCFUQw
I wouldn't want to be any where near a machine like that doing a 1000RPM if it lost registration! :o

User avatar
Cancelor
Posts: 757
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 11:18 am

joan wrote:
PiGraham wrote:An indexing cam mechanism might be appropriate.

https://www.youtube.com/watch?v=-6YArfCFUQw
I wouldn't want to be any where near a machine like that doing a 1000RPM if it lost registration! :o
Hummmm, with the drive shaft going at 4000rpm :lol:
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

PiGraham
Posts: 3671
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 11:54 am

With something like the Geneva wheel shaft speeds can be low and yet give fast indexing.
It's no more dangerous that any gear system. The nice thing about it is that constant input speed gives you smooth rapid indexing. Angular inertia of the motor works for, rather than against you.

The parts can be expensive.

A lot of modern machines have moved to DC servo rather than use fixed cams.

Brushless DC servos used for quadcopters and the like could be an option for the OP. I've seem them used in camera gimbals, to keep a camera pointed level as the 'copter turns and banks.
https://viacopter.eu/multirotor-shop/ca ... pter-store
Might be OK for a mass up to 250g.

PiGraham
Posts: 3671
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 11:55 am

joan wrote:
PiGraham wrote:An indexing cam mechanism might be appropriate.

https://www.youtube.com/watch?v=-6YArfCFUQw
I wouldn't want to be any where near a machine like that doing a 1000RPM if it lost registration! :o
It can't lose registration, unless something snaps.

Here are some more clever mechanisms.
https://www.youtube.com/watch?v=mkQ2pXkYjRM

landerson5733
Posts: 5
Joined: Wed Jun 18, 2014 8:08 am

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 7:17 pm

So many helpful replies, thank you all!!

So heres what I am trying to accomplish. Picture a foosball table. I want to spin one of those rods with this stepper motor as to make the men kick. This will require going from 0 degrees to 90-180 degrees with enough speed and torque to kick the ball. So the rod will not be constantly spinning it will just be making a kick motion. As I currently have it, the 200 rpms it is putting out will be a decent kick but not what I want which is a power kick. Now the rod is fairly heavy but it will be laying horizontal and be in bearings so there shouldnt be too much friction holding it back.
joan wrote: I don't know if the voltage would make a difference.

Given that software is under your control I'd try a ramp first to see if you can get anywhere approaching the theoretical speed.

For testing purposes it's probably more useful to know what speed you can reach rather than how quickly you can get there.

Something like.

Code: Select all

#define MINDELAY 250

for (delay=2000; delay>=MINDELAY; delay -= 50)
{
   for (steps=0; steps<50; steps++)
   {
      digitalWrite (24, 0) ;
      delayMicroseconds (delay) ;
      digitalWrite 24, 1) ;
      delayMicroseconds (delay) ;
   }
}
while (1)
{
   digitalWrite (24, 0) ;
   delayMicroseconds (MINDELAY) ;
   digitalWrite 24, 1) ;
   delayMicroseconds (MINDELAY) ;
}
I will try this out when I get home :) and let you know my results.
Maybe a different approach would be better.

If you just want to move between 0, 90 and 180 and back again - then what you need is a servo motor.

I was considering a servo but I dont think it will have enough torque to spin the rod. I havent done the math but I feel 5kgcm is the minimum I will need.

But assuming you want to turn 90, then another 90, then another 90 etc how about just arranging 4 solenoids around your motor shaft and selectively push them up and down to stop an arm on the motor from turning .

So you start up with 1st one up and motor arm hard against stop
power motor then move solenoid down so arm move to solenoid stop 2 switch motor off and then put solenoid 1 back up again.

This way, you'll get to each position as fast as possible
Hmm.. Interesting. I will look into this some more.
With something like the Geneva wheel shaft speeds can be low and yet give fast indexing.
It's no more dangerous that any gear system. The nice thing about it is that constant input speed gives you smooth rapid indexing. Angular inertia of the motor works for, rather than against you.

The parts can be expensive.
An indexing cam mechanism might be appropriate.

https://www.youtube.com/watch?v=-6YArfCFUQw
I would like to keep the cost down as low as possible but I will spend the money if I have to. I do like this approach tho! And it may be an option if just a stepper wont do the trick

User avatar
joan
Posts: 14482
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Help increasing rpm of stepper motor

Fri Jun 20, 2014 7:28 pm

PiGraham wrote: ...
Here are some more clever mechanisms.
https://www.youtube.com/watch?v=mkQ2pXkYjRM
I like clockwork.

RaspISteve
Posts: 98
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Help increasing rpm of stepper motor

Sat Jun 21, 2014 6:40 am

Landerson, you could use a simple electric motor as rotating actuator. Essentially a rotating solenoid. You could bias the armature with a small spring and limit the rotation (or kick) using two end stops maybe with sensors or switches.

When you want to 'kick' just switch some (or a lot of) current into the motor or, more accurately ... rotating actuator. If you avoid the time it spends stalled against a stop and the duty cycle you won't over heat it.

You can either rely on the spring to reset the kick or power it backwards. Controlling the kicking current by chopping it would vary the power/speed of the kick. Again, starting with a higher voltage will give you more control if you also pulse modulated the current with the software. You also control the profile of the kick action.
Share and Enjoy.

User avatar
Cancelor
Posts: 757
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: Help increasing rpm of stepper motor

Sat Jun 21, 2014 6:59 am

This will give it a kick .... but it's not a free kick!

http://uk.rs-online.com/web/p/rotary-solenoid/0440048/
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

Return to “Troubleshooting”