Polar coordinates are a way of specifying the position of a point in a plane using an angle and a distance from a fixed origin. They are often used in CNC machining to simplify the programming of circular or spiral motions. Polar coordinates can also be useful for creating complex shapes or patterns that are based on rotations or repetitions.
Usage Format
The G-code commands for polar coordinates are G15 and G16. G15 cancels the polar coordinate mode and returns to the Cartesian coordinate system. G16 activates the polar coordinate mode and sets the origin point for the polar coordinates.
The format for using G16 is:
G16 X# Y#
where X# and Y# are the coordinates of the origin point in the Cartesian system.
The format for using polar coordinates to move the tool is:
G01 X# Y#
where X# is the angle in degrees and Y# is the distance in millimeters from the origin point.
Explanation
When G16 is executed, the CNC machine will store the current position as the origin point for the polar coordinates. The origin point can be changed by using G16 with different X and Y values. The origin point will remain the same until G15 is executed or the program ends.
When polar coordinates are used to move the tool, the CNC machine will calculate the corresponding Cartesian coordinates based on the origin point, the angle, and the distance. The tool will then move in a straight line from the current position to the calculated position.
The angle is measured counterclockwise from the positive X-axis. The angle can be any value, positive or negative, and can exceed 360 degrees. The distance is always positive and represents the radius of the circle centered at the origin point.
Example
The following program will create a spiral shape using polar coordinates:
G90 ; Set absolute mode
G16 X0 Y0 ; Set origin point at (0,0)
G01 X0 Y10 F100 ; Move to (0,10) in polar coordinates
G01 X90 Y20 ; Move to (90,20) in polar coordinates
G01 X180 Y30 ; Move to (180,30) in polar coordinates
G01 X270 Y40 ; Move to (270,40) in polar coordinates
G01 X360 Y50 ; Move to (360,50) in polar coordinates
G01 X450 Y60 ; Move to (450,60) in polar coordinates
G01 X540 Y70 ; Move to (540,70) in polar coordinates
G01 X630 Y80 ; Move to (630,80) in polar coordinates
G15 ; Cancel polar coordinate mode
M30 ; End of program
The text diagram of the spiral shape is:
Y
^
|
70 | *
| / \
60 | * \
| / \
50 * *
| | \
40 | * \
| \
30 | *
| / \
20 * / *
| / |
10 | / |
* / |
0 +----------*---------> X
0 90 180 270 360 450 540 630