NX CAM Output Problems with Autoleveller

Help for setting up and using
Bryscus
Posts: 7
Joined: Tue Oct 17, 2017 8:57 pm

NX CAM Output Problems with Autoleveller

Post by Bryscus »

Hello all,

I have used the free version of Autoleveller in the past and had great success with it milling PCBs exporting from Eagle. I'd like to try engraving some nameplates, so naturally I turned back to Autoleveller and decided to become a member this time. I'm using NX 11 to generate CAM paths for engraving. They're pretty simple and just follow the inside and outside curves of letters. The issue I'm running into is that the vanilla gcode generated from NX doesn't seem to jive with Autoleveller. I can adjust the post output, but I need some idea of what to be adjusting to.

I use Mach3 on a 6040 machine. I've been milling pieces with stock NX gcode for some time now and rarely run into issues. This code seems to import just fine as well. I've attached the code for reference.

Are there any gcodes that don't work? (NX adds a lot of extra ones by default that don't apply to me)
Is there any formatting that causes issues? (For example, I've notice that Autoleveller doesn't seem to like a value "F10." but prefers "F10.0"
Are there issues with sequence numbers?

Thank you in advance.

- Bryce
Attachments
model2.txt
(12.81 KiB) Downloaded 330 times
- Bryce
User avatar
Country_Bubba
Posts: 124
Joined: Wed Oct 02, 2013 3:07 pm
Location: LaGrange, GA USA
Contact:

Re: NX CAM Output Problems with Autoleveller

Post by Country_Bubba »

Hi,
I just looked at your code and it appears that a vast majority of it is at Z+.01 instead of having a -Z for your actual work. I could be very wrong, but that is my first impression. I simulated it in Camotics and it also gives the same indication.
Also, I have never had any problems with sequence numbers.
Art
Country Bubba
Bryscus
Posts: 7
Joined: Tue Oct 17, 2017 8:57 pm

Re: NX CAM Output Problems with Autoleveller

Post by Bryscus »

Hi Country_Bubba,

Thanks for taking a look! I see what you're saying, but I believe that what you're referring to is the location where the ramp on shape starts to happen. There is a linear ramp to engage the cut that starts at "Z.01". Also, there is a Z0.1 clearance plane. Cuts are all made at "Z-.01". I think this is obscured because the engagement isn't just a direct Z move, but a more complicated linear move. N0200 is the ramp on shape move.

Code: Select all

N0170 G00 Z.1			%Clearance
N0180 X1.2599 Y.7875		%
N0190 Z.01			%Rapid to ramp start position
N0200 G01 Y.7128 Z-.01		%Start ramp ending at Z-.01
N0210 Y.55			%Cuts 
N0220 X1.3213			%Cuts
N0230 Y.7403			%Cuts
I added the comments above for clarity. It's good to hear about the sequence numbers. Playing around with the gcode, I couldn't get a clear indication of whether they were causing issues or not.

I attached a photo of the ramp on shape engagement into the "a". This is a screenshot from Mach3. Look at the center curve of the "a".
It's the easiest one to make out in the photo. Mach3 seems to have no issues with this toolpath at all.

Is this possibly a leading zeroes or trailing zeroes problem? I will play with it some more. Thanks again.

- Bryce
Attachments
ramp on shape.JPG
- Bryce
User avatar
Country_Bubba
Posts: 124
Joined: Wed Oct 02, 2013 3:07 pm
Location: LaGrange, GA USA
Contact:

Re: NX CAM Output Problems with Autoleveller

Post by Country_Bubba »

I see what your saying, but when I simulated it in Camotics, much of the path was in air and that is why I made the statement I did. Not sure what is going on. Will try looking at it again in a bit and see if I can figure out anything else.
Maybe James will jump in with an explanation that I have not even thought of.
Art
Country Bubba
Bryscus
Posts: 7
Joined: Tue Oct 17, 2017 8:57 pm

Re: NX CAM Output Problems with Autoleveller

Post by Bryscus »

I played with it a little more. Here are the quirks that definitely cause problems:

- Leading zeroes before a "." are required
- Trailing zeroes after a "." are required
- G moves must have the Gcode present (for example, the current NX code omits these on lines where the gcode is the same as the previous one)

Other things:
- "%" does not seem to comment out a line (this might be an NX only thing; it appears that autoleveller uses "(" for comments)

Things that definitely do not cause problems:
- Sequence numbers (or their values)

So this, which does not work at all:

Code: Select all

N0010 G40 G17 G90 G70
N0000 G91 G28 Z0.0
N0010 T00 M06
N0000 G00 G90 X1.8629 Y.7015 S24000 M03
N0020 Z.01
N0030 G01 Y.7761 Z-.01 F10. M08
N0040 Y1.0022
N0050 X1.823
N0060 G02 X1.7849 Y.9549 I-.1669 J.0953
N0070 X1.7359 Y.9183 I-.219 J.2424
N0080 X1.7076 Y.9026 I-.2112 J.3467
N0090 X1.6783 Y.8889 I-.2421 J.4798
N0100 G01 Y.8355
N0110 G03 X1.7431 Y.8632 I-.1831 J.5177
N0120 X1.8015 Y.902 I-.134 J.2648
N0130 G01 Y.55
N0140 X1.8629
N0150 Y.7761
N0160 Z.0525
N0170 G00 Z.1
N4380 M05
Becomes this, which kind of works:

Code: Select all

N0010 G40 G17 G90 G70 G20
N0000 G91 G28 Z0.0
N0010 T00 M06
N0000 G00 G90 X1.8629 Y0.7015 S24000 M03
N0020 G00 Z0.01
N0030 G01 Y0.7761 Z-0.01 F10.0 M08
N0040 G01 Y1.0022
N0050 G01 X1.823
N0060 G02 X1.7849 Y0.9549 I-0.1669 J.0953
N0070 G02 X1.7359 Y0.9183 I-0.219 J.2424
N0080 G02 X1.7076 Y0.9026 I-0.2112 J.3467
N0090 G02 X1.6783 Y0.8889 I-0.2421 J.4798
N0100 G01 Y0.8355
N0110 G03 X1.7431 Y0.8632 I-0.1831 J.5177
N0120 G03 X1.8015 Y0.902 I-0.134 J.2648
N0130 G01 Y0.55
N0140 G01 X1.8629
N0150 G01 Y0.7761
N0160 G01 Z0.0525
N0170 G00 Z0.1
N4380 M05
So, to me it looks like arc interpretation is wrong in the Autoleveller preview window. I can't run the actual generated output right now, but it looks like the autolevelled code probably is correct. It doesn't modify the arc codes so all is good. Now I need to figure out how to adjust the NX CAM post for the changes mentioned above.

I have attached images of the Mach3 output of the model2_modified4.txt file and the resultant output display in autoleveller. There is only code for engraving a "1". The extents seem to be OK, but they might be wrong in the case that there aren't G01 or G00 commands near the extents of the workpiece. I'm not sure.

It would be nice if there was a formatting document that specifies any requirements for gcode generation. If one exists already, I apologize, I couldn't find it.

Thank goodness for Notepad++ that makes these edits relatively easy.

Country_Bubba, again thanks for your help. I suspect Camotics doesn't like some formatting of that first code either. Please try running it against the second code to see if it comes out right.

- Bryce
Attachments
Autoleveller-'1'.png
Mach3-'1'.JPG
model2_modified4.txt
(575 Bytes) Downloaded 324 times
- Bryce
User avatar
Country_Bubba
Posts: 124
Joined: Wed Oct 02, 2013 3:07 pm
Location: LaGrange, GA USA
Contact:

Re: NX CAM Output Problems with Autoleveller

Post by Country_Bubba »

Glad you caught the problems. I was stymied.

As for the % being a comment delimiter, I have never seen that in the systems I have looked at. The ones I am familiar with use either a ; or a set of (....) as comment delimiters. I have only seen the use of % as the beginning or the end of a program.

I did not pick up on the use of modular commands as a problem as the code looks good. Then I went and looked as some of my Eagle adjusted files and sure enough, they all are written in a non modular way (a G code on each line).

"Leading zeroes before a "." are required" Again, I just checked some of my Eagle files and sure enough, it has leading zeros.
"Trailing zeroes after a "." are required" Checking in my files that have worked, I have instances of for instance "Y1" (no decimal point or trailing zero) but could find no instance of a "Y1." so can't really comment on that one.

As requested, I ran your revised code and it worked a treat and gave me a beautiful "1"

Unfortunately, I know nothing about NX CAM so can't really help you there. Hopefully James will see this thread and give some advice.
Art
Country Bubba
Bryscus
Posts: 7
Joined: Tue Oct 17, 2017 8:57 pm

Re: NX CAM Output Problems with Autoleveller

Post by Bryscus »

Great! Good to hear it showed up correctly for you. Much of my debug was determining the difference between my Eagle gcode and the NX stuff. ;)

