585,898 active members*
4,937 visitors online*
Register for free
Login
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2011
    Posts
    23

    [VB-Script] Auto-Tool-Zero on M6 END

    Hi,
    I've been tinkering arround now for a few days but can't figure out how to to this. Also my VB skills are way too poor for that.

    I want my working cycle look like this:

    -Insert First Tool
    -Zero Axis on the working Plane including Z
    -Start the program (generated with vectric aspire)

    -Wait for M6Start command (on the M6start it drives over the ToolLength Sensor / Tool changing position)
    -don't change tool because I already isnerted the first
    - Press "Start "
    - Z-Axis lowers to find Offset of tool
    -Returns to workpiece and starts milling

    ->
    Next tool and M6 command
    Drive to changing position
    manually change tool
    Press start
    Auto Measure
    Return
    and so on

    But I keep getting problems with Offset etc,.
    And I also can't really figure out what would be the safest way of doing this?
    Has anyone got some ready to use scripts for this? or any advice?


    I actually use this to measure the tool length:
    Code:
    If GetOEMDRO (24) <>0 Then
    	SetOEMDRO(1216,GetOEMDRO(83))
            SetOEMDRO(1217,GetOEMDRO(84))
            Code "G0G53 Z" & GetOEMDRO(54)
    	While IsMoving()
    	Wend
    	code "g0 g53 x" & GetOEMDRO(1218)
    	While IsMoving()
    	Wend
    	code "g0 g53 y" & GetOEMDRO(1219)
    	While IsMoving()
    	Wend
    	code "g0 g53 z" & GetOEMDRO(1220)
    	While IsMoving()
    	Wend
    	code "g31 z-1000 f500"
    	While IsMoving()
    	Wend
    	code "g53 g0 z" & GetOEMDRO(85)+3
    	While IsMoving()
    	Wend
    	code "g31 z-1000 f50"
    	While IsMoving()
    	Wend
    	Z_Shift = GetOEMDRO (1221)
    	Axis_Pos = GetOEMDRO(85)
    	Tool_Offset = Axis_Pos - Z_Shift
    	Call setOEMDRO(42, Tool_Offset)
            Code "G0G53 Z" & GetOEMDRO(54)
            Code "G0G53 X" & GetOEMDRO(1216)
            Code "G0G53 Y" & GetOEMDRO(1217)
    Else
    	MsgBox "Keine Werkzeug-Nummer gewählt",0 
    End If
    Thanks,
    Max

  2. #2
    Join Date
    Mar 2003
    Posts
    35538
    The macro that comes with my screenset does most of that.
    I modified my Aspire post to remove the first M6, and tool length offsets (G43).
    I zero the Z axis first, and if the g-code is loaded, it will start automatically.
    It's based on the macros in this thread, but with a lot of safety features added to try to prevent crashes.

    http://www.cnczone.com/forums/mach_w...r_big-tex.html

    An early version of my macros is in post #184 in that thread.
    There are videos on my website showing it in operation.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Oct 2011
    Posts
    23
    Thats exactly what I was thinking while you postet it(removing first M6 and playing with the G40 and G43)
    How did you modifiy it to remove the first M6 and G43s

    Your screenset looks beatufiul btw, especially compared to the standard rainbow colour version.

    I only got one fixed sensor, no plate for zeroing it on the workpiece yet.

    I hope I manage to get your script adapted.

  4. #4
    Join Date
    Mar 2003
    Posts
    35538
    POST_NAME = "Mach3 2010 (inch) (*.nc)"

    FILE_EXTENSION = "nc"

    UNITS = "inches"

    DIRECT_OUTPUT = "Mach|Mach4.Document"

    SUBSTITUTE = "({)}"

    +------------------------------------------------
    + Line terminating characters
    +------------------------------------------------

    LINE_ENDING = "[13][10]"

    +------------------------------------------------
    + Block numbering
    +------------------------------------------------

    LINE_NUMBER_START = 0
    LINE_NUMBER_INCREMENT = 10
    LINE_NUMBER_MAXIMUM = 999999

    +================================================
    +
    + Formatting for variables
    +
    +================================================

    VAR LINE_NUMBER = [N|A|N|1.0]
    VAR SPINDLE_SPEED = [S|A|S|1.0]
    VAR FEED_RATE = [F|C|F|1.1]
    VAR X_POSITION = [X|A|X|1.4]
    VAR Y_POSITION = [Y|A|Y|1.4]
    VAR Z_POSITION = [Z|A|Z|1.4]
    VAR ARC_CENTRE_I_INC_POSITION = [I|A|I|1.4]
    VAR ARC_CENTRE_J_INC_POSITION = [J|A|J|1.4]
    VAR X_HOME_POSITION = [XH|A|X|1.4]
    VAR Y_HOME_POSITION = [YH|A|Y|1.4]
    VAR Z_HOME_POSITION = [ZH|A|Z|1.4]
    VAR SAFE_Z_HEIGHT = [SAFEZ|A|Z|1.4]

    +================================================
    +
    + Block definitions for toolpath output
    +
    +================================================

    +---------------------------------------------------
    + Commands output at the start of the file
    +---------------------------------------------------

    begin HEADER

    "[N] G00G20G17G90G40G49G80"
    "[N] G70G91.1"
    "[N] G94"
    "[N] (Info"
    "[N] ([TP_FILENAME] )"
    "[N] (File created: [DATE] - [TIME])"
    "[N] (for Mach3 from Vectric )"
    "[N] (Material Size)"
    "[N] (X=[XLENGTH], Y=[YLENGTH], Z=[ZLENGTH])"
    "[N] ([FILE_NOTES])"
    "[N] (Toolpaths used in this file"
    "[N] ([TOOLPATHS_OUTPUT])"
    "[N] (Tools used in this file: )"
    "[N] ([TOOLS_USED])"
    "[N] [S] M3"
    "[N] (Toolpath:- [TOOLPATH_NAME])"
    "[N] ([TOOLPATH_NOTES])"

    +---------------------------------------------------
    + Commands output for rapid moves
    +---------------------------------------------------

    begin RAPID_MOVE

    "[N] G00 [X] [Y] [Z]"


    +---------------------------------------------------
    + Commands output for the first feed rate move
    +---------------------------------------------------

    begin FIRST_FEED_MOVE

    "[N] G1 [X] [Y] [Z] [F]"


    +---------------------------------------------------
    + Commands output for feed rate moves
    +---------------------------------------------------

    begin FEED_MOVE

    "[N] G1 [X] [Y] [Z]"

    +---------------------------------------------------
    + Commands output for the first clockwise arc move
    +---------------------------------------------------

    begin FIRST_CW_ARC_MOVE

    "[N] G2 [X] [Y] [I] [J] [F]"

    +---------------------------------------------------
    + Commands output for clockwise arc move
    +---------------------------------------------------

    begin CW_ARC_MOVE

    "[N] G2 [X] [Y] [I] [J]"

    +---------------------------------------------------
    + Commands output for the first counterclockwise arc move
    +---------------------------------------------------

    begin FIRST_CCW_ARC_MOVE

    "[N] G3 [X] [Y] [I] [J] [F]"

    +---------------------------------------------------
    + Commands output for counterclockwise arc move
    +---------------------------------------------------

    begin CCW_ARC_MOVE

    "[N] G3 [X] [Y] [I] [J]"

    +---------------------------------------------------
    + Commands output at toolchange
    +---------------------------------------------------

    begin TOOLCHANGE

    "[N] M5"
    "[N] M6 T[T]"
    "[N] (Tool: [TOOLNAME])"

    +---------------------------------------------------
    + Commands output for a new segment - toolpath
    + with same toolnumber but maybe different feedrates
    +---------------------------------------------------

    begin NEW_SEGMENT

    "[N] [S] M3"
    "[N] ([TOOLPATH_NAME])"
    "[N] ([TOOLPATH_NOTES])"

    +---------------------------------------------------
    + Commands output at the end of the file
    +---------------------------------------------------

    begin FOOTER

    "[N] G00 [ZH]"
    "[N] M5"
    "[N] M30"
    %
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

Similar Threads

  1. Auto tool changer Drum type tool magazine.
    By maylin1105 in forum News Announcements
    Replies: 0
    Last Post: 02-18-2012, 09:44 AM
  2. Auto tool changer Armless type tool magazine.
    By maylin1105 in forum News Announcements
    Replies: 0
    Last Post: 02-16-2012, 03:27 AM
  3. Tool change script help
    By sully0400 in forum Uncategorised MetalWorking Machines
    Replies: 0
    Last Post: 04-20-2011, 11:40 PM
  4. Newbe: edit tool change script
    By jrslick22 in forum Screen Layouts, Post Processors & Misc
    Replies: 0
    Last Post: 03-08-2010, 09:16 PM

Posting Permissions

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