Author Topic: Load Mach3 with mastercam G code  (Read 13921 times)

0 Members and 1 Guest are viewing this topic.

Offline Mario25

  • Active Member
  • Posts: 9
    • View Profile
Load Mach3 with mastercam G code
« on: March 31, 2010, 09:27:57 PM »
I started using Mastercam on 2D basis, everything goes fine, I then generate the G code there and do a copy paste  to a text document,  next I open Mach3 and load the G code from that text document.
The problem is, everything goes fine on the Mastercam simulation but on  Mach3,  with the same G code does not go at all or some other times goes very different from what I am expecting,  resulting in
a non usable piece of work.
If there is anyone who can give an hand on this, I would be much great full.

Offline elpablito

  • Active Member
  • Posts: 129
    • View Profile
Re: Load Mach3 with mastercam G code
« Reply #1 on: April 01, 2010, 12:09:22 AM »
Hi Mario

Can you please post a piece of code of what your postprocessor is outputting and maybe a description or a screenshot of what you expect it to do?

Offline Mario25

  • Active Member
  • Posts: 9
    • View Profile
Re: Load Mach3 with mastercam G code
« Reply #2 on: April 01, 2010, 02:11:59 PM »
Hi Elpablito,
it is very nice of you to help me, please see bellow the code generated by Mastercam which  Mach3  have problems to accept.
O0000(HORN 12)
(DATE=DD-MM-YY - 01-04-10 TIME=HH:MM - 01:08)
( T1 |   1. DRILL | H0 )
N100 G21
N102 G0 G17 G40 G49 G80 G90
N104 T1 M6
N106 G0 G90 G54 X-23.008 Y17.627 S0 M5
N108 G43 H0 Z4.
N110 G98 G81 Z-2. R2. F100.
N112 X-1.008
N114 X20.992
N116 X42.992
N118 X64.992
N120 X86.992
N122 Y-3.373
N124 X64.992
N126 X42.992
N128 X20.992
N130 X-1.008
N132 X-23.008
N134 G80
N136 X-22.5 Y-20.544 Z10.
N138 G1 Z-2. F6.
N140 X-21.5 F100.
N142 G3 X-20.5 Y-19.544 R1.
N144 G1 Y-18.088
N146 X-25.483 Y-4.397
N148 G2 X-21.394 Y-1.234 R2.678
N150 G1 X.102 Y-17.451
N152 G2 X.5 Y-18.249 R1.
N154 G1 Y-21.
N156 G2 X0. Y-21.5 R.5
N158 G1 X-20.
N160 G2 X-20.5 Y-21. R.5
N162 G1 Y-19.544
N164 G3 X-21.5 Y-18.544 R1.
N166 G1 X-22.5
N168 Z8. F6.
N170 G0 Z10.
N172 X-20.5 Y2.912
N174 G1 Z-2.
N176 X-25.483 Y16.603 F100.
N178 G2 X-21.394 Y19.766 R2.678
N180 G1 X.102 Y3.549
N182 G2 X.5 Y2.751 R1.
N184 G1 Y0.
N186 G2 X0. Y-.5 R.5
N188 G1 X-20.
N190 G2 X-20.5 Y0. R.5
N192 G1 Y2.912
N194 Z8. F6.
N196 G0 Z10.
N198 X1.5
N200 G1 Z-2.
N202 X-3.483 Y16.603 F100.
N204 G2 X.606 Y19.766 R2.678
N206 G1 X22.102 Y3.549
N208 G2 X22.5 Y2.751 R1.
N210 G1 Y0.
N212 G2 X22. Y-.5 R.5
N214 G1 X2.
N216 G2 X1.5 Y0. R.5
N218 G1 Y2.912
N220 Z8. F6.
N222 G0 Z10.
N224 Y-18.088
N226 G1 Z-2.
N228 X-3.483 Y-4.397 F100.
N230 G2 X.606 Y-1.234 R2.678
N232 G1 X22.102 Y-17.451
N234 G2 X22.5 Y-18.249 R1.
N236 G1 Y-21.
N238 G2 X22. Y-21.5 R.5
N240 G1 X2.
N242 G2 X1.5 Y-21. R.5
N244 G1 Y-18.088
N246 Z8. F6.
N248 G0 Z10.
N250 X23.5 Y2.912
N252 G1 Z-2.
N254 X18.517 Y16.603 F100.
N256 G2 X22.606 Y19.766 R2.678
N258 G1 X44.102 Y3.549
N260 G2 X44.5 Y2.751 R1.
N262 G1 Y0.
N264 G2 X44. Y-.5 R.5
N266 G1 X24.
N268 G2 X23.5 Y0. R.5
N270 G1 Y2.912
N272 Z8. F6.
N274 G0 Z10.
N276 Y-18.088
N278 G1 Z-2.
N280 X18.517 Y-4.397 F100.
N282 G2 X22.606 Y-1.234 R2.678
N284 G1 X44.102 Y-17.451
N286 G2 X44.5 Y-18.249 R1.
N288 G1 Y-21.
N290 G2 X44. Y-21.5 R.5
N292 G1 X24.
N294 G2 X23.5 Y-21. R.5
N296 G1 Y-18.088
N298 Z8. F6.
N300 G0 Z10.
N302 X45.5 Y2.912
N304 G1 Z-2.
N306 X40.517 Y16.603 F100.
N308 G2 X44.606 Y19.766 R2.678
N310 G1 X66.102 Y3.549
N312 G2 X66.5 Y2.751 R1.
N314 G1 Y0.
N316 G2 X66. Y-.5 R.5
N318 G1 X46.
N320 G2 X45.5 Y0. R.5
N322 G1 Y2.912
N324 Z8. F6.
N326 G0 Z10.
N328 X43.5 Y-20.544
N330 G1 Z-2.
N332 X44.5 F100.
N334 G3 X45.5 Y-19.544 R1.
N336 G1 Y-18.088
N338 X40.517 Y-4.397
N340 G2 X44.606 Y-1.234 R2.678
N342 G1 X66.102 Y-17.451
N344 G2 X66.5 Y-18.249 R1.
N346 G1 Y-21.
N348 G2 X66. Y-21.5 R.5
N350 G1 X46.
N352 G2 X45.5 Y-21. R.5
N354 G1 Y-19.544
N356 G3 X44.5 Y-18.544 R1.
N358 G1 X43.5
N360 Z8. F6.
N362 G0 Z10.
N364 X67.5 Y-18.088
N366 G1 Z-2.
N368 X62.517 Y-4.397 F100.
N370 G2 X66.606 Y-1.234 R2.678
N372 G1 X88.102 Y-17.451
N374 G2 X88.5 Y-18.249 R1.
N376 G1 Y-21.
N378 G2 X88. Y-21.5 R.5
N380 G1 X68.
N382 G2 X67.5 Y-21. R.5
N384 G1 Y-18.088
N386 Z8. F6.
N388 G0 Z10.
N390 Y2.912
N392 G1 Z-2.
N394 X62.517 Y16.603 F100.
N396 G2 X66.606 Y19.766 R2.678
N398 G1 X88.102 Y3.549
N400 G2 X88.5 Y2.751 R1.
N402 G1 Y0.
N404 G2 X88. Y-.5 R.5
N406 G1 X68.
N408 G2 X67.5 Y0. R.5
N410 G1 Y2.912
N412 Z8. F6.
N414 G0 Z10.
N416 X87.5 Y.456
N418 G1 Z-2.
N420 X88.5 F100.
N422 G3 X89.5 Y1.456 R1.
N424 G1 Y2.912
N426 X84.517 Y16.603
N428 G2 X88.606 Y19.766 R2.678
N430 G1 X110.102 Y3.549
N432 G2 X110.5 Y2.751 R1.
N434 G1 Y0.
N436 G2 X110. Y-.5 R.5
N438 G1 X90.
N440 G2 X89.5 Y0. R.5
N442 G1 Y1.456
N444 G3 X88.5 Y2.456 R1.
N446 G1 X87.5
N448 Z8. F6.
N450 G0 Z10.
N452 X89.5 Y-18.088
N454 G1 Z-2.
N456 X84.517 Y-4.397 F100.
N458 G2 X88.606 Y-1.234 R2.678
N460 G1 X110.102 Y-17.451
N462 G2 X110.5 Y-18.249 R1.
N464 G1 Y-21.
N466 G2 X110. Y-21.5 R.5
N468 G1 X90.
N470 G2 X89.5 Y-21. R.5
N472 G1 Y-18.088
N474 Z8. F6.
N476 G0 X-20.236 Y-7.119 Z10.
N478 G1 Z-2.
N480 X-16.838 Y-16.454
N482 X-7.861
N484 X-20.236 Y-7.119
N486 Z8.
N488 G0 Z10.
N490 Y13.881
N492 G1 Z-2.
N494 X-16.838 Y4.546
N496 X-7.861
N498 X-20.236 Y13.881
N500 Z8.
N502 G0 Z10.
N504 X1.764
N506 G1 Z-2.
N508 X5.162 Y4.546
N510 X14.139
N512 X1.764 Y13.881
N514 Z8.
N516 G0 Z10.
N518 Y-7.119
N520 G1 Z-2.
N522 X5.162 Y-16.454
N524 X14.139
N526 X1.764 Y-7.119
N528 Z8.
N530 G0 Z10.
N532 X23.764 Y13.881
N534 G1 Z-2.
N536 X27.162 Y4.546
N538 X36.139
N540 X23.764 Y13.881
N542 Z8.
N544 G0 Z10.
N546 Y-7.119
N548 G1 Z-2.
N550 X27.162 Y-16.454
N552 X36.139
N554 X23.764 Y-7.119
N556 Z8.
N558 G0 Z10.
N560 X45.764 Y13.881
N562 G1 Z-2.
N564 X49.162 Y4.546
N566 X58.139
N568 X45.764 Y13.881
N570 Z8.
N572 G0 Z10.
N574 Y-7.119
N576 G1 Z-2.
N578 X49.162 Y-16.454
N580 X58.139
N582 X45.764 Y-7.119
N584 Z8.
N586 G0 Z10.
N588 X67.764 Y13.881
N590 G1 Z-2.
N592 X71.162 Y4.546
N594 X80.139
N596 X67.764 Y13.881
N598 Z8.
N600 G0 Z10.
N602 Y-7.119
N604 G1 Z-2.
N606 X71.162 Y-16.454
N608 X80.139
N610 X67.764 Y-7.119
N612 Z8.
N614 G0 Z10.
N616 X89.764 Y13.881
N618 G1 Z-2.
N620 X93.162 Y4.546
N622 X102.139
N624 X89.764 Y13.881
N626 Z8.
N628 G0 Z10.
N630 Y-7.119
N632 G1 Z-2.
N634 X93.162 Y-16.454
N636 X102.139
N638 X89.764 Y-7.119
N640 Z8.
N642 M5
N644 G91 G0 G28 Z0.
N646 G28 X0. Y0.
N648 M30

