Manual tool change button

More
22 Aug 2016 22:07 #79284 by andypugh
Replied by andypugh on topic Manual tool change button
The manual toolchange is simple, insofar as getting the program to stop and pop-up a dialog is concerned:
(I am slightly surprised that that isn't already in the config)
linuxcnc.org/docs/2.7/html/gui/axis.html#_manual_tool_change
(and the HAL required is here: github.com/LinuxCNC/linuxcnc/blob/master...manualtoolchange.hal )

Once the pop-up dialog has appeared the actual manual toolchange is quite separate.

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

More
23 Aug 2016 15:57 #79317 by Jake
Replied by Jake on topic Manual tool change button
It may already be in there. I have not found it. But I also want to be setup where if the spindle is not running I can reach up push the button and drop the tool out of the spindle. Like if I need to change inserts, or if I am running the machine manually. I am going to look tonight

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

More
24 Aug 2016 12:39 #79352 by andypugh
Replied by andypugh on topic Manual tool change button

It may already be in there. I have not found it.

Easy test, just MDI "M6 T2" and see what happens.

But I also want to be setup where if the spindle is not running I can reach up push the button and drop the tool out of the spindle.


That just needs an "and2" on the spindle speed "near" 0 and the button being pressed.
loadrt and2
loadrt near
...
addf and2.0.servo-thread
addf near.0 servo-thread
...
# I have forgotten what hardware you have. This is for parport
net spindle-speed encoder.0.velocity => near.0.in1
setp near.0.in2 0
setp near.0.difference 2.0
net spindle-stopped near.0.out => and2.0.in0
# This would be your button
net release-button  parport.0.pin-NN-in => and2.0.in1
# And this is the air valve control
net release-tool and2.0.out => parport.0.pin-NN-out

You could get more elaborate, and prevent the spindle moving when the button was pressed, for example.

linuxcnc.org/docs/2.7/html/man/man9/and2.9.html
linuxcnc.org/docs/2.7/html/man/man9/encoder.9.html
linuxcnc.org/docs/2.7/html/man/man9/near.9.html
The following user(s) said Thank You: JJ48_24

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

More
14 Nov 2016 02:53 #82755 by Jake
Replied by Jake on topic Manual tool change button
Finally getting back to this.

Between work and masters classes the shop has been greatly neglected.

Soooo

All the above code needs to be in "manual tool change.hal" right?

The file is there, (still want to get the tool changer to work, but thats for another thread)

I have pico PPMC hardware,

My spindle has a run forward command needed along with a speed input to run.

If running a program, disable forward spindle run, request tool change, I can push button, change tool, acknowledge tool changed, resume program.

Or allow tool change any time "spindle forward" is not true, and block "spindle forward" any time tool change button is pressed.

loadrt and2
loadrt near
...
addf and2.0.servo-thread
addf near.0 servo-thread
...
#
net spindle-speed encoder.0.velocity => near.0.in1
setp near.0.in2 0
setp near.0.difference 2.0
net spindle-stopped near.0.out => and2.0.in0

net spindleFWD motion.spindle-forward ppmc.dout.10.out (must be false)
So all my inputs and outputs will be
# Release tool solenoid on SSR10
net release-tool ppmc.0.dout.10.out
#Release tool button on Input 26
net release-button ppmc.0.din.26.in

I do have mechanical limits if, the spindle is not locked it disables the spindle from moving, there is also a limit switch to send to the controller to disable forward run. I want to make sure that fwd run is disabled during a tool change, I dont want to risk that.


I am still digging through the docs to try to get this figured out. Hopefully be at the point where I can make some chips with it later this week. This machine is tighter than I thought it was going to be, backlash is 4-9 ten thou
The following user(s) said Thank You: johnmc1

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

More
14 Nov 2016 11:32 #82764 by andypugh
Replied by andypugh on topic Manual tool change button

If running a program, disable forward spindle run, request tool change, I can push button, change tool, acknowledge tool changed, resume program.


The hal_manualtoolchange component has a HAL pin to acknowledge tool changed. (hal_manualtoochange.change-button)

github.com/LinuxCNC/linuxcnc/blob/master...ualtoolchange.py#L56

If your machine can tell that there is a tool in the spindle then you could trigger that pin on a falling edge of the release button.
(it needs to know that there is a tool in the spindle, otherwise the spindle would start when the tool was removed and the button was released, if you do it as a two-stage process.

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

More
14 Nov 2016 18:16 #82801 by Jake
Replied by Jake on topic Manual tool change button
Thanks for the help Andy,

So I can have my inputs in the IOcontrol.hal file

for

spindle-locked
release-button
release-tool

Can I have two syntax tied to the same pin? I have one action when its true and another action from when its false or since these will be in the tool change hal I dont have to have them in the PPMC IO file?
# Spindle Limit +     DI 11
#net spindle-locked motion.spindle-locked ppmc.0.din.11.in
#net spindle-inhibit motion.spindle-inhibit ppmc.0.din.11.in-not
loadrt and2
loadrt near
...
addf and2.0.servo-thread
addf near.0 servo-thread
...
# PICO hardware
net spindle-speed encoder.0.velocity => near.0.in1 [b]{and2 here?}[/b]
setp near.0.in2 0
setp near.0.difference 2.0
net spindle-stopped near.0.out => and2.0.in0
# This would be your button
net release-button  ppmc.0.din.26.in => and2.0.in1 [b]{near 0 here? }[/b]
# And this is the air valve control
net release-tool and2.0.out => ppmc.0.dout.10.out

I am not understanding where the and2 and near0 need to be in the code

Thanks for all the help! I bet once I get past this the tool changer wont be too bad to deal with!

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

More
14 Nov 2016 18:28 #82803 by andypugh
Replied by andypugh on topic Manual tool change button

So I can have my inputs in the IOcontrol.hal file

You can have them in any HAL file that is specified in the INI file. Including in a separate one all of their own.

Can I have two syntax tied to the same pin? I have one action when its true and another action from when its false or since these will be in the tool change hal I dont have to have them in the PPMC IO file?

Yes, any HAL "writer" pin can connect to one signal, and that can be connected to any number of reader pins.
Also, the ppmc pins have both in and in-not pins, so you can connect different effects to each state of the pin.

I am not understanding where the and2 and near0 need to be in the code!


It isn't really code, not in the sense of a program. The HAL file is interpreted just once at startup, and at that point all the pins and functions are connected together as specified by the file. Then the inputs and outputs are updated every servo-period (normally 1mS)

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

More
17 Nov 2016 14:30 #82898 by Jake
Replied by Jake on topic Manual tool change button
one more ??

the "manual_toochange" does not show up in my hal configuration. I know I need to put load manual tool change somewhere but I cant find where.

The manual tool change is in the folder, and when I MDI M6 ### like you said it does not give me an error.

hopefully this will work in the IO control
# Tool Unclamp BUTTON    DI 26
#net release-button iocontrol ppmc.0.din.26.in

# Tool Unclamp        SSR 10
#net release-tool iocontrol ppmc.0.dout.10.out

Thanks!

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

More
17 Nov 2016 15:37 #82905 by andypugh
Replied by andypugh on topic Manual tool change button
You can just save this as a file to your config folder then add it to the list of HAL files in the INI file.
Or, incorporate the HAL lines to your HAL file. (in which case, without the unlinkp commands)

github.com/LinuxCNC/linuxcnc/blob/master...manualtoolchange.hal

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

More
20 Nov 2016 23:55 #83048 by Jake
Replied by Jake on topic Manual tool change button
I added the HAL to the INI, now it shows up in the HAL configuration. I do have the pins assigned to the tool-unlock and the IO file
# Tool Unclamp BUTTON    DI 26
net release-button ppmc.0.din.07.in

# Tool Unclamp        SSR 10
net release-tool ppmc.0.dout.09.out

# Spindle Limit +     DI 11
net spindle-locked motion.spindle-locked ppmc.0.din.31.in
net spindle-inhibit motion.spindle-inhibit ppmc.0.din.31.in-not

Pushing the button on the head I do not get any response (controller does see it) and with a M6 T2 MDI command I do not get anything.

Is there something I need to add into the manual toolchange.HAL to tell it?

Thanks again!

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

Time to create page: 0.148 seconds
Powered by Kunena Forum