1. Senior Member
Join Date
Jun 2006
Location
Austin, Texas
Posts
15,648
Now you're cutting and pasting random quotes and pictures from Nyquist sampling theory, but I'm waiting for an Ebay snipe to trigger, so I'll play:

Originally Posted by Evan
With your two degrees Robert you really should know more about sampling theorem.
I actually have three degrees A Bachelor's and Master's in Electrical Engineering, and a second Master's in Computer Science. But let's get back to CNC interpolation...

Originally Posted by Evan
Nyquist-Shannon sampling theorem is applicable to any discipline where data points are used to represent continuous functions.
This quote is correct, but taken somewhat out of context. Nyquist sampling theory applies to digitally sampling any analog signal. It's a rule applied to digital signal processing, including audio and graphics.

Unfortunately, cutting a curve with a CNC toolpath is not sampling an analog signal, and therefore has nothing to do with Nyquist sampling theory.

Originally Posted by Evan
While the theory says that sampling at twice the frequency is sufficient to describe the curve that is not true in practice because of the limitations imposed by mathematics. It would require computing an infinite series, not possible in reality.
You don't understand how Fourier Analysis works, or applies here. A single component signal, like the pure sine wave I proposed earlier in the thread, and which you have copied in your post from some random Nyquist tutorial, is a single term function, and not an infinite series.

An infinite series occurs when you're sampling a complex signal with an infinite number of frequency components. Fourier analysis breaks each frequency component into a separate sine wave, such that the sum of all the sine waves == the original signal.

If you have a mathematical discontinuity, such as a square wave signal, it takes an infinite series of frequency components to represent. But the reason I picked the pure sine wave for your challenge, and the reason it's in the Nyquist diagram you copied, is because a pure sine wave has a single frequency component, and therefore no Fourier analysis is necessary:

Originally Posted by lazlo
Plug a unit sine wave into a CAD/CAM model. It has one frequency component, with a frequency of 1. You'll still need an infinite number of interpolated steps to cut a smooth version of it.
Originally Posted by Evan
In practice sampling at only twice the fundamental frequency of the function only assures that aliasing won't occur. It cannot in practice be used to accurately represent the function sampled. Below is an illustration of this.
That's not what that Nyquist diagram is showing Evan. That's the classic undergraduate Nyquist sampling diagram that I described to you in this post:

http://bbs.homeshopmachinist.net/sho...9&postcount=30

Originally Posted by Lazlo
No. Nyquist says how often you need to digitally sample an analog signal to correctly reconstruct it.

So if you have a 2 Hz sine wave, and you sample it at 2 Hz, you can get a straight line if you sample at exactly the wrong points.
Which is exactly the example in the section of the Nyquist diagram you snatched. That's not a coincidence by the way, this is the same exact example you use to teach Nyquist to undergraduates:

2 Hz Sine Wave with 2 Hz Sampling:

And the third picture is with ideal Nyquist sampling: a 2 Hz pure sine wave with 4 Hz (Nyquist) sampling frequency, and the since wave is captured perfectly:

2 Hz Sine Wave with 4 Hz Sampling:

This is also the exact sine wave in the challenge I proposed to you to show you why Nyquist Sampling theory has nothing to do with CNC toolpaths: Take that 2 Hz Sine wave, and make a 2.5D or 3D model of it. Nyquist says, and your diagram shows, 2 sample points per cycle is necessary and sufficient to describe the sine wave. Now cut that sine wave on a CNC toolpath.

Despite the fact that's it's a pure sine wave, with a single frequency term, it will still take an infinite number of interpolated cutting steps to cut a smooth version of it.

Originally Posted by lazlo
So here's a challenge for you Evan: draw a unit (1 "Hz", but translate into spatial dimensions = 1 meter, 1 centimeter, whatever) sine wave. Since the since wave has 1 frequency component, so you don't have to do any Fourier analysis. Nyquist says that you can correctly sample that waveform with 2 points (three vectors). Now cut that sine wave in CAM with three vectors
So if you really understand Nyquist Sampling Theory, it will take you 10 minutes to generate that sine wave in CAD and create a GCode file of it. It will be immediately apparently to you that it will take an infinite number of vectors to cut a smooth version of it, as Swarf&Sparks aptly pointed out.

2. Senior Member
Join Date
Jun 2006
Location
Austin, Texas
Posts
15,648
Originally Posted by lazlo
I'm waiting for an Ebay snipe to trigger, so I'll play:
Tiffie and Swarf&Sparks -- I just won my snipe, and it appears that my NIB Henrob set is, in fact, now available

http://cgi.ebay.com/ws/eBayISAPI.dll...m=120250920468

3. Senior Member
Join Date
Jan 2004
Location
Missouri
Posts
15,627
Laslo:

