In doing some testing of the modifications of the Eagle widget that Ameen has

In doing some testing of the modifications of the Eagle widget that Ameen has doing (great job BTW) I ran into some other issues.

Issue #1
The Gode that is produced, produces a line M3 S12000 (Spindle Speed). The 12000 is whatever you set the the speed to in the widget. For me it’s 12000. However, this does not work for me. I have to modify the Gcode in the following way.

S0 12000

The speed and start line order can be reversed but seems to me that when combined on a single line it get’s ignored.

Issue #2
If I hit stop on a Gcode run and then go to restart it does not seem to work. It continues on from the last gcode line not the beginning. unless I enter at least 1 command via console interface and click the rewind to beginning button on the Gcode widget. Even though I have the "Send Feedhold and Queue Flush (!%) on Stop " checked I still have to rewind. Usually the 1 command I run is the M5. I don’t this one is related to the Eagle widget. I did not have to do this before. Has something changed in CP or is me.

Anybody else have these Issues? Happens with Chrome and Firefox. I use a TinyG with:
[fb] firmware firmware build 440.17
[fv] firmware version 0.97
[hp] hardware platform 1.00
[hv] hardware version 8.00

I did not have chance to test Ameen changes yet, but at the time I modified Eagle widget by adding a spindle speed the default gcode was set to ‘M3 S12000’ (12000 is the max speed supported by the 400W spindle I use) and then John added this modification to the main TinyG workspace. Could you compare if TinyG workspace works OK or same error occurs?

I would not be surprised if we’ve had that spindle line wrong all along. I have a manual spindle and so do lots of others in this community, so I just don’t think it’s had much testing. This is a super easy fix though.

On the Gcode question about play/rewind, it is possible you have found a bug, but I just tried running right now and it seems to work as normal. I do recommend not using “send feedhold and queue flush on stop”. I don’t think it’s the best approach anymore. I think it’s best to isolate feedhold from playing gcode. Also, when you say you hit the rewing button, do you mean the reverse step button? the only button that actually rewinds is the square stop button.

I did some additional testing. Under the Gcode widget I changed the

Multi-Line Upload Mode
Do Not Use Multi-Line Mode <--------- Selected “Do Not Use” option
Yes, Use Multi-Line Mode (Default)

In addition I changed the
Delay Per Gcode Upload Event (i.e. per line) to 100ms

Both issues have been resolved by this change.
The “M3 S12000” statement on a single line works now.

Not sure why I needed to do this all of a sudden but it works.

Ameens changes appear to be working very nicely. As soon as the curves and tabs are stable I will run a full test. So far they both appear to work.


I did some manual testing of the individual commands. They work on their own so I would hold on changing that just yet. Looks like multi line mode was the culprit here. I’ll run more tests to be sure though. One other issue that I noticed.

I do all my development work on a MAC. However, the Gcode coming out of the Eagle widget does not have CRLF. Since I run CP on a Windows machine the file is one long line. While I though this could be an issue it does not appear to be. I manually exported the Gcode and corrected it on Windows. However, I still got the same issue when pulled back in as gcode file. So right now multiline looks like the culprit. However it would not hurt to ensure there are CRLFs in the file if it matters to the the internals of CP or TinyG.

I am baffled that switching to “do not use multi-line mode” would change the behavior much. I always use multi-line mode. I may have to dig deeper but I’m at Consumer Electronics Show right now in Vegas.

On the CR/LF I always just use “\n” for everything in ChiliPeppr and try to toss out CRLF whenever possible. You would have to use a text editor that supports both if you export the Gcode. I use Atom editor or Microsoft’s Code editor (which is pretty darn nice these days).


Yeah the Multiline change is night and day, but it’s working for me right
now so don’t sweat it. As for CRLF I totally agree, I use Atom too and just
wanted to point out the issue in case it mattered. Enjoy the show I was
going to try to go but work got in the way.

I usually do not use the whole gcode file generated by Eagle widget at once, but make few copies of the file and keep one section per file, I am particularly interested in. This way I have a separate file for milling and marking holes, another file for drilling, another for outline cutting. I edit all those files manually to make sure that I keep the header and footer sections and that my M3/M5 are in correct order to avoid Z going down into workpiece with non rotating spindle. The first Eagle generated gcode containing all sections is copied by Ctrl+C/Ctrl+V into Notepad++ blank document and I never had the missing CRLF (single long line) issue. Possibly Windows Notepad will reproduce this problem.
I am on Windows 7 OS.

I’m considering adding checkboxes to the widget to allow only selected sections to be added to the gcode file, so no manual edition is needed.

When I do prototyping for PTH circuits I like to use a single Endmill .6mm and run the whole file through in a single run. Saves me alot of time. However, for more complex boards or SMDs where I have to use more than one tool. Like you I break the file up. I actually wrote python scripts to do this. With Ameens mods some of those scripts are not needed. Yes I would like to modify the widget to handle file operations and auto probing together. So that I can run a file and know the Header and Footers of each Gcode file are right along with Autoprobing and automatic tool change too.

Let me know if you’re going ahead with the selective gcode enhancements. I started last night building a mini framework for these selections but if you’re addressing it already it makes more sense for me to stop as your solution will be intrinsically more elegant having knowledge of the code base.

Justin, keep going, I’m not there yet I have a few other priorities in the way. But lets keep in sync si that we can time contributions. I can help test though.

I already have this idea to add checkboxes for some time, but unfortunately I won’t be able to do any coding within next couple of weeks, highly loaded at work including some travelling.

@sszafran @Michael_Omiccioli ok - I have spent an hour and got a skeleton ready. I will see what I can do in the meantime.

My approach is quite crude at the moment - I am leaving the whole gCode in the textarea and sending only the interesting parts on a click event.

In reparsing all the gcode lines into segments but from an analysis of the code it looks like there may already be some segmentation done earlier in the import process. In which case there may be some optimisation to be had by using that.

the UX is a bit ugly. I plan to go with something similar to the tinyg widget button. ie. open up a virtual modal panel, have checkboxes styled as push buttons. If there is a more elegant UX you have in mind let me know and I will have a go.

I like the virtual panel solution. The interface is getting crowded and it’s better to keep items off the screen once set. Can it also be set to remember settings that are not unique to the current job? What is the layout tool you plan to use?

If you look at the code of the Eagle BRD widget, the method exportGcode is where the magic happens starting on line 2349. It’s a really simple function that I’ve summarized here with just the parts of the Gcode that it uses. All you would need to do is create a 2nd method like exportSpecialGcode and reference the checkboxes in your UI to decide on which parts to export. That way we don’t break your method in the future because i’m guessing you’re using a regular expression approach or searching for comments to know which part of the Gcode is which.

exportGcode: function() {

        this.addGcode(i, this.exportGcodeHeader()     );
        this.addGcode(i, this.exportGcodeMilling()    );
        this.addGcode(i, this.exportGcodeMarkHoles()   );   //V5.2D20170105 added
        this.addGcode(i, this.exportGcodeDrillHoles()  );   //V5.2D20170105 added
        this.addGcode(i, this.exportGcodeMillHoles()  );    //V5.2D20170105 added
        this.addGcode(i, this.exportGcodeDimensions() );
        this.addGcode(i, this.exportGcodeFooter()      ); // let space for additional gcode entrys


Thanks @jlauer ​. Oddly I was reading and learning the code from the end up as the end was where I found was the start of the parsing process. Thanks for the reference.