Turning stepper one revolution

I have stepper motor that is suppose to be 200 steps per revolution but it can't be that to translate in the code. If I use
Stepper motor1(200, 9, 10) to specify 200 steps per revolution and then use motor1.step(200) it doesn't make one full rotation. It only moves a little bit. To make it turn roughly one full rotation I have to use motor1.step(6300). What am I missing? Thanks in advance to anyone that can help.

Also I am using a EasyDriver motor driver. Does that change things?

Here is some example code that will make the motor turn roughly one full revolution.

#include <Stepper.h>

Stepper motor1(200, 9, 10);


void setup()
{
  motor1.setSpeed(60);
  
}

void loop()
{
  motor1.step(6300);
  delay(500);
  motor1.step(-6300);
  delay(500);
}

Please post links to the stepper motor specs, and where you got the driver.

Sounds like you are losing steps due to wrong wiring.

It sounds perhaps as though you've bought a stepper with an attached gearbox, so that while the stepper motor is ostensibly 200 steps per revolution, the gearbox changes that to the 6300 you observe.

If so, as long as it's fast enough, does it really make any difference? You now know the number of actual steps per revolution, so just use that to declare the stepper object appropriately in your code.

wildbill:
You now know the number of actual steps per revolution

He said it was approximate.
If indeed the discrepancy is because of a gearbox, I would suggest that he put the motor through millions of steps in order to get at the correct figure, which, after all, might not even be an integer.

Or perhaps setSpeed is too fast. (Can the motor really turn at 60 rpm?)

lyrical10:
If I use Stepper motor1(200, 9, 10) to specify 200 steps per revolution and then use motor1.step(200) it doesn't make one full rotation. It only moves a little bit.

Does it move a consistent amount each time, and does that change when you load the output shaft forwards or backwards while it's moving? I'm wondering whether the motor may be slipping, perhaps because it's underpowered for the load.

I got the stepper motors off ebay: 3 x Stepper motors NEMA 17 - CNC ROUTER MILL ROBOT REPRAP MAKERBOT Prusa p2vs-3 | eBay

They are not geared in any way and are listed as 1.8 degrees/step.

Here are the drivers I'm using: http://www.ebay.com/itm/330908551899?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649. Its an EasyDriver.

There is no load on the motors and they do move a consistent amount every time. The power supply I am using is a wall wart rated at 12v 400ma but when I put a meter to it it is putting out around 16v.

