Determining rotational accuracy of a drive unit. - Page 1
Forum section: electronics / general

author: Puffie40
author_rank: Regular Contributor
timestamp: May 18, 2021, 04:47:18 pm
content: So we have a stepper motor/worm gear drive at work that does not provide very good positional accuracy at work, and I am trying to figure out the accuracy mathematically.The Stepper motor has a 25,000 step/rev resolution, and it is coupled to a 20:1 gearbox. The supplier told us that means(360/25,000)*(1/20) = 0.00072 degrees/stepI've determined the model of the gearbox used has a maximum backlash of 0.13 degrees, and I think this is a potential source of the problem (There is other issues, but this is the main one I can work with).The problem I'm having is determining how that backlash factors into the original equation. So far, I think this would be inserted into the equation as an error tolerance (ie 0.00072 degrees/step,+/- 0.13 Degrees).Any thoughts?

author: Benta
author_rank: Super Contributor
timestamp: May 18, 2021, 06:26:33 pm
content: Depends on whether is has to work bidirectionally or only in one direction, and if the mechanical load is reasonably constant.In just one direction, backlash is not very important. But when you reverse direction, you'll have a 0.13 degree "dead zone" before the output shaft starts moving again.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: May 18, 2021, 07:22:51 pm
content: Yeah, whether it's plus or minus 0.13 degrees will depend on the direction of rotation.Seems silly having such a fine step resolution when it's massively outweighed by the mechanical backlash.

author: nctnico
author_rank: Super Contributor
timestamp: May 18, 2021, 08:35:22 pm
content: I'd use a toothed belt drive reduction instead of a gearbox combined with a servo motor. From there on an absolute position encoder along the worm drive to create a feedback system into the servo motor. One of the things I've learned is that stepper motors kinda suck as an open loop control system and if you can going for a closed loop, a servo motor gives you a much simpler control system.Using gears together with stepper motors is a big no anyway because the stepper motor will wreck the gear teeth.

author: james_s
author_rank: Super Contributor
timestamp: May 18, 2021, 08:44:50 pm
content: CNC equipment typically has a backlash compensation setting, you measure the actual backlash under real world conditions and enter that constant and then whenever the drive changes direction it will account for that by turning the motor far enough to compensate. Can you do something like that with your system? You'll never completely eliminate backlash.

author: Benta
author_rank: Super Contributor
timestamp: May 18, 2021, 08:57:13 pm
content: Quote from: nctnico on May 18, 2021, 08:35:22 pmA 20:1 toothed belt reduction? Please post a picture.

author: james_s
author_rank: Super Contributor
timestamp: May 18, 2021, 09:11:29 pm
content: It's certainly possible to do a 20:1 belt reduction, but there's absolutely nothing wrong with using a gearbox.

author: MarginallyStable
author_rank: Regular Contributor
timestamp: May 18, 2021, 11:15:04 pm
content: Most of the robotic arms I have seen utilize "harmonic gear reduction" which does give very little, if any, backlash. Also known as "Strain Wave Gear reduction".https://en.wikipedia.org/wiki/Strain_wave_gearing

author: Someone
author_rank: Super Contributor
timestamp: May 19, 2021, 12:49:08 am
content: Quote from: nctnico on May 18, 2021, 08:35:22 pmFrom your experience. In my experience open loop stepper motor systems can be built (cheaply, much cheaper than servos with the same resolution) that don't have those drawbacks and need interferometric angle measurement to observe the positioning accuracy and repeatability.Its easy to do things poorly, but not that much effort to implement given technologies well. All this information is out there for people who want to find it.

author: Someone
author_rank: Super Contributor
timestamp: May 19, 2021, 12:53:59 am
content: Quote from: Puffie40 on May 18, 2021, 04:47:18 pmGood luck! most of the data sheet "specifications" are not going to translate into absolute accuracy. Some times you might get a "step accuracy" angular positioning tolerance which is where you'll need to start.

author: NiHaoMike
author_rank: Super Contributor
timestamp: May 19, 2021, 01:22:47 am
content: Quote from: nctnico on May 18, 2021, 08:35:22 pmCare to explain why? It's not that difficult to find a machine that uses a stepper motor driving gears and they seem reliable enough.

author: Someone
author_rank: Super Contributor
timestamp: May 19, 2021, 01:59:29 am
content: Quote from: NiHaoMike on May 19, 2021, 01:22:47 amThis is a common misconception from experience of driving stepper motors without micro stepping. Its not stepper motors that are the problem, but a vibration inducing drive method (which could equally apply to most motion actuators).

author: amyk
author_rank: Super Contributor
timestamp: May 19, 2021, 03:20:39 am
content: If you need no backlash at low to moderate loads, there are gearboxes that use a preload mechanism to do that (similar to the mechanism in a dial indicator.)

