4th axis touch probing - Page 5


Page 5 of 7 FirstFirst ... 234567 LastLast
Results 81 to 100 of 130

Thread: 4th axis touch probing

  1. #81
    Member
    Join Date
    Dec 2009
    Location
    Australia
    Posts
    166
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    I did not add a 2.5d surface probe routine however I recently needed this function my self so as a quick work around I did build a routine to do this which is not currently in the current macro files
    I built this routine probably quite different from other probe routines in that it requires you to supply a list of points to probe.
    Quite often when you need to do some milling on a large object but only on a small area of it ,you do not need to probe the whole object just the specific area that requires milling.
    So my approach was to first probe the boundaries of said object load this data into mastercam and in mastercam create an array of points over the area that needs to be machined this is then loaded into Mach3 the points are then probed.
    This method suits me well because I have full control over the exact area that I need to machine.
    Once the points are probed I then load the data back into Mastercam and create the 3d surface that I need to work on.

    To be more specific on the particular job I was doing I needed to engrave some Snooker sticks for some friends I only needed to create the surface on the rounded flat face that I was projecting the engraving text on.
    If you want 2.5d probing there is probably better choices out there it depends entirely on your needs most things I machine come from some other machines i.e engine parts and such and it is quicker to measure these parts and draw them as solids in Mastercam.



  2. #82
    Member ubergeekseven's Avatar
    Join Date
    Mar 2017
    Location
    United States
    Posts
    250
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Now that I think about this, I may be able to use an optical switch and then 3d print a disc with a slit. I have one more port available for input. I guess having it would allow for making something like a tombstone at some point. That could be useful to me. That would simplify setup as well.

    Sent from my SM-N950U using Tapatalk



  3. #83
    Member ubergeekseven's Avatar
    Join Date
    Mar 2017
    Location
    United States
    Posts
    250
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Quote Originally Posted by wmgeorge View Post
    I do not need 4th axis probing but I assume it will do standard flat table object scanning? I am not looking for "free", looking for something that works and I am willing to make a donation or purchase whatever does the job. Thanks for the feedback and I took a brief look at the files and I am impressed by the amount of work you have put into this!!
    I saw these years ago and up until this week has no ability to use it. Send like it's what you want.


    Auto Probing With G-Code Ripper | Scorch Works Blog
    CNC Probe Guide – Autoleveller



    Sent from my SM-N950U using Tapatalk



  4. #84
    Member ubergeekseven's Avatar
    Join Date
    Mar 2017
    Location
    United States
    Posts
    250
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Also, haven't tried this, but doesn't the probing wizard do this in Mach? Again, haven't tried.

    Sent from my SM-N950U using Tapatalk



  5. #85
    Member
    Join Date
    Dec 2009
    Location
    Australia
    Posts
    166
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    The A axis should only require 1 rotation to complete the job but if the object is complex and has protruding parts for instance the knight from a chess set (Horse) with ears neck nose excetera
    It is easy to assume the wrong method to probe it i.e the distance between points in the x or y how many degrees of rotation do you want ie every 1 degree or 0.1 degrees or 5 degrees these probes can be quick or take take a real long time to complete you then have to consider how you are going to put a surface on the point cloud'
    If the probe failed for some reason i.e sticky probe switch or bad connection computer crash Mach3 crash you want to be able to quickly return to where you started or ended to continue the probe
    I would have to say it is absolutely necessary to have accurate homing on all axis.



  6. #86
    Member ubergeekseven's Avatar
    Join Date
    Mar 2017
    Location
    United States
    Posts
    250
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Ok. I'll have to work out homing.i can easily create a mesh on any number of programs. That's one thing I'm actually good at.

    I found some posts from a while back talking about a guy named Stirling that had a 2.5 and 3d probing macro. Can't find it though. Found the posts, no macro.

    Sent from my SM-N950U using Tapatalk



  7. #87
    Member ubergeekseven's Avatar
    Join Date
    Mar 2017
    Location
    United States
    Posts
    250
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Just saw you replied to this now. It does make sense that r1 is redundant because the BOB has a 1.2K on it. I could remove it. I was so frustrated with getting it working before and now that it is working, I can actually look at it without any need to do something in the back of my mind. I did order n channel fets when I could not get it working at first. I may just try that one out to try it, now that I have a working one.

    thanks for help along the way too!



  8. #88
    Member ubergeekseven's Avatar
    Join Date
    Mar 2017
    Location
    United States
    Posts
    250
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    I have not tested any of the probing macros from anything yet, but I am compiling a list of what is out there. The "squirell probes" forum location is here https://www.cnczone.com/forums/mach-...les-angle.html
    I have downloaded it, but I use mach2010 screens now and this is for the standard screens. It would take some time to add it to mach2010, but when I get a chance, I will try and do it.

    The next big thing is creating a homing setup for my 4th. Once that is working, then doing the modifications after testing with the default screenset will be more appropriate.



  9. #89
    Member
    Join Date
    Sep 2005
    Location
    United States
    Posts
    1740
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Well I tried the Scan Wizard from Mach3 yesterday. What a joke.
    I placed the very small object on a piece of styrofoam stuck down with double faced tape

    .Learned from trial and error that scan starts lower left corner of the table by the object. Zero for Z is on the table or foam in this case. Z travel height is distance from table to above your object say .5 inch or so. So probe distance is that plus the height of your object, or how far the probe will go everything looking for a trip point. That must have a - (minus) in front of that number. Step over X and Y is the resolution you want .1 and .1 will be 1/10 of a inch or mm. Feed rate I set real low like at 3. It takes hours to do even a small scan.

    Make sure your computer does not go to sleep or have any power saving features and is not connected online. I got 3/4 done and it faulted out on a "Soft Limit" error??? I do not even have that enabled!!

    Big issue it does NOT always ask for a file name or make a file!! You can not save the setup screen from above, so each time you want to try.... you need to enter All the info again. The Wizard looks like someone slapped it together and said, good enough they will figure it out.

    It did make a XYZ text file that could be read with notepad but it lacked information that would let it be converted into a Mesh and exported as a STL. I am assuming if the program had not of crashed the file might have worked.

    1000x750 Workbee CNC - Mach4 - PMDX USB - Windows 10 Pro


  10. #90
    Member
    Join Date
    Dec 2009
    Location
    Australia
    Posts
    166
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Well in all the Testing I have done with Mach3 G31 probing can be a real pain and quite problem matic
    One thing I do know for sure is Mach3 does not respect the soft limit settings in a G31 move
    so if the probe point exceeds your soft limits it still either continues the move and crash the CNC into a hard stop or perform some other unknown move
    That is why I have spent so much time on the routines I have built and whilst they are fairly probe safe I certainly could not guarantee it.



  11. #91
    Member
    Join Date
    Sep 2005
    Location
    United States
    Posts
    1740
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Well I have my Kinect scanner up and running and with the "free" software. So far I am in the learning curve mode, but from what I can see right now the probe may be the only good way to digitize. Give me some more time.... but its seems to be more for gamers and home remodel people;

    1000x750 Workbee CNC - Mach4 - PMDX USB - Windows 10 Pro


  12. #92
    Member ubergeekseven's Avatar
    Join Date
    Mar 2017
    Location
    United States
    Posts
    250
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Quote Originally Posted by dharmic View Post
    Do you have a stylus type touch probe? I made one using the good old "3 pairs of bearing balls" setup, and it's changed my life.

    Anyroad, I don't have the code in front of me but basically I manually position the tip near the side of the calibration dowel facing me (the 4th runs across the machine as I look at it) and with the tip eyeballed to about centre height.

    The macro runs:

    Incremental mode

    Find the front - rough first, back off, come in again slow. Something like this:
    G31 Y30 F100
    G01 Y-1
    G31 Y2 F30

    Store the Y position (from the DRO)

    Hop the Z up, rapid to the other side of the dowel and come down again to the same height we were at the front.

    Repeat the two tap process to find the Y position of the back of the dowel.

    Ycentre = (Yfront + Yrear)/2

    Hop the Z up, move to Ycentre (absolute position, not differential for this move).

    G31 the Z down to touch off the top of the dowel at the centre.

    Your Z centreline is Ztop - (Yrear-Yfront)/2.

    Set your work offsets accordingly and the cycle is done.

    The Z part is a bit pointless if you don't have pre-loaded tools in holders with all the length offsets programmed in. I did it once, then turned up a round bar of about 40mm ali which is as long as the centre height of the 4th. Pop my tool height probe on top and I can set tool height as usual, but now to the centre height of the 4th.

    Sorry, not near a computer with the macros on it and this may not be much good to you if you don't have a touch probe. But hopefully it gives you an idea.
    After searching again for a probing routine for my rotary axis,I can only find this thread that I started on Google. I have a functioning probe now and saw that you said you have a routine. Would you be willing to post that routine on here? I would appreciate it and I'm sure others would as well.

    Sent from my SM-N950U using Tapatalk



  13. #93
    Member dharmic's Avatar
    Join Date
    May 2015
    Location
    Australia
    Posts
    1422
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Yeah, next time I'm near the machine I'll have a look.



  14. #94
    Member dharmic's Avatar
    Join Date
    May 2015
    Location
    Australia
    Posts
    1422
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    So, turns out someone is a filthy liar. I never created a macro for the 4th, just ran it hand-entered via the MDI.

    What I DO have is a macro I wrote for finding the centre of a hole:

    Code:
    'Simon's Hole Centre Finder
    'NB - this doesn't move Z so triple check for obstacles.
    
    
    ' Keeping these around in case I want to extend this later
    'XCurrent = GetOemDro(800)
    'YCurrent = GetOemDro(801)
    'ZCurrent = GetOemDro(802)    
    'GageH = GetOEMDRO(1001)    'OEMDRO(1001)=Gage Block Height
    
    
    ' Speeds
    fast = 1000
    slow = 50
    
    
    ' Get the current feed rate so we can restore it at the end
    FeedCurrent = GetOemDRO(818)
    
    
    ' Find north and south edges
    north = Approach(1,300, fast, slow)
    south = Approach(1, -300, fast, slow)
    
    
    ' The north/south centre is between those two.
    ymid =(north+south)/2.0
    
    
    ' Go to the middle.
    Code "G00Y"&ymid
    
    
    ' Find east and west, go to the middle again
    east = Approach(0,300, fast,slow)
    west = Approach(0,-300, fast,slow)
    xmid = (east+west)/2.0
    Code "G00X"&xmid
    
    
    ' We're now in the centre of the hole!
    
    
    ' Restore feedrate and we're done
    SetOemDRO(818,FeedCurrent)  
     
    ' Function approaches a probe point quickly, backs off and comes in again slower (for better accuracy)
    ' nAxis:         0 for X axis, 1 for Y axis, anything else for Z
    ' nMaxAndDir:     maximum distance to travel looking for probe trigger. 
    '                Sign of this parameter determines direction
    ' nFast:        Fast feed rate
    ' nSlow:        Slow approach feed rate
    ' return value:    The ordinate along the axis at which the probe triggered.
    Function Approach (nAxis As Integer, nMaxAndDir As Double, ByVal nFast As Integer, ByVal nSlow As Integer) As Double
    
    
    ' Work out the axis and target ordinate of maximum searching travel
    Select Case nAxis
        Case 0
        sAxis = "X"
        t = GetOemDro(800) + nMaxAndDir
    Case 1
        sAxis = "Y"
        t = GetOemDro(801) + nMaxAndDir
    case Else 
        sAxis = "Z"
        t = GetOemDro(802) + nMaxAndDir
    End Select
    
    
    ' Work out the direction
    nDir = (nMaxAndDir/Abs(nMaxAndDir))
    
    
    ' Make fast approach
    
    
    ' Send the move command
    Code "G31 F" & nFast &" " & sAxis &t
    
    
    ' Wait to get there
    While IsMoving()
    Sleep(10)
    Wend
    
    
    ' The DRO gives us the position at which we stopped
    rVal = GetOemDro(800 + nAxis)
    t = rVal - nDir
    
    
    ' back off
    Code "G00 " &sAxis &t    
    t = rVal + nDir
    
    
    ' slow approach now
    Code "G31 F" & nSlow & " " & sAxis & t    ' slow approach
    While IsMoving()
    Sleep(10)
    Wend
    rVal = GetOemDro(800 + nAxis)
    
    
    ' back off the overshoot
    t = rVal - nDir
    Code "G00 " &sAxis &t    ' back off
    
    
    ' return the new position
    Approach = rVal
    End function
    Now, if you replaced everything from ' Find north and south edges to ' We're now in the centre of the hole!" with calls to Approach following the logic in my first post, I reckon you'd be in about the right place. Untested but this should be close to it assuming the rotary axis runs along X:
    Code:
    YCurrent = GetOemDro(801)
    ZCurrent = GetOemDro(802)
    
    ' Hit the front (-ve Y) side
    south = Approach(1, 200, fast, slow)
    
    ' Hop up and over the rod
    Code "G00 Z"  & (zCurrent + 25)
    Code "G00 Y" & (yCurrent + 50)
    Code "G00 Z"  & zCurrent
    
    ' Come back to find the north side
    north = Approach(1, -200, fast, slow)
    
    ' our Y centre is between north and south
    radius = (north + south) / 2.0
    
    ' set the Y position, we're currently at +ve radius
    SetOemDRO(801,radius)
     
    ' Now hop up and over the centre
    Code "G00 Z" & (zCurrent + 25)
    Code "G00 Y0"
    
    ' Find the top of the bar
    Approach (2, -25, fast / 10, slow)
    
    ' And set Z based on us being one radius above the centreline
    SetOemDRO(802, radius)
    
    ' Back off and we're done
    Code "G00 Z" (radius + 5)
    Note this will need you to be working low enough on the rod mounted in the 4th that your probe triggers at the widest point.

    Hope it helps.



  15. #95
    Member ubergeekseven's Avatar
    Join Date
    Mar 2017
    Location
    United States
    Posts
    250
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Quote Originally Posted by dharmic View Post
    So, turns out someone is a filthy liar. I never created a macro for the 4th, just ran it hand-entered via the MDI.

    What I DO have is a macro I wrote for finding the centre of a hole:

    Code:
    'Simon's Hole Centre Finder
    'NB - this doesn't move Z so triple check for obstacles.
    
    
    ' Keeping these around in case I want to extend this later
    'XCurrent = GetOemDro(800)
    'YCurrent = GetOemDro(801)
    'ZCurrent = GetOemDro(802)    
    'GageH = GetOEMDRO(1001)    'OEMDRO(1001)=Gage Block Height
    
    
    ' Speeds
    fast = 1000
    slow = 50
    
    
    ' Get the current feed rate so we can restore it at the end
    FeedCurrent = GetOemDRO(818)
    
    
    ' Find north and south edges
    north = Approach(1,300, fast, slow)
    south = Approach(1, -300, fast, slow)
    
    
    ' The north/south centre is between those two.
    ymid =(north+south)/2.0
    
    
    ' Go to the middle.
    Code "G00Y"&ymid
    
    
    ' Find east and west, go to the middle again
    east = Approach(0,300, fast,slow)
    west = Approach(0,-300, fast,slow)
    xmid = (east+west)/2.0
    Code "G00X"&xmid
    
    
    ' We're now in the centre of the hole!
    
    
    ' Restore feedrate and we're done
    SetOemDRO(818,FeedCurrent)  
     
    ' Function approaches a probe point quickly, backs off and comes in again slower (for better accuracy)
    ' nAxis:         0 for X axis, 1 for Y axis, anything else for Z
    ' nMaxAndDir:     maximum distance to travel looking for probe trigger. 
    '                Sign of this parameter determines direction
    ' nFast:        Fast feed rate
    ' nSlow:        Slow approach feed rate
    ' return value:    The ordinate along the axis at which the probe triggered.
    Function Approach (nAxis As Integer, nMaxAndDir As Double, ByVal nFast As Integer, ByVal nSlow As Integer) As Double
    
    
    ' Work out the axis and target ordinate of maximum searching travel
    Select Case nAxis
        Case 0
        sAxis = "X"
        t = GetOemDro(800) + nMaxAndDir
    Case 1
        sAxis = "Y"
        t = GetOemDro(801) + nMaxAndDir
    case Else 
        sAxis = "Z"
        t = GetOemDro(802) + nMaxAndDir
    End Select
    
    
    ' Work out the direction
    nDir = (nMaxAndDir/Abs(nMaxAndDir))
    
    
    ' Make fast approach
    
    
    ' Send the move command
    Code "G31 F" & nFast &" " & sAxis &t
    
    
    ' Wait to get there
    While IsMoving()
    Sleep(10)
    Wend
    
    
    ' The DRO gives us the position at which we stopped
    rVal = GetOemDro(800 + nAxis)
    t = rVal - nDir
    
    
    ' back off
    Code "G00 " &sAxis &t    
    t = rVal + nDir
    
    
    ' slow approach now
    Code "G31 F" & nSlow & " " & sAxis & t    ' slow approach
    While IsMoving()
    Sleep(10)
    Wend
    rVal = GetOemDro(800 + nAxis)
    
    
    ' back off the overshoot
    t = rVal - nDir
    Code "G00 " &sAxis &t    ' back off
    
    
    ' return the new position
    Approach = rVal
    End function
    Now, if you replaced everything from ' Find north and south edges to ' We're now in the centre of the hole!" with calls to Approach following the logic in my first post, I reckon you'd be in about the right place. Untested but this should be close to it assuming the rotary axis runs along X:
    Code:
    YCurrent = GetOemDro(801)
    ZCurrent = GetOemDro(802)
    
    ' Hit the front (-ve Y) side
    south = Approach(1, 200, fast, slow)
    
    ' Hop up and over the rod
    Code "G00 Z"  & (zCurrent + 25)
    Code "G00 Y" & (yCurrent + 50)
    Code "G00 Z"  & zCurrent
    
    ' Come back to find the north side
    north = Approach(1, -200, fast, slow)
    
    ' our Y centre is between north and south
    radius = (north + south) / 2.0
    
    ' set the Y position, we're currently at +ve radius
    SetOemDRO(801,radius)
     
    ' Now hop up and over the centre
    Code "G00 Z" & (zCurrent + 25)
    Code "G00 Y0"
    
    ' Find the top of the bar
    Approach (2, -25, fast / 10, slow)
    
    ' And set Z based on us being one radius above the centreline
    SetOemDRO(802, radius)
    
    ' Back off and we're done
    Code "G00 Z" (radius + 5)
    Note this will need you to be working low enough on the rod mounted in the 4th that your probe triggers at the widest point.

    Hope it helps.
    Thank you. I'll try it out. One thing I was thinking through was how to make sure that the widest parts are touched. Because the tip of the probe is spherical as well.
    I thought about roughly setting the widest part of the probe below the widest of the dowel. Touch, store, move up slightly, repeat until the number started to fall. Return to the highest measurements location and touch to verify. Then move to the other side at the measured highest from the previous function and touch. Then I would have a known center on y. Move up and center, touch for z and now I have actual center of the rotary.
    Hopefully I can sit down for a few hours and do some testing. Just not familiar enough with everything, but I know I can program it eventually. Just have to get familiar with all the dro calls and the formatting/syntax. If it were in c++ I would have it done by now. I'm assuming since Mach 3 is essentially dead, so is the language. Haven't even looked at the Mach 4 side of it.

    Sent from my SM-N950U using Tapatalk



  16. #96
    Member dharmic's Avatar
    Join Date
    May 2015
    Location
    Australia
    Posts
    1422
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    I was thinking about that too. I have the same issue. It occurred to me that regardless of the contact height, front and back will be symmetrical so getting bang on the widest part is not critical there. Only for getting the Z height of the zero point. One way to deal with this is to touch off using a rod of known thickness mounted in the 4th chuck. You could hard code it in the last SetOemDRO(802) instead of using the calculated radius, and you'd be sorted. Either hard code it or use a pop-up asking for a value.

    The language in the macro space for Mach3 is Visual Basic for Applications so it's not completely dead. And it's pretty simple to pick up, hardest part is the Mach3 specific stuff but there are a couple documents floating around out there which document the API half decently.



  17. #97
    Member ubergeekseven's Avatar
    Join Date
    Mar 2017
    Location
    United States
    Posts
    250
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Quote Originally Posted by dharmic View Post
    I was thinking about that too. I have the same issue. It occurred to me that regardless of the contact height, front and back will be symmetrical so getting bang on the widest part is not critical there. Only for getting the Z height of the zero point. One way to deal with this is to touch off using a rod of known thickness mounted in the 4th chuck. You could hard code it in the last SetOemDRO(802) instead of using the calculated radius, and you'd be sorted. Either hard code it or use a pop-up asking for a value.

    The language in the macro space for Mach3 is Visual Basic for Applications so it's not completely dead. And it's pretty simple to pick up, hardest part is the Mach3 specific stuff but there are a couple documents floating around out there which document the API half decently.
    I have the programming document from the Mach 3 site. I will search for others. I'll try and add links here if I find them.
    I forgot that it's VB. Never used visual basic, only basic, 20 or so years ago. But the programming shouldn't be an issue once I can get the time. Wish I could simulate the output and tweak it on the real machine.

    Sent from my SM-N950U using Tapatalk



  18. #98
    Member dharmic's Avatar
    Join Date
    May 2015
    Location
    Australia
    Posts
    1422
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Sounds like you have what you need (apart from time) to crack on with it. Have fun!



  19. #99
    Member dharmic's Avatar
    Join Date
    May 2015
    Location
    Australia
    Posts
    1422
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Okayyy

    To save you from busting probe tips (I use sacrificial carbon fibre rod and managed to ping 3 of them getting this right)...

    Code:
    'Simon's 4th Centre Finder
    
    
    rodDiam = InputBox("Make sure Z=0 is at safe move height, Z is currently near the side forward of the 4th axis, and enter the rod radius", "Probe 4th axis centre", 0)
    if rodDiam > 0 then
    	rodRadius = rodDiam / 2.0
    
    
    	' Start Z is working height, Z=0 is safe move height.
    	' Keeping these around in case I want to extend this later
    	'XCurrent = GetOemDro(800)
    	YCurrent = GetOemDro(801)
    	ZCurrent = GetOemDro(802)    
    	'GageH = GetOEMDRO(1001)    'OEMDRO(1001)=Gage Block Height
    
    
    
    
    	' Speeds
    	fast = 1000
    	slow = 50
    
    
    
    
    	' Get the current feed rate so we can restore it at the end
    	FeedCurrent = GetOemDRO(818)
    
    
    	' Hit the front (-ve Y) side
    	south = Approach(1, 200, fast, slow)
    
    
    	' Hop up and over the rod
    	Code "G00 Z0"
    	Code "G00 Y" & (south + 5 * rodRadius)
    	Code "G00 Z"  & zCurrent
    
    
    	' Come back to find the north side
    	north = Approach(1, -5*rodRadius, fast, slow)
    
    
    	' our Y centre is between north and south
    	yOffset = Abs((north - south) / 2.0)
    
    
    	' set the Y position, we're currently at +ve radius
    	SetOemDRO(801,yOffset)
     
    	' Now hop up and over the centre
    	Code "G00 Z0"
    	Code "G00 Y0"
    
    
    	' Find the top of the bar
    	Let newZ = Approach(2, zCurrent, fast/10, slow)
    
    
    	' And set Z based on us being one radius above the centreline
    	' less the backoff after the approach
    	SetOemDRO(802, rodRadius + GetOemDRO(802) - newZ)
    
    
    	' Back off and we're done. Note Z has been re-zeroed
    	' so safe height is -(rodRadius (+ve) + newZ (which is -ve)) 
    	Code "G00 Z" & (rodRadius - newZ)
    
    
    
    
    	' Restore feedrate and we're done
    	SetOemDRO(818,FeedCurrent)  
    end if
    
    
     
    ' Function approaches a probe point quickly, backs off and comes in again slower (for better accuracy)
    ' nAxis:         0 for X axis, 1 for Y axis, anything else for Z
    ' nMaxAndDir:     maximum distance to travel looking for probe trigger. 
    '                Sign of this parameter determines direction
    ' nFast:        Fast feed rate
    ' nSlow:        Slow approach feed rate
    ' return value:    The ordinate along the axis at which the probe triggered.
    Function Approach (nAxis As Integer, ByVal nMaxAndDir As Double, ByVal nFast As Integer, ByVal nSlow As Integer) As Double
    
    
    
    
    ' Work out the axis and target ordinate of maximum searching travel
    Select Case nAxis
        Case 0
        sAxis = "X"
        t = GetOemDro(800) + nMaxAndDir
    Case 1
        sAxis = "Y"
        t = GetOemDro(801) + nMaxAndDir
    case Else 
        sAxis = "Z"
        t = GetOemDro(802) + nMaxAndDir
    End Select
    
    
    
    
    ' Work out the direction
    nDir = (nMaxAndDir/Abs(nMaxAndDir))
    
    
    
    
    ' Make fast approach
    
    
    
    
    ' Send the move command
    Code "G31 F" & nFast &" " & sAxis &t
    
    
    
    
    ' Wait to get there
    While IsMoving()
    Sleep(10)
    Wend
    
    
    
    
    ' The DRO gives us the position at which we stopped
    rVal = GetOemDro(800 + nAxis)
    t = rVal - nDir
    
    
    
    
    ' back off
    Code "G00 " &sAxis &t    
    t = rVal + nDir
    
    
    
    
    ' slow approach now
    Code "G31 F" & nSlow & " " & sAxis & t    ' slow approach
    While IsMoving()
    Sleep(10)
    Wend
    rVal = GetOemDro(800 + nAxis)
    
    
    
    
    ' back off the overshoot
    t = rVal - nDir
    Code "G00 " &sAxis &t    ' back off
    
    
    
    
    ' return the new position
    Approach = rVal
    End function




  20. #100
    Member ubergeekseven's Avatar
    Join Date
    Mar 2017
    Location
    United States
    Posts
    250
    Downloads
    0
    Uploads
    0

    Default Re: 4th axis touch probing

    Quote Originally Posted by dharmic View Post
    Okayyy

    To save you from busting probe tips (I use sacrificial carbon fibre rod and managed to ping 3 of them getting this right)...

    Code:
    'Simon's 4th Centre Finder
    
    
    rodDiam = InputBox("Make sure Z=0 is at safe move height, Z is currently near the side forward of the 4th axis, and enter the rod radius", "Probe 4th axis centre", 0)
    if rodDiam > 0 then
    rodRadius = rodDiam / 2.0
    
    
    ' Start Z is working height, Z=0 is safe move height.
    ' Keeping these around in case I want to extend this later
    'XCurrent = GetOemDro(800)
    YCurrent = GetOemDro(801)
    ZCurrent = GetOemDro(802)    
    'GageH = GetOEMDRO(1001)    'OEMDRO(1001)=Gage Block Height
    
    
    
    
    ' Speeds
    fast = 1000
    slow = 50
    
    
    
    
    ' Get the current feed rate so we can restore it at the end
    FeedCurrent = GetOemDRO(818)
    
    
    ' Hit the front (-ve Y) side
    south = Approach(1, 200, fast, slow)
    
    
    ' Hop up and over the rod
    Code "G00 Z0"
    Code "G00 Y" & (south + 5 * rodRadius)
    Code "G00 Z"  & zCurrent
    
    
    ' Come back to find the north side
    north = Approach(1, -5*rodRadius, fast, slow)
    
    
    ' our Y centre is between north and south
    yOffset = Abs((north - south) / 2.0)
    
    
    ' set the Y position, we're currently at +ve radius
    SetOemDRO(801,yOffset)
     
    ' Now hop up and over the centre
    Code "G00 Z0"
    Code "G00 Y0"
    
    
    ' Find the top of the bar
    Let newZ = Approach(2, zCurrent, fast/10, slow)
    
    
    ' And set Z based on us being one radius above the centreline
    ' less the backoff after the approach
    SetOemDRO(802, rodRadius + GetOemDRO(802) - newZ)
    
    
    ' Back off and we're done. Note Z has been re-zeroed
    ' so safe height is -(rodRadius (+ve) + newZ (which is -ve)) 
    Code "G00 Z" & (rodRadius - newZ)
    
    
    
    
    ' Restore feedrate and we're done
    SetOemDRO(818,FeedCurrent)  
    end if
    
    
     
    ' Function approaches a probe point quickly, backs off and comes in again slower (for better accuracy)
    ' nAxis:         0 for X axis, 1 for Y axis, anything else for Z
    ' nMaxAndDir:     maximum distance to travel looking for probe trigger. 
    '                Sign of this parameter determines direction
    ' nFast:        Fast feed rate
    ' nSlow:        Slow approach feed rate
    ' return value:    The ordinate along the axis at which the probe triggered.
    Function Approach (nAxis As Integer, ByVal nMaxAndDir As Double, ByVal nFast As Integer, ByVal nSlow As Integer) As Double
    
    
    
    
    ' Work out the axis and target ordinate of maximum searching travel
    Select Case nAxis
        Case 0
        sAxis = "X"
        t = GetOemDro(800) + nMaxAndDir
    Case 1
        sAxis = "Y"
        t = GetOemDro(801) + nMaxAndDir
    case Else 
        sAxis = "Z"
        t = GetOemDro(802) + nMaxAndDir
    End Select
    
    
    
    
    ' Work out the direction
    nDir = (nMaxAndDir/Abs(nMaxAndDir))
    
    
    
    
    ' Make fast approach
    
    
    
    
    ' Send the move command
    Code "G31 F" & nFast &" " & sAxis &t
    
    
    
    
    ' Wait to get there
    While IsMoving()
    Sleep(10)
    Wend
    
    
    
    
    ' The DRO gives us the position at which we stopped
    rVal = GetOemDro(800 + nAxis)
    t = rVal - nDir
    
    
    
    
    ' back off
    Code "G00 " &sAxis &t    
    t = rVal + nDir
    
    
    
    
    ' slow approach now
    Code "G31 F" & nSlow & " " & sAxis & t    ' slow approach
    While IsMoving()
    Sleep(10)
    Wend
    rVal = GetOemDro(800 + nAxis)
    
    
    
    
    ' back off the overshoot
    t = rVal - nDir
    Code "G00 " &sAxis &t    ' back off
    
    
    
    
    ' return the new position
    Approach = rVal
    End function
    Nice. Good idea, I'm going to try this when I get home. Looks easy enough. Thanks.

    Sent from my SM-N950U using Tapatalk



Page 5 of 7 FirstFirst ... 234567 LastLast

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

4th axis touch probing

4th axis touch probing