Hello Guest it is September 24, 2020, 07:28:47 AM

### Author Topic: G-Code G15/G16 Polar coordinate  (Read 8541 times)

0 Members and 1 Guest are viewing this topic.

#### tower

• 3
##### G-Code G15/G16 Polar coordinate
« on: July 27, 2015, 10:07:34 AM »
Hi,
this is my first post in the cnc world at all :-)

I am building a larger 3D-printer with a horizontal X axis and a rotational Y axis (plus Z-axis) - just like a normal tower crane. I calibrated the Y-axis so that G0 Y360 yields a full turn.

I than converted the cartesion coordinates of the G-code output of the CAM program to polar coordinates and read the file into Mach3.
The geomety of my input file shows perfectly up in the mach3 toolpath window!

G90
G0x0y0
G16
G1x1y45 (e.g.)
...
G15
M30
%

But unfortunately, G1x1y45 didn't go to the 45° position. Rather, a first G1x1y1 yielded a 30° move. But any efforts to scale this, where unsuccefull. The following problems occured, but I was unable to find a reasonable reasoning behind it:
- The scaling factor is not always 1 : 30, sometimes 12° sometimes even non linear (depending on the x-value)
- Mach switched sometimes (only) the x-moves in G91 modes (incremental)
- any attempt to calibrate "motor tuning" in the G16 mode didn't work (sometimes even non linear)

Any help would be very much appreciated.

Hans

#### BR549

• 6,932
##### Re: G-Code G15/G16 Polar coordinate
« Reply #1 on: July 27, 2015, 10:57:00 AM »
The G15/16 was not designed to do a wholesale conversion of your machine to polar coords you can do that with FORMULAS.  The g15/16 was designed to work with things such as a bolt circle as an easy way to program them in XY. Basically anything you can do as a polar array. Probing comes to mind as well.

Just a thought(;-) TP
« Last Edit: July 27, 2015, 10:59:28 AM by BR549 »

#### tower

• 3
##### Re: G-Code G15/G16 Polar coordinate
« Reply #2 on: July 27, 2015, 11:12:22 AM »

but I run very small pieces of G16/G15 polar coordinate programs, found in the internet, and I had the same problem with all of them...

#### BR549

• 6,932
##### Re: G-Code G15/G16 Polar coordinate
« Reply #3 on: July 27, 2015, 11:32:53 AM »
Show me an example of what you are doing with it.  Last time I tested G15/16 it worked exactly as it should.

(;-) TP

#### BR549

• 6,932
##### Re: G-Code G15/G16 Polar coordinate
« Reply #4 on: July 27, 2015, 11:50:16 AM »
Here is an example of a bolt circle using the G15/16. You can see it does do the proper 45 deg arry of holes. Note that the values of XY change under the g15/16 function. IF you were to build an array of bolt circle function you would use a SUB to program teh actual bolt circle code then use teh G15/16 to array it in a polar fashion. Then you would have a part that had a circular pattern of the Bolt hole function  (Say 8 sets of a bolt circle pattern arrange in a circle)

G0 X0 Y0 Z0
G91
G16
G81 X10 Y45 Z-1 R0 F100
Y45 L7
G16
G90
G80

M30

#### tower

• 3
##### Re: G-Code G15/G16 Polar coordinate
« Reply #5 on: July 30, 2015, 12:11:56 AM »
I now understand, why G15/G16 doesn't fit at all to my situation. I tried out the proposal of BR549 to use "formula axis correction" instead. It would be perfect if
a) I could distinct between cases (if ... then .. else) that appear in the trigonometric math and
b) if Mach3 would not only apply the formula to the endpoints of G1-lines, but also to all intermediate points. Without this, all lines appear to be arc. Why? Consider the example of moving from cartesian points (1,0) to (0,1). The polar coordinates are (1,0°) and (1,90°). So, Mach3 thinks: "twice the same x-values - so I don't have to move the x-axis" - yielding an arc from 0° to 90°, which is not what I expected. I expected a COORDINATED move from point to point, whereby the formula is applied to each intermediate point. That would give a real straight line.

I read about the cylindrical coordinates in the XZC-coordinate system: X and Z linear axis, C the rotational axis parallel to the Z-axis. Would that solve the problem maybe?

#### prygaard

• 1
##### Re: G-Code G15/G16 Polar coordinate
« Reply #6 on: February 11, 2018, 08:20:20 PM »
Tower,
If you are still there, did you ever find a solution?  A buddy and I have the same issue so I have been working on a program that takes in XYZ G-code and outputs Length-Angle-Depth polar G-code.   This is intended for cases where someone needs to carve on a plane that is perpendicular to a rotating axes. (My program assumes the 0,0 point of the polar plot is on the rotating axis)  I have a program running that seems to do the job, but if you found a solution it would be great to compare notes.