hello i would do something like this :
Code:
intro codes (*1)
R Zsafe (*2)
R X-tool_radius-2.5mm YA+tool_radius
R ZA G41 (*3)
linear feed to XB YB
circular feed to XC YC
linear feed to X-tool_radius-2.5mm YD
R Zsafe G40
(*1) ( work_coordinate , tool_length , tool_radius , rpm , coolant , check seat belt , etc )
(*2) ( R means rapid )
(*3) ( when this line is executed, only Z axis is moved; it's target position is a compensation position for the toolpath that follows in XY plane )
if you can not read tool_radius inside the program, than maybe you may use imaginary vectors; next code may need a bit of customization, because compensation starts at Z safe, while machining is done at a lower Z; requires knowing how the control behaves on such codes
Code:
intro codes
R Zsafe
R X-2.5 YA imaginary vectors
R ZA G41
linear feed to XB YB
circular feed to XC YC
linear feed to X-2.5 YD imaginary vectors
R Zsafe G40
if possible, is good to eliminate unnecesary movements :
... corresponding to lead-in and end-out comps among a toolpath
... keep constant clearance, regardless of tool diameter
...... some 10s of a second can be spared ; if you have read this post, then you have allready lost them / kindly