Macros Files for BB | Official Thread

Hey tmuka,

There exist two motion commands that first move to an intermediate coordinate, and only then to home or to an alternative position that you’ve set as predefined position. This is useful if you just milled inside a deep pocket, which is impossible to leave in the shortest way, in this case this command allows you to first let the router reach a higher position as intermediate position, and only then move to the final target coordinate. This command is called G28 or G30, but in order to use it, you need to have recorded the target final position before (unless you want it to be home, which is the default target). On the command line, you only give the intermediate position. If you give a Z axis value here, that can be seen as a sort of “safe height”.

Let’s assume that you have not set an alternative predefined position, in this case the default target position is the machine’s home position. This command goes this way:

G28 Z0

This will first lift Z to its topmost position which is 0 (Z goes from 0 to −133), and only then it will go to the predefined position (usually home position)

If you enter:

G91 G28 Z20

the prepended G91 (Set incremental distance mode) will make that value of the axis (here: 20) is interpreted as incremental value relative to the current position (instead of absolute machine value), so it would mean: “Lift Z by 20 mm from the current position, then go to the predefined postion (usally home position)”.

Cartesian coordinate system with right hand orientation


Schematic Representation of a CNC vertical milling center
– Source: Smid, Peter: CNC Programming Handbook , Industrial Press, South Norwalk, CT, USA, ISBN 9780831133474

See also here for CNC coordinate system and different positions for machine’s home.

2 Likes