Hello Guest it is March 28, 2024, 11:31:48 AM

Author Topic: Example of using the L Repeat and Incrementing Z movement  (Read 4830 times)

0 Members and 1 Guest are viewing this topic.

Example of using the L Repeat and Incrementing Z movement
« on: February 16, 2012, 06:10:24 AM »
Hi,

I am trying to hand code a facemill operation that involves repeating the same facing movements 5 times at increasing depth of 0.5mm, starting with the first cut 0.5mm deep.

Can someone give me an example of how you would code this using the "L word" number of repeats?

I have some code to cut at Z-0.5 and just want to generate a clever way to get to the final cut without having to repeat the code 5 times at the incremental depths.

Regards

Chrisjh

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Example of using the L Repeat and Incrementing Z movement
« Reply #1 on: February 16, 2012, 09:02:54 AM »
Look in the manual under SUb routine programming M98/99.

(;-) TP
Re: Example of using the L Repeat and Incrementing Z movement
« Reply #2 on: February 16, 2012, 02:30:17 PM »
chrisjh, look at my question on pockets. I think we are after the same information. Graham's example gave me a start and then reviewing the manual allowed me to sort the items that were critical to my operation. I am still a paper and pencil thinker so I will need to print the manual and make a binder for quick access to the important stuff.
One of those things is the O in the O0001 label
If you think you can't do it, you're right.

Offline Sam

*
  • *
  •  987 987
    • View Profile
    • hillbillyhilton.com
Re: Example of using the L Repeat and Incrementing Z movement
« Reply #3 on: February 17, 2012, 06:18:57 PM »
I would agree with BR, as to looking into the manual. It is really well written, and goes into detail about things that you probably didn't know possible.
Dunno if this will help you out any, but I commonly use this facing program. It should be good enough for an introductory. Change numbers as desired....

