New features for Lobo CNC control program

336 views
Skip to first unread message

Jeff

unread,
Aug 25, 2013, 5:59:02 PM8/25/13
to lob...@googlegroups.com
Hi All, I've added a few features (by popular demand) to the Lobo PSCNC controller program, but I haven't yet posted the new version.  I wanted to see if there are any pressing requests for other new features before posting.  (I prefer to keep program updates infrequent.)  Look over these additions and let me know if there's anything else you'd like me to stuff into this update:

1. R-mode arcs - Arcs can be specified either with an end point and I, J, K parameters or alternately with a single R parameter.  for example: 

G02 X1.0 Y2.5 R7

will produce a clockwise arc from the current position to the X,Y,Z goal point with a radius of 7.  R-format arcs will always be less than 180 degrees.  The R value must be positive.  If the R value is less than 1/2 of the chord length between endpoints, a 180 degree arc will be formed.  

2. Executing any G-code (either from a file or using immediate single line execution) will now set the focus to the Feedhold button.  Hence, pressing the spacebar or Enter key will execute a feedhold.  (You can also click on the Feedhold button.)

3. Clicking on the displayed  X, Y or Z coordinates will allow you to set the current position to a specific value.  You can still click on the Set X,Y or Z Origin buttons to make the current position 0.0.

4. The G-code filename is displayed at the top of the window.

-Jeff

no...@nlbrewe.com

unread,
Aug 26, 2013, 5:32:44 AM8/26/13
to lob...@googlegroups.com
The only other thing I can think of would be a "continue" button on the pop-up dialogs to change the tool and turn on the spindle so I don't have to press OK, and then press "start the g-code" button. Maybe the current setup is considered a safety feature and it is not a big deal. Thanks for making the other changes.
Norm

Jeff

unread,
Aug 26, 2013, 5:40:53 PM8/26/13
to lob...@googlegroups.com
I've now posted a new version of the Lobo PSCNC controller program at: lobocnc.com/lobopscnc.zip.  It has the new features listed above.  Check it out and let me know if I've screwed anything up.
-Jeff

no...@nlbrewe.com

unread,
Aug 29, 2013, 7:03:38 PM8/29/13
to lob...@googlegroups.com
I ran the new version for several hours yesterday. The new features work fine, but there is some kind of occasional problem that comes up after I have opened a g-code file several times. The open seems OK, but when I try to run the file I get a series of cascading error dialogs that say access violation at address xxxxx trying to access address yyyyy. The only way to recover is to use task manager to kill pscnc. I have a screen shot I can email you if that helps.

Jeff