author: Benta
author_rank: Super Contributor
timestamp: May 19, 2021, 07:37:34 pm
content: As the OP hasn't come back with more information, all this is moot.

author: Puffie40
author_rank: Regular Contributor
timestamp: May 20, 2021, 06:04:08 pm
content: The application is for a camera pan-tilt platform, so the load is constant. The programmers noticed the positioning accuracy would constantly get worse the more it moved. I did some one-way position movement and noticed the drift was constantly increasing the further it moved from the start point.I've heard that stepper motors and gearboxes are bad for positional accuracy, but I also don't think not having any position feedback aside from some limit switches would help eitherBecause it is a supplier-provided component, I cant do any redesign, but I can write up a small report to explain why.

author: james_s
author_rank: Super Contributor
timestamp: May 20, 2021, 06:17:05 pm
content: Missed steps can be an issue too, it's something that should be investigated. If anything ever causes a missed step to occur it's going to be a problem, because without any type of feedback the missed steps will accumulate. A classic workaround was the Apple II floppy drive, at power on it would drive the head positioning stepper with enough steps to move it all the way to the end stop from any position, it had no home sensor, it would just blindly crash it into the stop and then it knew it was in the home position, it's the reason for the iconic grinding chatter when you power on one of those machines. Something similar could be done with a camera positioner I suppose, but a home sensor would be better.

author: Puffie40
author_rank: Regular Contributor
timestamp: May 20, 2021, 06:22:29 pm
content: Quote from: james_s on May 20, 2021, 06:17:05 pmHow could one check for missed steps?

