Homing the Spindle
Iam currently converting a machine with a toolchanger which needs spindle orientation.
Doing spindle orientation with the spindle orient component is pretty easy, but there is one problem, the orient component does not use the index signal of the spindle, so the spindle will be oriented by the position the spindle is placed when the machine is turned on.
So I need to home the spindle using the index signal, this is also no problem.
But I can only do this with a component or mdi command or m command..
There is no possibility to make sure the spindle is homed when a toolchange is done.
How can I force spindle homing like axis homing before running any commands or programmes ?
Any idea ?
Thank you !
I think he got it working properly, so that the spindle oriented to the home position for a tool change.
REEEN wrote: How can I force spindle homing like axis homing before running any commands or programmes ?
To home the spindle you need to set the spindle encoder index-enable pin high, then rotate the spindle past the index.
There are a number of ways that this could be done, but none currently exist as a built-in part of LinuxCNC. I have raised a feature request
I need to experiment when at a machine, but it is possible that a G33 command in startup G-codes might have the desired effect.
Or, potentially, linking a G33 as an MDI_COMMAND to the X-axis is-homing pin.
Thanks for your reply.
I managed to solve the problem with a remap procedure and some mcodes running bash scripts.
I remapped toolchange to home the spindle before the change but only once, I used some bash scripts to check whether spindle is homed and if so my routine will skip homing to save time.
But a build in spindle homing procedure would be the best !
Connecting a homing axis with a mdi command is not possible because mdi commands cannot be run before axis are homed, because the need to access the mdi mode and that's not possible before axes are homed.
Connecting a homing axis with a mdi command is not possible because mdi commands cannot be run before axis are homed[/quote]
Ah, yes, that does complicate matters.
You can "sets" the spindle-index-enable in the HAL file.
If the position-control loop was arranged to output a fixed spindle speed if the index-enable was still set when position mode was enabled, then the spindle would first move through index before aligning itself.
This could be done with a mux2, I _think_ that the mux2.N.sel pin can be connected to the index-enable signal, but I am not 100% sure.
One would have to be careful to consider the case in a specific HAL file where the spindle was in velocity mode for rigid tapping (as an example) where the index-enable pin goes high before the start of the move.
In the typical setup:
You could replace the circled Mux2 with a Mux4, and connect position-mode-and-index-enable-set to a fixed speed, position-mode-and-not-index-enable to the position pid, and the other two inputs to the velocity pid.
If you are using Master then you might like to note that there are new pins in the orient component to drive the motion.spindle-is-oriented inputs:
orient.N.is-oriented bit out orient.N.tolerance float in www.linuxcnc.org/docs/devel/html/man/man9/orient.9.html
I possibly should have added them in 2.7, but didn't. You could halcompile --install the Master version if you wanted to.
But I prefer my way with remapping and bash scripts, it was less work.
I don't use master, but the new pins are very good, I did exactly the same with a near component to ensure spindle is oriented right when the toolchange starts.
A lot of machines use tool changers where a spindle orientation musdt be done and I think inserting pins for spindle homing in motion is a useful thing.
REEEN wrote: But I prefer my way with remapping and bash scripts, it was less work.
I think that the HAL way is less work if you are doing it as part of the HAL setup, rather than adding it later.
Basically all that changes is that the mux2 that chooses between the PID outputs becomes a mux4.
NitroCH3NO2 wrote: How did you generate the HAL diagram in the above post?
By hand. I did it some time ago for the Wiki.
The component tables were copy-pasted from halcmd to Excel, then formatted and aligned there, and copied to Inkscape where the arrows were added.