Equation format in g-code
Here are a few lines from a macro I'm trying to write, but I'm not sure of the correct formatting/syntax for doing equations in g-code. Can someone help me out? I'm trying to simulate it on "Torcomp CNCez Pro" for a Hass controller.
N100 #4 = [COS[#1]]* [#18 + [#7 / 2]] + [#24] (FIND X POS)
N110 #6 = [SIN[#1]] * [#18 + [#7 / 2]] + [#26 - [#7/2]] (FIND Z POS)
...
N150 G02 I-[#4 - #24] F#9
...
N170 IF [#6 NE #26] GOTO100
N180 G00 Z[#26 + #18 + #11]
Thanks for the help.
-Chris
Never Compare EQ When Using Floating Point
I assume that the areas indicated by "..." include modification of #6 or #26.
In general, it is unwise to compare for EQ because of roundoff error. Instead, compare LE, LT, GE, or GT, depending on what you need.
It appears that #7 represents the diameter of a cutter, and #18 represents the radius of a circle. Then #1 represents an angle.
I see no problems with your formatting.
Ken