As for the "%", I think you're right. It's just at the beginning and end. I assumed that meant comment, but apparently not. Bad assumption. :)

I guess the trailing zeroes only matter if the decimal point exists.

Thanks for helping me out. I'm sure I can figure out how to adjust the post output.
- Bryce
daedelus
Site Admin
Posts: 387
Joined: Tue Oct 01, 2013 1:41 pm
Location: London, UK
Contact:

Re: NX CAM Output Problems with Autoleveller

Post by daedelus »

Allow me to jump in here. I think yourself and Art pretty much have this sorted but there are a couple of points I need to clear up...

You are correct in your conclusion that AE does not like blank spaces before and after the decimal point and I can clear that up in the code fairly easily I hope. It should not matter if trailing/leading zeros are there or not. Stay tuned for the fix.

If you look closely at your modified file, you will see that the J words are missing leading 0's still. Re-adding 0's causes the viewer to draw arcs correctly as can be seen here:
correct1.png
So, actually the leading/trailing zero issue and the arc problem are one and the same thing.

Thanks for letting us know as it needed fixing :)
http://www.autoleveller.co.uk/. Software to probe and adjust a GCode file for PCB's or any probe-able surface.

http://www.autoleveller.co.uk/cnc-probe-guide/. A short guide to setting up the probe.

