Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: JohnHaine on August 12, 2014, 10:56:55 AM

Title: G code to generate a mathematical profile
Post by: JohnHaine on August 12, 2014, 10:56:55 AM
Hi all, I have a question about the best way to accurately mill a defined profile on the edge of a plate.  The plate will be mounted flat on the mill table on a sacrificial spacer, and the edge milled using just X and Y moves.  The curve I want to generate will be generated by a simple mathematical formula, and with care I can avoid the necessity of cutter radius compensation.

Ideally I would like a G code instruction of the form "Gxy X1 Y1 X2 Z2...Xn Yn" where the Xs and Ys are a series of coordinates of points along the desired profile; and the controller would use a suitable interpolator to smooth between the points.  However, as far as I can see there is no such Gxy instruction in Mach 3!

The obvious alternative is to use a (long) series of small line increments and a G01 move:
G01 X1 Y1
G01 X2 Y2
....
G01 Xn Yn

but this could be a large program (but no matter, I can generate it from a simple Excel spreadsheet). 

My question is, am I missing something?  Is there a better / well known way to do this please?
Title: Re: G code to generate a mathematical profile
Post by: HimyKabibble on August 12, 2014, 11:07:42 AM
No.  G1, G2, G3 are your only real option.  The only cutting move commands G-code has are G1, G2, G3.  Assuming you're using constant velocity mode, the moves will be "smoothed" to a small extent, if your feedrate is high enough, and/or your acceleration low enough.  Many CAM systems generate code in exactly that manner, and don't even use G2/G3 at all, and many very small G1 moves is really the ONLY way to generate non-circular arc moves.

Regards,
Ray L.
Title: G code to generate a mathematical profile
Post by: JohnHaine on August 12, 2014, 04:43:09 PM
Ok, thanks for that Ray.  I'll follow the G1 route then and see how it goes.