CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Electronics > PCB milling


PCB milling Discuss PCB milling here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 07-09-2008, 08:09 AM
 
Join Date: Dec 2004
Location: Memphis, TN
Posts: 1,074
Jay C is on a distinguished road
Optimizer for PCB-Gcode

I have posted a similar thread on this subject on www.millpcbs.com. I have taken some publicly available code posted on the PCB-Gcode Yahoo forum for optimizing the output from the Eagle CAD ulp PCB-Gcode and improved it. It is a DOS application and now I'm making plans to update it with a Windows GUI.

Long story short, I'd appreciate feedback on the UI. I'm only initially coding for PCB-gcode output, but if I see opportunities to modify it to be more generic I'll give them consideration. For now, if you have a current program that you like the UI on that would match the functionality of what you would like in a GUI for "Optimizer for PCB-Gcode" please post them here or on the www.millpcbs.com thread.

Jay
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 07-10-2008, 05:55 PM
 
Join Date: Dec 2004
Location: Memphis, TN
Posts: 1,074
Jay C is on a distinguished road
Updated Code: 7/10/2008

I have updated the code to be more universal in how it treats the paths in the input files. It now looks for the first G00 X... Y... line to start the path, and the next G00 X... Y... line to end the path.

Using the code posted by Dan above here are the results:
Input: c:\temp\suice.nc
Output: c:\temp\suice_OPT.nc

Old Length : 60869.8 New Length :5376.26 saved 91.1676%
Optimizations took: 1.36 seconds.
Done! Please review the generated gcode before proceeding to use the output.

Yep that's 60 thousand units of travel reduced to 5 thousand!

Jay

Last edited by Jay C; 07-10-2008 at 06:40 PM.
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 07-12-2008, 05:09 PM
 
Join Date: Dec 2004
Location: Memphis, TN
Posts: 1,074
Jay C is on a distinguished road

Before and after of the file I spoke about above:

http://picasaweb.google.com/jay.couture/CNC02
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 07-17-2008, 11:12 PM
 
Join Date: Dec 2004
Location: Memphis, TN
Posts: 1,074
Jay C is on a distinguished road

800+ views and no feedback Anyone using this?
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 07-19-2008, 03:35 PM
 
Join Date: Jun 2007
Location: Slovenia
Posts: 10
Tester is on a distinguished road

Hi,

I guess I'll be the first one to respond.
I'm observing the progress of your program almost from the beginning. It started at the pcb-gcode mailing list (which is btw not working at the moment), then at millpcbs.com forum and now on cnczone.
Personally I tried to optimize a few gcode files which I generated with pcb-gcode and all of them look just fine. Unfortunately I haven't had the chance to try them out in practice. Hhopefully I'll be milling a few PCBs next weekend - on my cheap DIY CNC .
I also have to say that I'm really glad that someone finally made a public and a working version of an optimizer because that "random" path selector from pcb-gcode generator really annoyed me, especially as my CNC doesn't have fast feedrates (25 cm/min or 9.8 inch/min) so any unnecessary movements add quite a lot to the final work time.

So, keep up the good work and keep us uposted with the progress of the GUI.

BTW, which IDE do you use with QT - Visual Studio, Eclipse or perhaps something else? I'm also starting to experiment with it but I have some difficulties with the Eclipse plugin for QT because g++ doesn't seem to find main.cpp
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 07-19-2008, 08:43 PM
 
Join Date: Dec 2004
Location: Memphis, TN
Posts: 1,074
Jay C is on a distinguished road

Originally Posted by Tester View Post
Hi,

I guess I'll be the first one to respond.
...
So, keep up the good work and keep us posted with the progress of the GUI.

BTW, which IDE do you use with QT - Visual Studio, Eclipse or perhaps something else? I'm also starting to experiment with it but I have some difficulties with the Eclipse plugin for QT because g++ doesn't seem to find main.cpp
I'm using the MingW C++ compiler. When I installed Qt, it sets up a link to a command line that sets all of the environment variables. To compile, you first do a qmake -project, then qmake which generates the make file. Finally, run make to compile and link which places the output into a new directory called release. I downloaded and have been reading the Qt book. I have my GUI planned out, just need some time to code it now

