Bad character error

Help for setting up and using
Post Reply
allnew
Posts: 7
Joined: Tue May 06, 2014 10:39 pm

Bad character error

Post by allnew »

What would this error in one of the code lines represent ? Without autoleveller, the code works fine. With autoleveller, the program generates the error when I am running it on the cnc machine.
thanks
tony
daedelus
Site Admin
Posts: 387
Joined: Tue Oct 01, 2013 1:41 pm
Location: London, UK
Contact:

Re: Bad character error

Post by daedelus »

Can you give me a bit more information.

Can you copy & paste the line and the ones around here please
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
allnew
Posts: 7
Joined: Tue May 06, 2014 10:39 pm

Re: Bad character error

Post by allnew »

Notice the period after the brackets at N1232....
#102=[#575+0.10259*#587-0.10259*#575]
#101=[#576+0.10259*#588-0.10259*#576]
#100=[#102+0.67476*#101-0.67476*#102]
N1230 X1.1042 Y2.0047 Z[#100 + -0.004]
#102=[#575+0.08828*#587-0.08828*#575]
#101=[#576+0.08828*#588-0.08828*#576]
#100=[#102+0.6741*#101-0.6741*#102]
N1232 X1.104 Y2 Z[#100 + -0.004] .
#102=[#575+0.07154*#587-0.07154*#575]
#101=[#576+0.07154*#588-0.07154*#576]
#100=[#102+0.6751*#101-0.6751*#102]
N1234 X1.1043 Y1.9945 Z[#100 + -0.004]
daedelus
Site Admin
Posts: 387
Joined: Tue Oct 01, 2013 1:41 pm
Location: London, UK
Contact:

Re: Bad character error

Post by daedelus »

OK, my initial look at my Autoleveller code didnt tell me much.

Does this happen anywhere else in the file?

Which version of Autoleveller are you using?

If you generate the file again, do you get the same problem in the same place?

If the problem is still there please email the original non-autolevelled file to daedelus@autoleveller.co.uk so I can re-create the issue.

thanks,
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
daedelus
Site Admin
Posts: 387
Joined: Tue Oct 01, 2013 1:41 pm
Location: London, UK
Contact:

Re: Bad character error

Post by daedelus »

Thanks for sending the file. This is interesting...

The original line is:
N1232 X1.104 Y2.

which is interpreted by the Autoleveller as:
N1232 X1.104 Y2 Z[#100 + -0.004] .

Autoleveller is using the regular expression "-?[0-9]*[\\.,]?[0-9]+" to search for valid numbers in the line. The regex essentially says if there is a point in the number then it must be followed by 1 or more digits, and in this case there are no more digits after the period. So it reads 2 correctly then reads the period as a separate entity. The Y value should be either Y2 or Y2.0 but not Y2.

I think the Autoleveller is correct with its interpretation of numbers but I would like to get someone else's opinion on this?

So, the question is, is "2." a valid number or must it be "2" or "2.0" even?

What software generated the file?

In the meantime you can just use a text editor to search and replace "] ." with "]". There are only 3 places in the levelled file with this problem that I found.
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
allnew
Posts: 7
Joined: Tue May 06, 2014 10:39 pm

Re: Bad character error

Post by allnew »

I am using Mastercam to generate the code. And yes, I've been using a text editor to remove the period.
Fortunately, it's an easy problem for the editor.
tony cervone
daedelus
Site Admin
Posts: 387
Joined: Tue Oct 01, 2013 1:41 pm
Location: London, UK
Contact:

Re: Bad character error

Post by daedelus »

Hi Tony,

I still think this is a strange notation, but Mastercam is a big program so I have made the changes to AutoLeveller to comply with their floating point notation. I have made the change to v0.8.2 only so its completely up to you whether you want to purchase it or not.

I will email you the file which v0.8.2 has output (unmodified by text editor) so you can see the result. thanks.
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