CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > G-Code Programing


G-Code Programing Discuss G-code programing and problems here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 07-22-2011, 02:09 PM
 
Join Date: Jul 2003
Location: Peoples Republic of Wisconsin
Posts: 110
cnczane is on a distinguished road
Help with "re-machining" G-code.

SolidModel -> MeshCAM v3 [Windows and Linux/WINE] -> G-code -> TurboCNC v3.1a [DOS]

I need to remachine a piece that's pretty good, but has an obvious mistake.

Firstly, I am new to doing real CNC, and I'm doing it on my home-brew machine, and this is only my third piece, but it is also my largest and best-so-far, and I'd like to save it.

The solid model was too big for MeshCAM: so I split it into two smaller models to be G-coded separately and combined later, into one G-code program that would yield a seamless model.

Problem: After combining and only after machining, it was clear that MeshCAM had been misled (by me, who had used different Zmax values for each half of the model) about the Z=0 reference in the first part, such that the elevations of the first part are 0.1" higher than the second, and thus there is a 0.1" wall/offset at the join between the two parts, where it's supposed to be seamless.

Question: What edits could be made to the first part's G-code so that it can be re-run to remove the 0.1" from the surface of only the first part and result in a seamless boundary at the interface to the second part, as intended?
---
I suspect it might be done by a little "fibbing" about what the current value of Z is.

For example, if TurboCNC sees an instruction to G01 Z-0.1, it will proceed differently if it thinks it's already AT Z=-0.1 than if it thinks it is at Z=0.

Thank you for any insights, and extra thanks for an example.
--
cnczane
__________________
--
Dan
Reply With Quote

  #2  
Old 07-22-2011, 04:07 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,454
ger21 is on a distinguished road
Buy me a Beer?

Question: What edits could be made to the first part's G-code so that it can be re-run to remove the 0.1" from the surface of only the first part and result in a seamless boundary at the interface to the second part, as intended?
---
I suspect it might be done by a little "fibbing" about what the current value of Z is.
Yes, just change the Z value prior to running the g code.

I'm guessing though, that you'll still not get it perfect after re-machining.
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

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

  #3   Ban this user!
Old 07-23-2011, 09:42 AM
 
Join Date: Jul 2003
Location: Peoples Republic of Wisconsin
Posts: 110
cnczane is on a distinguished road

Originally Posted by ger21 View Post
Yes, just change the Z value prior to running the g code.

I'm guessing though, that you'll still not get it perfect after re-machining.
Thanks, Gerry.

I'm just trying to make it look less like a piece of firewood.

It's not as simple as change the Z BEFORE running the code; I simplified the example to try to give a clear picture.

However, I need to change the Z INSIDE the code. Here's why.

The "wall" is between two areas that should align. I'm not really keen to recut the entire first section (which your suggestion would accomplish) because it'll take hours and because I don't think my machine will be able to hold accuracy over the whole area again.

Rather, what I'm anxious to try to smooth out the discontinuity over a span of rows:
- to back off say 20 rows from the discontinuity
- and remachine only that set of rows
- while lowering the cutting depth 1/20th of the discontinuity before each pass

In TurboCNC, my first try at this involved using G53/G92 because the TurboCNC manual said:
" G92 This code sets the position of any or all axes to a specific value. Use this
to reset the position inside a program. No motion will occur."
and
" You must be in the master coordinate system [G53] to use this code. All of the
other offsets (1-20) follow the master. Ergo, if the origin in offset 1 is set
to be exactly 3" away from the master origin (in G53 mode), then that
relationship is maintained as the master origin moves.
" Use jog mode to setup the coordinate offsets (tool offsets) and save them
through the file menu. This command is not modal in versions 3.1 and up."
and
" This code sets the position of any or all axes to a
specific value. Use this to reset the position inside a
program. No motion will occur.
" In machine coordinate (G53 T0) mode, the machine
coordinates themselves are updated.
" In any fixture offset mode (G54-G59) and T0, the fixture
offset is updated.
" In any tool offset mode (T1-T20), the tool offset is
updated.
" This code is not modal."

I didn't set any offsets, and assumed they defaulted to 0. Thus, T1-20's coordinates would be identical to T0's.

I tried:
M03
(STOCK/BLOCK, 16.496, 11.25, 0.406, -0.000, -0.000, 0.406)
...
; END ROUGH
; FINISH PARALLEL X
(TOOL/MILL,0.1250,0.06250,1.000,0.0)
M6 T5012500
; FINISH PARALLEL X S 3rd
G00 X0.000 Y0.002 Z0.020
G01 X0.000 Y0.002 Z-0.164 F5.0
G01 X0.004 Y0.002 Z-0.164 F20.0
...
G01 X16.496 Y3.161 Z-0.158 ; note ending Z=-0.158
; ROW 51, nom. - btwn Sections 1 and 2 at ROW 70, a Z discrepancy of -0.04"
; resulting in an apparent "wall" at Row 70
; begin "adjusting Z" to take out an extra 0.002" in the next 20 rows (20*0.002=0.04)
G53 ; must be in "Tool 0" mode (abs.) for G92 command to be recognized
; redefine Z 0.002" higher than where it ended, causing Z to be cut deeper
G92 Z-0.156
G01 X16.496 Y3.163 Z-0.158
...
etc.

