PDA

View Full Version : Rotary axis, z lift before rotate query



marbles
14-09-2020, 05:49 PM
Hiyas,

I’m about to start milling some fairly large 800x400x400mm polystyrene blocks on my rotary 4th axis. As I usually do I did a dry run to check the gcode. I see at the start of the test gcode the command to rotate the stock material before the mill end is lifted to the clearance height i’ve set. I’d like this reverse i.e. lift to clearance height and then stock rotation.

I’m sure this is a basic one but is it something I set up in RhinoCAM or in Mach3 and how do I do that? I have safe z ticked in Mach 3.

Here is the start of the code…

G00 G49 G40.1 G17 G80 G50 G90
G21
(Setup 2)
(Horizontal Roughing)
M6 T9
M03 S7200
A-45. F10160.
G00 Z143.4785
X-26.7328 Y32.0000
G01 Z98.7135 F3200.0
Z98.0785 F750.0
X-33.7178
X-37.9425 F4000.0
etc

Any ideas most welcome

Thanks

JAZZCNC
14-09-2020, 06:22 PM
Easy if you just want to change this code just swap the lines to this.

G00 Z143.4785
A-45. F10160.

But if you want this to happen all the time then you may need to alter the post-processor, there will be a section for initialization or pre-amble or setup whichever it calls it, at the moment these are the first 2 lines in your code with the codes G00 G49 G40.1 G17 G80 G50 G90 G21

I don't use Rhino Cam so can't say but there may well be a setting that lets you lif the Z-axis to a safe position first. Most Cam programs have this feature.

marbles
14-09-2020, 07:54 PM
Thanks

I'm just in the Rhinocam post processor editor now. Hmm... just looking at the various editable sections, see below. I've copied and pasted a couple of complete. Either of these look the likely place to prioritise the lift before the rotate?

start/end
tool change
setup
spindle
feedrate
motion
circle
helical
mulit axis motion
cutter comp
cut motion start end
cycles
misc
variables




start/end

[START_CHAR]
[SEQ_PRECHAR][SEQNUM][DELIMITER]G00 G49 G40.1 G17 G80 G50 [OUTPUT_MODE_CODE]
[SEQ_PRECHAR][SEQNUM][DELIMITER][OUTPUT_UNITS_CODE]

End code:
[SEQ_PRECHAR][SEQNUM][DELIMITER]M5[DELIMITER]M9
[SEQ_PRECHAR][SEQNUM][DELIMITER]G00[DELIMITER]X0.0000[DELIMITER]Y0.0000
[SEQ_PRECHAR][SEQNUM][DELIMITER]M30
[STOP_CHAR]

Setup

Setup0 (coordinate system change)macro:
[LINEAR][DELIMITER][NEXT_X][DELIMITER][NEXT_Y][DELIMITER][NEXT_Z][DELIMITER][ROTATION_AXIS][ROTATION_DIR][ANGLE][DELIMITER][FEEDRATE_CODE][ROTATION_FEEDVALUE]

Setup1 (rotate table) macro:
[DELIMITER][DELIMITER][DELIMITER][DELIMITER][ROTATION_AXIS][ROTATION_DIR][ANGLE][DELIMITER][FEEDRATE_CODE][ROTATION_FEEDVALUE]

JAZZCNC
14-09-2020, 08:35 PM
Try this for the start/end code. But just know that the first move will send the Z-axis to Z0 (or whatever value you enter for Z) for every program.

You could use the same line further down in one of the setup sections.
[SEQ_PRECHAR][SEQNUM][DELIMITER]G00[DELIMITER] G53[DELIMITER] Z0


start/end

[START_CHAR]
[SEQ_PRECHAR][SEQNUM][DELIMITER]G00 G49 G40.1 G17 G80 G50 [OUTPUT_MODE_CODE]
[SEQ_PRECHAR][SEQNUM][DELIMITER][OUTPUT_UNITS_CODE]
[SEQ_PRECHAR][SEQNUM][DELIMITER]G00[DELIMITER] G53[DELIMITER] Z0

marbles
14-09-2020, 09:00 PM
Thanks, I'll try this out tomorrow.
I'll need to change the Z0 value as I use the centre of rotation as Z0 and that will drive the mill into the centre of the stock at cycle finish. I can add a value in the code to suit i'm guessing... G53[DELIMITER] Z50 or something?

Neale
14-09-2020, 09:05 PM
The important bit I think you've missed is the G53 which switches to machine, not work, coordinates for the G00 Z0 move. So the machine should go up to highest Z, irrespective of work coordinates. It's a useful trick!

JAZZCNC
14-09-2020, 09:12 PM
Thanks, I'll try this out tomorrow.
I'll need to change the Z0 value as I use the centre of rotation as Z0 and that will drive the mill into the centre of the stock at cycle finish. I can add a value in the code to suit i'm guessing... G53[DELIMITER] Z50 or something?

G53 is working in MACHINE coordinates so it will send it to the HOME position if set to Z0. Don't confuse it with Z0 in work coordinates.

Edit: Didn't see Neale beat me to it.!..:thumsup:

marbles
14-09-2020, 09:38 PM
Thanks for the comments guys. My knowledge of G code instructions is very limited as you can tell. I've added the line Jazz suggested to the startup code. l'll try out the new setup tomorrow :)

JAZZCNC
14-09-2020, 09:58 PM
Thanks for the comments guys. My knowledge of G code instructions is very limited as you can tell. I've added the line Jazz suggested to the startup code. l'll try out the new setup tomorrow :)

When you run this code turn down the feed rate percentage just in case it doesn't work as expected.!! . . . . Or put another don't blame me if it crashes if you don't. . .Lol

marbles
14-09-2020, 10:23 PM
Will do :)