Manual tool change + tool lengh touch off
05 Apr 2019 10:06 #130331
by andypugh
It sort-of is.
G-code was defined a long time ago and largely on the assumption that machines with interchangeable tooling had repeatable tool length. I don't think anyone back then imagined using the not-yet-invented ER collet directly in the spindle nose.
If you have R8 / CAT / ISO / BT / HSK etc etc tooling then you store the tool length in the tool table and every time you put a tool in it is in exactly the same position. (You can actually do this with an end-stop in your collet spindle, by the way)
With that sort of system M6 does a tool change and G43 applies an offset based on the tool table.
What LinuxCNC allows you to do is re-define what happens when T or M6 are found in the G-code.
Start LinuxCNC and look in the sample configs. Start the sim/axis/remap/manual-toolchange-with-tool-length-switch/ home it and try doing a tool change (M6 n MDI for example). You will see that the behaviour is pretty much exactly what you are asking for, except that the move to the tool change position followed by a tool length measurment happens when the tool is changed, not after a fixed length of time (which seems to be what you are asking for)
Replied by andypugh on topic Manual tool change + tool lengh touch off
What i would like is that it homes. I push the green button, then it should move to preset coordinates and measure tool length. Then move to preset coordinates where i have clamped the workpiece. After some time it should go back to home - and then ask for a new tool - and the proces above repeat itself.
...
Weird the feature is not there in linuxcnc.
It sort-of is.
G-code was defined a long time ago and largely on the assumption that machines with interchangeable tooling had repeatable tool length. I don't think anyone back then imagined using the not-yet-invented ER collet directly in the spindle nose.
If you have R8 / CAT / ISO / BT / HSK etc etc tooling then you store the tool length in the tool table and every time you put a tool in it is in exactly the same position. (You can actually do this with an end-stop in your collet spindle, by the way)
With that sort of system M6 does a tool change and G43 applies an offset based on the tool table.
What LinuxCNC allows you to do is re-define what happens when T or M6 are found in the G-code.
Start LinuxCNC and look in the sample configs. Start the sim/axis/remap/manual-toolchange-with-tool-length-switch/ home it and try doing a tool change (M6 n MDI for example). You will see that the behaviour is pretty much exactly what you are asking for, except that the move to the tool change position followed by a tool length measurment happens when the tool is changed, not after a fixed length of time (which seems to be what you are asking for)
Please Log in or Create an account to join the conversation.
05 Apr 2019 21:15 - 05 Apr 2019 21:36 #130367
by diep
Replied by diep on topic Manual tool change + tool lengh touch off
Much appreciated you explain that i can redefine gcode commands - that's very helpful!
Yeah it's good to know from how far linuxcnc comes if i read the struggle some had years ago needing to modify all the HAL and similar files.
I did find that sim directory in
/usr/share/doc/linuxcnc/examples/sample-configs/sim/axis/remap/manual-toolchange-with-tool-length-switch/
In that directory listed is a .glade .hal .ini and .ui file - how do i load those?
Can i double click on one of them?
And how do i take care i have a button in the linuxcnc-GUI underneath the 'home all' i like also a button 'set tool'.
I did find a good youtube explaining which g-code i'd need for that.
But no clue where to put this code so the linux-CNC gui knows how to deal with it.
with the values proposed except height of toolsetter
O <touch-to-zero> sub
G91 G21
G38.4 Z-20 F100
G0 Z1
G38.4 Z-10 F10
G10 L20 P1 Z-40.5 // my setter here seems to switch at 40.5mm or 41mm
G90 G21
G0 Z10
O <touch-to-zero> endsub
Where to put all this. Have a link to how to program linuxcnc-GUI?
My plan which might be good or not is to put a few steel bars on the bed at fixed positions at known locations. If i put there known distances (parallels) in between then i know exactly at which coordinates i clamp workpieces to the bed. So that's in my case most
parallels are 6mm thickness so clamp position is 6mm away from those 2 steel bars on the bed.
If i mill multiple sides of an object that might be very useful.
(everything in millimeters)
The homing goex to (X,Y) ---> (3,3)
Now the toolsetter also is at a known location i intend to put it at (X,Y) --> (50,0)
I can change tools then at (3,3)
Above the toolsetter is not so much space.
Z-coordinate where toolsetter loses signal is at -40.5mm or -41mm (must still precisely figure that one out - you bet i will.
With the bed at 0.00mm.
Idea i had what to make:
a) a button in the linux-cnc GUI
subroutine SetToolAndHome
- home all axis
- move to (50,0) <== toolsetter location
- carry out SUBROUTINE touch-to-zero
- move to (3,3)
b) a button in the linux-cnc GUI
if( current location is NOT (3,3) then SHOW ERRORMESSAGE to first home
move from (3,3) to Clamp Position
Then run the code PyCam generated here
for which i'll have to figure out what sort of supercomputer i have to buy to speed it up a tad producing gcode otherwise it'll take years to test some stuff there.
Yeah it's good to know from how far linuxcnc comes if i read the struggle some had years ago needing to modify all the HAL and similar files.
I did find that sim directory in
/usr/share/doc/linuxcnc/examples/sample-configs/sim/axis/remap/manual-toolchange-with-tool-length-switch/
In that directory listed is a .glade .hal .ini and .ui file - how do i load those?
Can i double click on one of them?
And how do i take care i have a button in the linuxcnc-GUI underneath the 'home all' i like also a button 'set tool'.
I did find a good youtube explaining which g-code i'd need for that.
But no clue where to put this code so the linux-CNC gui knows how to deal with it.
with the values proposed except height of toolsetter
O <touch-to-zero> sub
G91 G21
G38.4 Z-20 F100
G0 Z1
G38.4 Z-10 F10
G10 L20 P1 Z-40.5 // my setter here seems to switch at 40.5mm or 41mm
G90 G21
G0 Z10
O <touch-to-zero> endsub
Where to put all this. Have a link to how to program linuxcnc-GUI?
My plan which might be good or not is to put a few steel bars on the bed at fixed positions at known locations. If i put there known distances (parallels) in between then i know exactly at which coordinates i clamp workpieces to the bed. So that's in my case most
parallels are 6mm thickness so clamp position is 6mm away from those 2 steel bars on the bed.
If i mill multiple sides of an object that might be very useful.
(everything in millimeters)
The homing goex to (X,Y) ---> (3,3)
Now the toolsetter also is at a known location i intend to put it at (X,Y) --> (50,0)
I can change tools then at (3,3)
Above the toolsetter is not so much space.
Z-coordinate where toolsetter loses signal is at -40.5mm or -41mm (must still precisely figure that one out - you bet i will.
With the bed at 0.00mm.
Idea i had what to make:
a) a button in the linux-cnc GUI
subroutine SetToolAndHome
- home all axis
- move to (50,0) <== toolsetter location
- carry out SUBROUTINE touch-to-zero
- move to (3,3)
b) a button in the linux-cnc GUI
if( current location is NOT (3,3) then SHOW ERRORMESSAGE to first home
move from (3,3) to Clamp Position
Then run the code PyCam generated here
for which i'll have to figure out what sort of supercomputer i have to buy to speed it up a tad producing gcode otherwise it'll take years to test some stuff there.
Last edit: 05 Apr 2019 21:36 by diep.
Please Log in or Create an account to join the conversation.
05 Apr 2019 21:20 #130369
by andypugh
Start LinuxCNC from the menu (under "CNC") and then navigate to that config in the config picker.
(You can run it without worrying about having any effect on your real config)
Replied by andypugh on topic Manual tool change + tool lengh touch off
I did find that sim directory in
/usr/share/doc/linuxcnc/examples/sample-configs/sim/axis/remap/manual-toolchange-with-tool-length-switch/
In that directory listed is a .glade .hal .ini and .ui file - how do i load those?
Start LinuxCNC from the menu (under "CNC") and then navigate to that config in the config picker.
(You can run it without worrying about having any effect on your real config)
The following user(s) said Thank You: diep
Please Log in or Create an account to join the conversation.
05 Apr 2019 21:55 #130372
by diep
Replied by diep on topic Manual tool change + tool lengh touch off
Ah yes that opens a new linuxcnc-GUI yet on the right side the buttons are greyed out. Also if i press with mouse the left top cross and then next to it the F2 button.
The probe-in i had defined at pin 11 for the toolsetter for this same linuxcnc-GUI but then the one that works for the machine to home (had gotten that to work obviously).
The probe-in i had defined at pin 11 for the toolsetter for this same linuxcnc-GUI but then the one that works for the machine to home (had gotten that to work obviously).
Please Log in or Create an account to join the conversation.
05 Apr 2019 23:18 #130374
by diep
Replied by diep on topic Manual tool change + tool lengh touch off
Yes checking out GladeVCP now.to add something to Axis. Should manage i hope. Will report when problems or when it works ok
Please Log in or Create an account to join the conversation.
05 Apr 2019 23:29 #130376
by andypugh
They are only active during a tool change. If you home the machine and hit "run" you will see what it does.
Replied by andypugh on topic Manual tool change + tool lengh touch off
Ah yes that opens a new linuxcnc-GUI yet on the right side the buttons are greyed out. Also if i press with mouse the left top cross and then next to it the F2 button.
They are only active during a tool change. If you home the machine and hit "run" you will see what it does.
Please Log in or Create an account to join the conversation.
06 Apr 2019 20:20 #130413
by diep
Replied by diep on topic Manual tool change + tool lengh touch off
I do not know how to merge the gladeVCP example of manual-toolchange-with-tool-length-switch/ into the defines i had made for the machine in linuxcnc/configs/3040ext/ + configs/3040ext.stepconf
What would be the approach there?
Note i also tried to followtutorial at:
www.gnipsel.com/linuxcnc/gladevcp/gladevcp01.html
Took me hours to create the .glade file in GIT yet that tutorial doesn't work for me. Crashes linuxcnc when i try to load it. Let alone that i could try to merge it with the 3040ext.stepconf and directory of the machine defines.
With the tutorial the first problem is which directory+file to add the line
"[DISPLAY]
GLADEVCP= -u handler.py example.glade"
It must be in an .ini file but which one in which directory?
I have 3040ext.stepconf and 3040ext directory in
/home/diep/linuxcnc/configs
Must i add it do the configs/3040ext/3040ext.ini file?
Or must i add it in the later created directory linuxcnc/configs/gladevcp1/gladevcp1.ini somehow?
As that inifile already has some stuff regarding gladevcp.
Trying to test it, it crashes.
Perhaps better is trying to merge the existing example from
/usr/share/doc/linuxcnc/examples/sample-configs/sim/axis/remap/manual-toolchange-with-tool-length-switch/
Any tips where to find more info how to merge this into the 3040ext.stepconf + 3040ext directory?
What would be the approach there?
Note i also tried to followtutorial at:
www.gnipsel.com/linuxcnc/gladevcp/gladevcp01.html
Took me hours to create the .glade file in GIT yet that tutorial doesn't work for me. Crashes linuxcnc when i try to load it. Let alone that i could try to merge it with the 3040ext.stepconf and directory of the machine defines.
With the tutorial the first problem is which directory+file to add the line
"[DISPLAY]
GLADEVCP= -u handler.py example.glade"
It must be in an .ini file but which one in which directory?
I have 3040ext.stepconf and 3040ext directory in
/home/diep/linuxcnc/configs
Must i add it do the configs/3040ext/3040ext.ini file?
Or must i add it in the later created directory linuxcnc/configs/gladevcp1/gladevcp1.ini somehow?
As that inifile already has some stuff regarding gladevcp.
Trying to test it, it crashes.
Perhaps better is trying to merge the existing example from
/usr/share/doc/linuxcnc/examples/sample-configs/sim/axis/remap/manual-toolchange-with-tool-length-switch/
Any tips where to find more info how to merge this into the 3040ext.stepconf + 3040ext directory?
Please Log in or Create an account to join the conversation.
07 Apr 2019 06:54 #130425
by diep
Replied by diep on topic Manual tool change + tool lengh touch off
Update : i manage to get a button with gcode that gets called with pyvcp.
Thanks to this page: 7xcnc.com/software/probing/z-touch-plate/
I would guess that's what i want to accomplish for now and can easily expand it (i hope) to more buttons after this one works...
(Need to bring back the computer (old and heavy) from this room to the room where the cnc machine is located - no internet there of course).
I'll report back here. Either how i got it all done or with questions
Thanks to this page: 7xcnc.com/software/probing/z-touch-plate/
I would guess that's what i want to accomplish for now and can easily expand it (i hope) to more buttons after this one works...
(Need to bring back the computer (old and heavy) from this room to the room where the cnc machine is located - no internet there of course).
I'll report back here. Either how i got it all done or with questions
Please Log in or Create an account to join the conversation.
07 Apr 2019 13:51 #130440
by andypugh
The GladeVCP panel exists only to simulate the probe trip, for use with a simulated machine.
A real machine should not need any of that.
What you do need is the remap routine (ngc) and the INI file entries.
Replied by andypugh on topic Manual tool change + tool lengh touch off
I do not know how to merge the gladeVCP example of manual-toolchange-with-tool-length-switch/ into the defines i had made for the machine in linuxcnc/configs/3040ext/ + configs/3040ext.stepconf
The GladeVCP panel exists only to simulate the probe trip, for use with a simulated machine.
A real machine should not need any of that.
What you do need is the remap routine (ngc) and the INI file entries.
Please Log in or Create an account to join the conversation.
17 Apr 2019 19:00 #131066
by macla
Replied by macla on topic Manual tool change + tool lengh touch off
I have been testing OrangeCats manual tool change routine and ran into issues I didn't understand - primarily this:
"Linear move on line 128 would exceed joint 2's positive limit"
This error popped up after a new tool was inserted and the height probing complete. But not in a consistent way, and that puzzled me.
I therefore modified the subroutine by inserting some (print, ..) statements. See the attached file.
I then did this:
1) Start LinuxCnc from the terminal, so I can watch the output from the print statements
2) Home the machine (now at (0,0,0))
3) From MDI run: M600 and then M0 T6 (I leave the tool in)
The first probing sequence is executed and the spindle returns to its original position (0,0,0). The print output is:
First tool change
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Trip point _ToolZRef = -24.113033
4) I load the .ngc file with the cnc project I want to run
5) Manually move the spindle to the workpiece and touch off all axes. The print output is:
First tool change
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Trip point _ToolZRef = -32.790000
First tool change
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Trip point _ToolZRef = -32.790000
First tool change
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Trip point _ToolZRef = -32.790000
First tool change
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Trip point _ToolZRef = -32.124133
6) Press Run to start the program. Linuxcnc prompts me to change to the first tool. Since the correct tool is in the spindle, I leave it in.
The probing sequence starts. The print output is:
ToolDiamMM = 4.000000
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Old tool length = ######
New tool length = -23.671500
G53 G1 F[500.000000] Z[0.000000 - -24.113033 + -23.671500]
USRMOT: ERROR: invalid command
Linear move on line 128 would exceed joint 2's positive limit
The problem is clearly that the last G53 command wants to move the spindle above Z0 (valid range is -130 to 0).
Even though it is the same tool in both probing sequences, the small difference (actually rather large??) between two readings may result in the addition of a positive number. This combined with the fact that variable #5183 apparently always is zero (also if I move the z-axis down after homing and before step 3 above).
My two questions:
1) Why is #5183 always zero?
2) Why is the tool-change.ngc subroutine executed when the touch-off button is pressed? (The "First tool change" output is seen multiple times and "_ToolZRef = -32.790000" is printed
at each touch-off button press, even though the z-axis doesn't move. Don't understand where this value comes from?
What am I missing here?
"Linear move on line 128 would exceed joint 2's positive limit"
This error popped up after a new tool was inserted and the height probing complete. But not in a consistent way, and that puzzled me.
I therefore modified the subroutine by inserting some (print, ..) statements. See the attached file.
I then did this:
1) Start LinuxCnc from the terminal, so I can watch the output from the print statements
2) Home the machine (now at (0,0,0))
3) From MDI run: M600 and then M0 T6 (I leave the tool in)
The first probing sequence is executed and the spindle returns to its original position (0,0,0). The print output is:
First tool change
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Trip point _ToolZRef = -24.113033
4) I load the .ngc file with the cnc project I want to run
5) Manually move the spindle to the workpiece and touch off all axes. The print output is:
First tool change
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Trip point _ToolZRef = -32.790000
First tool change
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Trip point _ToolZRef = -32.790000
First tool change
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Trip point _ToolZRef = -32.790000
First tool change
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Trip point _ToolZRef = -32.124133
6) Press Run to start the program. Linuxcnc prompts me to change to the first tool. Since the correct tool is in the spindle, I leave it in.
The probing sequence starts. The print output is:
ToolDiamMM = 4.000000
G38.2 Z[-128.000000 - -10.000000] F[400.000000]
Old tool length = ######
New tool length = -23.671500
G53 G1 F[500.000000] Z[0.000000 - -24.113033 + -23.671500]
USRMOT: ERROR: invalid command
Linear move on line 128 would exceed joint 2's positive limit
The problem is clearly that the last G53 command wants to move the spindle above Z0 (valid range is -130 to 0).
Even though it is the same tool in both probing sequences, the small difference (actually rather large??) between two readings may result in the addition of a positive number. This combined with the fact that variable #5183 apparently always is zero (also if I move the z-axis down after homing and before step 3 above).
My two questions:
1) Why is #5183 always zero?
2) Why is the tool-change.ngc subroutine executed when the touch-off button is pressed? (The "First tool change" output is seen multiple times and "_ToolZRef = -32.790000" is printed
at each touch-off button press, even though the z-axis doesn't move. Don't understand where this value comes from?
What am I missing here?
Please Log in or Create an account to join the conversation.
Time to create page: 0.131 seconds