Welcome! Log In Create A New Profile


From a curve to the steppers

Posted by Ecir Hana 
From a curve to the steppers
December 01, 2010 07:57AM

not sure if I got the thread folder right, if not I apologize in advance.

Please, does anyone know how does it work when Mendel (or a printer) gets a some 3d model (say, a cross-section in a shape of curve) and turns it into steppers motion?

I mean, does it turn the curve into many tiny straight lines and then, according to the slope of such a line it command X-stepper to turn 3 teethes forward and Y-stepper 2 steps backward? I guess an error would accumulate over some steps, right? Is this approach "fine" enough to draw smooth curves?
Re: From a curve to the steppers
December 01, 2010 09:18AM
The STL file only contains triangles, so all curves have been converted to short line segments by the CAD tool you use. If you set the CAD tool to make STL files accurate to 0.1mm and angles accurate to 5 degrees then you get lots of short line segments and curves come out smooth .

The filament naturally smooths out the lines because its diameter is much bigger than the short line segments, so it has a minimum bend radius.

Of course you need good firmware to keep up with lot of short segments.

Re: From a curve to the steppers
December 01, 2010 09:38AM
Ok, but if I have such a one small line, what do the steppers then do? Does the motherboard command them to run simultaneously 3 steps forward on X and 1 step back on Y? Whaf it the line has finer precision than one step of a stepper?
Re: From a curve to the steppers
December 01, 2010 10:42AM
... search for "Bresenham algorhythmus" - this methode is used for translating lines and curves with good accuracy into discrete steps for drawing on a display or moving steppers ...

Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: From a curve to the steppers
December 01, 2010 10:45AM
The steppers move along the line segments using the Bresenham algorithm. The motor moving the furthest distance steps on every step and the other on just some steps. So the line is theoretically a staircase, just as it is on a computer monitor. But when the motors move quickly the inertia smooths out the steps in the staircase and then the filament bend radius smooths it further.

The line is just specified by its endpoints in floating point numbers so that is high precision. The firmware converts that to stepper motor units by scaling and quantisation, so the lines are all rounded onto stepper motor positions. With half stepping that is a 0.1mm grid, but with micro stepping it can be finer.

There is no cumulative error, all the vertices are just snapped to the nearest point on the grid. Since the grid is fine compared to the filament diameter it is not noticeable.

Re: From a curve to the steppers
December 01, 2010 10:55AM
Very helpful, thanks a lot for the explanation!!
Sorry, only registered users may post in this forum.

Click here to login