Gsender Macro help requested

I am using a drag knife on my Sienci MK2 CNC with gsender software. I am trying to cut through a thin layer of vinyl to make a template. It is difficult to get the z0 position exactly correct. What I would like to do is come up with a macro that would adjust the z0 position by a small amount (say .001) and change the number displayed in the DRO. The plan would be to set the z0 position a little be high and then run the macro repeatedly until I get the result I want. All the macro has to do is read the current z0, add the constant, and update the DRO. I would start the job again. If it is still too high I would stop it, run the macro again. I know that I can do this manually by editing the z0 value in the DRO or by moving to z0, then moving down .001, and resetting z0. Both of these methods are tedious and prone to error. If anyone has any suggestions or can write a macro that will work in Gsender 1.5.7, I would appreciate the help. Thanks.

@dbwessell Welcome to the group, Dave. I believe that this will do it, but test it off the side of the material to make sure. :grinning_face: This is in metric. Do you have gSender set to metric or imperial? If imperial, I’ll change it.
This will move the cutter down .001"/.0254mm, then reset Z to 0 at the new location.

G91
G21
G1 Z-.0254 F2000
G10 L20 P1 Z0

Thanks for the reply. I am using imperial.

@dbwessell OK try this
G91
G20
G1 Z-.001 F60
G10 L20 P1 Z0

The only reason that the F60 is there is that I have found on my machine that offset movements such as this are better done more slowly than an G0 command does.

Thanks. That works fine. I appreciate the help. BTW, I was able to accomplish what I wanted to do without machine movement with this line:

G10 L20 Z[posz + .001]; make the system think that it is higher than it actually is so that z0 is effectively lower

This appears to do the same thing as manually typing the new value in the DRO.

@dbwessell I don’t quite understand how that works, but since it does, that’s all the matters. I’ll mark your issue resolved and close the thread. Good luck with your vinyl cutting.