First please note my reply above which was posted while you were typing industriously....... I agree with most of what you said previously.

Then think for a second, and I think you will see a reason Nyquist MIGHT apply.

You DO have a set of data points, representing, if you will, samples of some arbitrary waveform......

if you satisfy the sampling requirement, you DO have (as I noted, and Evan claims) the data which will reconstruct that wave.

What is missing, as I noted above, is the reconstruction filter.

I somewhat jokingly suggested cutter diameter as the "filter"............... It could just work......... I admit to not having analysed the matter other that a quick qualitative estimate....

4. Senior Member
Join Date
Aug 2007
Posts
327
lazlo is spot on with interpolated cnc paths, which is 99% of machining and the default mode for machine controllers.

The caveat is that high speed machining controllers do not treat the path like other controls do, and will fit a spline to the points. They also use acceleration and jerk based algorithms to produce a stepless toolpath.

5. Senior Member
Join Date
Jun 2006
Location
Austin, Texas
Posts
15,648
Originally Posted by J Tiers
First please note my reply above which was posted while you were typing industriously....... I agree with most of what you said previously.

Then think for a second, and I think you will see a reason Nyquist MIGHT apply.

You DO have a set of data points, representing, if you will, samples of some arbitrary waveform......

if you satisfy the sampling requirement, you DO have (as I noted, and Evan claims) the data which will reconstruct that wave.
Right, agree completely JT -- in the sine wave example, you have a 2 Hz sine and 4 datapoints, and if you had the right reconstruction filter, the CAM controller could reconstruct the path.

Originally Posted by JTiers
What is missing, as I noted above, is the reconstruction filter.
I see two problems: like you say, the reconstruction filter, which in the case of the sine wave, would have to generate a b-spline -type function. The second problem is that CNC controllers, especially the 2.5D hobbyist controllers, are programmed with G-Code interpolated per axis, and not digital reconstruction filters

So the process I was describing in the CAD/CAM challenge to Evan was that in order to cut a pure sine wave, the CAM program has generate enough vectors to smoothly interpolate the curve, even though mathematically it can be described by a single continuous function: sin(X), and discretely as 4 Nyquist points.

Now, if you were very clever, perhaps you could write a MACH plug-in that would take a Mathlab description of the reconstruction filter, the Nyquist points, and generate curved toolpaths. That would "fix" the interpolated curve problem that 2.5D controllers have....

6. Member
Join Date
Nov 1999
Location
SE OZ
Posts
1,968

## Neophite aspect

OK.

I'd like to step in here as a novice and neophyte as regards the theory and address the practical application in my shop with a fairly common mill (HF-45 column mill).

I would like to know and ask how this affects me in my shop with my average CAD, post-processor and CNC set-up for the work I want to within my small budget and limited knowledge and capabilities.

Good discussion so far. It is staying "on track" and neither (too?) vindictive or personal - thanks for that.

I can follow most of it. My calculus is long forgotten as is most of my (analogue) servo theory and practice/application.

I can appreciate the number of points to be addressed in any function.

I am aware too that most/all CAD systems resolve/regard/address most splines and curves as a very large number of very short lines - at least in the graphical outcome. The better CAD systems have higher resolutions and number of decimal places addressed or resolved to as well.

OK? Or not?

The CNC file for use in a CNC machine (say Mach3) is a post-processed version of a DXF file which is exported from the CAD system as a series of vectors (straight lines at a pre-determined orientation).

Still OK? Or not?

The post-processed file output is a series of pulses that cause the CNC "motors" to "step"/"pulse"/"jerk" around their axis in very small pre-determined rotational increments.

Still OK? Or not?

These small discrete individual steps are transmitted to a (say) ball-screw/lead-screw that has mass and inertia as well as an elastic torsional distortional component and so will tend to "smooth" the "steps". This "smoothed" output from the ball/lead-screw is transmitted to the (say) mill table "X" or "Y" motion which is further "smoothed" by the mass of the machine table/s.

Still OK? Or not?

I can appreciate that some "dither" must be transmitted as a function of "stepping" and that the "dither" improves the "sensitivity" of the machine movement response in terms of minimising the effects of "stiction" but that too much dither can and will cause undue wear on machine components as well as at worst showing up in the work-piece finish.

I guess that at the end of it all, that there must be allowances and compromises made to have the best result of the theory and computing at the work-face.

I would guess that the average HSM-er would be aiming to get a "satisfactory" (for him) CAD and CNC system.

So let's address that as well.

Not-with-standing the theory so well expressed and explained thus far, at what point is the computed resolution adequate for the movement of the job/work-piece in relation to the (end-milling?) cutter to provide a sufficiently accurate result as regards size, finish and time generally and with regard to the type/class of machine and CAD/CNC system in the average HSM shop?
Last edited by oldtiffie; 04-29-2008 at 01:13 AM.

