Hello Guest it is March 29, 2024, 11:41:35 AM

Author Topic: Variable Newbie having a few issues  (Read 2860 times)

0 Members and 1 Guest are viewing this topic.

Variable Newbie having a few issues
« on: April 29, 2014, 12:20:37 PM »
I'm new to "programming" in G-code, thanks beforehand for the help.
I was asked to come up with a 4 axis program that would repetitively cut unequal tapers in foam from a Text or Excel File. I tried doing it in Excel with VB, no luck. So now I am trying to make a program to do them one at a time via G-code.
Program is as follows, it hangs up on N10

N01
N02 % TAPER PROGRAM, ONLY CHANGE PARAMETERS ON NEXT 5 LINES!!
N03 #1=7  (N corner)
N04 #2=8  (E Corner)
N05 #3=9  (S Corner)
N06 #4=10 (W Corner)
N07 #5=16 (IPM FEED RATE)
N08 #6=-48 (X/B TRAVEL)
N09 G59P12 X0 Y0 A0 B0(RAPID MOVE WIRE TO TOOL OFFSET ZERO)
N10 GOO A[#3*1.102] Y[#4*1.102] (RAPID RAISE Y-A TO CORRECT HEIGHTS)
N11 M00               (TEMP STOP)
N12 G91 Y1 A1         (BACK OFF OFFSET BY ONE INCH INCREMENTAL MODE)
N13 G90               (BACK TO ABSOLUTE MODE)
N15 M3                (HEAT ON)
N17 G4 P2             (WAIT FOR TWO SECONDS)
N19 A[#3*1.102] Y[#4*1.102]            (MOVE X-B TO INITIAL CUTTING POSITION)
N21 G1 A[#1*1.102] Y[#2*1.102] X#6 Y#6 F#5 (COORDINATED A/B-Y/X MOVE AT SPEED)
N23 G91 B-1 B-1       (OVERTRAVEL ONE INCH)
N25 G90               (BACK TO INCREMENTAL MODE)
N27 M05               (HEAT OFF)
N29

Basically the hot wire machine is 12' wide and I'm cutting these 4' panels in the middle hence the need for the 1.102 multiplier to get correct height at tangent.
Anything glaring?

Thanks!

JOSH

Offline mbele

*
  •  58 58
    • View Profile
Re: Variable Newbie having a few issues
« Reply #1 on: April 29, 2014, 12:28:18 PM »
Hi, in line 10, command should be G0 (zero not O) :)
Re: Variable Newbie having a few issues
« Reply #2 on: April 29, 2014, 12:32:00 PM »
That was dumb, I could have sworn I checked my O's.. :-) Thanks!
Re: Variable Newbie having a few issues
« Reply #3 on: April 29, 2014, 01:36:08 PM »
Yea!!! I'm not the only one! :)
Re: Variable Newbie having a few issues
« Reply #4 on: April 29, 2014, 04:33:48 PM »
O.K. That was the issue but in working through this I've come up with another.
The Variables in Line 21 won't compute. I've tried re-arranging brackets with no luck.


N01 % TAPER PROGRAM, WILL DO ANY SIZE TAPER WITH FOUR DEFINED CORNER HEIGHTS
N02 %
N03 #1= 6.3      (N)
N04 #2= 6.3      (E)
N05 #3= 5.6      (S)
N06 #4= 5.6      (W)
N07 #5= 20       (IPM FEED RATE)
N08 #6= 48       (X/B DEPTH OF TAPER)
N09 #7= 11       (RAPID RETURN CLEARANCE)
N10 #8= 48       (Y/A WIDTH OF TAPER SECTION)
N11 #9= 76.875 (DISTANCE FROM WIRE START TO CENTER OF TABLE)
N12
N13 % CODE STARTS HERE, DO NOT MODIFY BELOW THIS LINE!
N14
N15 #10=[[#1-#2]/#8]                (N TO E SLOPE)
N16 #11=[[#2-#1]/#8]                (E TO N SLOPE, RECIPROCAL OF #10)
N17 #12=[[#3-#4]/#8]                (S TO W SLOPE)
N18 #13=[[#4-#3]/#8]                (W TO S SLOPE, RECIPROCAL OF #12)
N19 #14=[#9-[#8/2]]                  (DISTANCE FROM GIVEN PART EDGE TO WIRE START)
N20 G59P12 G00 X0 Y0 A0 B0          (RAPID MOVE WIRE TO TOOL OFFSET ZERO)
N21 G00 A#3+[#14*#13] Y#2+[#14*#12]         (RAPID RAISE Y-A TO CORRECT START HEIGHTS)
N22
N23
N24 M30 (UNTESTED CODE BELOW)

Offline mbele

*
  •  58 58
    • View Profile
Re: Variable Newbie having a few issues
« Reply #5 on: April 29, 2014, 07:49:45 PM »
IIRC, all expressions should be enclosed in square brackets:
N21 G00 A[#3+[#14*#13]] Y[#2+[#14*#12]]         (RAPID RAISE Y-A TO CORRECT START HEIGHTS)