%
O0000 (Facing)
G20
G0 G17 G40 G80 G90
T1 M6
G43 H1
G0 G90 X0.0 Y0.0 Z2.432 S1000 M3 F30
M98 P1 L7(M98=call sub, P=sub# to call, L=number of groundhog days)
M98 P2 (M98=call sub, P=sub# to call)
g90 g0 x0.0 y0.0 Z2.432
M5
M30 (program rewind)
O1 (sub#)
G91 Z-0.035
G90 G01 X0.0 Y0.0 F30
X-11.0 Y0.0
G91 Z0.002
G90 G0 X0.0 Y0.0
G91 Z-0.002
M99 (sub end)
O2 (sub#)
G91 Z-0.002
G90 G01 X0.0 Y0.0 F14.5
X-11.0 Y0.0
G90 G01 Z2.432
G0 X0.0 Y0.0
M99 (sub end)
%
"CONFIDENCE: it's the feeling you experience before you fully understand the situation."
Re: Example of using the L Repeat and Incrementing Z movement
« Reply #4 on: February 18, 2012, 01:09:30 AM »
Hi All,

Read the manual and get the general idea.  I have come up with a program based on an example on P378 of Smid's bible that works (see below).

However I ended up not withdrawing the Z to a clearance height to traverse across the top of the material, rather I had to skirt around the material so as not to disturb the last Z cut depth.

This is fine for facing but, if I had a pocket, this would not work.

What I need to some clever maths and programming that:

Stores the first cut depth in memory.
At the end of the first and subsequent cuts, raise the Z height to clear the original top surface of the material.
Rapid back to the XY Start position.
Move Z down to the most recent cut depth by using the stored data in memory.
Increment the Z cut depth to the next cut depth using G91 Z-0.5.
Store the new depth in memory.
Repeat this until the final cut depth is reached.

I am aware that parameters/variables need to be set and varied by formula calculation, but I can't think of a way to do it in Mach3.

Thanks and Regards

Chrisjh

%
(Test 3)

(This routine faces material in 6 passes of 0.5 DOC)

(Datum is Top LH Corner of unprofiled 265 x 137 material X0 Y0)

(CJH 18Feb12 Original Example From Smid's book P378)

G00 G17 G21 G40 G49 G50 G64 G80 G90 G94 F1000
M9 T9 (Ø50mm Facemill)
M3 S750 M8 (Coolant on)

G00 X-27 Y-20 Z15 (Go to Starting XY Position)

G00 Z1 (Rapid down to 1mm above Z0)

G01 Z0 F200 (Start Z @ Z0)
M98 P1 L6 (Repeat Face Cut 6 times @ Depth Increments of 0.5mm)
G90
G00 Z15
M5 M9 (Spindle and Coolant Off)
G00 X-27 Y-20 (Return to start XY position)
M30
%

O1 (Subroutine 1 Increment Depth and Facing Cut Routine)

G91 G01 Z-0.5 F200 (Increment Z Down By 0.5mm)
G90 (Back to Absolute Mode)
G01 X292 F300
G00 Y-117
G01 X-27
G00 Y-68
G01 X292
G00 Y30
G00 X-27 (Skirt around material at last cut depth)
G00 Y-20 (Skirt around material at last cut depth)
M99
%
Re: Example of using the L Repeat and Incrementing Z movement
« Reply #5 on: February 22, 2012, 11:34:09 PM »
Hi,

After many iterations trying to use maths, parameters and variables, I resorted to using old faithful G52 Temporary Z Offset for the retract position to traverse the top level of the stock.

This works:
(Facing CJH 23Feb12 Rev B)

(This routine faces material in 6 passes of 0.5 DOC)

(Datum is Top LH Corner of unprofiled 265 x 138 material X0 Y0)

(CJH 23Feb12 Based on Original Example from Smid's book P378)

(23Feb12 Added G52 Routine to move Z up to clear stock for return to start position)

(23Feb12 Added Entry Arcs)

G00 G17 G21 G40 G49 G50 G64 G80 G90 G94 F1000
M9 T9 (Ø50mm Facemill)

(Soft Spindle Start Routine)
M3 S500 M8 (Spindle & Coolant On)
G04 P100
S750
G04 P100
S1000

G00 X-27 Y-47 Z15 (Go to Start XY Position)

G00 Z1 (Rapid Down to 1mm above Material Top)

G01 Z0 F200 (Start Z @ Z0)
M98 P1 L6 (Repeat Face Cut 6 times @ Depth Increments of 0.5mm)
G90

G00 Z15
M5 M9 (Spindle and Coolant Off)
G00 X-27 Y-47 (Return to Start XY Position)
M30
%

O1 (Subroutine 1 Increment Depth and Facing Cut Routine)

G91 G01 Z-0.5 F200 (Increment Z Down By 0.5mm)
F350 (Set Feedrate)
G90 (Back to Absolute Mode)
G02 X0 Y-22 R25 (Arc into Job)
G01 X292
G00 Y-91
G02 X264 Y-116 R25 (Arc into Job)
G01 X-27
G00 Y-94
G02 X0 Y-69 R25 (Arc Into Job)
G01 X292
G52 Z-2 (Temporary Offset Retract Z Up)
G00 X-27 Y-47 (Return to Start XY Position)
G52 Z0 (Cancel Temporary Z Offset)
M99
%

I still haven't given up on parameters and variables as I can see the wisdom in such a programming approach.  I'll have another go when time permits.

Regards

Chrisjh

Offline Sam

*
  • *
  •  987 987
    • View Profile
    • hillbillyhilton.com
Re: Example of using the L Repeat and Incrementing Z movement
« Reply #6 on: February 23, 2012, 03:44:53 PM »
I see that you've specified a Z offset value, but I don't see where you've actually raised the Z axis to clear the part. All you've done is created an offset and then cancelled it. Instead of using a temporary offset, why not just go back to incremental , specify a Z distance to clear, absolute back to start, increment back down the same amount you raised it.
Such as...

G91 Z1.0
G90 G0 X-27 Y-47
G91 Z-1.0

There's probably a hundred ways to get the job done, and really it just boils down to what you get accustomed to. Personally, I won't use an offset if I don't have to.
"CONFIDENCE: it's the feeling you experience before you fully understand the situation."