How to homing the A-axis again with gcode?
- israfilcaglar
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
12 Apr 2025 17:49 #326182
by israfilcaglar
How to homing the A-axis again with gcode? was created by israfilcaglar
Hello, I'm new here. I'm a bit of a novice. Sorry if I put the question in the wrong place.
I'm making a 4-axis swiss lathe. I've never had any mechanical problems. But I'm having some trouble with linuxcnc, I want you to help me.
I have a mesa 7i96s card. I control the spindle with step/dir and I want to use it both for turning and as an a-axis. I'm homing the a-axis, no problem.
I want to do this; I want the a-axis to find the ahome switch again using g28 in the program. The a-axis should rotate until it finds the switch. How do I reset the joint.3.homing pin with g-code? How can it homing again with g-code?
I'm making a 4-axis swiss lathe. I've never had any mechanical problems. But I'm having some trouble with linuxcnc, I want you to help me.
I have a mesa 7i96s card. I control the spindle with step/dir and I want to use it both for turning and as an a-axis. I'm homing the a-axis, no problem.
I want to do this; I want the a-axis to find the ahome switch again using g28 in the program. The a-axis should rotate until it finds the switch. How do I reset the joint.3.homing pin with g-code? How can it homing again with g-code?
Attachments:
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4305
- Thank you received: 1908
12 Apr 2025 18:05 #326184
by Aciera
Replied by Aciera on topic How to homing the A-axis again with gcode?
There is no way to 'unhome/rehome' a joint in gcode.
There is a modified 'orient' component that allows optional rehoming to an encoder index signal before doing the spindle orientation.
This post contains a config for spindle/rotary switching in gcode using the modified 'orient' component to rehome the spindle before switching to rotary mode. (This requires an encoder with index on the spindle)
forum.linuxcnc.org/38-general-linuxcnc-q...blem?start=20#324276
There is a modified 'orient' component that allows optional rehoming to an encoder index signal before doing the spindle orientation.
This post contains a config for spindle/rotary switching in gcode using the modified 'orient' component to rehome the spindle before switching to rotary mode. (This requires an encoder with index on the spindle)
forum.linuxcnc.org/38-general-linuxcnc-q...blem?start=20#324276
Please Log in or Create an account to join the conversation.
- israfilcaglar
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
12 Apr 2025 19:08 #326187
by israfilcaglar
Replied by israfilcaglar on topic How to homing the A-axis again with gcode?
Thank you. I will check and try.
I want to ask you a question. How can I use the M19 command with Mesa 7i96s?
Can I call the M19 gcode and position the spindle?
I want to ask you a question. How can I use the M19 command with Mesa 7i96s?
Can I call the M19 gcode and position the spindle?
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23297
- Thank you received: 4938
15 Apr 2025 12:57 #326365
by andypugh
Replied by andypugh on topic How to homing the A-axis again with gcode?
I can think of a few ways that you might be able to "reset" the A axis, but I don't know if any would work properly.
Firstly, you can't run the actual homing sequence in "Auto" mode. That's a pretty fundamental limitation that prevents homing while a G-code program is running.
If you don't need that (though I think that you probably do) then there are ways such as G-code remaps or custom-Mcodes that could do that.
You could try using the G10 command to reset the A-axis position, though.
Asuming that the A axis is calibrated in degrees:Will "unwrap" all the full-turns that have happened in spidle mode.
However you need to keep in mind that all the full turns are still there, and at some point there will be enough full turns that you will lose precision in the partial turns. The spindle position is a double-precision float, with about 14 significant digits, so this will take some time but you would probably still want to re-home the A axis manually between every few dozen jobs.
Firstly, you can't run the actual homing sequence in "Auto" mode. That's a pretty fundamental limitation that prevents homing while a G-code program is running.
If you don't need that (though I think that you probably do) then there are ways such as G-code remaps or custom-Mcodes that could do that.
You could try using the G10 command to reset the A-axis position, though.
Asuming that the A axis is calibrated in degrees:
G10 L20 A [#<_a> MOD 360]
However you need to keep in mind that all the full turns are still there, and at some point there will be enough full turns that you will lose precision in the partial turns. The spindle position is a double-precision float, with about 14 significant digits, so this will take some time but you would probably still want to re-home the A axis manually between every few dozen jobs.
The following user(s) said Thank You: israfilcaglar
Please Log in or Create an account to join the conversation.
- israfilcaglar
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
18 Apr 2025 21:19 #326635
by israfilcaglar
Replied by israfilcaglar on topic How to homing the A-axis again with gcode?
thank you for your help. I want to ask you a question. I have a mesa 7i96s card. stepgen.00 X axis, stepgen.01 Y axis, stepgen.02 Z axis, stepgen.03 spindle pwm speed control, stepgen.04 a axis. I use spindle speed mode. I turn the spindle with m3 command, then I stop the spindle with m5 command. I want the spindle tip to always stay at the same angle when I give the m5 command. How can I do this?
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23297
- Thank you received: 4938
21 Apr 2025 17:31 #326821
by andypugh
Replied by andypugh on topic How to homing the A-axis again with gcode?
I can't immediately think of a way to do what you ask.
It would be possible if M5 was re-mappable, but I don't think it is.
If you can use (for example) M15 in place of M5, then that could be remapped to:
wait for spindle stopped
measure the current angle
reset the offset (as described earlier)
rapid to A=0
linuxcnc.org/docs/stable/html/remap/rema...remap:existing-codes
It would be possible if M5 was re-mappable, but I don't think it is.
If you can use (for example) M15 in place of M5, then that could be remapped to:
wait for spindle stopped
measure the current angle
reset the offset (as described earlier)
rapid to A=0
linuxcnc.org/docs/stable/html/remap/rema...remap:existing-codes
Please Log in or Create an account to join the conversation.
Time to create page: 0.090 seconds