This approach failed because, I think, of my M6 T5012500 line. I always understood the "T" part to be an arbitrary string (in MeshCAM), to help me identify which tool was being called for in a tool change. (I do remember wondering why it would only take numbers...) I've been encoding my tool names like this from Day One, long before I ever had a machine to work on. "T5" tells me it's a ball-end, "0125," 0.12500".

In looking at why my G53/G92 failed, my reading now suggests that "T" is an actual G-code which not only prompts the user for which tool to change, but also changes to that tool's coordinate system(?). G53/G92 are for "T0".

I should state that I don't zero my two tools and set any tool offsets before I run the code. Because I have only one tool change (from 1/2" rougher to 1/8" finisher), I wait for the M6 "tool-change" command and zero the finisher at that time.

I've been using M6 to pause the machine to alert me and to permit me to change tools but now I think M6 has also been telling the G-code interpreter to "switch to the '5012500' coordinate system." G53/G92 may have changed "T0"s position, but they did nothing for "T5012500"s.

My next try will be to redefine my finish tool to say T2 and to use:
...
G01 X16.496 Y3.161 Z-0.158 ; Note, machine thinks it's at Z=-0.158
M6 T2
G55 ; change T2's coord. system
G92 Z-0.156
G01 X16.496 Y3.163 Z-0.158 ; machine thinks it's at Z=-0.156 so will cut -0.002
...
__________________
--
Dan
Reply With Quote

  #4  
Old 07-23-2011, 10:14 AM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,454
ger21 is on a distinguished road
Buy me a Beer?

This approach failed because, I think, of my M6 T5012500 line. I always understood the "T" part to be an arbitrary string (in MeshCAM), to help me identify which tool was being called for in a tool change. (I do remember wondering why it would only take numbers...) I've been encoding my tool names like this from Day One, long before I ever had a machine to work on. "T5" tells me it's a ball-end, "0125," 0.12500".
T is the tool#, so you're telling TurboCNC to change to tool # 5012500

M6 T5 means change to tool #5. Generally, people use tool numbers from 1-255 or higher, if they have more.
In looking at why my G53/G92 failed, my reading now suggests that "T" is an actual G-code which not only prompts the user for which tool to change, but also changes to that tool's coordinate system(?). G53/G92 are for "T0".
G53 is machine coordinates, which are the absolute coordinates of your machine's axis'.
G92 can offset the G53 coordinate system.

It really doesn't matter which tool is currently active. However, if you have a tool length offset applied, it appears that this offset may be changed to reflect the G92 offset.
In any tool offset mode (T1-T20), the tool offset is
updated.
Not 100 % sure on how that works exactly, as I've never used G92, and never used TurboCNC on an actual machine. It's been years since I've had a copy running.


I've been using M6 to pause the machine to alert me and to permit me to change tools but now I think M6 has also been telling the G-code interpreter to "switch to the '5012500' coordinate system." G53/G92 may have changed "T0"s position, but they did nothing for "T5012500"s.
There is no 5012500' coordinate system.
As stated before, G53 is the machine coordinate system. Generally, cutting is done in a work offset coordinate system (fixture offset), typically G54 through G59. Each system contains XY and Z offsets, which are relative to the G53 coordinates, which can be modified by the G92 offsets. Confusing?
If the Work Offsets are zero, the the work offset system is the same as the G53 system.

My next try will be to redefine my finish tool to say T2 and to use:
...
G01 X16.496 Y3.161 Z-0.158 ; Note, machine thinks it's at Z=-0.158
M6 T2
G55 ; change T2's coord. system
G92 Z-0.156
G01 X16.496 Y3.163 Z-0.158 ; machine thinks it's at Z=-0.156 so will cut -0.002
What you probably want to do, is set your G54 offsets to zero, and start in the G54 system.
Set the Z offset in your G55 system to -.156, and just switch to G55 when you change to T2.
No need to mess with G92.



It's not as simple as change the Z BEFORE running the code; I simplified the example to try to give a clear picture.

However, I need to change the Z INSIDE the code. Here's why.

The "wall" is between two areas that should align. I'm not really keen to recut the entire first section (which your suggestion would accomplish) because it'll take hours and because I don't think my machine will be able to hold accuracy over the whole area again.

Rather, what I'm anxious to try to smooth out the discontinuity over a span of rows:
- to back off say 20 rows from the discontinuity
- and remachine only that set of rows
- while lowering the cutting depth 1/20th of the discontinuity before each pass

What I would do, is make a copy of the g-code, and edit out everything you don't need.
Then just change the Z zero, and run only the code that you need.
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

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

  #5   Ban this user!
Old 07-23-2011, 12:27 PM
 
Join Date: Jul 2003
Location: Peoples Republic of Wisconsin
Posts: 110
cnczane is on a distinguished road

It'll take a while to digest this, but I am sure the answer is in your long reply.

I just came back to report that my latest attempt:
G55
G92 Z-0.156
complained that "Must be in T0 mode to use this command [G92]..." or something like it.

