![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Here's some psudo-code to cut a circular pocket: % O0001 (CIRCULAR_POCKET) (2.500 DIA., 0.568 DEPTH) G17 G40 G80 (1.0 INSERT CUTTER - ROUGHING) G90 G54 G0 X-.45 Y0. S1250 M3 G43 Z2. H1 T2 Z.1 G1 Z.1 F25. M8 M98 P2 G0 X-.45 Y0. Z-.0136 G1 Z-.0136 F25. M98 P2 G0 X-.45 Y0. Z-.1272 G1 Z-.1272 F25. M98 P2 G0 X-.45 Y0. Z-.2408 G1 Z-.2408 F25. M982 G0 X-.45 Y0. Z-.3544 G1 Z-.3544 F25. M98 P2 M30 O0002 (1.0 INSERT CUTTER) G91 G3 X.9 Y0. Z-.0136 I.45 J0. F20. Z-.025 I-.45 Z-.025 I-.45 Z-.025 I-.45 Z-.025 I-.45 Z-.025 I-.45 Z-.025 I-.45 Z-.025 I-.45 Z-.025 I-.45 G90 M99 % It generates this: ![]() Here is what I can't figure out. The pocket is cut to 0.568 deep. The sub gets called 5 times, and .025 cuts are taken in incremental mode. The the last time the sub is called, the cutter is at 0.568. I'm trying to figure out the math so I can write incremental subs that step down in constant increments like this. The first time the sub is called, the first four blocks beginning with the G91 block just cut air. On the fifth block, cutting begins at -0.0136. In the remaining calls to the sub, the first four blocks beginning with the G91 block are overlap. Cutting resumes with the fifth block. For example, here are the values for the first pass through the sub: 0.0864 0.0614 0.0364 0.0114 -0.0136 -0.0386 -0.0636 -0.0886 -0.1136 Cutting begins at -0.0136. The value -0.0136 also appears in the main program as an absolute value, and in the sub as an incremental value. The crux of the matter is: Where does this -0.0136 value come from????? I'm actually traveling .668 in Z (beginning at Z.1). So I've tried a variety of dividing .668 by .025, etc., etc. I have noticed that .068/5 = .0136. Coincidence??? I can't figure out what to do with this information though, or how to write a similar sub for a depth of say .432, or how to factor in the overlapping blocks. I want to be able to write a sub in incremntal mode for this type of scenario, and know how to handle the difference left over after dividing by my cutting increment (say .025). I'm going to keep messing with this, but would love any suggestions. Thanks..................... |
|
#2
| |||
| |||
| Did you write this or get it from somewhere? One error is at the beginning in these lines: G43 Z2. H1 T2 Z.1 G1 Z.1 F25. M8 M98 P2 When the sub is called the tool is at Z.1 above the work so of course it has to make four circuits going down Z-.025 before it reaches the top of the work. Also some of the commands don't seem to make sense such as this: G0 X-.45 Y0. Z-.0136 G1 Z-.0136 F25. The machine is in absolute and rapid mode from the G0X-.45 Y0. command so the next line Z-.0136 does a rapid move down to this position; the G1 Z-0.0136 does nothing because the tool is already at that position. Regarding this question: I want to be able to write a sub in incremntal mode for this type of scenario, and know how to handle the difference left over after dividing by my cutting increment (say .025). One way to do this is to start slightly above the surface so the final incremental pass is at the correct depth. Actually your code does this but it starts way too high and has a lot of unnecessary stuff. You want to go to a depth of 0.568 using 0.025 per pass. Diviiding 0.568 by 0.025 gives 22.72 passes. It is impossible to get .72 of a pass so you us 23 which would take you down to 0.575 which is 0.007 deeper than you want to go. So you start at Z+0.007 and go down 23 times 0.025 to finish at -0.568. Then you would need to do a final circuit without an Z value to remove the helical ramp at the bottom.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#3
| |||
| |||
| Hey thanks for that suggestion. Simply starting the tool the remainder of the division above the part sounds like a good way to go. The code is just a portion of a part program from work. Mostly computer generated I suspect. I noticed several oddities also, but am just focused on the helical interpolation part. It does include a finish end mill as well. The value .0136 is obviously caluculated, and I was just kinda' curious about how it it came to be. Thanks for your suggestion, though. |
|
#4
| |||
| |||
| Here is where the 0.0136 comes from, at least the best I can figure it. The final sub program call has Z-.3544 for the starting position. The first line in the sub program does a half circuit moving down -0.0136 so now the tool is at Z-0.368 then it does 8 circuits at -.025 each for a final position of Z-0.568. But there is a whole lot of redundant nonsense in the code.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#6
| |||
| |||
| Amazing the difference sleeping on something can make. Using your thinking, Geof, here's why the Z-0.136 word is used 5 times (once for each sub program call). The code first makes 2 arbitrary decisions: 1. the sub program will cut .100 deep in .025 increments. 2. the sub program will be called 5 times. Given these arbitrary parameters, 5 executions of the sub program will get us to .500. That leaves us with .068 worth of depth unaccounted for. So, instead of following your thinking and just swiping it all off the top, it gets cut in .068/5 = .0136 increments. Each call to the sub program removes -.0136 + .100 = .1136 worth of material, x5 = .568. Simple. Thanks again for your time. |
![]() |
| 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 |
| G12/G13 Circular pocket help needed | NeoMoses | G-Code Programing | 8 | 09-27-2011 02:53 PM |
| Newbie- Need help programming a circular pocket | Robert_Downs | Bridgeport and Hardinge Mills | 6 | 07-29-2010 06:13 AM |
| Circular Pocket Question | JayKayEh | CamWorks | 4 | 05-03-2010 11:56 AM |
| Need Help!- circular pocket | Darek833 | Okuma | 8 | 01-01-2010 04:42 AM |
| G77 Circular Pocket | Big John T | BobCad-Cam | 3 | 02-27-2007 10:33 AM |