Connect 2 toolsetters to linuxcnc - new to this forum
15 Aug 2017 00:04 #97488
by Marcodi
Connect 2 toolsetters to linuxcnc - new to this forum was created by Marcodi
Hello,
I am completely new to linuxcnc and just testing out its possibilities for a new machine being build. I just want to be in control of my controller this time
. Use is professional.
Second reason is to see how active this forum is and if there is a good base for help out there.
Cause my idea is : alone is just alone and far more difficult.
Is it possible in linuxcnc to connect 2 different tool height setters? I want to set one tool height setters fixed on my tablebed and use another tool height setter to find the height of the workpiece.
I would program a macro to calculate the height difference after a tool change so that after a tool change I can just use the fixed tool height setter to zero out the new tool in comparison to the previous tool.
Is something like this possible in linuxcnc. (I am not scared of the c++ programming needed.)
Anybody wrote a macro like this already?
Thanks
Stephane
I am completely new to linuxcnc and just testing out its possibilities for a new machine being build. I just want to be in control of my controller this time
![:) :)](/media/kunena/emoticons/smile.png)
Second reason is to see how active this forum is and if there is a good base for help out there.
Cause my idea is : alone is just alone and far more difficult.
Is it possible in linuxcnc to connect 2 different tool height setters? I want to set one tool height setters fixed on my tablebed and use another tool height setter to find the height of the workpiece.
I would program a macro to calculate the height difference after a tool change so that after a tool change I can just use the fixed tool height setter to zero out the new tool in comparison to the previous tool.
Is something like this possible in linuxcnc. (I am not scared of the c++ programming needed.)
Anybody wrote a macro like this already?
Thanks
Stephane
Please Log in or Create an account to join the conversation.
15 Aug 2017 03:48 - 15 Aug 2017 04:12 #97491
by Roc
Replied by Roc on topic Connect 2 toolsetters to linuxcnc - new to this forum
Not an expert here, but you can have multiple probes connected at the same time, but there is only one probe_in signal so whenever any of them fires it will signal a probe contact. That is if you had two different touch probes at two different locations of the table there is no problem assuming probe 1 can't be triggered when you are performing a probing operation at location 2 and vice versa. Unless you wanted to utilize them both in an operation which also is possible. By the way here is my probe routine which does exactly that, just finished it a day or two ago so please make sure it is doing the right thing for you if you choose to use it. Especially where I convert from active coordinates to machine coordinates. Not sure what cases might need to be considered there, but for my hobby use case it should be fine. I tried to verbosely comment it to help you make any adjustments you might need. The file is also attached.
O<my_probe_tool> sub
O11 if [EXISTS[#<_reference_tool_pos>] eq 0] (first time)
#<_reference_tool_pos> = 0 (maybe zero is not the best value for this)
O11 endif
(debug, Reference is #<_reference_tool_pos>)
g90 (absolute mode)
g49 (turn off length compensation)
g53 g0 z0 (Move to a safe height)
g53 x#5161 y#5162 (Rapid to the g28 x,y location at a safe height)
g28 (Execute g28 to complte Move above switch)
g91
g38.2 z-3.5 f12 (Probe towards switch, on my machine -3.5 is a good distance to probe)
g38.4 z0.3 f2 (Back away slowly from the switch)
g90
o100 if [#5220 gt 0] (check if we are offsets are in effect)
(compensate for the offsets)
#3 = [5221 + [#5220 - 1] * 20 + 2] (Get the Z paramater # for the current g5x coords)
#4 = ##3 (dereference to the get the z value)
o200 if[#5210 eq 1] (check if g92 offsets in effect)
#1 = [#5063 + #5213 + #4] (adjust probe offset by g5x offset and g92 offset)
o200 else
#1 = [#5063 + #4] (adjust probe offset by g5x)
o200 endif
o100 else
return #1 = #5063 (we are in already in machine coordinates)
o100 endif
O1 if [#<_reference_tool_pos> ne 0]
#2 = [#1 - #<_reference_tool_pos>]
(debug, Setting tool offset to offset #2)
G10 L1 P#5400 z[#2] (Set the length of the tool in the spindle relative to first tool)
O1 else
(debug, Setting reference offset to #1)
#<_reference_tool_pos> = #1 (Save our reference offset)
G10 L1 P#5400 z0 (First first tool set the length to be zero)
O1 endif
g43 H0 (Note sure if this is necessary as G10 should have reloaded the offsets)
g28 (I like to move back up to my probe location)
o<myprobe_tool> endsub
O<my_probe_tool> sub
O11 if [EXISTS[#<_reference_tool_pos>] eq 0] (first time)
#<_reference_tool_pos> = 0 (maybe zero is not the best value for this)
O11 endif
(debug, Reference is #<_reference_tool_pos>)
g90 (absolute mode)
g49 (turn off length compensation)
g53 g0 z0 (Move to a safe height)
g53 x#5161 y#5162 (Rapid to the g28 x,y location at a safe height)
g28 (Execute g28 to complte Move above switch)
g91
g38.2 z-3.5 f12 (Probe towards switch, on my machine -3.5 is a good distance to probe)
g38.4 z0.3 f2 (Back away slowly from the switch)
g90
o100 if [#5220 gt 0] (check if we are offsets are in effect)
(compensate for the offsets)
#3 = [5221 + [#5220 - 1] * 20 + 2] (Get the Z paramater # for the current g5x coords)
#4 = ##3 (dereference to the get the z value)
o200 if[#5210 eq 1] (check if g92 offsets in effect)
#1 = [#5063 + #5213 + #4] (adjust probe offset by g5x offset and g92 offset)
o200 else
#1 = [#5063 + #4] (adjust probe offset by g5x)
o200 endif
o100 else
return #1 = #5063 (we are in already in machine coordinates)
o100 endif
O1 if [#<_reference_tool_pos> ne 0]
#2 = [#1 - #<_reference_tool_pos>]
(debug, Setting tool offset to offset #2)
G10 L1 P#5400 z[#2] (Set the length of the tool in the spindle relative to first tool)
O1 else
(debug, Setting reference offset to #1)
#<_reference_tool_pos> = #1 (Save our reference offset)
G10 L1 P#5400 z0 (First first tool set the length to be zero)
O1 endif
g43 H0 (Note sure if this is necessary as G10 should have reloaded the offsets)
g28 (I like to move back up to my probe location)
o<myprobe_tool> endsub
Last edit: 15 Aug 2017 04:12 by Roc.
Please Log in or Create an account to join the conversation.
15 Aug 2017 08:35 #97494
by Marcodi
Replied by Marcodi on topic Connect 2 toolsetters to linuxcnc - new to this forum
Well, that answers my questions. There is some really good info to be received here.
Thanks for your explanation!! (I get the syntax of the program, just the numbers are unknown to me how that works, but I will first study this before asking any questions about it. )
Really appreciate it!
Thanks for your explanation!! (I get the syntax of the program, just the numbers are unknown to me how that works, but I will first study this before asking any questions about it. )
Really appreciate it!
Please Log in or Create an account to join the conversation.
15 Aug 2017 13:26 #97509
by Roc
Replied by Roc on topic Connect 2 toolsetters to linuxcnc - new to this forum
You can find the g-code and system parameter reference here:
linuxcnc.org/docs/html/gcode/overview.ht...:numbered-parameters
Flow control instructions reference here:
linuxcnc.org/docs/html/gcode/o-code.html#cha:o-codes
and all docs here:
linuxcnc.org/docs/2.7/html/
linuxcnc.org/docs/html/gcode/overview.ht...:numbered-parameters
Flow control instructions reference here:
linuxcnc.org/docs/html/gcode/o-code.html#cha:o-codes
and all docs here:
linuxcnc.org/docs/2.7/html/
Please Log in or Create an account to join the conversation.
17 Aug 2017 12:50 #97620
by andypugh
You won't need any C++, something like this would be done in a G-code routine (It is quite hard to move the machine from C or C++ code, especially if the machine is in the middle of a G-code program and has its trajectory waypoints all pre-computed)
If you need any custom HAL components then you need something C-llike for the halcompile tool, here is a probe-related example used to operate two probes, but the reason for the component is to activate a probe on-demand rather than being caused by the fact that there are two probes) forum.linuxcnc.org/10-advanced-configura...in-for-probing#97553
Replied by andypugh on topic Connect 2 toolsetters to linuxcnc - new to this forum
Is something like this possible in linuxcnc. (I am not scared of the c++ programming needed.)
You won't need any C++, something like this would be done in a G-code routine (It is quite hard to move the machine from C or C++ code, especially if the machine is in the middle of a G-code program and has its trajectory waypoints all pre-computed)
If you need any custom HAL components then you need something C-llike for the halcompile tool, here is a probe-related example used to operate two probes, but the reason for the component is to activate a probe on-demand rather than being caused by the fact that there are two probes) forum.linuxcnc.org/10-advanced-configura...in-for-probing#97553
Please Log in or Create an account to join the conversation.
Time to create page: 0.092 seconds