# Thread: This should be easy...

1. ## This should be easy...

N20 G01 X94.625 Y125.000 F320.000
N21 G03 X85.000 Y134.625 R9.625 F320.000

So I get the start and end points on the arc, the radius and the direction.

Unless the separation happens to be 2r there are two possible solutions, two possible locations for the centre of the arc.

Find one center, mirror it across the two points and get another possible center.

Perhaps I missing something, not understanding

Terminally frustrating, have 3 axis mill, have g-codes, need to write an interface, not an Ixxx or Jxxx in sight, stuck, HELP

2. G3 is CCW, G2 is CW. There's only one way to do the arc in your code. Where you may run into problems is arcs of greater than 180°. Then you should either split them up, or use IJ arcs instead of R arcs.

3. Well done Gerry

I put in a >180 degree arc and it obligingly split it in to 2.

So I simply calculate both arcs and cut the shorter.

Many thanks

Robin

4. Robin,

Many CNC's (Fanuc, Yasnac, Haas, etc.) allow R for any arc up to 359.999 degrees. Only one stipulation: If arc is 180 degrees or less, program R, if arc is greater than 180 degrees, program R-(minus). Full circles require I & J.

Dave

5. I've done that bit...

Other G codes he's using (G-Simple), is there a list somewhere? No sticky?

G28 Rapid move to origin.
Where the heck is origin? 0,0? 0,0,0 would be a disaster in the making First co-ordinate? Somewhere of my choosing? Can't see him setting it anywhere, he uses it before a tool change.

G54-59 Select co-ordinate system
Only found G54, presumed it is for absolute, but he also uses...

G90 Absolute distance mode.

6. What control are you using? G codes can vary a bit between controls. With that in mind, here's a list.
http://www.teskolaser.com/gcode_list.html

As for G28, you usually need to "home" the machine or manually pick a reference point before calling G28. Yes, it should be 0,0,0.

G54-G59 = user defined coordinate offsets

G90 = move to absolute coordinates, vs G91= move incrementally from prevoius location.

7. Hi Gerry

I'm using G-Simple on account of it's a freebie and can accept my dxf's.

I'm driving the steppers on my mill through the paralel port on a DOS machine using the timer interrupt. All the stepping command stuff happens in the background, so I can fool about doing fancy graphics on screen until the Active flag goes away. I kinda built the hardware and wrote the software before I discovered cnczone and realised I didn't have to

OTOH it does make it very easy to patch.

This program I'm writing converts the G codes to my own format which is a sort of compressed dxf.

best regards

Robin

8. ## G28 and GSimple

(From Haas operators manual)

The G28 code is used to return to the machine zero position on all axes. If an X,Y,Z or A is specified on the same block (meaning the same line), only those axis will move and return to the machine's zero point. If X,Y,Z or A specifies a different location that the current location, the the movement to machine zero will be through the specified point...

GSimple programs (usually) contain following lines:

G28 G91 Z0 (near the beginning of the program)

G28 G91 Z0
G28 G91 Y0 (near the end of the program)

G28 G91 Z0 will move to the Z origin (that is move the tool up) through a point which is 0 mm (or inch) away from the current (G91 means relative position) -that is through the current point.

This part of the code is just for security. The machine will move up and then execute the rest of the code.

G28 G91 Y0 drives the table out, so you can easily reach your part.

By the way, these commands are nor "hardwired" into GSimple. Look in the configuration file, and you will find following lines:

# Program will start with a G28 G91 Z0 (move z axis to mashine origin)
PROGSTART G28 G91 Z0

# And will end with
# Semicolons are used as line separators
PROGEND G28 G91 Z0;G28 G91 Y0;G90

If you delete them (or make them comments by inserting a # at the start of the line) G28 will disappear from the code (with the execption of the Drill-Cleaning Option selecteable through the G-Code/make Options menu)