For benefit of others, I explain my Autoleveller process using an actual probe device:
This is based on using Autoleveller with output from Cambam, and using Linuxcnc, but it should be informative for other app combinations as well, because the principles are the same.
Now, before we go into the general items of the list, I want to include a bit on the toolpath modes and how to program them, because Autoleveller breaks up the gcode into bite-sized segments, and each gets Z (height) adjusted to compensate for Z (height) errors.
Constant Velocity mode (set via a "G64" in the gcode) moves the machine around curves and tiny Z changes produced by Autoleveller get cut relatively quietly and smooth, whereas when the program is set to Full Stop mode (set via G61 in the gcode), all the Z adjustment transitions are audible and the machine vibrates significantly more. So I recommend to use Constant Velocity mode for the toolpath for files destined for Autoleveller, not Full Stop.
One needs to learn about toolpath tolerances when using Constant Velocity, because otherwise corners and turns may get overly rounded.
In Cambam, the Velocity Mode setting is a drop down menu choice in the Machining folder of the tree view. But Cambam doesn't yet include a place to enter the tolerance. A rough copy from the Cambam Forum shows how to set the tolerance in Cambam so you don't have to manually edit the gcode output file each time you save it:
If you always use constant velocity mode, one solution is to change your Linuxcnc post processor definition. (under the system tab, post processors)
Where it says:
{$velocitymode}
Replace this with
{$velocitymode} P<tolerance>
where <tolerance> is your motion blending tolerance.
(Or, It's simple enough to edit the gcode file manually as explained further below.)
Use Constant Velocity mode with caution, because the corners and turns will be slightly rounded, or swung to the outside of the turn. The faster the machine moves around a bend in Constant Velocity, the more rounded it gets. This is where the tolerance value is useful, to keep this rounding within acceptable limits.
As written in the Linuxcnc manual:
You can see that there is a trade off here: you can slow down to get better path following, or keep the speed up and have worse path following. Depending on the particular cut, the material, the tooling, etc., the programmer may want to compromise differently. Rapid moves also obey the current trajectory control. With moves long enough to reach maximum velocity on a machine with low acceleration and no path tolerance specified, you can get a fairly round corner.
But, you can enter a decimal tolerance value after the G64, and achieve a compromise between speed and accuracy.
Here is an excerpt from the Linuxcnc manual:
If you program G64 P0.05, you tell the planner that you want continuous feed, but at programmed corners you want it to slow down enough so that the tool path can stay within 0.05 user units of the programmed path. The exact amount of slowdown depends on the geometry of the programmed corner and the machine constraints, but the only thing the programmer needs to worry about is the tolerance. This gives the programmer complete control over the path following compromise. The blend tolerance can be changed throughout the program as necessary.
"User units" means millimeters or inches depending on which you are using in Linuxcnc.
So, in a nutshell, to set this manually, just open the gcode file, and find the G64(s) and type after it a space followed by "P" and a meaningful tolerance, like:
G64 P0.05
and measure a test part after you run it. Adjust the tolerance value(s) for a good compromise between speed around corners and cut accuracy.
If you run fairly slow, this is not much of a difference between having a tolerance and not, because the machine is not pushing the acceleration limit enough to produce noticeably wider turns. I tried to run a slow finishing pass just to be sure I am trimming off any error made in a faster roughing step, but this won't fix inside corners that cut too deep. Thus adding a tolerance value after G64 gives the best control vs speed overall.
Linuxcnc 2.7, is currently available as a development branch, and hopefully soon to be released as the current version, has a better motion planner for smoothing segmented curved features. Printed circuit board milling folks will love it because their work has many twists and turns and so PCB milling should be sped up considerably in Linuxcnc 2.7 while maintaining the programmed tolerance.
A YouTube video A/B comparison showing a large continuous spiral being cut using the new trajectory planner with look-ahead, reveals an impressive speed-up over the old trajectory planner: http://www.youtube.com/watch?v=oUajH5BCOUQ
Ok, with that background out of the way, here are the steps to using Autoleveller with a real probe on Linuxcnc. You can download Autoleveller from http://www.autoleveller.co.uk
1. Generate your original toolpath gcode file using a CAM app like Cambam, etc, that can be used to produce a gcode file from your drawing file or DXF file, etc.
2. Prepare to generate the probe-only file gcode file output from Autoleveller. To do this, open the latest paid membership version of Autoleveler, and then open your original gcode file in Autoleveller.
Autoleveller will attempt to generate settings for a probing grid that will cover your work area, but you should probably edit the probe settings to achieve an ideal probing grid. To do this, adjust the X,Y, X Length, Y Length, numbers in Autoleveller until the grid of probe locations is centered on the virtual workpiece, so the grid of probe locations covers the CNC cutting work area completely, yet clears the clamps on the edges of the grid.
3. Generate the output gcode with "Probe Only" checked.
4. Review the Probe Only Autoleveller output gcode file in Cutviewer Mill or some other cnc simulator app. Assign a small end mill, and you should see a grid of dots, like drill holes.
5. Repeat step 2 to 4 as needed until things look good.
Notes: In my case I set the X and Y origin of the Cambam to the center of the workpiece, with Z=0 on the top surface of the workpiece. Setting the top of the workpiece to zero Z height in your cad is important for Autoleveller to work properly. Future versions may allow the Z origin to be set elsewhere, but for now, the top of the workpiece surface is the Z = 0 plane, or Z origin.
I got in the habit of setting the X and Y origin in the center of the workpiece for the purpose of being able to flip the workpiece over and mill the opposite side. Then, the X and Y origin does not change when flipped over, and this makes managing flips easier for me, because I can check them in the drawing by actually flipping them over.
As a side note of potentially high value, there is a clever way to create flip geometry within the workpiece stock itself, if you part is reasonably thick, so that you can remove the center piece after doing side A, and re-insert it into the cavity with a tight fit, and then cut side B, with everything registered and aligned properly between A and B sides. If you haven't seen it, I recommend watching the following YouTube video; it's one of the coolest cnc stunts I seen, and I have made use of this myself cutting two-sided half-inch thickness G10 FR4 glass laminate board:
Platform CNC | Milling a Two Sided Soap Dish
http://www.youtube.com/watch?v=BLD4dFoXC7o
The only glitch I had is two of the diagonally opposed corners need a wee-bit of rounding off before the flipped piece would fit back into the original cavity. Easy enough to add this to the file that cuts it. This is an awesome stunt for flipping and aligning somewhat-thick workpieces.
Ok, back to Autoleveller. Using a 12 inch by 12 inch workpiece (304.8mm by 304.8mm), and allowing for clamps around the border, and having the origin at the XY center and Z top of the workpiece, my particular probe grid settings are X = -130, Y = -130, X Length = 260, Y Length = 260.
6. We now should have a probe-only gcode file that is centered and covers all the cuts, and won't hit the clamps (hopefully). Copy it to the cnc machine computer.
7. Now prepare to probe. The workpiece should be quite square to the table prior to clamping it down. It doesn't have to be perfect, but should be near square to the machine x and y axis as possible. Use a jig or measurements if possible, or very careful eyeballing. Often we probe quite close to the clamps along the edges of the workpiece, and we want workpiece squareness consistency to avoid a crash on subsequent probing runs.
8. Install the probe device into the spindle. Electrically connect or plug in the probe to the electronics of your controller. Secure the probe wire around something near the spindle or use a rubber band or something else, so the probe doesn't rotate during the run, which can skew results if the probe is not calibrated x-y tilt-wise. As a cheap and dirty method, I wrap the output wire a few turns around my Loc-Line flood coolant plumbing manifold.
Notes: Real Probes can easily be too tall for use on hobby routers like mine. My probe device, which is of typical size, barely fits over .375 total thickness of material on the table, even using the shorter "stub" probe tip.
One can raise the spindle motor in the clamps, to accommodate the height of a typically sized probe, but the spindle motor has to be lowered again prior to cutting, for the tool to reach the workpiece and be able to cut deep enough into it according to the program.
A low-profile probe (minimum Z-height of combined probe body and tip) would be a better fit for a hobby class CNC router machine. Can anybody recommend one that is significantly shorter, maybe a Z-only probe with a quality contact mechanism? Maybe this will be my next project; a shorter probe. Then all of the hobby router folks will have some more Z height to work with.
I found a very narrow range of spindle motor height where I can do both probing and cutting, without requiring me to move the spindle motor up or down in its clamps. And yet, this is with only 0.375 of total material thickness on the table, including the spoil board. So, yes, a lower profile probe would be very desirable to own for this kind of work, to expand the narrow "no fussing with the spindle motor height in the clamps" Z-window.
9. Test the probe manually by deflecting it with your finger, and watching the status on the screen, prior to probing and verify it is properly connected and actually works at this time. Otherwise, you may CRASH the probe into the workpiece.
Notes: To see this probe status in Linuxcnc, bring up the little monitor screen (Axis Menu> Machine>Halmeter) to show the live status of HAL Pin "Probe In" in a little window. Select signals tab on the main window, and scroll down for Probe In. If "Probe In" signal is not working or changing at all as you fiddle with the probe to trigger it, then the signal is not connected properly in the HAL config file or the ini file.
Using the available tools built into Linuxcnc to look at internal signals and their current"wiring" state, you have to trace the HAL signal from your CNC hardware interface card's probe input pin, and program it to propagate to "Probe In" with HAL connection commands in the hal file. Also you can use the appropriate Linuxcnc wizard you used to set up your steppers, these can control other card inputs as well. So you would set the proper card input to go to Probe In, and invert the polarity if needed, all right in the wizard.
If probe signal status on the screen is False when the probe tip is deflected, and True when released, it's inverted, and you can add or remove a "NOT" from the hal config file on the appropriate line which has"Probe In" mentioned. You will have to restart Linuxcnc to apply hal config file changes.
10. Touch off Y and X edges of the workpiece using the probe tip to the side edges of the workpiece. This will align your X and Y work offset to the part so everything jives. Don't forget to add the probe tip radius to both the X and Y workpiece edge coordinate. My probe tip is 0.125 diameter, so I add 0.0625" (the probe tip radius) to the intended coordinate of the edge itself, for both X and Y respectively, so the touch-off entries are correct; not off by the value of the probe radius, a common mistake.
11. With the Probe Only gcode file loaded, look at the grid of points on the program on the Linuxcnc, Mach3, etc screen and manually jog around to the extremities so to see if the probe tip or the probe body will hit the clamps. You may need to shrink your grid by one column or row or both, to keep a safe distance from the clamps. But if your program has cuts near the clamps, you need to cover them with this grid of probe points to ensure they get leveled. So this can cascade to increasing the gap between the programed toolpaths and the edge of the stock, so the probe clears the clamps AND covers all of the toolpaths.
12. Manually jog the probe to near the starting corner, 5 to 9mm above the workpiece.
13. Important: Manually touch off the Z axis using the probe device, at the first probe location's X and Y coordinate; the starting corner coordinates. This aligns the probe routine with the actual workpiece, Z-wise. Crashes will be less harsh should the probe stop communicating the signal, and the probe routine won't get errors due to Z touch-off being too high or low.
14. Run the probe-only gcode on the CNC. The program should probe three times at the starting location, and then "mow the lawn"; probe the workpiece in rows and columns. Set the max speed limiter slow at first (but not super-slow), and watch the machine carefully with your mouse on the pause or stop button, to be ready to stop movement should the probe tip or casing get too close for comfort to your clamps or something else. Low profile clamps are best here for this reason. My clamps are just a simple 1" X 3.5" wide piece of scrap clear acrylic with a hole and a lip, secured to the t-nut in the table slot via a small and some large washers and a bolt. Washers can raise the bolt head up some so it doesn't bottom out in the T-Slot prior to clamping the workpiece. Similar shims of scrap acrylic are used under the rear of the clamp, to tilt it up slightly.
15. At the end of probing, the cnc should return the probe to the starting XY location. Make a written note of it, so if you need to jog to remove probe easily, we can return to this probe starting location to touch off manually in the next step, at this x and Y probe start location. These are also written in the gcode files.
16. Find the "RawProbeLog.txt" file in the Linuxcnc/(your CNC machine name) directory or in Mach3 the file is wherever you set it. Copy the file to the dongle or to the machine running Autoleveller and delete any old copies so as not to confuse it with the new probe data file.
17. In Autoleveller, Open the original (un-leveled) gcode file from Cambam, etc, and then open the "RawProbeLog.txt" file using the corresponding file dialog box in Autoleveller. Uncheck "Probe Only". Click Generate Leveled Gcode, and save it to disc. Using the default naming is so much faster than futzing with it; the probe only output file is the file with a "ALProbe" prefix, and the leveled gcode output file is the one with the "AL" prefix.
Important: Before using this leveled gcode Autoleveller output file, we have to edit it slightly for this "using a real probe device" method of probing, or we will drive the probe into the workpiece and perhaps even bend or break it!
18. So, to avoid a crash of our expensive probe, within the Autoleveller leveled gcode output file, delete all of the text added by Autoleveller to the top of the original gcode file, or comment out the following two subroutine calls:
o100 call [-130.0] [-130.0] [0.005852]
o101 call [-130.0] [-130.0]
Put parenthesis around each of these two lines to comment them out.
Keep in mind, comment these out rather than delete all text above the original file, if you think you may want to restart where you left off following a broken tool, etc. The code and probe point list is there to provide a way to handle this situation so you can replace the tool and continue where you left off. In my case, I just deleted all text added to the top of the original gcode file for simplicity.
If you don't delete or comment out the Autoleveller g-code as described above, the program will try to probe when the program starts. This is fine if you are milling a PCB and have the probe signal wire attached to the tool, but very bad otherwise; it will crash the tool into the workpiece, because there is no probe input signal to stop it.
We are not trying to probe touch off Z as in PCB work, we intend to manually touch off Z with a piece of paper, etc, because the tool is what we are now touching off, not the probe.
I imagine a tool length setter device can also touch off the tool automatically at this stage, and compare the tool length to the prior probe length and the prior touch-off on the workpiece, but I have not yet attempted to do it.
19. Remove the probe, and install the drill or cutting tool, end mill, etc.
20. Jog manually or MDI command to the X and Y first probe location, exactly. Touch off the tool manually using a sheet of paper method. At this "touch-off to zero" moment, the tool tip is resting exactly at the top of the workpiece material at the correct X Y first probe coordinates, and the z axis gets touched off to zero.
21. Run the leveled gcode on the CNC. I put in a high z command at the beginning, like...
G0 Z35
... so I can tell right away if the Autoleveller output file has not been edited by me and is about to break my tool by attempting to "probe touch-off" with the tool. When correct, this code added will raise up Z high right away, so to provide me a signal that it's ok. A quick patch can add the option to manually touch off, and Autoleveller output files will no longer need manual editing.
22. If possible test the files in a CNC simulator app one last time to do an idiot check before running, I use Cutviewer Mill.
23. Run a new probing session and generate a new probe file each time you swap the workpiece for a new one, or flip the part to cut the backside, or move anything. Clamp pressure changes and even temperature can also affect the z, so redo it if a few days have passed, the temp is wildly different, or otherwise in doubt. Delete the old probe file to be sure it is properly refreshed with current data in the new probe session.
24. You can leave the Autoleveller app settings alone and just hit "Create Leveled Gcode" and hit save again when you need to re-level the same file due to edits, etc, to quickly propagate a change made in your cad app down the line and get it to generate the leveled gcode file. Just remember to delete or comment out the touch off code at the beginning of the Autoleveller "leveled" output file, or comment out the 2 subroutines. This issue of unwanted added touch-off code will be fixed in future versions of Autoleveller by adding an option to the GUI.
25. That's it! The steps flow fast after some practice. Using Autoleveller with a real probe is a useful way to z-compensate non-conductive parts as well now. Autoleveller is being made even better, so keep an eye out for new releases. Future versions will be more polished and offer more features and even smarter leveling algorithms.
Leveling non-conductive workpieces using a real probe
Re: Leveling non-conductive workpieces using a real probe
Just had a proper read and this is awesome. Full of additional tips and well worth the read. Thanks for this.
I am currently working on a completely new Autoleveller which should include some nice new features and just be better in many ways. One additional feature I was thinking of possibly adding was a "Jigless alignment feature" for 2 sided PCB's using the drill holes and some manual input to re-adjust the gcode file for the second side. However the process shown in that video looks a much better option and could probably be built into AL much easier.
One question (for now), where did you get your current probe from. Do you have a link?
I am currently working on a completely new Autoleveller which should include some nice new features and just be better in many ways. One additional feature I was thinking of possibly adding was a "Jigless alignment feature" for 2 sided PCB's using the drill holes and some manual input to re-adjust the gcode file for the second side. However the process shown in that video looks a much better option and could probably be built into AL much easier.
One question (for now), where did you get your current probe from. Do you have a link?
http://www.autoleveller.co.uk/. Software to probe and adjust a GCode file for PCB's or any probe-able surface.
http://www.autoleveller.co.uk/cnc-probe-guide/. A short guide to setting up the probe.
-James
http://www.autoleveller.co.uk/cnc-probe-guide/. A short guide to setting up the probe.
-James