Steps per mm troubles

605 views
Skip to first unread message

trav

unread,
Feb 14, 2013, 9:37:09 AM2/14/13
to accels...@googlegroups.com
Hello everyone, 

Relatively new to accel stepper (just found it a few days ago and giving a whirl). 

I have what I hope is a simple question that is just eluding me. 

I have a 1.8 degree unipolar stepper wired up 4 wire to a Big Easy Driver linked to an Arduino UNO. The motor is coupled to a THK KR20 200mm linear actuator. The lead screw in the actuator is 1 mm per full rotation. I would think I would be getting 1600 steps per mm but for some reason it seems like around 1698 steps gets me close to 1mm. I have to assume some factor some where is incorrect but I just cant seem to figure out which of these variables is out (the motor, the screw, the driver, the code). I guess all I am asking is if any of you have ran into calibration issues like this and what were some ways to check to identify the problems source? Thanks! 




 

Brian Schmalz

unread,
Feb 14, 2013, 11:00:00 AM2/14/13
to accels...@googlegroups.com

Trav,

 

You are correct, it should be _exactly_ 1600 steps/mm. If you have to do more steps to get to 1mm, then it means you are probably missing steps somewhere (meaning the UNO told the BED to take a step, and the stepper motor didn’t actually move forward by 1 step, but probably jumped back.) This can be caused by a number of things. The first of which is an incorrectly set current adjustment pot.

 

Here’s what I’d do. Set up a test that will allow you to run some nice number of mm (say 100 – should be 160000 steps). Then run the motor nice and slow (say 100 steps/second) to make sure that speed isn’t causing the issue. Run it back and forth along the 100mm a couple time, and see if you get exactly 100mm of travel each time. If not, try adjusting the current adjust pot slightly one way or the other (SparkFun sometimes changes the pot on the board, so you can’t trust the silk screen’s arrow for MAX direction), then run the test again. If you get it working, then start running faster. You’ll find a set of current and speed that cause you to miss steps – back off from that by some margin.

 

Make sense? You should be able to achieve exactly 1mm=1600 steps by tuning it this way.

 

*Brian

 

Brian Schmalz  //  Principal Embedded Systems Engineer | product development services

Logic PD
T // 612.436.5134

NOTICE: Important disclaimers and limitations apply to this email.

Please see this web page for our disclaimers and limitations:

http://logicpd.com/email-disclaimer/

--
You received this message because you are subscribed to the Google Groups "accelstepper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to accelstepper...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

trav

unread,
Feb 14, 2013, 12:17:37 PM2/14/13
to accels...@googlegroups.com
Thanks so much, Brian! 

I had been messing with the pots and did not realize that could be part of the problem since the motion appeared smooth and consistent. I throttled them up until high pitched whine and stutter vanished but didn't realize i could be under/over volting them.

My sketch is really simple as it's basically copied from the big easy driver examples where it moves positive then negative the same amount in a loop with acceleration/deceleration. I will dig in tonight when i get home and see if this helps. Thanks soooooo very much for the reply! You've given me hope again. I was out on the ledge ready to jump last night lol. 

trav

unread,
Feb 14, 2013, 10:17:55 PM2/14/13
to accels...@googlegroups.com
Well I was hoping to post a whoo whoo message but unfortunately that isnt the case. It seems like at 1600 i get right at .88 or .89 and at 1600 i get around 9.8 and some change. Strangely the results are fairly repeatable. I've gone slow, really slow, and crawling slow. I've switched actuators and motors just to be sure and i get the same results. I even kept the multimeter on the power supply to make sure the voltage from the power supply wasnt dipping. The power supply is rock solid at 12 to 13 volts (its adjustable). I will say that after playing with the pots about all i achieved was hot drivers and hot motors. im totally open to new suggestions. I have a set of the smaller easy drivers I could try on 1 motor. I'll give that a shot next I guess. 

trav

unread,
Feb 14, 2013, 10:19:02 PM2/14/13
to accels...@googlegroups.com
That should have read 1600 .88 to .89 and at 16000 9.8mm 

Brian Schmalz

unread,
Feb 14, 2013, 10:35:58 PM2/14/13
to accels...@googlegroups.com

Trav,

 

In that case, if it’s repeatable, it would seem like the motor is in fact stepping exactly 1600 steps, but something else is wrong. Could the lead screw not be exactly 200 steps/mm? Is there any way? I’ve never heard of a lead screw being off like that. Are you sure it’s not backlash? Could you change your measurement so that you travel in one direction to distance zero, then reverse direction and travel to distance 1mm and start your 10mm measurement, then take 16000 steps, (you would then be at 11mm from zero) and repeat the measurement? (I.e. both start and end measurements are coming from the same direction – without a reverse in between – thus eliminating backlash as a source of error)

 

*Brian

--

trav

unread,
Feb 15, 2013, 10:03:26 AM2/15/13
to accels...@googlegroups.com
Hi Brian, 

Thanks again for the response and taking your time to help. I wondered about the screw pitch as well, but I've never had trouble out of any THK gear i've ever had so when that thought entered my mind I pretty quickly pushed it back out. I also have two of these KR20's from different sources and both exhibit the problem. So that also makes me think "not the problem here", but you are right, it could be possible I suppose.

So heres a little more info about what I have going on. The first thing I considered was backlash like you are suggesting, but I Zero the dial indicator and move 1 or 10 mm (take a reading) pause 3 seconds to hit the Zero button on the indicator and then measure going the opposite direction if I need to. If I don't Zero out the indicator it doesnt seem to move back to 0 but it moves back to around .02 mm. Changing speeds and pot values doesnt really seem to affect anything (unless of course the pot value dips to high or low and then we get the shakes and stutters). 


