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 05-12-2010, 03:58 PM
 
Join Date: Dec 2007
Location: usa
Posts: 10
beekeep is on a distinguished road
G54 question

I have built a 6 axis cnc mill for making beekeeping woodenware. I first design was for a frame end piece. These pieces are about 9" long by 1 3/8" wide. The machine does a nice job I would like to make it cut multiple copies using Code G54. How do I tell it where the starting position of the G code is? For example if the following code cuts the piece:
G0 X0Y0Z1
M3
G1 Z0.25 F6
X1Y0
X1Y1
X0Y1
X0Y0
Z1
M5

How do I tell the machine that X0Y0Z1 is the starting point for each piece and that I want to cut one at X0Y0, X1Y0, X2Y0, etc?

TIA Greg Ferris aka beekeep
Reply With Quote

  #2  
Old 05-12-2010, 04:24 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

What kind of controller does it have?
__________________
First you get good, then you get fast. Then grouchiness sets in.

(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 05-12-2010, 05:01 PM
 
Join Date: Dec 2007
Location: usa
Posts: 10
beekeep is on a distinguished road

I'm using mach3
Reply With Quote

  #4  
Old 05-12-2010, 09:19 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

First you should be homing the machine to some position that can be repeatedly found again after the power is shut off and turned back on. This home position is most commonly described as being X0Y0Z0 in the machine coordinate system which is named G53. However, by parameter, you could also give the home position other coordinates, but this is still the primary machine coordinate system G53.

All the workshifts from G54 through to G59 are related to this G53 coordinate system, as distances from the zero point of G53 to the zero point of G54 (on up to G59).

So if you are machining without being aware of this, I'm not sure how you established the zero of your first part because normally G53 X0Y0 does not coincide with the G54 X0Y0 of your workpiece. That is not to say that it couldn't coincide it is just highly unlikely

So if your first part datum (location) is somehow being machined at G54 X0Y0, then the second part should be machined at G55. You should be able to find the workshift registers in your control and input values for G55 X and Y that equal the amount of offset you need in order to produce the second part without overlapping the first one. The third part will use G56, again with unique values for X and Y in the G56 register. Bear in mind that the values in the workshift registers are absolute distances from the G53 X0Y0 and not incremental distances between workshifts.

Normally at the beginning of your operation, immediately after the tool change, you insert G54 (or whichever workshift you wish to call) into your code. This causes the controller to shift X0Y0 from the machine G53 coordinate system to whichever workshift you invoke.
__________________
First you get good, then you get fast. Then grouchiness sets in.

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

  #5  
Old 05-12-2010, 09:34 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,448
ger21 is on a distinguished road
Buy me a Beer?

What Hu said. In order to use G54-G59 easily, you need to have a repeatable home position.

If not, you may be better off using G92.

You enter the offsets on the offset screen, btw.
__________________
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

Sponsored Links
  #6   Ban this user!
Old 05-13-2010, 07:40 AM
 
Join Date: Dec 2007
Location: usa
Posts: 10
beekeep is on a distinguished road
Still confused

If I'm getting this right the program would be something like this:?

G53 X0Y0Z14.25
G54 X0Y0Z1
M3
G1 Z0.25 F6
X1Y0
X1Y1
X0Y1
X0Y0
Z1
M5
G55 X1Y0
G56 X2Y0

Am I limited to 9 copies?
Reply With Quote

  #7  
Old 05-13-2010, 08:24 AM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

Using a workshift does not create subroutines, you'd have to do that yourself. You can do this by putting your toolpath code in a subroutine (or subprogram) and then write a main program which contains a workshift, then a sub call, next workshift, sub call, etc.
You'd be limited by the number of workshifts available to your controller basically up to G59. A lot of controllers have an extended list of workshifts up somewhere over G110.

But another way to do this is to use G52 calls, which you can have as many as you like.
__________________
First you get good, then you get fast. Then grouchiness sets in.

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

  #8  
Old 05-13-2010, 10:52 AM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,448
ger21 is on a distinguished road
Buy me a Beer?

There are I think 255 offsets available in Mach3. Check the manual on how to call the ones after G59, but I think it's G59P1, G59P2, or something like that.
__________________
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

  #9   Ban this user!
Old 05-14-2010, 01:56 PM
 
Join Date: Jun 2009
Location: USA
Posts: 1
GCODEMONKEY is on a distinguished road

If it's that simple of a program you could just loop the program in incremantal instead of absolute.
Reply With Quote

  #10   Ban this user!
Old 05-18-2010, 12:03 PM
 
Join Date: Dec 2007
Location: usa
Posts: 10
beekeep is on a distinguished road

I rewrote the program in incremental. I'm learning and didn't realize that I could go back and forth between incremental and absolute. I reality my biggest problem has been the new terms that I am not familiar with. The only programming that I have done in the past was basic and that was many years ago. I'll get the hang of this it is just a matter of learning a new language.

Question. Can one write G code subroutines and call them up in G code?

Thanks
Greg Ferris
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 05-18-2010, 12:37 PM
Karl_T's Avatar  
Join Date: Mar 2004
Location: Dassel,MN,USA
Posts: 1,318
Karl_T is on a distinguished road

I have a different control but it works about the same as mach. here's the instruction for my machine:



QUESTION 209
How do we call and loop subroutines in the G code program?

We use the industry standard method. Anyone familiar with G code programming should be able to explain this better. You can look in the Buyers Guide in the back of your CamSoft manual on what book we recommend to learn CNC programming. An M98 call will call a subroutine and an M99 will return back to the line after the M98 when finished. M98 has two parameters - P and L. P calls the block number or program number to jump to and L specifies the number of times to repeat or loop the subroutine. In CNC Professional M98 is user definable. The P parameter can either call a block number that starts with N or a program number that starts with O. In CNC Plus the letter O is the default. In CNC Professional the letter N is the default, but can be changed. Each subroutine should be capable of standing alone and run on its own. Subroutines cannot be called from CNC Lite.

Below are some examples:

(Call a simple subroutine and repeat the subroutine 3 times.)
N1 G0 X0 Y0 Z0
N2 M98 P1234 L3
N3 M30
O1234
N4 G1 Z-.5 F25
N5 G0 Z.1
N6 M99

(Use a subroutine to loop the entire program 100 times.)
N1 M98 P1234 L100
N2 M30
O1234
N4 G0 X0 Y0 Z0
N5 G1 Z-.5 F25
N6 G0 Z.1
N7 M99

(Nested subroutines, only available in CNC Professional.)
N1 G0 X0 Y0 Z0
N2 M98 P1234 L1
N3 M30
O1234
N4 G0 X1 Y1 Z1
N5 M98 P5678 L1
N6 M99
O5678
N7 G1 Z-.5 F25
N8 G0 Z.1
N9 M99
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





All times are GMT -5. The time now is 02:08 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