![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| General Metalwork Discussion Discuss everything relating to metal work. |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| I thought I would share a common question we have been receiving about probing 4 points on a surface and finding the average. Most have been adding the points and dividing by 4 to get the average. The problem with this method is that it can give you undesirable results even if you don’t have negative values. A better way to do it is to find the mid point, that is the point that is half way between the lowest reading and the highest reading. You could code that like this on a Fanuc with Renishaw macros: G65P9811Zz #101=#142(FIRST PT Z ERROR) G65P9811Zz #102=#142(SECOND PT Z ERROR) G65P9811Zz #103=#142(THIRD PT Z ERROR) G65P9811Zz #104=#142(FOURTH PT Z ERROR) (SET VARIABLE TO LOOP) #10=1 (LOOP CODE TO FIND HIGH AND LOW) WHILE[#10LE4]DO1 IF[#10GT1]GOTO10 (GET FIRST POINT AND SET) (IT TO HIGH AND LOW ) #12=#101(HIGH) #14=#101(LOW) GOTO30 N10 IF[#[100+#10]GT#12]GOTO20 IF[#[100+#10]LT#14]GOTO25 GOTO30 N20 #12=#[100+#10](SET NEW HIGH POINT) GOTO30 N25 #14=#[100+#10](SET NEW LOW POINT) N30 #10=#10+1.(INCREMENT COUNTER) END1 (NOW FIND THE MIDPOINT AND SET THE ORIGIN) #16=#12+#14/2.(MIDPOINT) (UPDATE THE G54 Z ORIGIN) #5223=#5223+#16 Note that the system variable for G54 Z was used, 5223 So, the expression wrote the new Z value to the existing Z value plus the mid point error. If you’re more comfortable with the parameter write statement you can do this: G91 G10L2P1Z#16 G90 Because it’s incremental when in G91 it just adds the value in #16 to the existing Z value. Just don’t forget to put it back in G90 absolute mode. Also, keep in mind that this method just updates the G54 Z by the error found measuring a target surface. It doesn’t change the G54 Z to some other feature. If you want to do that, write the same code but use the actual Z value from the measure output, #137 instead of #142 I hope this helps and find it useful. APT2000 Advanced Probe Technologies www.Advprobetech.com |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Points to Surfs | JDcam | Rhino 3D | 4 | 01-26-2009 12:04 PM |
| Need Help!- POINTS | el gordo | Mastercam | 1 | 10-04-2008 11:41 PM |
| points cloud to dxf converter? | satchid | General CAM Discussion | 1 | 09-01-2006 01:21 PM |
| Points on arcs | gguidi | Autodesk Software (Autocad, Inventor etc) | 2 | 07-25-2006 08:49 AM |
| position of points | TPPJR | OneCNC | 3 | 01-04-2006 01:19 PM |