From: Mathias K. <mk...@gm...> - 2015-02-05 16:45:06
|
Hello, I milled a board with 'autolevelling' today and the result was quite nice. However I had to change a few things beforehand: Firstly, I think I found another issue with the interpolation. It was only correct with 4 probe points in 1in distance, here is a patch to correct it: diff --git a/autoleveller.cpp b/autoleveller.cpp index e9e30c9..a44c63c 100644 --- a/autoleveller.cpp +++ b/autoleveller.cpp @@ -196,20 +196,21 @@ void autoleveller::probeHeader( std::ofstream &of, double zprobe, double zsafe, string autoleveller::interpolatePoint ( icoordpair point ) { int xminindex; int yminindex; - double x_minus_x0; - double y_minus_y0; + double x_minus_x0_rel; + double y_minus_y0_rel; xminindex = floor ( ( point.first - startPointX ) / XProbeDist ); yminindex = floor ( ( point.second - startPointY ) / YProbeDist ); - x_minus_x0 = point.first - startPointX - xminindex * XProbeDist; - y_minus_y0 = point.second - startPointY - yminindex * YProbeDist; + x_minus_x0_rel = (point.first - startPointX - xminindex * XProbeDist) / XProbeDist; + y_minus_y0_rel = (point.second - startPointY - yminindex * YProbeDist) / YProbeDist; + // std::cerr << "IPP " << xminindex << "," << yminindex << " " << XProbeDist << "," << YProbeDist << " " << x_minus_x0 << "," << y_minus_y0 << "\n"; return str( boost::format( callSub[software] ) % BILINEAR_INTERPOLATION_MACRO_NUMBER % getVarName( xminindex, yminindex + 1 ) % getVarName( xminindex + 1, yminindex + 1 ) % getVarName( xminindex, yminindex ) % getVarName( xminindex + 1, yminindex ) % - y_minus_y0 % x_minus_x0 ); + y_minus_y0_rel % x_minus_x0_rel ); } The "_x_y"-Variables are only Z coordinates, so the #5 and #6 in the macro below must be relative positions (from [0,1]) within a rectangle of probe points: o1000 sub ( Bilinear interpolation macro ) #7=[#3+[#1-#3]*#5] ( Linear interpolation of the x-min elements ) #8=[#4+[#2-#4]*#5] ( Linear interpolation of the x-max elements ) #100=[#7+[#8-#7]*#6] ( Linear interpolation of previously interpolated points ) o1000 endsub The second change I made is not really related to autolevelling, but the 'optimization'. Initially I got 14Mb of G-Code for the bottom layer of my test board. It's 90x55mm and is not very dense. I run the 'machinekit' offspring of linuxcnc on a Beaglebone Black to control the mill - the step timing is so much more precise (and the machine quieter and faster) with the hardware generated step timing. However 160k lines of G-Code in 'Axis' is no fun on a 512Mb ARM system. The largest board I milled with the Eagle-pcbgcode-Toolchain was ~100x80mm large and had much more components on it, and it used ~550kByte / 16k lines of G-Code. The huge size is due to 'trivial G-Code' stemming from the outline bitmap tracing. The 'optimise' command line option does not completely remove the redundant steps. There is something similar in surface.cpp around line 226, the 'simplifypath'-method. Switching that on and setting the accuracy argument to 1/dpi dramatically reduces the file size while keeping sufficient precision. There is one issue left: simplifypath does not know about the autoleveller and can generate very long moves crossing several cells of the probing grid. One should break those long moves to interpolate at the cell boundaries. With 'simplifypath' enabled I got ~680k of G-Code. Regards, Mathias On 02.02.2015 22:57, Nicola Corna wrote: > You're welcome! > I've pushed a commit (ba90eac95d503952f5f35b5a095a0dc0e1fa9917) that fixes that bug. Now also the 1st point of the chain has interpolation. > That ~0.1mm is curious... I don't have a probe tool yet, I'll let you know when I get it. > > Nicola Corna > > 1 Febbraio 2015 23:15, "Mathias Katzer" <mk...@gm...> wrote: > >> Hello Nicola, >> >> with those changes LinuxCNC accepts the NGC output here as well. >> >> I tried the autoleveller superficially in the LinuxCNC simulator (probe >> close is a button) but not on the real mill yet. It seems to interpolate >> the tracks well so far, however the initial Z-move after the rapid x/y >> to the start of a chain is produced directly in ngc-exporter.cpp:344 and >> is not interpolated from the probed Z positions: >> >> [...] >> >> Can you please tell me if the autoleveller works for you? It's still experimental and any >> feedback >>> is very appreciated >>> Thanks >>> >>> Nicola Corna > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Pcb2gcode-devel mailing list > Pcb...@li... > https://lists.sourceforge.net/lists/listinfo/pcb2gcode-devel |