Single Direction readings from 2 setups

0 to 1 mm (no direction change) I get .88 pretty repeatably from a 1.8 degree 0.9a Nema 17 unipolar wired up 4 wire to a KR 20 200 mm actuator 

0 to 1 mm (no direction change) I get .88 pretty repeatably from a 1.8 degree 2.5a Nema 17 bipolar wired up 4 wire to a KR 20 50 mm actuator 

on both motor / actuator combinations I get the same results within a few thousandths of a mm. 



Here is a similar 50 mm KR 20 setup that I am using. This isnt the exact one, but same deal.  


Here is the larger motor i am using on the smaller KR 20. This IS the exact motor. 



And of course I have the larger KR20 200 which is the same setup, just longer. 
   it has the .9a 1.8 degree lin engineering unipolar stepper attached to it. 


I am currently powering the Arduino UNO off of my USB from my PC. Perhaps powering it from the power supply could help? I am not educated enough on Arduino to know if this will matter in the GPIO voltage regulation for this application or not (basically just grabbing at straws). 

I am going to try hooking up the smaller easy driver to the .9a stepper tonight and just see if theres any difference unless anyone has a better idea. 

I have an aluminum L bracket attached to the block of the KR20 with a dial indicator on it. The KR20 is positioned vertically (think z axis fixture holder for a visual). 

The code I am using to test this i snagged from the big easy driver examples page for accelstepper and looks pretty much like this.  

#include <AccelStepper.h>

AccelStepper stepper1(1, 4, 7);
int pos1 = 1600;

void setup()
  stepper1.setMaxSpeed(100);
  stepper1.setAcceleration(100);
 
}

void loop()
{
  if (stepper1.distanceToGo() == 0)
  {
    delay(3000);
    pos1 = -pos1;
    stepper1.moveTo(pos1);
  }
  stepper1.run();

Brian Schmalz

unread,
Feb 15, 2013, 10:53:32 AM2/15/13
to accels...@googlegroups.com

Trav,

 

On first pass, I don’t see anything that you’re doing wrong.  Looks like you’ve taken everything into account quite well.

 

One way to see if you really are missing steps somewhere would be to put an indicator on the shaft of the stepper motor, then execute exactly one revolution (1600 steps), and make sure that the indicator lines up exactly where it was when you started. You can check this (one rev at a time) across the whole distance you want to move. Either the indicator will be off (indicating lost steps) or it will be dead on, indicating no lost steps.

 

That’s the next test I’d do. Make sure that the problem really is lost steps.

 

If you can confirm that the motor is losing steps every revolution, then the BED is either not getting exactly 1600 rising edges on the step input, or it is getting those pulses but it’s not taking every step.

 

Another thing to try, if possible, is to use a higher voltage power supply, like 24V. If the BED is having trouble making individual micro-steps, raising the input voltage gives you more room to create the microsteps.

 

I don’t think that the power supply going to the Arduino should make much difference at all – if it’s spitting out 0V to 5V pulses (Which it seems it is) then you should be fine there.

 

*Brian

Brian Schmalz  //  Principal Embedded Systems Engineer | product development services

Logic PD
T // 612.436.5134

NOTICE: Important disclaimers and limitations apply to this email.

Please see this web page for our disclaimers and limitations:

http://logicpd.com/email-disclaimer/

 

trav

unread,
Feb 15, 2013, 11:36:52 AM2/15/13
to accels...@googlegroups.com
Sounds like a plan! 

I had ordered another one of those Nema 17's off of Ebay a day or so ago. I think I'll wait for it to arrive, order a power supply, and then chain up the new motor and test. This way I don't have to disassemble this crazy contraption to test the motor steps. I'll let you know in a few days once all of this arrives. Thanks tremendously for the help! 

trav

unread,
Feb 16, 2013, 6:57:50 PM2/16/13
to accels...@googlegroups.com
Well I've decoupled a motor and I do appear to be getting a full 360 at 1600 after making a sharpie mark on the shaft and motor. They line up. Well that leads me to think that either my screw pitch is off, or under a load I am losing steps. 




On Thursday, February 14, 2013 9:37:09 AM UTC-5, trav wrote:

trav

unread,
Feb 17, 2013, 10:58:38 AM2/17/13
to accels...@googlegroups.com
and the winner is..... "the gauge is crap!"

switched gauges and all is well.... man, what a waste of a week. 

Well on the bright side after tearing everything apart, i found a motor out of phase so it wasnt a total loss i suppose. Uhg... 

Thanks again for the help, Brian! Being alone at sea can suck sometimes! 

Brian Schmalz

unread,
Feb 18, 2013, 10:05:20 PM2/18/13
to accels...@googlegroups.com

Trav,

 

I’m _super_ glad you got to the bottom of it – at least you know exactly what the problem was. Total bummer that it took so long though.

 

Glad to hear it wasn’t a problem with the driver or library. J

 

*Brian

 

From: accels...@googlegroups.com [mailto:accels...@googlegroups.com] On Behalf Of trav
Sent: Sunday, February 17, 2013 9:59 AM
To: accels...@googlegroups.com
Subject: [accelstepper] Re: Steps per mm troubles

 

and the winner is..... "the gauge is crap!"

--

Reply all
Reply to author
Forward
0 new messages