I have a WorkBee CNC and have just bought a PanelDue screen for my Duet control board. Through the screen, it is not possible to set Work Zero, but macros can be run. Can someone help me with the G-code for a macro to set Work Zero and another macro to return to Work Zero?
Yes, I can, but it's bedtime here in the UK and I'm busy tomorrow. To answer the first question I need to know what version of Ooznest's firmware you are using. The macro to return to workplace zero is an easy one :- G0 X0 Y0 G0 Z0 Notice there are two lines so it moves to X0Y0 first and then lowers to Z0. Alex.
no, avoid G92 The correct code is 'G10 L20 Ps X. Y. Z' as in G Codes You will need 3 macros, one for each axis for X Code: G90 G17 G10 L20 P0 X0 for Y Code: G90 G17 G10 L20 P0 Y0 for Z Code: G90 G17 G10 L20 P0 Z0 You could combine X and Y but I don't recommend combining with Z for XY Code: G90 G17 G10 L20 P0 X0 Y0 The 'P0' tells it to use the current work offset system, which avoids having to know which one is in use, though G54 is the default. Then for the gotos I would use 2 macros first, goto X0 y0 and a safe Z height Code: G90 G17 G21 G53 G0 Z-5 G0 X0 Y0 That sets millimeter mode then raises Z to 5mm below the Z limit switch. IF that is not far enough to avoid triggering the limit, then use -10 G53 is a machine coordinate move, referenced to home rather than workpiece 0, G90 is absolute coordinates (as opposed to relative), G17 is XY plane, G21 is millimeters. Macros must always set the modes they expect, never assume that the mode, like G90, is already in effect, someday, it won't be )-: now for Z, I would not rapid move to Z0, that would not give me time to abort if there was a problem Code: G90 G17 G21 G1 Z0 F400 This sets the modes as before, then uses a feedrate of 400mm/min to move to the current work Z0. This will do 100mm in 15 seconds, which should give you time to emergency stop if there is a problem, without taking so long you get bored. Of course you can adjust this feedrate to be faster, your machine, your risk, I find fast Z moves to happen much too quickly for comfort so I take the slow road.
All good except for the one in the quote above - that is perfectly correct for most cnc controllers but won't work with the Duet controller and Ooznest's firmware. So ;- G90 G17 G21 G53 G0 Z80 G0 X0 Y0 Alex.