Z-profile feature

Issue #72 new
Juan Pablo Caram repo owner created an issue

Implement Z-axis adjustment based on input file.

Comments (12)

  1. Juan Pablo Caram reporter

    I haven't moved forward with this feature because of the following dilemma: Generating the surface map requires particular hardware/software setup. There needs to be a feedback loop between the probe (for blank PCBs it can be just something that determines conductivity between a tool and the PCB surface) and the CNC controller. Therefore, the largest problem for users is generating the the surface map that has to be provided to FlatCAM. I would like to have FlatCAM help in this process, in a machine-independent way.

    Feedback is welcome.

  2. Gur Dar

    i think gcode movement comands g00 or g01 are common on all type of cnc machines. What need to do, is to let user to enter own commands for z-high measurement (g30 or somethig else) and format for machine answer. Number of measurement points, area are common too. One problem is related to communication. Its easy to control cnc through usb/virtual com, but i am not sure how to (easy) control LPT based machines. i am really interesting in this feature.

  3. Bryce Barbato

    I'm not entirely sure how it's done, but you might want to take a look at the generated output of Autoleveller (http://www.autoleveller.co.uk/). I have used this in the past and it prepends the gcode with the probing commands and then adjusts the gcode with the offsets that it found. It works quite well, but seems to be controller dependent. Autoleveller only supports LinuxCNC and Mach3. I'm not sure what specifics apply to various systems. I'm not sure there is a generic way to create this feature.

  4. Piotr Curious

    I think whatever input format flatcam will use, users will just adjust to it...

    f.e. the simplest way would be to just use CSV array of height map. for productivity reasons I would suggest adding also 'reload height map' button so after user would create height map with own scripts , after f.e. inserting of new PCB blank, height map could be quickly reloaded.

    as of ways of getting height map - i think there can be plenty. f.e. personally i would like to have 'cable-less' method as i have several machines and just one computer so i mostly work using sd-cards. There is f.e. grbl sd-card serial controller, which simply outputs contents of a file from sd-card to grbl machine via serial port. I guess extending such design to also allow creation of height map so one could get it stored on SD card would be good option for me. for most other people probably some simple python script would do same job. There are so many machines that it would be indeed challenging to implement it into flatcam itself... and then also each user uses different OS to control their machines - macs, windows , androids , linuxes and *bsd are most popular ... just managing the serial port being properly open on all those systems is big pile of code...

  5. Andres

    I'm new to Flatcam :) ... Coming from Coppercam (which has still many bugs while calculating isolations routes), so I was wonder when I see the clean aspect of the Flatcam generated routes. Obviously, I'm also interested on Z auto leveling Feature (PCB milling).

  6. Roman Valls

    This is actually one of the main reasons I'm putting some serious effort in "refreshing" this software package via my recent port to python3/pyqt5, @jpcgt .

    Our mill does need the auto leveling feature, otherwise it is inviable to mill PCBs judging by the runs we made a few days ago at our space/shed here in Melbourne :/

  7. Juan Pablo Caram reporter

    Hi @brainstorm , I can put in a few hours of work here or there into this, but not a lot. If we can constrain what specific help you need from me we can probably pull it off.

    Are you proposing to take the lead on this effort? If so, I can guide you. Specifically I had started some work on this implementing a Voronoi mesh (check camlib.py). This is how I envisioned it would work:

    1. Provide a CSV file with (X, Y, Zoffset per line)
    2. Create the Voronoi map around these points. This defines certain regions.
    3. When we generate the G-Code, we check if each segment crosses a region boundary. If it does, we update the Z value.

    Of course, we need to figure out how to store and represent all this information. The Voronoi map can be just another Geometry object in the program, but we would need to "attach" somehow, the Z values for each region. Maybe we just don't "attach" it. We could simply have an entry in the "File" menu that imports the CSV and generates the Voronoi in a Geometry Object. Then, when we generate the G-Code, we add inputs for the Voronoi Geometry and the CSV file (again, just to find the Z values of each region).

  8. Roman Valls

    Thanks for the reply and overall planning @jpcgt!

    After giving some thought into that feature and implementing some autoleveling for a commercial mill (Carvey from Inventables):

    https://github.com/brainstorm/carvey_board

    I came to the conclusion that it should be implemented separatedly, decoupled from FlatCAM, IMHO.

    I suspect that as the milling software evolves, more independent/decoupled components could be a better bet at future-proofing this tool, using the "small/decoupled components do better" philosophy.

    My personal secondary objective with my PR and general contribution(s) to this project would be to exclusively use the command interface to automate the process as much as possible so that other programs like KiCad could easily/seamlessly/transparently use FlatCAM to print your PCBs.

  9. Piotr Curious

    I've spent some time playing with Marlin and custom builds to spare as much memory as possible (f.e. cutting serial buffers as printing from sd card) to allow auto-levelling being done by controller, and I can say that controller based levelling has serious limits. Even with larger memory sanguinolu board working on PCB larger than about 1m x 1m and with multiple warps becomes serious trouble. If one wants to get to even larger table, say using "mostly printed CNC" design, then also geometry of CNC cranes start to get into play. Those controllers just lack enough RAM to hold all the corrections. Grid sizes of 20x20 is usually max those devices can do. One could perhaps try cutting more corners by trying to compress the array data but still no miracles.. and then mechanical inaccuracies of probes (esp. if one wants to scan high speed) and mechanics of cheap CNC machines aswell actually push demands for actually gathering more control points , as otherwise the scanned surface inaccuracies just get amplified instead of interpolated.

    Also another issue is about dividing segments and arcs of GCODE in firmware. It is simply cpu intensive and difficult. Firmwares like marlin focus mainly on bed adhesion so do not care about accuracy - if few segments get wrong levelling, overall print will still fit.

    So to resume - for good results, one needs to gather at least 100x100 array of points, especially if PCB is large. To get rid of gcode artifacts gcode needs to be densely segmented and without too many arcs.

    So taking pcb height map into consideration (however supplied) is IMHO very good to be done on flatcam-stage , and it saves most gray hair when it's done by proper algorithm, on decent computer. It also makes users independent on firmware quirks - many times people get cnc machines with fixed firmware, not allowing too much flexibility or upgrades. It especially holds for 'bigger' commercial machines , and 'abandonware' class of machines recycled from old factories - sometimes their manufacturers are long gone and machines themselves are over 30 years old. So again coupling z-profile feature with flatcam is very handy, and could be useful by just providing option to load it just like another 'geometry' file and then applying corrections to existing geometry - kind of like 'join' or 'merge' geometry option. then all 'generate geometry' options could just take the Z component of geometry into account. This also extends flatcam's use to many non-standard milling operations over curved surfaces which surely extends toolkit of everyone :)

    greetings

  10. Log in to comment