7. Senior Member
Join Date
Aug 2007
Posts
327
In the spirit of your questions tiffie, I am going to keep my responses strictly in the realm of HSM. Please bear in mind i am not mentioning exceptions or things that happen on expensive control platforms.

Originally Posted by oldtiffie
I can appreciate the number of points to be addressed in any function.

I am aware too that most/all CAD systems resolve/regard/address most splines and curves as a very large number of very short lines - at least in the graphical outcome. The better CAD systems have higher resolutions and number of decimal places addressed or resolved to as well.

OK? Or not?
Sort of OK. You are spot on in the small lines thing. The wrong part is that most machines are limited to four decimal places, and CAM systems pretty much spit out four unless you need more for some reason.

Originally Posted by oldtiffie
The CNC file for use in a CNC machine (say Mach3) is a post-processed version of a DXF file which is exported from the CAD system as a series of vectors (straight lines at a pre-determined orientation).

Still OK? Or not?
Yep. A series of G01 moves, usually made incrementally at the machine's maximum resolution.

Originally Posted by oldtiffie
The post-processed file output is a series of pulses that cause the CNC "motors" to "step"/"pulse"/"jerk" around their axis in very small pre-determined rotational increments.

Still OK? Or not?
Sort of. There's a wide variety even in HSM controls on how they handle the increments. Some do small jerks, some try and make it smooth. Usually yes, you wind up with a bunch of small segements. You'll see reference made to "velocity based control" when you go to servos, in that a servomotor can drive at a specific velocity rather than stepping. Obviously this has advantages when you try to speed things up.

Originally Posted by oldtiffie
These small discrete individual steps are transmitted to a (say) ball-screw/lead-screw that has mass and inertia as well as an elastic torsional distortional component and so will tend to "smooth" the "steps". This "smoothed" output from the ball/lead-screw is transmitted to the (say) mill table "X" or "Y" motion which is further "smoothed" by the mass of the machine table/s.

Still OK? Or not?
No. The control must actively be aware of the machine dynamics in order to average things out. Get a hobby mill cutting a large circle at 100 ipm or so. The combination of control deficiency (pure interpolation) and machine dynamics will produce a very nasty scalloping. Most hobby mills have very limited look ahead (which starts to get into splines and curve fitting in a very basic way) if any, and the interpolation approach begins to break down at moderate feed rates. Many hobby mills won't cut a decently sized circle at over 40 ipm.

Originally Posted by oldtiffie
Not-with-standing the theory so well expressed and explained thus far, at what point is the computed resolution adequate for the movement of the job/work-piece in relation to the (end-milling?) cutter to provide a sufficiently accurate result as regards size, finish and time generally and with regard to the type/class of machine and CAD/CNC system in the average HSM shop?
If I was a betting man, i'd say around .0002-.0003 for most hobby mills. The control scheme (pure interpolation) breaks down with a bunch of short, quick moves. So you are limited in speed anyway. In terms of accuracy, you don't need more than your equipment can handle. If you had a pair of decent servos driving ballscrews, I'd say .0001" resolution is plenty, and is what most older commercial VMCs go with for interpolation.

Again, with interpolation, the slower you go, the more resolution you can make use of. So if you wanted a real dang smooth circle, you'd have to feed at fractional inches per minute and use encoders that supported better resolution. You won't gain accuracy (at all), but you do gain more points on the curve.

8. Member
Join Date
Nov 1999
Location
SE OZ
Posts
1,968

## A "goodie"

Thanks TD for taking the time and putting in the effort and skills that you have in crafting that excellent reply.

I have checked to see that you are still "on-line".

I will respond to your post and will include a couple of other "as it is" matters and comments as well later.

We have to go out for a while so I guess you will see it later today or tomorrow.

9. Senior Member
Join Date
May 2003
Location
52N 122W Western Kanuckistan
Posts
40,400
Now you're cutting and pasting random quotes and pictures from Nyquist sampling theory, but I'm waiting for an Ebay snipe to trigger, so I'll play
You don't get it do you? I drew that diagram myself.

Unfortunately, cutting a curve with a CNC toolpath is not sampling an analog signal, and therefore has nothing to do with Nyquist sampling theory
No, it isn't. It is synthesizing samples to reconstruct an analog function. You don't seem to have noticed that is what I am talking about, yet. I am talking about the construction of continuous functions with discrete data points, which is the second half of Nyquist-Shannon sampling theory.

You don't understand how Fourier Analysis works, or applies here. A single component signal, like the pure sine wave I proposed earlier in the thread, and which you have copied in your post from some random Nyquist tutorial, is a single term function, and not an infinite series.
The tutorial is mine.

