More C programs, Rigid/Synchronous/Peck tapping, G10L20 workaround, A axis delete multiples of 360

Moderators: TomKerekes, dynomotion

Post Reply
nmorong
Posts: 6
Joined: Sun Jun 07, 2026 12:48 am

More C programs, Rigid/Synchronous/Peck tapping, G10L20 workaround, A axis delete multiples of 360

Post by nmorong » Tue Jun 23, 2026 5:49 pm

Just sharing a few more of my C programs. Once again, I don't claim to know what I'm doing, I just got some stuff to work on my machine. I've had some of this stuff working for quite a while now, but I'm just now getting around to cleaning it up and sharing it.

The tap program works a little differently than those I've seen before, it uses the spindle servo axis and commands rotational moves, while slaving the Z axis to the spindle encoder. My machine has separate encoders on the spindle, and the spindle motor. It's probably too specific to my machine for anyone else to use as is, but the approach I took might be useful for someone. Also comments include some of my notes from figuring out how to get it working. I found some things very confusing, like why my tapping program would just hang at the end before I realized I needed to command a small move to bring Z EXACTLY back to the retract point before it would move on.

NOTE: METRIC MODE NOT TESTED!!!

ZeroAllAtCurrent is what I'm using as an Mcode workaround because KmotionCNC doesn't support G10L20. It sets the current point to zero in the current fixture offset. I use this with a "throwaway" fixture offset so I can copy/paste programs into a program that I'm running without worrying about position. For example, say I have an NPT thread milling program saved on my control PC. It uses G59 and zero is .100" above the center of the hole. It uses several tools to make the hole, chamfer it, and thread it. I can go to .100 above the center of the hole, switch to G59, run the Mcode, and then I can just copy/paste my thread milling program.

Adeletemultiplerotations: Adjusts the current fixture offset so the A axis position is between -360 and 360 degrees. Example: if A was at 370 degress, it will now be at 10 degrees. Useful if you use the A axis for turning and end up with huge numbers for A axis position.
Attachments
RigidTap-Working 6-22-26.c
(10.95 KiB) Downloaded 6 times
Adeletemultiplerotations-Working 6-22-26.c
(2.8 KiB) Downloaded 18 times
ZeroAllAtCurrent-Working 6-20-26.c
(1.59 KiB) Downloaded 6 times

Post Reply