Gallery, Projects and General > How do I??

How does CNC _actually_ work?

<< < (3/4) > >>

russ57:
AvE (YouTube) recently described something a bit like you are talking about, but still horizontal. Packs away, as it doesn't have a table.


-russ

PekkaNF:
just thinking here aloud on alphanumerals....polar cordinates are ok with bearings....but gears and position sensors are harder than you think prior taking pen and paper and then industrial robot sounds really good.

I don't know about plasma much, then ones I heard have water table.

But if you solve the "table" and bolt down the plate both cut and off-cut - why not? After all direction of the gravity does not change.

Slight angle might help. Is there anything to learn from vertical panel saw?
http://www.productiq.com/DesktopModules/ProductIQ/Shared/ProductImage.aspx?Large=1&ProductId=75637

http://www.dbkeighley.co.uk/images/koolkut_kk12.jpg


Pekka

vtsteam:

--- Quote from: AdeV on April 14, 2017, 12:02:52 PM ---OK, that might seem like an odd (and pretty wide) question.... so let me boil it down by way of a couple of examples...

Let's say I wanted to machine a straight line between the position my cutter is at now, and another position which is 10 inches away at an angle of 14.8 degrees (some nice random numbers there...)

I'm assuming that the controller figures out that for every N steps in the X-direction, there must be 1 step in the Y-direction. But how does it then apply this to the controller? Does it literally move N steps in the X-axis, then 1 step in the Y, repeat until we arrive at our destination? If N is not a whole number, presumably it keeps track of the remainder & occasionally moves 1 step in the Y axis at N-1 steps, or N+1, or whatever.  snip.....

--- End quote ---

Yes, it does -- sorry to be answering such an old post, but I just happened to read it, and I also think nobody answered this first part of the question.

The way it is handled is by what's called a DDA algorithm. You can find complex mathematical explanations online, but the process you mention is for practical purposes what happens. A motion increment is determined -- equal to one unit of movement for X (for instance, it might be in eighth steps for a stepper motor). You then calculate the amount of Y increase that one unit of X  movement would generate according to the formula for your particular function (for instance if its a straight line you'd use y=mx+ b). Likewise If a circle, you'd use a circle formula, or if some other function, you use that.

And as you say, if there is a decimal part (remainder), you test the result using the old rounding method we learned in school -- if it is .5 or more, you add one additional unit step to the Y movement, and if it is less, you don't.

Hope that's understandable.

I first learned about the DDA algorithm when I built an LNW-80 computer in the late 70's and wanted to write a program to draw wire frame 3D boat hulls on screen. The algorithm is very fast with integer math -- particularly in assembly language, and it was a success on the old Z-80 proc I had.

sparky961:
On the first CNC machine I built, or rather the first iteration of my CNC 3-in-1 conversion saga, I used Bresenham's algorithm. There are versions for lines and arcs. The concept was very easy to grasp. This was for a stepper systwm. I'd do it differently today with servos.

CrazyModder:
Indeed these are the same kinds of algorithms (Bresenham...) which draw lines, circles or splines on your computer monitor. They have been around for a very long time, since the advent of the first graphical computer displays. Their beauty is that they work very simply with no floating point arithmetic, i.e. only integer arithmetic. While today, computing performance would not be an issue for a CNC controller, this especially means that the algorithms internally use "steps" anyways (we call them pixel on the monitor...). So they conform naturally to the steps of the CNC motors/servos. Also, those algorithms move "along" the line they are drawing, and not jumping around in weird fashion.

https://en.wikipedia.org/wiki/Bresenham's_line_algorithm shows the line algorithm. At first glance it seems pretty complicated, but if you do it per hand once you find that it is incredibly simple... just some additions and subtractions; the only multiplication is "times two", which is incredible easy for a computer to do, for obvious reasons.

https://en.wikipedia.org/wiki/Midpoint_circle_algorithm for the circle algorithm (though it would need to be adapted for CNC as this draws the 8 octants simultaneously.

Same would apply for arcs/segments, splines, or other complex shapes - the same algorithms which draw that stuff on the screen would likely also used by the CNC controllers.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version