- Posts: 572
- Thank you received: 115
Work with probe
- JohnnyCNC
- Offline
- Platinum Member
-
Less
More
3 years 3 months ago #275054
by JohnnyCNC
Ig using G54 then coordinate_system = 1, G55 = 2, etc. With this system you can use 1-8 because I stole G59.3 (9) to hold the tool-setter trip point.
G10 L2 P#<coordinate_system> Z[#[4000+#<coordinate_system>]+#5063]
I had to read the documentation a bunch of times to get through this.
Something that helped me a lot. Start LinuxCNC from the command line and you will see output of those print statements. BUT, keep in mind that those PRINT statements will output twice. Once when the file is first read and again when the code is executed. During the first pass when the file is just being read that output value will be useless. That behavior really threw me off track when I first started this.
Replied by JohnnyCNC on topic Work with probe
For that I first measure the tool-setter trip point by placing the nose of the spindle just above the toolsetter. Then run measure_toolsetter_inch.ngc. This will switch to G59.3, probe the tool-setter and set that position in G59.3 to zero. The when the M6 Remap code is called, if the tool length in the tool table is zero the tool will be measured by probing the tool-setter with the tool. The current Z coordinate is then set with the length just measured and the value stored in #4001 (if using G54).Hi John,
It does. At the moment it's setting the tool lengths that has me perplexed as I said in the other posting.
I'll get there.
Ig using G54 then coordinate_system = 1, G55 = 2, etc. With this system you can use 1-8 because I stole G59.3 (9) to hold the tool-setter trip point.
G10 L2 P#<coordinate_system> Z[#[4000+#<coordinate_system>]+#5063]
I had to read the documentation a bunch of times to get through this.
Something that helped me a lot. Start LinuxCNC from the command line and you will see output of those print statements. BUT, keep in mind that those PRINT statements will output twice. Once when the file is first read and again when the code is executed. During the first pass when the file is just being read that output value will be useless. That behavior really threw me off track when I first started this.
Please Log in or Create an account to join the conversation.
- jcdammeyer
- Offline
- Senior Member
-
Less
More
- Posts: 73
- Thank you received: 8
3 years 3 months ago - 3 years 3 months ago #275055
by jcdammeyer
Replied by jcdammeyer on topic Work with probe
Thanks. I'll try it like that. Hadn't thought of using the G59.3 as the tool setter trip point.
Edit: And I have to figure out where to call the probe_z_minus_wco.ngc.
Edit: And I have to figure out where to call the probe_z_minus_wco.ngc.
Last edit: 3 years 3 months ago by jcdammeyer.
Please Log in or Create an account to join the conversation.
- JohnnyCNC
- Offline
- Platinum Member
-
Less
More
- Posts: 572
- Thank you received: 115
3 years 3 months ago #275073
by JohnnyCNC
Replied by JohnnyCNC on topic Work with probe
Which UI are you using? I think you just need to find what code is being executed when the probe Z button is pressed and that add code to save the value to #4001. That is where I'm running into the problem with QTDragon_HD. In QTDragon is calling probe_z_minus_wco but in QTDragon_HD it is calling Python code. I haven't figured out how to save the value to #4001 from within Python code yet.
Please Log in or Create an account to join the conversation.
- jcdammeyer
- Offline
- Senior Member
-
Less
More
- Posts: 73
- Thank you received: 8
3 years 3 months ago - 3 years 3 months ago #275081
by jcdammeyer
Replied by jcdammeyer on topic Work with probe
I'm running AXIS. Of interest is the Down Button
The flow is as follows:
Iniide my_mill.ini is the gladevcp program runing psng.glade which is the tab with the buttons and information display.
# begin Touch Probe
EMBED_TAB_NAME=PSNG
EMBED_TAB_COMMAND=gladevcp -c probe -x {XID} -u psng/python -H psng/psng.hal psng/psng.glade
# end Touch Probe
When the down button is clicked the object
<object class="GtkButton" id="btn_probe_table">
has a signal
<signal name="released" handler="on_btn_probe_table_released" swapped="no"/>
The program called when the down button is activated is tool_measurement.py which has this object and the signal.
# Down probe to table for measuring it and use for calculate tool setter height and can set G10 L20 Z0 if you tick auto zero
@ProbeScreenBase.ensure_errors_dismissed
def on_btn_probe_table_released(self, gtkbutton, data=None):
# Start psng_probe_table.ngc
if self.ocode("o<psng_probe_table> call") == -1:
return
a = self.probed_position_with_offsets()
self.add_history(gtkbutton.get_tooltip_text(), "Z", z=a[2])
self.set_zerro("Z", 0, 0, a[2])
From there the first of a few g-code programs are called the first being
psng_probe_table.ngc
This calls
_psng_probe_z.ngc with max distance to probe. When it returns without error I suspect here the line could be inserted after setting up the other parameters.
#[4000 + [#5220]] = [#<z_minus_probed> + #<workspace_z> - #<_ini[PROBE]LENGTH>] (Added by JHK)
In turn _psng_probe_z.ngc calls _psng_probe.ngc with the Z axis [3] specified and _psng_probe.ngc is then the generic touch and retouch code doing the final
O22 else if [#<search_axis> EQ 3]
; Z Axis
G38.3 Z[#<_hal[probe.ps_probe_latch]>*2*#<search_direction>]
O22 endif
So the write to 4000+ could be done there instead.
John
The flow is as follows:
Iniide my_mill.ini is the gladevcp program runing psng.glade which is the tab with the buttons and information display.
# begin Touch Probe
EMBED_TAB_NAME=PSNG
EMBED_TAB_COMMAND=gladevcp -c probe -x {XID} -u psng/python -H psng/psng.hal psng/psng.glade
# end Touch Probe
When the down button is clicked the object
<object class="GtkButton" id="btn_probe_table">
has a signal
<signal name="released" handler="on_btn_probe_table_released" swapped="no"/>
The program called when the down button is activated is tool_measurement.py which has this object and the signal.
# Down probe to table for measuring it and use for calculate tool setter height and can set G10 L20 Z0 if you tick auto zero
@ProbeScreenBase.ensure_errors_dismissed
def on_btn_probe_table_released(self, gtkbutton, data=None):
# Start psng_probe_table.ngc
if self.ocode("o<psng_probe_table> call") == -1:
return
a = self.probed_position_with_offsets()
self.add_history(gtkbutton.get_tooltip_text(), "Z", z=a[2])
self.set_zerro("Z", 0, 0, a[2])
From there the first of a few g-code programs are called the first being
psng_probe_table.ngc
This calls
_psng_probe_z.ngc with max distance to probe. When it returns without error I suspect here the line could be inserted after setting up the other parameters.
#[4000 + [#5220]] = [#<z_minus_probed> + #<workspace_z> - #<_ini[PROBE]LENGTH>] (Added by JHK)
In turn _psng_probe_z.ngc calls _psng_probe.ngc with the Z axis [3] specified and _psng_probe.ngc is then the generic touch and retouch code doing the final
O22 else if [#<search_axis> EQ 3]
; Z Axis
G38.3 Z[#<_hal[probe.ps_probe_latch]>*2*#<search_direction>]
O22 endif
So the write to 4000+ could be done there instead.
John
Last edit: 3 years 3 months ago by jcdammeyer. Reason: Add bold,italics to key file or object names, Fix which file name is called.
Please Log in or Create an account to join the conversation.
- JohnnyCNC
- Offline
- Platinum Member
-
Less
More
- Posts: 572
- Thank you received: 115
3 years 3 months ago #275110
by JohnnyCNC
Replied by JohnnyCNC on topic Work with probe
Well, I've made some progress. I am able to update #400x from within Python but I also noticed a latency excursion. I think I'll need to commit to my new hardware before I can finish this upgrade to LCNC 2.9 running on Bookworm.
Please Log in or Create an account to join the conversation.
- jcdammeyer
- Offline
- Senior Member
-
Less
More
- Posts: 73
- Thank you received: 8
3 years 3 months ago #275113
by jcdammeyer
Replied by jcdammeyer on topic Work with probe
What was the code to update #400x from within python and where did you do that?
Please Log in or Create an account to join the conversation.
Time to create page: 0.246 seconds