unread,
Aug 29, 2013, 8:39:38 PM8/29/13
to lob...@googlegroups.com
That's interesting - I ran into the same bug just today, but I was running on an ancient Win98 machine and assumed it was an operating system compatibility issue.  I've put the original version back in place on the web site (in case anyone doesn't still have it) and I'll track down the bug tomorrow.

-Jeff

no...@nlbrewe.com

unread,
Aug 30, 2013, 9:26:08 AM8/30/13
to lob...@googlegroups.com
I notice that when I open another file, the new file name is appended to the previous windows title instead of replacing the previous windows title. I assume eventually the windows title runs out of space.

Norm

Jeff

unread,
Aug 30, 2013, 12:55:41 PM8/30/13
to lob...@googlegroups.com
Thanks, Norm.  I fixed the bug and the new version of the controller program is again available at: lobocnc.com/lobopscnc.zip.

-Jeff

no...@nlbrewe.com

unread,
Sep 10, 2013, 9:06:41 PM9/10/13
to lob...@googlegroups.com
I've been using the new version of the program for a while and like it. I asked for the R arc format because I was hoping to fix a problem I was having with F-Engrave and a monogram kk font. F-Engrave has an option to turn off arcs, and when they are off, I was getting segments on some curves. Turning arcs on didn't fix the problem, but caused another one. PSCNC handled the first part of the G-code fine which included some arcs, and then on a G1 instruction it started going in a straight line in the +y direction and didn't stop. The instruction was
G1 X-1.6695 Y0.0789 Z-0.1137 (line 545)
This was with contour on. With contour off, it did the same thing at a different G1 instruction. Turning off arcs in F-Engrave fixed the problem.
I can send the G-code file if that helps. The only other thing I can think of is that I didn't home the mill before starting, but was well within the operating envelope. This problem is very repeatable. I can send the G-code file if that helps.

Jeff

unread,
Sep 14, 2013, 3:41:34 PM9/14/13
to lob...@googlegroups.com
Norm - looks like this is an issue with a G02 arc in your G-code.  It specifies a 0.02" move with radius  of 33", which amounts to more or less a straight line.  For some reason, it is deciding to travel the entire circle plus a small amount rather than just travelling the small amount commanded.  Numerically, it can be tricky handling cases of extreme parameters like this - you end up having to check for situations which are close to mathematical singularities (like a divide by zero).  I'll look at the code and see where the math is failing and add the appropriate checks.

-Jeff

Ted Markson

unread,
Jan 23, 2014, 12:17:55 PM1/23/14
to lob...@googlegroups.com
Jeff, you probably know about these issues but here's two filename problems I've run into. Let me know if this thread isn't appropriate for them,

When you export a single machine op gcode from Cambam, it makes a file named like this: '...[machine_op]...'    Apparently that breaks PSCNC!  The program closes shortly after clicking Open. 

Also trying to open a gcode file with an extra period in the name will cause an unhandled exception in PSCNC.

I'm digging the arc handling!  And the editable DRO is great, excellent features added and they work well for me! Thanks Jeff,

Ted

Jeff

unread,
Jan 26, 2014, 2:08:55 AM1/26/14
to lob...@googlegroups.com
I'll check into this and hopefully post a fix soon.

-Jeff

Doug

unread,
Feb 1, 2014, 11:33:26 PM2/1/14
to lob...@googlegroups.com
Feature request (unless I missed it somehow): a simulation mode so we can validate gcode w/out connecting to the CNC.

Jeff

unread,
Feb 2, 2014, 10:28:42 PM2/2/14
to
A simulation mode would be nice, but might take me a while to get to it.  There are a number of G-code simulators available - either free,free with reduced functionality, or with mildly annoying "refresh" requirements.  Apparently OpenSCAD will simulate your G-code program, but I haven't tried it.  I also know that CamBam shows to the generated toolpaths, although it doesn't show you the resultant part.

-Jeff

Oops, that should be OpenSCAM rather than OpenSCAD

thest...@gmail.com

unread,
Feb 10, 2014, 9:09:31 PM2/10/14
to lob...@googlegroups.com
One issue I have had with CamBam and PSCNC is drilling holes.

What I was doing was making a grid of .25" holes. I took my end mill, set the drill size to .25", and told it to plot out the hole grid. PSCNC cannot recognize that G-code, or the G-Code setup for a drill pattern. What I did do, however, was tell it to drill, then search for the G-Code and manually replace it with a fed plunge and a travel retract. Using Find/Replace was the easiest tool, and it didn't take that long.

I do think it would be an easy thing to add, to recognize drill G-Code, but then again, I am not on the software side of this.

Jeff

unread,
Feb 11, 2014, 11:13:32 AM2/11/14
to lob...@googlegroups.com
Drilling is usually done with a "canned cycle" where a single line of G-code actually executes several separate motions.  The PSCNC program is not really structured to handle canned cycles, so it would take a bit of work to implement.

There are, however, a couple of ways of handling drilling.  Firstly, the minimum speed of most routers is about 10,000 RPM which is way too fast for most drilling operations.  CamBam offers a Spiral drill operation that makes a spiral cut of the right diameter using a smaller diameter end mill.

However, what I usually do for most drilling operations (1/16 thru 3/8") is to just use the mill for spot drilling the hole locations and then I do the actual drilling on drill press or by hand.  For this I select the "Custom Script" option in CamBam, and use the following code for a custom script:

G00 Z0.100
G00 X$x Y$y
G01 Z-0.05 F5
G00 Z0.1

The "$x" and "$y" will be replaced by actual numerical values by CamBam when it generated the G code.

-Jeff

Ted Markson

unread,
Mar 2, 2014, 11:35:15 PM3/2/14
to lob...@googlegroups.com
On Saturday, September 14, 2013 3:41:34 PM UTC-4, Jeff wrote:
Norm - looks like this is an issue with a G02 arc in your G-code.  It specifies a 0.02" move with radius  of 33", which amounts to more or less a straight line.  For some reason, it is deciding to travel the entire circle plus a small amount rather than just travelling the small amount commanded.  Numerically, it can be tricky handling cases of extreme parameters like this - you end up having to check for situations which are close to mathematical singularities (like a divide by zero).  I'll look at the code and see where the math is failing and add the appropriate checks.

-Jeff

Jeff, 

I'm seeing the same issue as Norm did with some G02 arcs in my gcode on the lobo. I've forgotten which code line it is exactly but it was a small arc with a ~50mil radius. 

Were you ever able to look at the PSCNC source to debug this? 

Thanks,

Ted 

Jeff

unread,
Mar 3, 2014, 12:01:44 PM3/3/14
to lob...@googlegroups.com
I believe I have found the problem with the large radius arc.  It turns out that arcs which cover an angle of less than 0.06 degrees will mistakenly produce a full circle rather than a tiny arc segment.  I'm trying to decide the best way to fix this.  Many G-code interpreters do not allow arcs greater than 180 degrees, but I really like being able to simply use something like "G02 I-0.5" to get a complete circle.  The problem is in distinguishing this case, where the beginning and ending points are exactly the same (and thus calling for a complete circle), from the case where the beginning and ending points are nearly the same, where you want a very small arc instead.  In any case, hope to have a fix soon.

Ted, It sounds like you might be running into a different issue.  If you can send me the exact lines of G-code that are giving you trouble, I'll have a look.

-Jeff

Jeff

unread,
Mar 3, 2014, 1:22:12 PM3/3/14
to lob...@googlegroups.com
Also - until I get a fix for the arc issue, there are some tweaks you can make to the CamBam post processor to avoid having it produce problematic arc commands.  First, select the System tab and expand the Post Processors folder.  Click on the post processor you are using (I'm still using Default).  In the Options section of the properties below (make sure you are looking at the Advanced properties rather than the Basic properties), change the Maximum Arc Radius to something like 100 (from 10000) and change the Minimum Arc Length to 0.005.  This will force CamBam to produce line segments instead of arcs for these extreme cases.

This may still miss a few cases, so your other option is to change the Arc Output Mode from from Normal to Convert to Lines.  This will convert all arcs to lines, and you should set the Arc to Lines tolerance to something like 0.001.  This produces larger G-code files, but that shouldn't be a problem.

-Jeff

Ted Markson

unread,
Mar 3, 2014, 2:02:00 PM3/3/14
to lob...@googlegroups.com
Jeff - thanks for looking into this!   I wasn't sure about the line number (pscnc doesn't have line numbers!) so I will get back on the machine and keep track of lines. I was milling anything, just doing an air pass looking for this movement issue. 

I bet the Convert to Lines option will work fine. The only issue with that is the curves become segmented (no look ahead). It'll work but eventually these moulds need a pure curve to make the best composite layups. 

I'll report back tonight (EST), thanks again for your attention on this, 

Ted

Jeff

unread,
Mar 3, 2014, 6:10:46 PM3/3/14
to lob...@googlegroups.com
I think I have a fix for at least one of the arc issues in PSCNC.  Arcs that traverse less than about 0.1 degrees are now replaced by a line segment.  I've posted this change at:


If it seems to work for everyone (or at least causes no more problems than the previous version), I'll make this the main download version.  Also in this version, I increased the communications timeout to keep gutless computers (like the netbook I'm using) from getting communications errors.  Let me know if this version gives anyone any grief.

-Jeff

Ted Markson

unread,
Mar 4, 2014, 6:05:41 AM3/4/14
to lob...@googlegroups.com
On Monday, March 3, 2014 1:22:12 PM UTC-5, Jeff wrote:
Also - until I get a fix for the arc issue, there are some tweaks you can make to the CamBam post processor to avoid having it produce problematic arc commands.  First, select the System tab and expand the Post Processors folder.  Click on the post processor you are using (I'm still using Default).  In the Options section of the properties below (make sure you are looking at the Advanced properties rather than the Basic properties), change the Maximum Arc Radius to something like 100 (from 10000) and change the Minimum Arc Length to 0.005.  This will force CamBam to produce line segments instead of arcs for these extreme cases.

Jeff,  your recommendation worked for me! I saw the new program version and will try it soon (tomorrow hopefully).- ted
Reply all
Reply to author
Forward
0 new messages