Thanks Thanks:  0
Likes Likes:  0
Needs Pictures Needs Pictures:  0
Picture(s) thanks Picture(s) thanks:  0
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Feb 2004
    Location
    Oxley, Brisbane
    Age
    79
    Posts
    3,041

    Default Strange problem with Z auto zero

    After initially working flawlessly my Z auto zero seems to have developed a strange and annoying eccentricity.

    When I first use the auto z height adjustment everything works perfectly. However, after a job has had its first run (or something like that) when I change a bit or just re-zero z it moves to the proper height, pauses for less than a second and then plunges 5mm or so before withdrawing to what it now claims (incorrectly) is z zero.

    This behaviour is not a good thing and I would like it to stop. Can anyone advise me what might be happening?

    Bob Willson
    Bob Willson
    The term 'grammar nazi' was invented to make people, who don't know their grammar, feel OK about being uneducated.

  2. # ADS
    Google Adsense Advertisement
    Join Date
    Always
    Location
    Advertising world
    Age
    2010
    Posts
    Many





     
  3. #2
    Join Date
    May 2003
    Location
    Perth WA
    Posts
    3,784

    Default

    Looks to me like your VB code is still active from the initial zeroing. There might be a loop in the code which is not ending properly. Make sure all your if, then statements close in the right sequence so that after zeroing or not zeroing the the script ends.
    Cheers,
    Rod

  4. #3
    Join Date
    Feb 2004
    Location
    Oxley, Brisbane
    Age
    79
    Posts
    3,041

    Default

    Thanks Rod
    The script I am using is below. I cannot see anything wrong with it but then I can't program.

    PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

    If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty

    DoOEMButton (1010) 'zero the Z axis so the probe move will start from here

    Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place

    Code "G31Z-40 F100" 'probing move, can set the feed rate here as well as how far to move

    While IsMoving() 'wait while it happens
    Wend
    ZProbePos = GetVar(2002) 'get the axact point the probe was hit

    Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun

    While IsMoving ()
    Wend

    Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness

    Code "G4 P0.25" 'Pause for Dro to update.

    Code "G0 Z20.0013" 'put the Z retract height you want here

    Code "(Z axis is now zeroed)" 'puts this message in the status bar
    Else
    Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
    Exit Sub
    End If


    It is a copy of Greolt's? script, so it should be good.

    Bob
    Bob Willson
    The term 'grammar nazi' was invented to make people, who don't know their grammar, feel OK about being uneducated.

  5. #4
    Join Date
    May 2005
    Location
    Cockatoo Vic
    Posts
    996

    Default

    The other thing I would suspect is that you are in a G91 modal state.


    That is an old script you are using and does not protect against that scenario.

    There are so many scripts to zero a tool floating around. Some good, some not so good.

    By far the best thing to do, is to study a few scripts and work out what they are doing and in what sequence, and then modify one to suit yourself.

    Here is what I currently use,

    CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
    CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
    CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
    PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

    If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
    DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
    Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place
    Code "G90 G31Z-20 F100" 'probing move, can set the feed rate here as well as how far to move
    While IsMoving() 'wait while it happens
    Wend
    ZProbePos = GetVar(2002) 'get the axact point the probe was hit
    Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
    While IsMoving ()
    Wend
    Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
    Sleep 200 'Pause for Dro to update.
    Code "G1 Z20 F800" 'put the Z retract height you want here
    While IsMoving ()
    Wend
    Code "(Z axis is now zeroed)" 'puts this message in the status bar
    Code "F" &CurrentFeed 'Returns to prior feed rate
    Else
    Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
    End If
    If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
    Code "G91"
    End If
    If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
    Code "G0"
    End If



    Greg

  6. #5
    Join Date
    May 2003
    Location
    Perth WA
    Posts
    3,784

    Default

    Hi Bob,
    Greg's script he just posted is much better than the one you are using. We learn more as we go along so the code evolves with this knowledge.
    Cheers,
    Rod

  7. #6
    Join Date
    Jan 2006
    Location
    Moss Vale NSW
    Age
    80
    Posts
    317

    Default

    Greg,

    Thanks for the update ... my one is a bit old as well! Bit like me!!

    On my original script, I added in some rodm speech and when I am demonstrating the machine to anyone they are a bit gobsmacked when it talks to me ... especially the bit where is says ... Zoot CNC thanks you for your attention ... or something equally as stupid.

    Alan
    4 out of 3 people have trouble with fractions.

  8. #7
    Join Date
    Feb 2004
    Location
    Oxley, Brisbane
    Age
    79
    Posts
    3,041

    Default

    Thanks Greg and also Rod

    If there are any ongoing problems then I will post them here.
    The script looks prettier so I am sure that it will be better too.
    Bob Willson
    The term 'grammar nazi' was invented to make people, who don't know their grammar, feel OK about being uneducated.

  9. #8
    Join Date
    Feb 2004
    Location
    Oxley, Brisbane
    Age
    79
    Posts
    3,041

    Default

    Quote Originally Posted by Greolt View Post
    The other thing I would suspect is that you are in a G91 modal state.

    Greg

    Hi Greg

    I had just finished the roadrunner using a VERY light cut of about 0.1 mm using a ball end cutter and I was changing the bit to go over the same path using a slightly deeper cut with a V cutter to check the machines repeatability

    I notice that the one of the first commands that roadrunner issues is G43 H5. Both these commands modify the offset length of the tool. Would that have anything to do with it?

    Bob
    Bob Willson
    The term 'grammar nazi' was invented to make people, who don't know their grammar, feel OK about being uneducated.

  10. #9
    Join Date
    Feb 2004
    Location
    Oxley, Brisbane
    Age
    79
    Posts
    3,041

    Default

    I have discovered what I think the problem is, and if so, then the program may need a little modification.

    I ran the road runner again and the zero tool worked perfectly.

    I then ran the same program again but with the X and Y scaled up 10 times and the Z scaled up 2 times. This caused the aberrant behaviour to repeat itself.

    Bob

    Edit: I forgot to say that I then manually changed the Z back to 1 and the problem went away.
    Bob Willson
    The term 'grammar nazi' was invented to make people, who don't know their grammar, feel OK about being uneducated.

  11. #10
    Join Date
    Feb 2008
    Location
    NOWRA
    Posts
    648

    Default

    If you are getting the G43 and H5 codes, it would be something to do with the tool height offsets. G43 is a negative offset for tooling and H5 is the offset. These codes might be automatically set using a tool table so when tool number 1 is called the offset is automatically called out.

    Hope you sort it out soon.
    Daniel

  12. #11
    Join Date
    May 2005
    Location
    Cockatoo Vic
    Posts
    996

    Default

    Bob

    I never use tool length compensation. I have neither an automatic tool changer, nor fixed length tooling, which as far as I know are the only reasons you would use it.

    Using G49 in the script should fix that.


    Also never use scaling. I have found in the past that it is not one of Mach's more thoroughly integrated features. Maybe it is better these days. I do anything like that in CAD/CAM.

    Using G50 in the script should fix that.

    You could add a line like this,

    Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place
    Code "G49 G50 G90"
    Code "G31Z-20 F100" 'probing move, can set the feed rate here as well as how far to move


    Greg

  13. #12
    Join Date
    Feb 2004
    Location
    Oxley, Brisbane
    Age
    79
    Posts
    3,041

    Default

    Thanks Greg

    I will give it a go tomorrow and see what happens.

    Bob
    Bob Willson
    The term 'grammar nazi' was invented to make people, who don't know their grammar, feel OK about being uneducated.

  14. #13
    Join Date
    Feb 2004
    Location
    Oxley, Brisbane
    Age
    79
    Posts
    3,041

    Default

    Thanks Greg

    I tried that and it works perfectly.

    Not wanting to strain the friendship, but is it possible to read the original states of those G codes and then return the program to whatever their values were before they were canceled?

    This code at the beginning of the script
    CurrentScale = GetOemDRO(61) 'Get the current scale to return to later
    CurrentScaleLED = GetOemLED(43) 'Get the current G49 state

    This code at the end of the script
    End If
    If CurrentScale = 0 Then 'if G49 was in effect before then return to it
    Code "G49"
    End If
    If CurrentScaleLED = 0 Then 'if Scaling was in effect before then return to it
    Code "G49" That doesn't look correct. I think that I just canceled the scaling again.
    End If


    Told you I can't program.

    Bob
    Bob Willson
    The term 'grammar nazi' was invented to make people, who don't know their grammar, feel OK about being uneducated.

  15. #14
    Join Date
    May 2005
    Location
    Cockatoo Vic
    Posts
    996

    Default

    Bob

    Resetting Z axis scale is fairly straight forward and here is an example of how you could do it;

    CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
    CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
    CurrentZscale = GetOEMDRO(61) 'Get Z scale
    CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
    PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO


    If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
    Code "G49 G90" 'cancel tool offset and set absolute coordinates
    Sleep 100
    DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
    Call SetOEMDRO (61,1) 'set Z scale to 1
    Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place
    Code "G31 Z-20 F100" 'probing move, can set the feed rate here as well as how far to move
    While IsMoving() 'wait while it happens
    Wend
    ZProbePos = GetVar(2002) 'get the axact point the probe was hit
    Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
    While IsMoving ()
    Wend
    Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
    Sleep 200 'Pause for Dro to update.
    Code "G1 Z20 F800" 'put the Z retract height you want here
    While IsMoving ()
    Wend
    Code "(Z axis is now zeroed)" 'puts this message in the status bar
    Code "F" &CurrentFeed 'Returns to prior feed rate
    Call SetOEMDRO (61, CurrentZscale) 'return Z scale factor
    Else
    Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
    End If
    If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
    Code "G91"
    End If
    If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
    Code "G0"
    End If





    Resetting tool length offset would need a bit of digging (for me at least)

    Do you use it? If not, then just make sure all values in the tool table are zero.

    If you do use it, I can do a bit of research on how we could allow for it in the script.

    Greg
    Last edited by Greolt; 30th August 2010 at 02:44 PM. Reason: Had G49 in the wrong place, now fixed

  16. #15
    Join Date
    Feb 2004
    Location
    Oxley, Brisbane
    Age
    79
    Posts
    3,041

    Default

    That is great. Thanks a lot for that Greg.

    I will test it all tomorrow.

    Bob

    Just noticed the question on the bottom. No I don't think I use that. I will definitely try not to.
    Bob Willson
    The term 'grammar nazi' was invented to make people, who don't know their grammar, feel OK about being uneducated.

Page 1 of 2 12 LastLast

Similar Threads

  1. Help with strange problem
    By glenn k in forum MOTOR VEHICLES
    Replies: 6
    Last Post: 29th August 2012, 11:11 AM
  2. Auto trimming
    By Wombat2 in forum UPHOLSTERY
    Replies: 2
    Last Post: 16th June 2010, 09:34 PM
  3. strange mill problem
    By weisyboy in forum SMALL TIMBER MILLING
    Replies: 13
    Last Post: 30th September 2009, 12:43 PM

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
  •