You don't understand sampling theory. To reconstruct a sine wave sampled at the Nyquist frequency theoretically requires the summing of an infinite series of terms. A square wave is the product of an infinite series of sine wave harmonics. To reconstruct the sine wave fundamental from the square wave produced by sampling at the Nyquist frequency a deconvolution must be performed which is the inverse function of constructing a square wave from a series of sine waves.

If you have a mathematical discontinuity, such as a square wave signal, it takes an infinite series of frequency components to represent. But the reason I picked the pure sine wave for your challenge, and the reason it's in the Nyquist diagram you copied, is because a pure sine wave has a single frequency component, and therefore no Fourier analysis is necessary:
You have certainly stuck your foot in your mouth this time Robert.

I must know what I am talking about. You have said so three times now.

I see two problems: like you say, the reconstruction filter, which in the case of the sine wave, would have to generate a b-spline -type function. The second problem is that CNC controllers, especially the 2.5D hobbyist controllers, are programmed with G-Code interpolated per axis, and not digital reconstruction filters
What do you call approximating a circle then? Since pi is irrational you don't have any choice but to approximate it with a series of data points. It doesn't matter if you use splines or anything else, they can all be deconstructed to a series of straight line moves since the machine must be instructed to move in discrete steps.  There is a name for that. It's called sampling.

Jerry,

There is a filter in Mach 3 that takes care of the high frequency components cause by oversampling. When Mach 3 is running in constant velocity mode it cuts corners, literally. At the points that correspond to a discontinuity, a "jaggie", Mach 3 departs from the absolute toolpath and and in effect provides a low pass filtering function. The faster the cutting speed the greater the departure from the calculated toolpath.
Last edited by Evan; 04-29-2008 at 02:17 AM.

10. Member
Join Date
Nov 1999
Location
SE OZ
Posts
1,968

## Onward

Originally Posted by jacampb2
I have been using Acad autodesk '06 for a few years now, and have gotten fairly good with it, both for 2d and 3d modeling. From reading my mach3 manual again, a cam program or post processor is highly recommended. So, what software are you guys using? Preferably affordably priced. I haven't looked at the included software with mach3, haven't had time yet. I know I saw a lot of discussion in a thread a while back, but I am not turning it up. I could have sworn it was one of Evan's threads, but I am not seeing it. If you have the link, that is fine by me too.

Anyhow, I would like to be able to do 3d, or is it 2.5d, I am not really sure what the heck the difference is.

Tell me what you all recommend.

Thanks,
Jason
I thought that given the number of posts that it might be timely to re-visit Jason's Original Post (OP) - see above quote.

Toasty Death (TD) in his post at his post #57 at:
http://bbs.homeshopmachinist.net/sho...5&postcount=57
did an excellent job of addressing issues that I had raised at my post #65 at:
http://bbs.homeshopmachinist.net/sho...0&postcount=56

Some further relevant issues at the following concurrent thread at posts my #5 and #7 and John Stevenson's post #8 at:

So to keep it in the context of the (I hope) typical HSM-er who may have or be interested in CNC at non-Professional/Academic level, I thought I'd press on.

Those who are or continue to want to read or explore the Professional/Academic level should/can read/refer to the excellent and informative posts between lazlo and Evan on this thread.

For myself, TD's advice that a step/move value of 0.0001" (1 tenth) should suffice for a/the HSM environment seemed very reasonable.

That suggests that a 0.2000" lead ball-screw would need 0.2000/0.0001 = 2,000 pulses per revolution of the ball-screw.

He also suggested that cutting a circle on a HSM machine (my presumption) using say Mach3 should not exceed 40" per minute. That suggests - for circles - the ball-screw should not exceed 40/0.2 = 200 RPM which means a pulse rate - as I understand it - of 200 x 2,000 = 400, 000 (4 x 10^5) pulses per minute = 6,666.6667 = 6.667 x 10^3 pulses per second.

As the CNC process relies on dead-recking (ie where it - the table - should be) as opposed to knowing where it is (by feed-back as would be the case in a servo system) the only apparent way of knowing where the table actually is relative the the "X" and "Y" ways is to use absolute measurements via a very good Digital Read-out (DRO) system. That might assist in finding errors due to "back-lash", "end-float" and "gib adjustment" etc.

So the quality and rigidity of the machine and its set-up are very relevant as well.

So, as those may be regarded as "given" the only variables that we (or at least I) need to know are those as asked by the OP are or seem to be:

1.
what is the best "bang for buck" CAD system/software?:

2.
what is the best "bang for buck" post-processor?:

3.
what is the best "bang for buck" CNC system/software?:

4.
and if the answer to (3) is not Mach3, why isn't it?

Page 6 of 19 First ... 4567816 ... Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•