-James
Bryscus
Posts: 7
Joined: Tue Oct 17, 2017 8:57 pm

Re: NX CAM Output Problems with Autoleveller

Post by Bryscus »

James,

Thanks for chiming in! I had come to the same solution before I checked your post. I added the leading zeroes for the "J" words and all was well. I figured something was still wrong with my code when after I changed the post all my arcs worked correctly.

Hopefully the leading and trailing zeroes are an easy fix.

I'm not sure what the rules are when it comes to G words, but I did find that AutoLeveller seems to want a G word forced at the beginning of every line rather than assuming the last G word is still in effect. For example:

This is not OK:

Code: Select all

N0060 G02 X1.7849 Y0.9549 I-0.1669 J0.0953
N0070 X1.7359 Y0.9183 I-0.219 J0.2424
N0080 X1.7076 Y0.9026 I-0.2112 J0.3467
N0090 X1.6783 Y0.8889 I-0.2421 J0.4798
This is OK:

Code: Select all

N0060 G02 X1.7849 Y0.9549 I-0.1669 J0.0953
N0070 G02 X1.7359 Y0.9183 I-0.219 J0.2424
N0080 G02 X1.7076 Y0.9026 I-0.2112 J0.3467
N0090 G02 X1.6783 Y0.8889 I-0.2421 J0.4798
The top code renders with an issue, but the bottom is fine.

Any thoughts? Thanks.

P.S. AutoLeveller also doesn't seem to care how many trailing zeros there are (as long as there is at least one, which I believe it correct as well.
- Bryce
daedelus
Site Admin
Posts: 387
Joined: Tue Oct 01, 2013 1:41 pm
Location: London, UK
Contact:

Re: NX CAM Output Problems with Autoleveller

Post by daedelus »

The top code should be OK to be honest. I will check it out.

I have a couple of thoughts on this. Maybe the N words are 'getting in the way'? Not sure yet. Will let you know.

Thanks again.
http://www.autoleveller.co.uk/. Software to probe and adjust a GCode file for PCB's or any probe-able surface.

http://www.autoleveller.co.uk/cnc-probe-guide/. A short guide to setting up the probe.

-James
Post Reply