Here is a picture of how its wired (but I'm using pins 9 and 10):
http://bildr.org/blog/wp-content/uploads/2011/05/EasyDriver-Stepper-Motor-Driver2.png

I don't know why its not working!

The ebay description suggests that the winding current should be on the order of 1 amp/winding. If true, there is no way that your power supply can supply enough current to run these motors satisfactorily. Try using a power supply that can provide 2 amps at 12-24 volts.

Can you measure and post the actual winding resistance? What is written on the motor nameplate?

The motors seem to turn pretty strong with this power supply. The power supply could affect the steps per revolution that much? Meaning my code has to do roughly 6300 steps instead of 200 to make a full rotation.

What does 1amp/winding mean? How do I measure the winding resistance?

Also the EasyDriver says it can provide 750ma/phase. It should still run these motors fine right?

Also I don't really understand the whole winding/phase concept. Is a winding and a phase the same thing?

Frankly, I don't completely understand why specifying about 6300 steps should give you a full turn. But then, you haven't given us all the information needed to figure out what is actually causing the problem. It would help to know exactly what motor you have and a data sheet for it.

Lacking that info, use a multimeter to measure winding resistance. If you don't have a multimeter, and want to learn about how motors, motor drivers and other electrical circuits work, then you should go out and buy one today.

Stepping motors have two to four windings and each needs to be powered on and off (or the current reversed) in a certain sequence to turn the shaft. The winding current controls the shaft torque, and the manufacturer usually prints the maximum winding current on the nameplate of the motor. Sometimes the winding resistance and the maximum winding voltage are printed. The relationship is just Ohm's law for steady state.

Finally, two windings are usually powered at the same time, so to get the maximum torque out of your motor, the power supply must be capable of supplying twice the maximum winding current. Yours can't do that.

lyrical10:
The motors seem to turn pretty strong with this power supply. The power supply could affect the steps per revolution that much? Meaning my code has to do roughly 6300 steps instead of 200 to make a full rotation.

Do you mean that when you try to prevent the output shaft from moving by twisting it against the direction of movement it still moves at the same speed, and when you try to help it by twisting in the direction of movement it doesn't go any faster? If so, this doesn't sound like an inadequate power supply causing slipping.

Does your stepper motor driver support micro-stepping, and if so what mode are you using?

Do you have a picture of the motor? Perhaps that would reassure us that you haven't simply ended up with a stepper/gearbox unit by mistake.

I agree about the lower speed. At too high a speed I have seen steppers just sort of "hum" along and not turn properly. For testing, make the speed much lower and see what happens.

Here is what I'm going to do when I get home:

  1. lower the setSpeed
  2. use a 12v 1A power supply instead of a 400ma one

I did some searching on the motors but couldn't find a data sheet that I knew for sure was right. Maybe someone else will be able too. Here is whats listed on the motors:

Minebea Co LTD
ASTROSYN
P/N FH5-1043 02
TYPE 17PM-J034-P2VS
NO T8318-01

I thought the motors were 12v based on the eBay description but after reading specs on similar motors on the Minebea website I think they might be 24v. Is there a way to test them to find out for sure? Is it okay to run 24v stepper motors at 12v?

Thanks to everyone who has tried to help so far. I will let you know what happens tonight when I lower the speed and change the power supply.

So now I'm really confused. It looks like my motors take 800 steps per revolution. I'm using an EasyDriver and I tested at every mode (full and micro-stepping) and got:
full step = 800 steps/rev
half step = 1600/rev
quarter step = 3200/rev
eighth step = 6400/rev

How could that be? Do they even make 800 step/.45 degree steppers? They are not geared in anyway. See attached picture.

I don't know what could be wrong in my code or wiring?

#include <Stepper.h>

Stepper motor1(800, 9, 10);

void setup()
{
  motor1.setSpeed(60);
}

void loop()
{
  motor1.step(800);
  delay(500);
  motor1.step(-800);
  delay(500);
}

Picture of how I have it wired (except I'm using pins 9 and 10)

If you know how many steps are actually needed to turn one full revolution, what is the problem?

Why is turning one full revolution important?

I'm building a CNC machine with them and everything I've been reading and researching uses 200 step motors. I was just wanting mine to be the same to make things easier when configuring.

Its also bugging me that I can't figure out why I'm getting 800 steps per revolution instead of 200. Anyone got any ideas?

I don't know how these steppers could be 800 steps per revolution. Do they even make such a thing? I couldn't find anything online.

lyrical10:
I did some searching on the motors but couldn't find a data sheet that I knew for sure was right. Maybe someone else will be able too. Here is whats listed on the motors:
Minebea Co LTD
ASTROSYN
P/N FH5-1043 02
TYPE 17PM-J034-P2VS
NO T8318-01

I think you don't search very hard -> Google "17PM-J034-P2VS datasheet"
2nd link ->http://www.eminebea.com/content/html/en/hybrid_list/custom.shtml
where you could found a datasheet.

68tjs,

I found that page also when searching but when you scroll down the page to the specification section 17PM-J034 is not listed. I didn't want to assume my motors were the same as one of the ones listed in the chart. Do you see something I don't?

The advert definitely says 1.8 degrees per step and you are definitely not seeing that, so I suggest you contact the seller, inform them that it is not as advertised, and ask them to explain the discrepancy.

I spoke to the seller and I believe he is correct about them being 1.8 degree motors. So what is wrong with my wiring or code? I'm totally stumped!