Jay
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 07-21-2008, 02:18 PM
 
Join Date: Jun 2007
Location: Slovenia
Posts: 10
Tester is on a distinguished road

Today I tried to mill a smal PCB and found an error in optimized gcode.
When first path is milled CNC continues to the next path without raising the spindle thus braking one connection on its way. All other paths are milled without a problem.
I attached the original and optimized gcode files so you can analyze them. *The problematic line in optimized file is line number 34 (spindle should be raised to Z 0.5000 but instead it stays at Z -0.2000).

I hope I provided enough information so you can locate the cause of the problem.

EDIT:
I'm not sure if line 34 is "the problematic one", but the path of the traveling spindle at the wrong height can be clearly seen in Mach3.
Attached Files
File Type: zip gcode_example.zip‎ (3.2 KB, 120 views)
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 07-21-2008, 04:35 PM
 
Join Date: Dec 2004
Location: Memphis, TN
Posts: 1,074
Jay C is on a distinguished road

The issue is that the Z up movement occurs after the (File Footer) tag and thus is not included in this path. HMMM, the best solution I can think of (which would also remove the need for the (File Footer) tag is to make the last path always the footer path (my terminology for the last path in the source file).

I will work on a solution and post an update. In the mean time, you can just add G00 Z0.5000 before the (File Footer) tag as a work around.

Jay
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 07-21-2008, 04:40 PM
 
Join Date: Jun 2007
Location: Slovenia
Posts: 10
Tester is on a distinguished road

Yes, this seems to be the problem. Thanks for the temporary solution .
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 07-21-2008, 05:33 PM
 
Join Date: Dec 2004
Location: Memphis, TN
Posts: 1,074
Jay C is on a distinguished road

Updated 7/21/2008

Modified the code to remove the (File Footer) tag requirement. This should make it pretty universal now. Still working on GUI development, but got sidetracked playing with my mill this weekend

Here

Jay
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 07-27-2008, 08:03 AM
 
Join Date: Aug 2007
Location: Australia
Posts: 6
dakiller322 is on a distinguished road

Hmm, your source code looks familiar nice to know it's going to good use.

I see you've put a bit more care into how it reads in the files, you've done a nice job with it. I'm surprised someone didn't make an optimiser for it sooner, it's such a crude algorithm but it works so well here.

Please feel free to make whatever you want with it, just as long as I get some credit
Tweet this Post!Share on Facebook
Reply With Quote

  #12   Ban this user!
Old 07-27-2008, 10:40 AM
 
Join Date: Dec 2004
Location: Memphis, TN
Posts: 1,074
Jay C is on a distinguished road
Cool

Yes the code you posted is the kernel of the optimizer. At the top of the source file is:
Code:
/*
*   PCB-Gcode Optimiser
*   Original code: Daniel
*   Updated Code: Jay C
*
*   Release: Beta ... use at your own risk
I will gladly put anything more you wish. Just let me know and it will be included in all future releases. I neglected to give either of us credit in the Windows source I have fixed this. Oh, and I gave you full credits on PCB-Gcode, unfortunately that is now lost Not sure the Google Group is much of an improvement.

Jay
Tweet this Post!Share on Facebook
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cutting optimizer kurt5 General CAM Discussion 2 12-07-2007 08:00 AM
New M&G code 3D Viewer, Editor, DNC Dripfeeder and optimizer software! BinaryCam Product Announcements & Manufacturer News 4 05-05-2007 09:56 PM
Gcode I think Mr.Chips DIY-CNC Router Table Machines 2 10-26-2006 07:52 PM
I have a problem with my gcode or my conversion to gcode , everything is tiny? NickLatech G-Code Programing 0 03-10-2005 01:46 PM
gcode to gcode converter july_favre General CAM Discussion 4 05-24-2004 07:51 PM




All times are GMT -5. The time now is 01:19 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353