How to homing the A-axis again with gcode?

More
1 year 6 months ago #326182 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?


 

Attachment not found


 

Attachment not found


 

Attachment not found

Please Log in to join the conversation.

More
1 year 6 months ago #326184 by Aciera
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

Please Log in to join the conversation.

More
1 year 6 months ago #326187 by israfilcaglar
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?

Please Log in to join the conversation.

More
1 year 6 months ago #326365 by andypugh
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:
Code:
G10 L20 A [#<_a> MOD 360]
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.

Please Log in to join the conversation.

More
1 year 6 months ago #326635 by israfilcaglar
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 to join the conversation.

More
1 year 6 months ago #326821 by andypugh
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

Please Log in to join the conversation.

Time to create page: 0.125 seconds
Powered by Kunena Forum