author: ajb
author_rank: Super Contributor
timestamp: May 20, 2021, 06:39:44 pm
content: There are several different kinds of "accuracy" and it's not immediately clear which kind you're describing. There's actual accuracy, which is how close the system gets to its commanded position, repeatability, which is how close the system gets to a commanded position after moving to another position, stability/drift, which is how much the position error changes over time and can be a short- or long-term, linearity, which is how consistent the positioning is over the range, and noise, which is how much the system moves when commanded to hold position.Quote from: Puffie40 on May 20, 2021, 06:04:08 pmThat's only true if the load is balanced over both rotational axes. If it's not perfectly balanced, then the load will change through the rotation. This could introduce an error term via simple mechanical deflection in the drive or the mechanical structure, or by the fact that the required positioning and holding torque will keep the motor itself from holding its commanded position. Even if there were no gearbox involved and the load were solidly mounted to the shaft there would be a positioning error as the torque changed because the torque will move the rotor away from its theoretical magnetic position. The direction of the holding torque may even reverse if the load's center of gravity crosses from one side of the axis to the other, which in combination with backlash could be a significant issue.QuoteSo is the problem getting worse as the system makes more moves (as if it's wearing, for example), or is the accuracy over a single move worse the longer the move is? If the latter is it really the length of the move or where the destination is within the range? These all imply different underlying problems.QuoteWell, define "bad"? Open loop steppers are used all over the place because they're good enough for a lot of applications. Closed loop is certainly better in terms of reliable accuracy, but costs more and is therefore "bad" if the application doesn't require it. Closed loop where the loop includes all of the mechanics--like some high end CNC machines that use glass scales directly on the axes for position feedback--is even better, but even more expensive. Gearboxes and other mechanical transmissions certainly introduce additional potential error terms, and where accuracy is required those need to be designed to minimize those errors, which is why you see harmonic drives used in robots (where the mechanics amplify angular errors so angular position is REALLY important) and ball screws with preloaded angular contact bearings and zero-backlash preloaded ball nuts in CNC machines. It's engineering, "bad" and "good" are all relative to the application.One other thing specific to steppers, although this is likely not significant here because it will be largely swamped by your gearbox issues, is that when microstepping the microsteps are often not linear across a full step. This is because the way that fractional step currents in the windings translate to magnetic field strengths and thus torque on the rotor varies a bit from the theory due to design and manufacturing factors in the motor itself. Trinamic has an appnote about this somewhere, and some of their drivers include a lookup table that can be programmed to modify the shape of the microstepping curves to compensate. They also have their own line of motors specifically designed to provide very linear microstepping, which in my testing are noticeably better than at least the real cheap ones from ebay or wherever.

author: nctnico
author_rank: Super Contributor
timestamp: May 20, 2021, 07:11:31 pm
content: Quote from: ajb on May 20, 2021, 06:39:44 pmIf you look more closely you'll notice that none of them are actually open loop. All of them have at least some form of nulling.

author: Puffie40
author_rank: Regular Contributor
timestamp: May 20, 2021, 07:36:16 pm
content: Quote from: ajb on May 20, 2021, 06:39:44 pmI would say actual and repeatability are the two big ones. The Called-for angle, and the measured angle can be off as much as two degrees, and that positional error appears to increase the more the pan-tilt has traveled from the start. (For example, after initalizing the PT to 0 degrees, and move the PT to 90 degrees, I get an angle of 89.8. If I move the PT forward a complete revolution around to 90 degrees again, I get a actual angle of 88.8.QuoteI did some measurements with increasingly larger movement increments, and observed that the error pattern in the graphs stays about the same. The curious part of my testing has shown that the error increases quite a bit after the PT moves past 180 degrees, and as I move past 360 degrees, that error continues to increase in the same pattern. It even reverses when you move in the opposite direction.I am feeling rather inexperienced with these kinds of issues, so you'll have to forgive me if I seem to be giving confusing information.

author: ajb
author_rank: Super Contributor
timestamp: May 20, 2021, 07:49:24 pm
content: Quote from: nctnico on May 20, 2021, 07:11:31 pmNot sure what you're trying to say here. If you're talking about nulling in the conventional electronic sense as part of the driver's current control system that's hardly the same thing as using an encoder to close the loop around the mechanical position of the motor. If you're talking about "nulling" the mechanics by referencing an initial position to a limit or home switch, that's also different because the loop is only "closed" during the referencing and does not in and of itself provide any assurance that any other position is accurate the way a true closed-loop mechanical system with an encoder would.

author: Benta
author_rank: Super Contributor
timestamp: May 20, 2021, 07:55:30 pm
content: There's an interesting issue which is rarely mentioned.This is the mechanical resonance of the stepper motor vs. stepping frequency.I attended a very interesting conference on this point (must've been around 12 years ago) hosted by AMI Semiconductor.The mechanical response of the motors in relation to step frequency and ramp speed was astonishing. At certain frequencies, the motor would simply lose torque or holding torque and begin step-slipping. AMI had some really smart devices that would detect this and modify the driver parameters accordingly (yeah, I know, sales talk).But the Bode plots of the motors were extremely interesting.Unfortunately, I no longer have the conference material, but perhaps a search onwww.onsemi.comin the "Power Management" section might find some app notes, presentations or videos.Not necessarily relevant to this discussion, but something to keep in mind.

author: james_s
author_rank: Super Contributor
timestamp: May 20, 2021, 08:01:54 pm
content: Quote from: Puffie40 on May 20, 2021, 06:22:29 pmWell, that can be tricky. Probably the easiest way to do it is figure out a way of connecting an external position sensor and then write a script that makes repeated movement commands and record the offset between commanded position and measured position and look over the data to see if the offset appears to randomly jump around. You could also repeatedly sweep from say 90% in one direction to 90% in the other direction and see if it develops an offset over time, which would suggest missed steps. The difficulty will be if it's missing approximately the same percentage of steps in both directions over time.You might also see if you can slow down the stepping so that it's moving one step at a time, at low speed a stepper is less likely to miss, and it's more apparent if you send it a step command and the device doesn't move. If there's always an offset near the end of the travel range and the offset doesn't seem to vary much then it's possible that your drive ratio is not quite precisely what you think it is.

author: Someone
author_rank: Super Contributor
timestamp: May 21, 2021, 12:23:03 am
content: Quote from: james_s on May 20, 2021, 08:01:54 pmTo expand on this a bit more, missed steps are often from acceleration as much as velocity (noting the velocity resonances mentioned above (which can't be measured from bode plots in steady state (and can be only reproducible in operation with the specific loads (motion ends up with many layers of context/complexity)))). So the classic way to test for missing steps is to walk the system to random positions at random speeds and accelerations inside the operating envelope, then periodically return to a known/observable origin and check the alignment there.Quote from: Puffie40 on May 20, 2021, 07:36:16 pmSimple things like how you measured angles and what the drive was commanded/configured to do are important here. Describing "error" and their accumulations or patterns isn't working so well and you'd probably be better off plotting it to show what you mean. Being out by a degree or more could be entirely the gearbox, or some ratio calculation in the software that is incorrect (floating point is not a magic answer to precision).

author: james_s
author_rank: Super Contributor
timestamp: May 21, 2021, 02:53:16 am
content: After thinking about this some more, I think a good place to start is to single step it through the entire range from one end to the other and measure the angle every 5 degrees or so. You need to find the total number of steps required to traverse the entire range and see if it equals the value that you think it does. For example of the gear ratio is off very slightly you might find that instead of 3,000 steps it actually takes 2973 or 3019, just numbers I pulled out of thin air for sake of example. If you're assuming 3,000 steps then your calculations going between relative positions are going to be off. The backlash ought to be more or less constant, at any given position the moving part will have +/- x degrees of slop if you wiggle it. If it hasn't missed any steps the actual position should never be off any more than the amount of backlash in the mechanism.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 21, 2021, 03:47:34 am
content: Stepper motors don't have "25000 steps/rev".Stepper motors usually have 200 steps/rev, but 400 steps/rev also exist, and it can be as low as 24 steps/rev.With microstepping you can increase resolution a bit, maybe by a factor or two or four, but if you try to go further, then you get into the magnetic elasticity too far and position is too much load dependent.

author: Siwastaja
author_rank: Super Contributor
timestamp: May 21, 2021, 03:09:27 pm
content: Yes I don't believe the OP has a "25000 steps/rev" motor, it would be very special.Larger and larger error towards one end sounds like you have just some slightly wrong number somewhere. For example, if you expect your reduction gear is 1:20 but in reality it is 1:21, you would have linearly increasing error ending up at 5%.Recheck all numbers.Regarding microstepping, the point is not to magically generate ridiculously high positional accuracy, the point is to drive the motor with sinusoidal waveform instead of square wave and minimize stutter / vibration. The more microsteps, the better it approximates sinusoidal drive. You can't have too much really, use as much as you can implement.Regarding missed steps, you'll notice if that happens from the jerk and sound it makes. If it is sitting on your lab table and operating smoothly without you noticing any weird, you are not missing steps.Backlash compensation can be implemented by always stopping the motion in one certain direction. If you need to go to the opposite direction, go half a degree over the destination then come back half a degree.Steppers are OK for many applications if you know and accept the limitations.

author: mikerj
author_rank: Super Contributor
timestamp: May 21, 2021, 05:17:38 pm
content: Quote from: Siwastaja on May 21, 2021, 03:09:27 pmI wonder if the 25,000 steps/rev is after the 20:1 reduction, that seems more feasible when combined with microstepping.

author: Puffie40
author_rank: Regular Contributor
timestamp: May 21, 2021, 05:36:36 pm
content: Quote from: Doctorandus_P on May 21, 2021, 03:47:34 amThat is rather curious. It took me a bit to determine the stepper motor model, but I found it here:https://www.moonsindustries.com/series/stm23r-series-integrated-stepper-motors-a01020402It has an integrated driver and claims to have a microstepping resolution of up to 25,000 steps.

author: Benta
author_rank: Super Contributor
timestamp: May 21, 2021, 06:05:12 pm
content: Note that resolution is not the same as accuracy (which the data sheet doesnotspecify).

author: james_s
author_rank: Super Contributor
timestamp: May 21, 2021, 06:46:06 pm
content: The accuracy should be fairly constant though, a stepper motor is always going to move in discrete steps which are directly tied to the mechanical construction of the motor. It's not going to randomly take a different number of steps to make a full revolution.

author: Benta
author_rank: Super Contributor
timestamp: May 21, 2021, 07:53:41 pm
content: Quote from: james_s on May 21, 2021, 06:46:06 pmQuite, no dicussion on this.But to take a (possible) resolution of 1/25000 and translate that to an angle accuracy of 0.0144 degrees (or whichever unit) is a very far leap.The magnetic poles in the motor are not even machined to tolerances that would allow that kind of accuracy.And then adding a worm mechanism on top of that for even higher resolution (notaccuracy) is asking for trouble.

author: nctnico
author_rank: Super Contributor
timestamp: May 21, 2021, 08:56:17 pm
content: It could be the stepper motor has an internal reduction which then adds to the error as well.

author: Puffie40
author_rank: Regular Contributor
timestamp: May 21, 2021, 09:26:16 pm
content: Quote from: nctnico on May 21, 2021, 08:56:17 pmNo, the stepper motor has no other reduction- it is a direct drive. It's full step size appears to be 1.8 degrees, since its lowest resolution is 200steps/rev.

author: james_s
author_rank: Super Contributor
timestamp: May 21, 2021, 11:09:54 pm
content: Quote from: Benta on May 21, 2021, 07:53:41 pmYeah 25,000 steps/rev is totally unrealistic I think, that just sounds like marketing wank to me. Microstepping can be useful to make a stepper operate more smoothly, but I would still not expect it to stop accurately at a point in between physical steps of the motor.

author: nctnico
author_rank: Super Contributor
timestamp: May 21, 2021, 11:39:30 pm
content: Quote from: Puffie40 on May 21, 2021, 09:26:16 pmBut that is not what it says in your original post; there you start with a stepper which has 25000 steps/revolution and then goes through a 1:20 reduction.

author: james_s
author_rank: Super Contributor
timestamp: May 21, 2021, 11:47:15 pm
content: Quote from: nctnico on May 21, 2021, 11:39:30 pmThe motor is direct drive with no integral gearbox, it drives a separate mechanism which results in a 1:20 reduction, at least that's how I read it.