hal_manualtoolchange as signal for manual tool change button close to spindle

More
08 May 2024 19:21 - 08 May 2024 19:22 #300153 by N3pu
I want to have a button close to my spindel with a light to change the tool by hand (no automatic changer available for now). Thinking about how to activate this button (the light should indicate, that the button can be pushed to change manually - so spindle is at thero speed and disabled and..)

Now I found this hal component. Could this be a way of how I can "supply" / "activate" my button / light?
That means I will have to do a tool change by entering the m6 command in the mdi line each time right? But the bennefit of the hal file will be that linuxnc is checking if motion is stopped and will wait to accept a spindle run until I press continue / tool change is ready. So I could make sure my hands are safe during change.

Is this a good idea to use it in my case or bad?

Please notice the sketch of attached of the button, light and tool clamping valve.
Attachments:
Last edit: 08 May 2024 19:22 by N3pu.

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

More
08 May 2024 23:27 #300167 by tommylight
You can add a VCP panel with that button, link it in hal to the physical button and also make it do whatever you want, so issuing an M6 is easy, having it also check if the spindle is at 0 speed or disabled is a bit more work, about 3 to 5 lines in hal, probably.

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

More
09 May 2024 06:54 #300201 by N3pu
VCP means Virtual control panel? So adding a software button?
I just want to go by a physical hardware button. Direct connected to the valve for unclamping the tool like in the schematic.

Could you explain a bit more in detail?
My though was to i could maybe go with the hal_manualtoolchange.
If hal_manualtoolchange.change bit in (Receives signal to do tool change) is active I will foward this to an output of the mesa card to supply my button.

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

More
09 May 2024 08:34 #300204 by rodw
you need an input for the button and and2 it to the tool change pin.
The output from the and2 would be connected to an output pin that triggers your relay or whatever. 

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

More
09 May 2024 11:49 #300219 by JT
The tool change HAL pins are:
tool-change iocontrol.0.tool-change
tool-changed iocontrol.0.tool-changed
tool-number iocontrol.0.tool-prep-number
tool-prepare-loopback iocontrol.0.tool-prepare

Information about those pins are here:
linuxcnc.org/docs/html/config/iov2.html

JT

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

More
09 May 2024 18:31 #300232 by N3pu
Ok. I think I got it.
That means I have to change my wiring by wiring each signal (button and valve) to the IO card and manage it via linuxcnc.

Will check it out during the weekend.
Thanks for now!

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

More
14 May 2024 11:13 #300570 by N3pu
Now I have wired the button to an Input Pin and the ATC-Valve to an Output.
So I did the configuration now like this in .hal (atc_button is and2 instance):
#  ---Signale zum manuellen Werkzeugwechsel---

#net tool-change-request    <= iocontrol.0.tool-change

net tool-change-confirmed  => iocontrol.0.tool-changed
net tool-number            <= iocontrol.0.tool-prep-number

# ---Toolchange Button Integration during M6 Call---
addf atc_button servo-thread
net tool_change_request iocontrol.0.tool-change => atc_button.in0
net atc_button_on_spindle hm2_7i76e.0.7i76.0.0.input-29 => atc_button.in1
net atc_zylinder  hm2_7i76e.0.7i76.0.0.output-04 <= atc_button.out

when I now type "M6 T5" as MDI I can push my button and the ATC valve is acting.
BUT after changing the tool by hand Linuxcnc (gmocapy) still says T1 is inserted.
How is the procedure here to commit the change?

Are the nets  "tool-change-confirmed" and "tool-number " needed somewhere? Or are they just in as a standard for user adjustment / routing?!

By the way: "I have no idea how it´s done usually - cnc newbie"

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

More
14 May 2024 12:29 - 14 May 2024 12:45 #300575 by Aciera
Yes, I'd say you are lacking some feedback signals.

Try to add these to your hal:

net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
net atc_zylinder iocontrol.0.tool-changed

[edit]
Note that the last line is probably not correct as you would really want a signal that reflects the tool change is complete. The usual manual toolchange has a popup window with an 'OK' button so the user can confirm that the toolchange has been completed.

[edit2]
Given the title of your topic I presume you are aware of this component but I do not know if you are actually using this along with your hardware button, which may be a good way to confirm tool change completion:
linuxcnc.org/docs/html/man/man1/hal_manualtoolchange.1.html
Last edit: 14 May 2024 12:45 by Aciera.

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

More
14 May 2024 17:57 #300589 by N3pu
thanks for your help. i have now comment one more line to use the io tool-prepared.
#  ---Signale zum manuellen Werkzeugwechsel---

#net tool-change-request    <= iocontrol.0.tool-change

#net tool-change-confirmed  => iocontrol.0.tool-changed
net tool-number            <= iocontrol.0.tool-prep-number

# ---Toolchange Button Integration during M6 Call---
addf atc_button servo-thread
net tool_change_request iocontrol.0.tool-change => atc_button.in0
net atc_button_on_spindle hm2_7i76e.0.7i76.0.0.input-29 => atc_button.in1
net atc_zylinder  hm2_7i76e.0.7i76.0.0.output-04 <= atc_button.out

net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
net atc_zylinder iocontrol.0.tool-changed


#  ---ignoriere Anfragen zu Werkzeug-Vorbereitungen---
#net tool-prepare-loopback   iocontrol.0.tool-prepare      =>  iocontrol.0.tool-prepared

when i now push the button after M6 Tx it justfires a small pulse to the atc_zylinder and then it shows the correct toolnumber in linuxcnc.


BUT the small pulse is to short to insert the tool / unclamp. I think that pushing the button fires the tool changed and then tool-change is not active anymore.

Maybe a way could be to watch the button rising and falling edge??
or could it makes more sense to tr the hal component "manualtoolchange" out?

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

More
15 May 2024 06:08 #300655 by Aciera
If you need a pulse on a falling edge have a look at the 'oneshot' component, which has a parameter setting for falling edge detection:
linuxcnc.org/docs/html/man/man9/oneshot.9.html

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

Time to create page: 0.080 seconds
Powered by Kunena Forum