Offline elpablito

  • Active Member
  • Posts: 129
    • View Profile
Re: Load Mach3 with mastercam G code
« Reply #3 on: April 01, 2010, 03:25:02 PM »

When I load your code, mach outputs the following error in the status line:

Cannot use two gcodes that both use axis values.

It references the following line:

N644 G91 G0 G28 Z0.

If you remove G0 from that line, the code loads fine.
I cant check any further if the code does what it should because I dont know the part.
What mastercam post processor are you using?

I dont use mastercam but I have seen in the download section post processors for it.

Offline Mario25

  • Active Member
  • Posts: 9
    • View Profile
Re: Load Mach3 with mastercam G code
« Reply #4 on: April 01, 2010, 09:34:22 PM »
I have done what you said and is absolutely great, in fact I could not work out that I should only remove  the G0, what I tried before, was removing the all line N644 and of course the part end up  even worst.
Now is perfect, you have done a good job and of course a great help, you must be very knowledgeable with Mach3.
Regarding the post processor on Mastercam I do not know, after drawing the part and give all details for machining  I press a proper  button on Mastercam and it generates itself the G code,  what I can say to you is, 
the extension is .NC and shows FANUC on a little window that´s all I can tell, sorry I am a new comer on this matters, I hope you understand these details I am giving you.
The part is a small horn for air modeling purposes which will be attached to a servo with a metal link.
Once again,  thank you very much for your concern and prompt help, I am jet model pilot, if you ever need any help regarding jets and turbines please do say something and I will be very glad to help you too.
Best regards.

Offline elpablito

  • Active Member
  • Posts: 129
    • View Profile
Re: Load Mach3 with mastercam G code
« Reply #5 on: April 01, 2010, 09:42:26 PM »
Youre welcome Mario,

The postprocessor is a file related to the CAM that tells it the way it must generate GCode to be usable in your machine. In your case, the Fanuc postprocessor is compatible with Mach so it will interpret it ok (at least most of the code)
In this section
there are postprocessors written for some of the most popular CAMs to work with Mach. I have never tested the mastercam postpros, but maybe you can give them a try when you have time.

By the way, where are you from?