Circles and CNC
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Circles and CNC
Howdy all (again)
I am seriously new to this - so my apologies if this is something obvious!!
NOTE: I saw elsewhere about "converting lines and arcs into segments" (command: OG) but that didn't work either. :/
My situation....
I am having a problem exporting a DXF file with circles and arcs! I will design something in QCAD that contains arcs...
Then use the CAM Export
Then load it into my Linux CNC machine
...I get an error.
Judging on what I see in the error message, for some reason arcs do not line up when exported~!! However, I can make the same drawing, save it as an SVG and use Makercam to export it for the CNC...and it works. (so I'm sure it is not my CNC software).
Idea? Help? It would really be an arduous process to draw these things by hand!
...I've uploaded an error message...
I am seriously new to this - so my apologies if this is something obvious!!
NOTE: I saw elsewhere about "converting lines and arcs into segments" (command: OG) but that didn't work either. :/
My situation....
I am having a problem exporting a DXF file with circles and arcs! I will design something in QCAD that contains arcs...
Then use the CAM Export
Then load it into my Linux CNC machine
...I get an error.
Judging on what I see in the error message, for some reason arcs do not line up when exported~!! However, I can make the same drawing, save it as an SVG and use Makercam to export it for the CNC...and it works. (so I'm sure it is not my CNC software).
Idea? Help? It would really be an arduous process to draw these things by hand!
...I've uploaded an error message...
- Attachments
-
- QcadArcError.png (128.86 KiB) Viewed 16740 times
>>>Thanx!
~Sterl~
~Sterl~
Re: Circles and CNC
The X/Y coordinates in your G-Code file look like they are relative. However, your application tries to interpret them as absolute coordinates.
You either have to:
- produce absolute X/Y coordinates with QCAD/CAM or
- add a setting to the header to tell your machine that X/Y coordinates are relative (incremental). You can do this very likely by changing G90 in the header to G91.
Keep in mind that Z movements will likely also be interpreted as being relative if you switch to G91 (incremental) positioning. I'd recommend to stick to absolute coordinates.
What configuration did you use when creating the G-Code file from QCAD/CAM? The default configuration of QCAD/CAM ('GCode') actually produces absolute X/Y coordinates.
Or perhaps your machining software has converted the file based on some user preference? Just a wild guess...
You either have to:
- produce absolute X/Y coordinates with QCAD/CAM or
- add a setting to the header to tell your machine that X/Y coordinates are relative (incremental). You can do this very likely by changing G90 in the header to G91.
Keep in mind that Z movements will likely also be interpreted as being relative if you switch to G91 (incremental) positioning. I'd recommend to stick to absolute coordinates.
What configuration did you use when creating the G-Code file from QCAD/CAM? The default configuration of QCAD/CAM ('GCode') actually produces absolute X/Y coordinates.
Or perhaps your machining software has converted the file based on some user preference? Just a wild guess...
Re: Circles and CNC
Howdy -
Thanx for the reply Andrew~!
Here is the thing:
I have exported it using the "GCode" option as well as the "LinuxCNC" option (which was a *.js script file written by someone from the LinuxCNC forms)
In the past, I have exported designs that have contained arcs before, and there has been an intermittent problem...but not every single time like I am getting now. :/
I have even taken the arcs, and trace over them using the "Two Points And An Angle" command (A2) repeating them with a 10 degree angle.
I'm fairly certain there is something awry in the exporting process because when I do so, the header and initial coordinates are as follows =
G20 G17 G40 G49 G54 G64 P0.005 G80 G90 G94
G0 ZNaN
XNaN YNaN
...obviously this will not do!
I uninstalled and updated QCADCAM to version 3.7.2
I'm pretty new to this, and don't understand much regarding the terminology or definitions; I draw and export! So if I miss something or am not clear, let me know & I will try to me more clear! Thanx~!
Thanx for the reply Andrew~!
Here is the thing:
I have exported it using the "GCode" option as well as the "LinuxCNC" option (which was a *.js script file written by someone from the LinuxCNC forms)
In the past, I have exported designs that have contained arcs before, and there has been an intermittent problem...but not every single time like I am getting now. :/
I have even taken the arcs, and trace over them using the "Two Points And An Angle" command (A2) repeating them with a 10 degree angle.
I'm fairly certain there is something awry in the exporting process because when I do so, the header and initial coordinates are as follows =
G20 G17 G40 G49 G54 G64 P0.005 G80 G90 G94
G0 ZNaN
XNaN YNaN
...obviously this will not do!
I uninstalled and updated QCADCAM to version 3.7.2
I'm pretty new to this, and don't understand much regarding the terminology or definitions; I draw and export! So if I miss something or am not clear, let me know & I will try to me more clear! Thanx~!
>>>Thanx!
~Sterl~
~Sterl~
Re: Circles and CNC
NOTE: Lines #2 and #3 were hand coded in by me (the were NaN)
Also...the Initial X and Y coordinates are negative, ad that doesn't make sense either as I have the image well within the positive side of the area!
Also...the Initial X and Y coordinates are negative, ad that doesn't make sense either as I have the image well within the positive side of the area!
>>>Thanx!
~Sterl~
~Sterl~
Re: Circles and CNC
OK, it looks like the configuration you are using is probably broken.
I've attached a simple configuration based on the information I've seen on your screenshot:
(attachment removed, latest version below)
I'd expect that there are probably other things that need to be adjusted, just let me know.
- Quit QCAD/CAM
- Save the attached file to your QCAD/CAM installation under scripts/Cam/CamConfigurations
When converting to CAM, choose the configuration "LinuxCNC". You can choose absolute or incremental positioning. The configuration should support both.
I've also pasted the contents of the file here to make it easier to view for interested users:
I've attached a simple configuration based on the information I've seen on your screenshot:
(attachment removed, latest version below)
I'd expect that there are probably other things that need to be adjusted, just let me know.
- Quit QCAD/CAM
- Save the attached file to your QCAD/CAM installation under scripts/Cam/CamConfigurations
When converting to CAM, choose the configuration "LinuxCNC". You can choose absolute or incremental positioning. The configuration should support both.
I've also pasted the contents of the file here to make it easier to view for interested users:
// include GCode configuration: include("GCode.js"); // constructor: set up global settings: function LinuxCNC(documentInterface, newDocumentInterface) { GCode.call(this, documentInterface, newDocumentInterface); // output unit is inch: this.unit = RS.Inch; // output four decimals (e.g. 1.2345): this.decimals = 4; // for incremental positioning, set current position as 0/0: this.x = 0.0; this.xPrev = 0.0; this.y = 0.0; this.yPrev = 0.0; this.z = 0.0; this.zPrev = 0.0; } // configuration is derrived from GCode: LinuxCNC.prototype = new GCode(); LinuxCNC.prototype.getFileExtensions = function() { // set allowed output file extension: return ["ngc"]; }; LinuxCNC.prototype.getLineNumberCode = function() { // don't use line numbers: return ""; }; // header: LinuxCNC.prototype.writeHeader = function() { // LinuxCNC header: if (this.getIncrementalXYZ()) { this.writeLine("G20 G17 G40 G49 G54 G64 P0.1 G80 G91 G94"); } else { this.writeLine("G20 G17 G40 G49 G54 G64 P0.1 G80 G90 G94"); } // retreat to safety level: this.writeRapidZMove(this.getSafetyZLevel()); this.toolPosition = GCode.ToolPosition.Clear; }; // footer: LinuxCNC.prototype.writeFooter = function() { this.writeToolUp(); this.writeRapidZMove(this.getSafetyZLevel()); this.toolPosition = GCode.ToolPosition.Clear; this.writeLine("M2"); };
Re: Circles and CNC
Thanx for the file!!
Let me start off by saying that I did not receive an error.
However...I noticed that when I loaded the exported file into the CNC machine, the measurements were not what I remembered. When I looked at the "header" of the code, I saw that G21 was listed first, meaning the code was generated in metric. I had made the drawing in inches. So, I changed the "G21" into "G20"; reloaded the file and I receive an arc error again. :/
So then I changed the drawing table in QCADCAM from inches into mm. However, my 4inch drawing did not become a 25mm drawing. It became a 4mm drawing!
Instead of redrawing everything...is there another way to convert?
Let me start off by saying that I did not receive an error.
However...I noticed that when I loaded the exported file into the CNC machine, the measurements were not what I remembered. When I looked at the "header" of the code, I saw that G21 was listed first, meaning the code was generated in metric. I had made the drawing in inches. So, I changed the "G21" into "G20"; reloaded the file and I receive an arc error again. :/
So then I changed the drawing table in QCADCAM from inches into mm. However, my 4inch drawing did not become a 25mm drawing. It became a 4mm drawing!
Instead of redrawing everything...is there another way to convert?
>>>Thanx!
~Sterl~
~Sterl~
Re: Circles and CNC
I changed the G21 to G20 in your file and encountered an ARC error again.
So then, I changed the size of my drawing from 4inches to 25inches.
The export worked and loaded fine...however, the Z axis was EXTREMELY high, and instead of following the arcs (there are about 5 of them) it broke each one into multiple segments of about 10+.
Maybe I need to change the QCADCAM application and drawing preferences from inch to metric and then reload it and try again?
IDK...I'm running out of ideas~!
So then, I changed the size of my drawing from 4inches to 25inches.
The export worked and loaded fine...however, the Z axis was EXTREMELY high, and instead of following the arcs (there are about 5 of them) it broke each one into multiple segments of about 10+.
Maybe I need to change the QCADCAM application and drawing preferences from inch to metric and then reload it and try again?
IDK...I'm running out of ideas~!
>>>Thanx!
~Sterl~
~Sterl~
Re: Circles and CNC
The code is actually produced in Inches (this.unit = RS.Inch;).Sterling wrote:When I looked at the "header" of the code, I saw that G21 was listed first, meaning the code was generated in metric.
The LinuxCNC config outputs a fixed header ("G21 G17 G40 G49 G54 G64 P0.1 G80 G91 G94" or "G21 G17 G40 G49 G54 G64 P0.1 G80 G90 G94"). It is important to understand that QCAD/CAM does not know (or care) about the meaning of this header. The meaning is also highly depended on individual machines.
I've adjusted the config to produce "G20" instead of "G21".
Arcs are coded with I / J coordinates. Some machines expect these coordinates to be absolute, others relative to the arc start point. If you know which one it is for your machine / controller, I can change the configuration accordingly. If you don't have that information, perhaps you can provide a working example with an arc in it, so I can analyse it.I receive an arc error again.
Another possible source for errors are the decimal places. Perhaps, your machine expects more decimal places (or less) than generated by the LinuxCNC config. The decimal places are currently set to 4 (this.decimals = 4;). Again, a working example or machine documentation, etc. would be helpful.
Re: Circles and CNC
Groovy, thanx! I am running LinuxCNC version 2.6.3 ...and I see that 2.6.4 has been released. I'll update that and look into the rest. Thanx again~!
>>>Thanx!
~Sterl~
~Sterl~
Re: Circles and CNC
My Linux CNC machine is not hooked up to the internet. So I brought it in, and ran the updates.
I have QCADCAM installed on that machine as well (version 3.7.2) So I decided to run some tests on that while at my desk inside the house I took my original QCADCAM image, made a new layer, then drew the top arc over the old one, hid all but the new layer and exported it = It worked!
I did this with the next two arcs, and it worked. Even when I joined #2 and #3. Then I drew the last inside arc, exported that file, but received an error.
So I decided to deleted that last arc, draw a straight line and then redrew the arc… it worked~!!! (curious...)
Files uploaded/attached
(File with error = “Top4Arc.ngc”)
(File without error =“Top4.ngc”)
(Image of error "4arclast-bad.ngc")
I have QCADCAM installed on that machine as well (version 3.7.2) So I decided to run some tests on that while at my desk inside the house I took my original QCADCAM image, made a new layer, then drew the top arc over the old one, hid all but the new layer and exported it = It worked!
I did this with the next two arcs, and it worked. Even when I joined #2 and #3. Then I drew the last inside arc, exported that file, but received an error.
So I decided to deleted that last arc, draw a straight line and then redrew the arc… it worked~!!! (curious...)
Files uploaded/attached
(File with error = “Top4Arc.ngc”)
(File without error =“Top4.ngc”)
(Image of error "4arclast-bad.ngc")
- Attachments
-
- 4arc_last-bad.png (125.84 KiB) Viewed 16697 times
-
- Top4.ngc
- (363 Bytes) Downloaded 556 times
-
- top4Arc.ngc
- (329 Bytes) Downloaded 540 times
>>>Thanx!
~Sterl~
~Sterl~
Re: Circles and CNC
A couple of addendums...
#1) Yesterday my work was being done on my home machine, which is a Windows machine & where I do the majority of my design work.
#2) Today I had been doing this on the Linux machine.
I'm not sure if that makes a difference...both are running the same version of QCADCAM.
Oh, and one more thing I just realized - the Linux exported the files export using that original Linux_cnc.js...not the one you made/modified.
I can give the same procedure a try on my Windows machine and see if that makes a difference!
(And again - Thank you *very* much for the help!!)
#1) Yesterday my work was being done on my home machine, which is a Windows machine & where I do the majority of my design work.
#2) Today I had been doing this on the Linux machine.
I'm not sure if that makes a difference...both are running the same version of QCADCAM.
Oh, and one more thing I just realized - the Linux exported the files export using that original Linux_cnc.js...not the one you made/modified.
I can give the same procedure a try on my Windows machine and see if that makes a difference!
(And again - Thank you *very* much for the help!!)
- Attachments
-
- Lcnc_Mill.js
- (2.13 KiB) Downloaded 561 times
>>>Thanx!
~Sterl~
~Sterl~
Re: Circles and CNC
Hmm.. that pretty much explains it. My configuration cannot possibly fix any problems if you aren't using it Any reasons for this?Sterling wrote:Oh, and one more thing I just realized - the Linux exported the files export using that original Linux_cnc.js...not the one you made/modified.
The problem with your configuration file is that decimals are set to 3 (default), but LinuxCNC needs 4 decimals for Inch output.
The LinuxCNC.js configuration does all that, but you kinda do have to use it to benefit from that...
I've also copied over the other settings from your configuration in case you require any of these (defaults for clearing level, etc).
Anyway, latest version is attached.
- Attachments
-
- LinuxCNC.js
- (2.37 KiB) Downloaded 546 times
Re: Circles and CNC
Awesome, thank you!!
In the interim, I decided to to uninstall QCADCAM from my windows7 notebook, reboot & them perform a fresh install.
I will remove the old LinuxCNC_mill.js file from the cam/cam congif directory and copy this new one in. Thanx again!
(Fingers crossed)
In the interim, I decided to to uninstall QCADCAM from my windows7 notebook, reboot & them perform a fresh install.
I will remove the old LinuxCNC_mill.js file from the cam/cam congif directory and copy this new one in. Thanx again!
(Fingers crossed)
Last edited by Sterling on Mon Nov 24, 2014 5:50 pm, edited 1 time in total.
>>>Thanx!
~Sterl~
~Sterl~
Re: Circles and CNC
HUZZAH!!
I was able to Export it with no troubles *AND* when I copied it over to the Linux machine, there were NO ERRORS!!!!
THANK YOU!!!
Next up...copy your LinuxCNC file over to my Linux machine~!!! Thanx again!
(My apologies for being problematic!)
I was able to Export it with no troubles *AND* when I copied it over to the Linux machine, there were NO ERRORS!!!!
THANK YOU!!!
Next up...copy your LinuxCNC file over to my Linux machine~!!! Thanx again!
(My apologies for being problematic!)
>>>Thanx!
~Sterl~
~Sterl~