Scripting a Moveable Tool Setter in TNG

Results 1 to 14 of 14

Thread: Scripting a Moveable Tool Setter in TNG

  1. #1
    Member
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    60
    Downloads
    0
    Uploads
    0

    Default Scripting a Moveable Tool Setter in TNG

    Hi to all the users out there,

    I've long been using TNG, works great. My shortfall is that I'm not a script or code writer. Basic G-code, no problem, but getting a script going is my nemesis.

    I have a moveable tool setter, accurate, with a trigger point measured at 67.5mm from it's base. I wish to jog to close to it, place it under the tool, and activate a script that will jog it down, trigger it, stop, set the Z-axis to 67.5mm, then jog Z up to 100mm so I can pull out the tool setter.

    Probe set, high and low speed values set, switch click set, Z position set, the Measure function just does not do it. It goes down fast, triggers the switch, returns 2mm, goes down slow, triggers it again, returns back a bit to a height I cannot see where i was, then set's Z to 0. Does not help me, I want Z to be set to 67.5mm at triggering the setter on the slow measure, then go up to 100, for if I then remove the setter, the tool will be 100mm above the work surface.

    I tried using the G-code program; first line M59 P1, next line G09 Z67.50, next line G00 Z100.00, it works. When I run it, it waits for Input 1 to be triggered, the Z position immediately sets to 67.50, and it then goes up to 100.0. Great, but how do I get the Z-axis to jog down and wait for the input to be triggered before activating the G09 command? I cannot use for instance G01 Z-50.00 F100, hoping for it to jog downward and hit the setter switch to then stop and execute the G09 command, as it first want to complete the downward jog to Z-50.00 before it stops, waits for the probe to be triggered, then does the correct thing from there on. I sense I need some conditional O command....

    Any help out there with this issue?

    Thanks, Francois.

    Similar Threads:


  2. #2
    Member awpross's Avatar
    Join Date
    Jan 2022
    Posts
    107
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    As far as I know there is already an option to use movable tool setter for what you try to achive.

    In TNG settings -> offset is an option "use probe"
    If you disable this option you can set the 67.5 in "Size Z"

    If "Use Probe" is enabled, it will not use the current tool as reference but expects a probe as tool for measurement.
    So if you always use the movable tool setter, disable "use Probe"

    If this is not sattisfying your requirements, I may create a script for your special case.



  3. #3
    Member
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    60
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    Thanks awpross,

    I tried this, but the latest version of TNG does not work as advertised. I set all the values under Offset/Measure, i.e speed, low speed, switch click travel, including making the Z-size 67.5. Unselected Use Probe. Under the Probe setup, I only set the pin the tool setter was connected to. I can conform it works correctly in the IO status window. When I hit the Measure button on the left, it sure jogs down at speed, triggers, returns the switch click travel distance, comes down again at low speed, again hits the switch, but then jogs up slightly at low speed, then a bit further at high speed, and sets the z-value to 0, not to 67.5. So it works great, but does not set correctly. Bloody frustrating.

    Cheers, F.



  4. #4
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1304
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    Make sure "Use Probe" setting is not enabled. If it is then all values are taken from "Probe" and not from "Offset" .

    Last edited by PlanetCNC; 03-17-2022 at 05:11 AM.


  5. #5
    Member
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    60
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    Quote Originally Posted by PlanetCNC View Post
    Make sure "Use Probe" setting is not enabled. If it is then all values are taken from "Probe" and not from "Offset" .
    I have done this, as well as entered the Z value in the Probe side, or in the Offset side, or in both, but nothing makes sense. It jogs down at the set speed (400), retracts, again down at slow speed (100), retracts again slightly at slow speed (100), then retracts a lot at max Z speed (750), not set speed (400). The machine Z position then resets to 0, and the work sets to some value that makes absolutely no sense. It's not the set 67.5, it's not something that could make sense like half, or double or any sum of any set value.

    I can send you my settings zip file if you wish to validate my settings.

    Cheers, Francois.



  6. #6
    Member
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    60
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    Quote Originally Posted by awpross View Post
    As far as I know there is already an option to use movable tool setter for what you try to achive.

    In TNG settings -> offset is an option "use probe"
    If you disable this option you can set the 67.5 in "Size Z"

    If "Use Probe" is enabled, it will not use the current tool as reference but expects a probe as tool for measurement.
    So if you always use the movable tool setter, disable "use Probe"

    If this is not sattisfying your requirements, I may create a script for your special case.
    Could I kindly request that you perhaps put together a script for me, this would be highly appreciated.

    Cheers, Francois.



  7. #7
    Member awpross's Avatar
    Join Date
    Jan 2022
    Posts
    107
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    I can send you a modified script in a few hours.

    Meanwhile you can check if maybe different offsets colide with each other.

    For example may tool offset, coordinate system, axis offset and work offset all do something to change the actual work position.

    Are you using any of them or is just the work offset and maybee tool offset something you are using? If so.. is tool offset enabled? If not, this may also produce "funny" measured z heights.

    I personally use just the coordinate system as offset and have set the work offset as not set. But that depends on personal preference.



  8. #8
    Member Clyde_IT's Avatar
    Join Date
    Nov 2021
    Posts
    35
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    Quote Originally Posted by HobbyCAD View Post
    ... When I hit the Measure button on the left, it sure jogs down at speed, triggers, returns the switch click travel distance, comes down again at low speed, again hits the switch, but then jogs up slightly at low speed, then a bit further at high speed, and sets the z-value to 0, not to 67.5...
    Witch button you hit? Are you using "work position/measure height" and NOT "Tool offset/Measure Lenght"?

    L.



  9. #9
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1304
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    Please export your profile and send us .zip file.



  10. #10
    Member awpross's Avatar
    Join Date
    Jan 2022
    Posts
    107
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    You may use the attached G-Code which is based on the regular measure script. So it may produce the same behaviour but I have added several print commands to see where the Problem may be.
    You can see the results in output window.

    For comparing the values which are expected, you can manual jog down to the sensor until contact and note the machine and work coordinates. So I can compare the actual and the expected values.




    M73
    G08 G15 G90 G91.1 G90.2 G94
    M50P0
    M55P0
    M56P0
    M57P0
    M10P1

    (print,Used _workoff_size #<_workoff_size>)
    G65 P110 H2 E-1 Q0 R1 D10000 K#<_workoff_swdist> J#<_workoff_size> F#<_workoff_speed> I#<_workoff_speed_low>

    o<chk> if[NOTEXISTS[#<_return>] OR [#<_measure> EQ 0]]
    (msg,Measure Work Offset Measure error)
    M2
    o<chk> endif

    (print,Measured Pos #<_measure_z>)

    #<off> = #<_measure_z>
    o<chk> if[#<_tooloff> NE 0]
    #<off> = [#<off> - #<_tooloff_z>]
    (print,Applied Tool Offset #<off>)
    o<chk> endif

    #<off> = [#<off> - #<_coordsys_z>]
    (print,Applied Coord Offset #<off>)

    #<off> = [#<off> - #<_warp_offset>]
    (print,Applied Warp Offset #<off>)


    G92.1 Z#<off>



  11. #11
    Member
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    60
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    Quote Originally Posted by PlanetCNC View Post
    Please export your profile and send us .zip file.
    OK, will do. Do I send that to a specific e-mail?

    Thanks, Francois.

    - - - Updated - - -

    Quote Originally Posted by Clyde_IT View Post
    Witch button you hit? Are you using "work position/measure height" and NOT "Tool offset/Measure Lenght"?

    L.
    I hit the correct measure one, not the tool offset one.

    Cheers, Francois.



  12. #12
    Member
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    60
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    Quote Originally Posted by awpross View Post
    You may use the attached G-Code which is based on the regular measure script. So it may produce the same behaviour but I have added several print commands to see where the Problem may be.
    You can see the results in output window.

    For comparing the values which are expected, you can manual jog down to the sensor until contact and note the machine and work coordinates. So I can compare the actual and the expected values.




    M73
    G08 G15 G90 G91.1 G90.2 G94
    M50P0
    M55P0
    M56P0
    M57P0
    M10P1

    (print,Used _workoff_size #<_workoff_size>)
    G65 P110 H2 E-1 Q0 R1 D10000 K#<_workoff_swdist> J#<_workoff_size> F#<_workoff_speed> I#<_workoff_speed_low>

    o<chk> if[NOTEXISTS[#<_return>] OR [#<_measure> EQ 0]]
    (msg,Measure Work Offset Measure error)
    M2
    o<chk> endif

    (print,Measured Pos #<_measure_z>)

    #<off> = #<_measure_z>
    o<chk> if[#<_tooloff> NE 0]
    #<off> = [#<off> - #<_tooloff_z>]
    (print,Applied Tool Offset #<off>)
    o<chk> endif

    #<off> = [#<off> - #<_coordsys_z>]
    (print,Applied Coord Offset #<off>)

    #<off> = [#<off> - #<_warp_offset>]
    (print,Applied Warp Offset #<off>)


    G92.1 Z#<off>
    Sir, many thanks for this. I shall run and check this this in the next days, I have since discovered I may have a noisy input somewhere. Since 2 probe input pins have been enabled for the first time a couple of days ago, one wired to a tool setter, the other wired to a scanning touch probe, I ran a small job and the machine twice stopped in the middle of the job, shut down the spindle and other outputs. This has never happened before in the 7 years that I have been running this Mk3 card, or in the last years that I have been using TNG. Seems there is a spurious input to the enabled probe input lines, as the machine acts as if a limit switch was hit, or an e-stop activated. Without resetting anything, one can restart the job, but it happened again. I removed the assignment of inputs to the Probe settings box, and today did a large job, not a problem when without the probe inputs enabled. I will now first place some 10nF ceramic caps between ground and each new input pin to take care of any spikes, check if the machine behaves, then change the settings back to enabling the probe inputs to see if it still randomly stops. After that, I will check your script by running the G-Code you have sent.

    Many thanks for your help.

    BR,

    Francois



  13. #13
    Member PlanetCNC's Avatar
    Join Date
    Mar 2017
    Location
    Slovenia
    Posts
    1304
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    You can enable Counters under File/Settings/User Interface -> Utilities
    This will scan and print any activation of inputs of controller. This tool was made for exactly such reasons, in order to find any "noisy" inputs that may cause random machine stopping.

    Make sure that Utilities panel is enabled under File/View/Panel/Utilities



  14. #14
    Member awpross's Avatar
    Join Date
    Jan 2022
    Posts
    107
    Downloads
    0
    Uploads
    0

    Default Re: Scripting a Moveable Tool Setter in TNG

    One of my Touch probes is very sensitive to vibrations. Therefore i have included a line in the probing script which sets the input pin for the second probe only, if it is used and remove the input after use of the probe.

    Another problem I had a few months ago was cooling water and oil in one of the limit switches.
    Remember that the controller does not distinguish between the limit and the probing pins and stops on contact of any of them while probing or while hardware limit is enabled. So check the probes and limit switches in case of issues.



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Scripting a  Moveable Tool Setter in TNG

Scripting a  Moveable Tool Setter in TNG