Many thanks.
__________________
--
Dan
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 07-23-2011, 12:59 PM
 
Join Date: Jul 2003
Location: Peoples Republic of Wisconsin
Posts: 110
cnczane is on a distinguished road

Originally Posted by ger21 View Post
Each system contains XY and Z offsets, which are relative to the G53 coordinates, which can be modified by the G92 offsets. Confusing?
Speaking for all newbies Everywhere: "Yes."

If the Work Offsets are zero, the the work offset system is the same as the G53 system.
Only I don't think it did that. However: I did not explicitly set any work offsets, ASSUMING that "if I didn't SET them, they MUST be zero." (?)

What you probably want to do, is set your G54 offsets to zero, and start in the G54 system.
But I don't know how to set my G54 offsets to zero nor how to start in the G54 system, (but that part I suspect is just the G54 command). Do I define these offsets in TurboCNC setup BEFORE I actually load and run the code?

Set the Z offset in your G55 system to -.156, and just switch to G55 when you change to T2.
What I need to do is to re-machine the 40 rows, dropping down 0.001" with each new row, for a total drop of 0.04", thus smoothing out the difference over many rows.

I think I need to be able to (re)set the Z offset in G55 on-the-fly, inside the program to do this.

No need to mess with G92.
...which will avoid it messing with me...


What I would do, is make a copy of the g-code, and edit out everything you don't need.
Then just change the Z zero, and run only the code that you need.
This is what I've done. I only run that subset of the code, after aligning my tool over where the program is about to begin. I'm hung up on the "just change the Z zero." (The "just" stings because it suggests it's really simple--and I can't figure it out!)
__________________
--
Dan
Reply With Quote

  #7  
Old 07-23-2011, 01:42 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,454
ger21 is on a distinguished road
Buy me a Beer?

But I don't know how to set my G54 offsets to zero nor how to start in the G54 system, (but that part I suspect is just the G54 command). Do I define these offsets in TurboCNC setup BEFORE I actually load and run the code?
Setup > Manage Fixtures

Fixture 1 = G54
Fixture 2 = G55

and so on.

To start in the G54 system, just put a G54 at the start of your g-code, or use the MDI window (F9) and type G54.

You can change during the program by just calling the new offset (fixture).


What I need to do is to re-machine the 40 rows, dropping down 0.001" with each new row, for a total drop of 0.04", thus smoothing out the difference over many rows.
OK, that's a lot trickier.
I think I need to be able to (re)set the Z offset in G55 on-the-fly, inside the program to do this.
I don't believe that's possible.
It looks like you only get 6 offsets (fixtures) in TurboCNC, so they are not really a viable option.

Here's what you could do.

Between each "row", in your g-code, use G92 to lower the axis .001. When the row finishes, move to Z0, and use G92 to set the position to -.001. If you need to move up out of the way first, you could move to Z0.5, and G92 to Z.499.

So between each "row" of g-code, you'd do this:

G0 Z0.5
G92 Z0.499

It looks like you'll want to be in G53, and use T0 for all cutting. This makes it less confusing, then switching tools. Although you may be able to do this:

T0
G0 Z0.5
G92 Z0.499
T1 (or whatever tool you're using)
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

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

  #8   Ban this user!
Old 07-24-2011, 10:02 PM
 
Join Date: Jul 2003
Location: Peoples Republic of Wisconsin
Posts: 110
cnczane is on a distinguished road

Well, it worked pretty well, but it was a nail-biter until the very end when it became clear
that the calculations were close.

For each of the 40 rows prior to the 0.04" discontinuity,
I did something like this.
M6 T0 ; I had just the one tool, so I renamed it T0, and skipped trying to figure out G54, etc.
...
G01 X... Y... Z-0.150 ; I take note where last row ended
M00 ; I inserted a pair of pauses so I could confirm that the Z values were actually changed by the G92
G53
G92 Z-0.149 ; reset Z-axis up 0.001"
M00 ; Z changed by +0.001"?
G01 X... Y... Z-0.150 ; which causes this to be cut 0.001" deeper than it would have been
...

Thanks for ALL the assistance.
__________________
--
Dan

Last edited by cnczane; 07-25-2011 at 10:47 AM. Reason: add some comments to the code
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help!- Machining 1" wide x 2-1/4" deep slot midguard General Metal Working Machines 4 02-15-2011 05:15 PM
Need Help!- Fanuc 11m Spindle drive code 11: "DC Link Voltage High" cwtoyota Fanuc 2 04-09-2010 10:56 AM
Need Help!- Heidenhain TNC2500 or TNC360 Teksoft Post Processor " G " code ISO RMARCH Bridgeport and Hardinge Mills 0 06-11-2009 11:51 AM
Just IN- MIKINI MECHATRONICS - NEW CNC MACHINING CENTERS 16"x10"x16" 2000 lbs Linear Rail MIKINI MECH Product Announcements & Manufacturer News 23 02-25-2009 03:49 PM
Newbie- Post adds "A0." code and machine stops lookingforhelp1 Fanuc 10 08-29-2008 12:58 PM




All times are GMT -5. The time now is 07:58 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361