Understanding Microstepping

You can discuss various control electronics here. RAMPs, Arduinos, Motor Controller boards & etc...
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Kilh
Posts: 30
Joined: Sat Aug 16, 2014 10:32 am
Location: Berlin, Germany
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Understanding Microstepping

Postby Kilh » Wed Mar 18, 2015 9:16 am

Hey Folks,
I finally started with my build and while everything seems to come together as planned so far, I still kind of struggle with the electronics.
I'm using an Arduino Mega with Ramps 1.4 and A4988 drivers. After some trial and error and a good amount of cursing I got my z-stage to work. When I hit the "move 10mm" button in CW it moves exactly 10mm, so I guess that's fine for now.

After throwing my numbers at the reprap calculator ( http://www.prusaprinters.org/calculator/#stepspermmlead ) I set 320 steps per mm in my configuration file which leaves me with a resolution of 50 micron...

Now, what I don't get (and I wouldn't be suprised if I just have a thinking error here as I absolutely suck at maths); my Nema23 does 200 steps per full revolution (1.8°), my leadscrew has a pitch of 10mm. According to my brain 10mm/200 steps equals 50 micron, but where's the microstepping in that equation? I have it fully jumpered (which should be 1/16th if I'm not mistaken) so shouldn't it be a 16th of 50micron? My guts tell me that I'm probably an idiot, but it'd be great if someone could confirm that. :lol:

In case I'm all wrong and 50 micron is the lowest I can get with this setup. Would there be any way to further increase the resolution (to let's say 25 micron)? Other drivers, or something like that? A different leadscrew with a different pitch is not an option.

Thanks for the help!
Daniel

Phife
Posts: 239
Joined: Fri Jan 17, 2014 5:24 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Understanding Microstepping

Postby Phife » Wed Mar 18, 2015 10:36 am

You have your steps per mm set to 320, you have 16x microstepping turned on. You are microstepping.

You said your leadscrew is 10mm/revolution so for every revolution of your screw your stepper gets 3200 step pulses. 200 steps of your stepper x 16 microsteps=3200

Your machine can move a single microstep at a time so your resolution is 0.003125mm/microstep or 3.125 microns not 50.

dangre
Posts: 116
Joined: Wed Jun 25, 2014 4:20 pm
Location: SW Michigan
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Understanding Microstepping

Postby dangre » Wed Mar 18, 2015 11:11 am

mm_per_steps = 1 / ((motor_steps_per_rev * driver_microstep) / thread_pitch)
1 / ((200 * 16) / 10) = 0.003125 mm or 3.125 microns
Dan - mUVe 1 DLP

Kilh
Posts: 30
Joined: Sat Aug 16, 2014 10:32 am
Location: Berlin, Germany
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Understanding Microstepping

Postby Kilh » Wed Mar 18, 2015 8:28 pm

Alright, that's what my logic told me as well, 3.125 or 3200 steps.

So the question is... why does it even work correctly? In the Marlin config I set it to 320 steps/mm (as suggested by the online tool) and when I move the axis via CW it moves exactly as it should.
Do I have to add the microstepping somewhere else in the firmware? Is it already working and I just don't get it? I only set the microstepping via jumpers, is there anything else to do?

If these confusing questions make me look like a complete idiot, I can assure you I also feel like one right now. :?

I'm not even sure how to frame my question. Maybe like this: Do I just leave the 320 (full) steps in the firmware as they are right now and don't worry about a thing because the board/software knows that it can go finer on it's own?
After reading Phife's reply 20 times I feel like the above might be the right lead...

Thanks!

Phife
Posts: 239
Joined: Fri Jan 17, 2014 5:24 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Understanding Microstepping

Postby Phife » Thu Mar 19, 2015 12:13 am

You are already microstepping as I said. You set the microstepping with the jumpers, all 3 is 16x. You set this in your firmware as well. 320 steps/mm (1mm) and since your leadscrew has a 10mm pitch, you only need to turn 1/10 of a full revolution of the screw or 320 steps for 1mm. For 10mm you would need 3200 steps which would be a full revolution.

If you commanded the machine to move 0.003125mm it could do it. So no need to worry about anything, you have it set correctly and you are capable of some fine resolutions.

Kilh
Posts: 30
Joined: Sat Aug 16, 2014 10:32 am
Location: Berlin, Germany
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Understanding Microstepping

Postby Kilh » Thu Mar 19, 2015 6:12 am

Thanks for clearing that up :) I guess I was just overthinking the issue and made myself crazy about it.

Now back to finalizing the construction and figuring out how to make the shutter servo work :D

Yogi2010
Posts: 14
Joined: Tue Sep 08, 2015 8:27 am
Location: Mumbai
Contact:

Re: Understanding Microstepping

Postby Yogi2010 » Wed Dec 02, 2015 5:06 am


dangre
Posts: 116
Joined: Wed Jun 25, 2014 4:20 pm
Location: SW Michigan
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Understanding Microstepping

Postby dangre » Wed Dec 02, 2015 2:05 pm

Yogi,
From the PDF it looks like your KK50 has a lead of 2mm (if your model number is actually a KK-50-2). You can also measure this on your screw. Microstepping is set by your jumpers on your board (1/16 =all jumpers installed ). I need to revise my formula to:

mm_per_steps = 1 / ((motor_steps_per_rev * driver_microstep) / thread_lead)

So using the information you gave us:
mm_per_steps = 1 / ((200 * 16) / 2) = 0.000625mm [somebody please check my math]
Dan - mUVe 1 DLP

Yogi2010
Posts: 14
Joined: Tue Sep 08, 2015 8:27 am
Location: Mumbai
Contact:

Re: Understanding Microstepping

Postby Yogi2010 » Sun Jun 05, 2016 10:23 am


ramamramam
Posts: 1
Joined: Mon Jan 23, 2017 3:01 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Understanding Microstepping

Postby ramamramam » Wed Jan 25, 2017 2:51 am

I totally agree with Phife's comment about that ....
Graduated from University with First Class Degree with Honours in Computer Science.


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable