Problem long lines of code

General Discussion about anything!
GordonRB
Posts: 5
Joined: Mon Mar 24, 2014 11:22 am
Location: Aberdeen, Scotland
Contact:

Problem long lines of code

Post by GordonRB » Mon Mar 24, 2014 6:53 pm

Having just built my Shapeoko 2 it works perfectly with files made directly in MakerCAM, but there is a problem when I transfer a design from Inkscape to MakerCAM. The lines of code are too long and return error messages. When I look at the files in a viewer, there very long lines of code.
I am sure I read something about this somewhere but cannot re-discover where it was or what the cure is. Please can anyone help by providing a solution or pointing me to where I can find the solution? Please be aware that I am not a computer buff. I design subsea equipment but I leave all the control electronics to the experts!

From InkScape:-
G1 X57.88324873096447 Y68.31472081218274 F300
G2 X57.97969543147208 Y68.83756345177665 I13.527918781725887 J-2.2030456852791875
G2 X58.55837563451777 Y70.43908629441624 I5.682741116751268 J-1.1522842639593909
G2 X57.88324873096447 Y71.18781725888324 I0.9467005076142132 J1.5304568527918783

From MakerCAM:-
G1 X86.80203045685278 Y97.83756345177665
G0 Z5
G0 X82.00177664974619 Y102.63756345177664
G1 Z-2 F200
G1 X82.00253807106598 Y167.23857868020303 F300
G1 X80.88832487309645 Y167.23857868020303

Thanks,
GordonRB

WillAdams
Posts: 8514
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Problem long lines of code

Post by WillAdams » Mon Mar 24, 2014 7:03 pm

You are correct, this is an issue.

It's addressed in ``Operations Troubleshooting'' on the wiki: http://www.shapeoko.com/wiki/index.php/ ... leshooting

which notes: ``Co-ordinates have too many decimals
GRBL is limited in the number of characters per line it can handle, which causes it to ignore the end portions of too-long lines. If your job is previewing correctly, but not running properly, check to see that line lengths are w/in its limits (50 for older versions, 70 for 0.8c dev or later) as discussed in the forums''

and links to:

http://www.shapeoko.com/forum/viewtopic.php?f=3&t=1161
http://www.shapeoko.com/forum/viewtopic.php?f=33&t=1536

Best option is using a Communication / Control program which will trim the too-long lines on the fly.

Alternately, use a tool to trim them off, either a text editor w/ GREP, or the javascripted web page (should we host that somewhere? Is there some equivalent tool already on-line?).
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

GordonRB
Posts: 5
Joined: Mon Mar 24, 2014 11:22 am
Location: Aberdeen, Scotland
Contact:

Re: Problem long lines of code

Post by GordonRB » Mon Mar 24, 2014 7:36 pm

Thanks for such a quick reply. I will follow this up this evening. I guess that at some point I will have to get into the programming. As a designer, I am impressed with the machine, and just want to get it working to make parts for my models.

Oud
Posts: 23
Joined: Sat Dec 07, 2013 5:54 am

Re: Problem long lines of code

Post by Oud » Tue Mar 25, 2014 2:42 am

For what it's worth I've also run into the character length issue. I've been working around this by working in inches whenever I can. Makercam seems to be more efficient at making short g-code for imperial. I originally thought it was a fault of mine for making my svg in imperial and doing CAM in metric. But I've done makercam gcode in both imperial and metric from the same svg and the imperial had nice short lines while the metric was unrunable (even if a communication program can modify it on the run, I'm paranoid/OCD and like my gcode to be able to be run 'raw')

I wonder if the generation code starts in imperial and generates metric with a bunch of n=n*25.4's which balloons out the decimals?
Stock Shapeoko2, First pre-order batch.

WillAdams
Posts: 8514
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Problem long lines of code

Post by WillAdams » Tue Mar 25, 2014 2:51 am

Something like that.

There's a setting for precision which I've tried changing, but anything but the default value seems to make MakerCAM crash even more often.

We really do need to take MakerCAM apart, document the source code, re-create it using an opensource toolkit and see what we can do to make it reliable.
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

noproblem
Posts: 60
Joined: Tue Mar 18, 2014 12:10 pm
Location: Jamaica
Contact:

Re: Problem long lines of code

Post by noproblem » Tue Mar 25, 2014 12:17 pm


WillAdams
Posts: 8514
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: Problem long lines of code

Post by WillAdams » Tue Mar 25, 2014 12:33 pm

Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

GordonRB
Posts: 5
Joined: Mon Mar 24, 2014 11:22 am
Location: Aberdeen, Scotland
Contact:

Re: Problem long lines of code

Post by GordonRB » Wed Mar 26, 2014 6:25 pm

I tried using imperial instead of metric, and it worked fine, so that got me started. Being a complete non-starter on the programming side, I then thought what I might do with programs I am familiar with.
Taking one of the problematic .nc files, changed the .nc to .doc and opened in MSWord. Using find/replace, replaced X with X(tab) Y with Y(tab) etc,
Then copy and paste the whole text into a blank Excel spreadsheet - all the numbers are now in columns. Define all numerical values as truncated to 4 decimal places, and save as .txt file.
Open the new .txt file with Word, then find/replace all the tabs with nothing. All text is now as per original but all numbers are truncated to 4 decimal places.
Resave the file as unicode .txt, then change the file from .txt to .nc. Ran the files through the machine using UniversalGcodeSender. This worked, so now have written macros in word to automate both processes of putting tabs in, and then taking them out again. This whole routine now takes only minutes to complete.
Haven't tried the geode-truncator yet but will give that a spin also in the next few days.
Two other quick questions for the experts out there:-
1. Are the I and J co-ordinates necessary, as I believe they control tool angle on a 5-axis machine, so maybe can be taken out altogether?
2. Having a problem with MakerCAM with things like letter O which is shown as two concentric circles. When entered as a pocket operation to cut out between the two circles, the tool path only takes out the centre circle, leaving the outer circle untouched. Same thing happens with other letters like a and p where the letter is not cut out, only the enclosed centre part. If anyone can tell me what I am doing wrong, I would appreciate it.
Thanks, Gordon.

edwardrford
Posts: 1250
Joined: Mon Apr 09, 2012 5:40 pm
Location: Dixon, IL
Contact:

Re: Problem long lines of code

Post by edwardrford » Wed Mar 26, 2014 6:39 pm

Hi Gordon,

your post made me smile. It reminded me so much of the comic shown below.

To your questions:
1.) The I,J are for circles/arcs, so yes they are necessary.
2.) I believe you can solve that by changing the order by which you select the 2 circles. IIRC, you need to select the inside profile *FIRST* and then the outside profile. If you do it the other way around, it'll try to fill the whole area. Play around with that idea a little and see if it helps.

Image

-Edward
Shapeoko 1 #0 - a couple of upgrades.
Shapeoko 2 #0 - a couple of upgrades.
Shapeoko 3 #2 - Stock

GordonRB
Posts: 5
Joined: Mon Mar 24, 2014 11:22 am
Location: Aberdeen, Scotland
Contact:

Re: Problem long lines of code

Post by GordonRB » Wed Mar 26, 2014 9:47 pm

Edward,
Thanks for the post - I will put that on my wall (cut and paste of course!)
My philosophy is : We don't have a problem, we have a situation - if we can't find a solution to the situation, then we have a problem. So far no problems, only solutions, of these some may not be elegant but they work!
Especially with help from the forum.
Cheers,
Gordon.

Post Reply