1 Attachment(s)
Help understanding stepper motor behavior
Hi! First post here on these forums.
I'm controlling an XY gantry put together in a H shape, with the X axes below the higher Y axis. I'm using an Arduino Uno with a CNC shield and TMC2208 controllers.
I'm using 16x microstepping on nema 17 motors with 200steps/rev. The steppers are mounted to lead screw guided carriages. The motion is smooth and free of noise and apparent skipping of steps.
The repeatability test that I ran on my gantry involved moving a total of 90mm in 10mm incremental steps (#1...#9), repeated over 5 runs. The position of the moving gantry was measured using a laser triangulation sensor (https://www.bannerengineering.com/us...rt.803940.html)
I am much more interested in the repeatability of my system, than the accuracy. If 1mm is 1.01mm that is completely fine.
I found it interesting to see in the data that, within each run, the distance traveled (per commanded 10mm move) varied for each of the 9 moves. (data highlighted red)
The baffling thing about the data is that, between all 5 runs, the distance traveled by each numbered segment (#1..#9) was almost identical. (data highlighted green)
What can I attribute this behavior to???
See the data attached in jpg:
Thanks,
Erik
Re: Help understanding stepper motor behavior
Hi Eric - Steppers move from "magnet" to magnet and have a mechanical accuracy. Typical commercial motors are +/-5% per step non accumulating. You can get 2% motors. So for a 200step motor ie 1.8degs per step you have a 1.8*0.05= +/-0.09deg accuracy or "zone" that the motor will stop at, at each full step. So you can now figure out the "zone" the motor should stop in mechanically if you know the lead of the screw (then there's also backlash to consider and hysteresis which means you will get a different measurement going one way vs the other). Then you have the electronic accuracy. Microstepping is a way to sort of balance the motor between mechanical steps. This has an accuracy as well.
So there is an averaging going on as the motor moves it stretches and compresses slightly around each technically correct spot (mechanically and electronically). Over many moves it averages to correct. Cheers Peter S
Re: Help understanding stepper motor behavior
That looks like ballscrew error to me, assuming the runs were all done over the same absolute positions...
Re: Help understanding stepper motor behavior
May we have the chance to view the lead screws?I'm guessing that with Nema 17's involved they aren't large and may not be ballscrews.I would expect a stepper to complete one revolution when the code requires it,with or without microstepping.
Re: Help understanding stepper motor behavior
I would do the same test with microstepping set to half or full steps.
This should eliminate errors from microstepping.
I also agree that it could be pitch error with the ballscrew.
And I'd also adjust your steps per unit, as your average travel is slightly over 10mm.
Re: Help understanding stepper motor behavior
Hi Erik - what is the lead of the screw and the steps /unit you have the controller set at? Peter
Re: Help understanding stepper motor behavior
Hi, thank you all for your insights. Some more information about my setup.
@peteeng, how does the nonaccumulating error manifest itself during microstepping. It is just +/-%5 or +/-2% of my my microstepped amounts?
@routalot, It is in fact not ball screws, but lead screws. Here is an image: https://photos.app.goo.gl/EPKYVGLDafqCXYg8A.
@get21, I performed the same test with microstepping changed from 16x to 4x and saw the same behavior.
@peteeng, the lead of the screw is 14mm/rev and i'm using 228.571 steps/mm. Here is a link to the inexpensive drive i'm using: https://www.robotshop.com/en/panowin...iABEgIMCfD_BwE
Re: Help understanding stepper motor behavior
Rather than get regurgitated information, just go to one of the most repsected sources when it comes to steppers
https://www.geckodrive.com/support/s...esolution.html
https://www.geckodrive.com/support/s...or-basics.html
1 Attachment(s)
Re: Help understanding stepper motor behavior
Hi Erik - I won't try to explain your machines behaviour, I will explain what should happen. Did you do this test in only one direction. You need to do it in two directions to remove hysteresis or to understand how much hysteresis is in your system. Plus if possible measure backlash to account for that as well.
So from the beginning, which I've been told was only 13.8 billion years ago... The motors have a mechanical tolerance spec but not an electronic tolerance on the usteps. This is because depending on speed, torque and all the other variables we cannot determine the exact location of where the ustep physically is. What we do know is that when the motor gets to a full step it centralises to the motor tolerance which for general spec motors is 5% of a step. So looking at the calcs attached.
1) a 14mm lead means that 200steps = 14mm and you have 228 (at 14 usteps per step 14/200*14=200) which is a big delta. ie the lead screw is poorly made, possible. Did the lead come with a tolerance or grade? Or you have a big backlash. So calibrate your screw over a large run and a small run and see what happens
2) One step is 0.070mm and has a tolerance of +/-0.0035mm
3) one ustep, if we use 14 usteps to the step is 0.005mm fuzzy and there are 14x200=2800 usteps/rev
4) 10mm is 142.857 steps so every step the error is averaged out mechanically and it's the last 0.857 steps that are electronic. If system is perfect then this is exactly 10mm all good. Max error is 1 ustep so in fact we will land somewhere between 9.995mm and 10.005mm which is what happens on your run at the first 10mm, past that it gets a little bit off. You need to work on your 228 and figure this a bit better I think and if possible include backlash compensation
5) BUT when you where at "zero" we do not know if the motor is at a full step or a ustep. If its a ustep then it takes off from an unknown point (starting error) could be +/-0.005mm then corrects at first step then gets to the remainder usteps and could be out 0.005 again so total position error could be 0.01mm in the perfect system.
So all of this is sort of academic if you are aiming at an accuracy or repeatability of 0.1mm as these figures will stand up to that as long as your mechanics are good. If you are aiming at 0.01mm then its borderline and you need to use much better mechanics and forget about trying for 0.001mm. Hope this helps & check my maths...Peter
I just noticed in the attached that I write the tolerance as +/-5degs should be +/-5%
Re: Help understanding stepper motor behavior
Quote:
1) a 14mm lead means that 200steps = 14mm and you have 228 (at 14 usteps per step 14/200*14=200) which is a big delta. ie the lead screw is poorly made, possible.
This is wrong. He has 16x microstepping which is 3200 microsteps per revolution. so, 16*200/14 = 3200/14mm = 228.5714. Exactly what he said he has it set for. I have never seen a stepper driver with a setting for 14x microstepping. So the screw is fine.
1 Attachment(s)
Re: Help understanding stepper motor behavior
Thanks for the check JB - see corrected attached. Not sure why the 14 popped into my head. Commentary same intent. I'm not sure how controllers decide on the remainder steps. In this case does it truncate to 13 or round up to 14 have to ask the programmer. Maybe its smart calculates the closest which would be 14 steps.... Peter
Re: Help understanding stepper motor behavior
From the images the 14mm pitch looks like quite a large multiple of the diameter.With such a coarse pitch in relation to the diameter it only needs a tiny discrepancy in the amount of rotation for a positioning error to occur and the previous posts have listed or linked to explanations of what those may be.