Homing the Spindle

More
28 Aug 2015 20:25 #61863 by REEEN
Homing the Spindle was created by REEEN
Hello guys,

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 !

Please Log in or Create an account to join the conversation.

More
31 Aug 2015 16:04 #61933 by ArcEye
Replied by ArcEye on topic Homing the Spindle
I can only suggest that you have a good read through Thomas's thread on converting his spindle to use orient for toolchanging

www.linuxcnc.org/hardy/index.php/english...3-works?limitstart=0

I think he got it working properly, so that the spindle oriented to the home position for a tool change.

regards

Please Log in or Create an account to join the conversation.

More
01 Sep 2015 21:13 #61999 by andypugh
Replied by andypugh on topic Homing the Spindle

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
sourceforge.net/p/emc/feature-requests/138/

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.

Please Log in or Create an account to join the conversation.

More
02 Sep 2015 14:17 #62041 by REEEN
Replied by REEEN on topic Homing the Spindle
Hello Andy,
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.

Please Log in or Create an account to join the conversation.

More
02 Sep 2015 16:36 - 02 Sep 2015 16:44 #62043 by andypugh
Replied by andypugh on topic Homing the Spindle
[quote="REEEN" post=62041I managed to solve the problem with a remap procedure and some mcodes running bash scripts.
...
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.

<thinking aloud>
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.
Attachments:
Last edit: 02 Sep 2015 16:44 by andypugh.

Please Log in or Create an account to join the conversation.

More
02 Sep 2015 17:16 #62044 by REEEN
Replied by REEEN on topic Homing the Spindle
Yes, the way you described looks possible.
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.

Greets Rene

Please Log in or Create an account to join the conversation.

More
02 Sep 2015 17:44 #62046 by andypugh
Replied by andypugh on topic Homing the Spindle

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.

Please Log in or Create an account to join the conversation.

  • LearningLinuxCNC
  • LearningLinuxCNC's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
More
02 Sep 2015 20:35 #62057 by LearningLinuxCNC
Replied by LearningLinuxCNC on topic Homing the Spindle
Andy,

Sorry to hijack but I must know.

How did you generate the HAL diagram in the above post?

Please Log in or Create an account to join the conversation.

More
02 Sep 2015 21:17 #62059 by andypugh
Replied by andypugh on topic Homing the Spindle

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.

Please Log in or Create an account to join the conversation.

  • LearningLinuxCNC
  • LearningLinuxCNC's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
More
02 Sep 2015 21:20 #62060 by LearningLinuxCNC
Replied by LearningLinuxCNC on topic Homing the Spindle
I was laying awake last night thinking of ways to do that automatically by reading the HAL files in a config. May be an upcoming programming project for me. I thought there might already be a tool out there for it.

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum