Custom mcodes
- Philip Lydin
- Away
- Junior Member
-
Less
More
- Posts: 29
- Thank you received: 3
07 Mar 2025 01:44 #323384
by Philip Lydin
Custom mcodes was created by Philip Lydin
Hello im currenttly working on a latthe rettrofit. The tailstock on the machine works by movving the z axis so it is aligned with the tailstock then a pin gets hydraullically pressed into the tailstock so when you now move the z axis it brings along the tailstock so you can move it to the desired position. Does anybody have a idea how i can make this. I tried to use a m100-199. But then i saw you canttt use subroutines. Otherwise ittt would be perfect since you can use its related parameters to set where you want to place the tailstock. Is it possible to use parameters with unallocatted mcode. So you could maybe do like a m20p200?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Away
- Platinum Member
-
Less
More
- Posts: 4981
- Thank you received: 1451
07 Mar 2025 16:36 #323434
by Todd Zuercher
Replied by Todd Zuercher on topic Custom mcodes
How I think I would attack this would be to use a probing routine to look for a switch that indicates alignment of the pin with the hole in the tailstock. Then use a couple of m-codes to unlock the tailstock and engage the pin. Then use another set of m-codes to relock and disengage the pin after moving. This all could be saved in two subroutines one called "move-tailstock" and another "lock-tailstock".
Writing these as sub routines will let you call the M-codes to move the pin and lock or unlock the tailstock. Rather than try to make the M-codes be the whole subroutine.
If you want to use g-code subs as your M-code, then you must use g-code remapping.
Writing these as sub routines will let you call the M-codes to move the pin and lock or unlock the tailstock. Rather than try to make the M-codes be the whole subroutine.
If you want to use g-code subs as your M-code, then you must use g-code remapping.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
Time to create page: 0.161 seconds