• Learning this again...

    Timo Birnschein12/02/2019 at 04:26 0 comments

    Oh man, there is so much that one can forget. It's almost annoying.

    Couple new rules:

    • One clean cut is better than three too shallow ones
    • Make ABSOLUTELY SURE that the PCB is not bent. Check this about five times before autoleveling!
      Rather bend the board in the opposite direction before clamping it down as the force in Z when the milling bit tries to dig into the surface might be high enough to just push the board down and not actually cut anything useful.
    • Invert your X axis instead of milling in negative coordinate space when using CNC-GCode-Controller. That way you can actually do autoleveling!
    • Drill LAST! If you drill on the top layer, you might poke into a hole during autoleveling on the bottom side. This is REALLY bad and happened to me more than ones. The consequence usually is that the board needs to be milled without autoleveling. That is indeed really bad
    • Cut deeper that you would intuitively think. I set it up to -0.25mm and run once, even with a slightly dull v-shaped bit that I ran into the board during autoleveling a couple times
    • Make your traces thicker. It's nice to see 0.25mm traces but are they needed? Likely, the answer is: no! I set everything to 0.8mm traces and have them be reliable for a very long time. Plus, it's easier to solder in case the original footprint of your part was so small that the restring after drilling is barely visible anymore
    • Drill twice or three times. It's worth it to have smaller holes for wired components. I use 0.9mm for all the Arduino stuff (square pins). But for wired resistors and stuff, it's good to make the extra effort to drill a smaller hole like 0.4mm  to 0.5mm
    • Drill deeper than you would intuitively think! Nothing is worst than realizing that one has to manually redrill the 150 holes because the drill bit just poked about 90% of the way through! The board is 1.6mm thick and the copper is flexible. If you don't have the sharpest bits on the planet, it's worth just drilling 2mm and be done with it.
    This came out nearly perfect! And I haven’t even cleaned it up, yet!
    Very pleased! :)

  • Milling Using CNC-GCode-Controller

    Timo Birnschein10/14/2019 at 01:34 0 comments

    Okey, here is where the fun gets a but more interesting. I usually use my own software but cnc-gcode--controller has the amazing advantage that it can do proper bed leveling. However, the software was written in Java and oh my god I am not a friend of Java.

    Since I use my own PCB milling machine, we need to send some amount of gcode commands to make this all work properly:

    First, we need to home the machine with

    $H

    After this, my machine is ready to mill the top layer with the 0,0 point at the bottom left corner.

    Now, we need to z-probe the actual z-height of the board and then reset the coordinate system for Z. We will probe at -35mm and a very slow feedrate of 20mm per minute. After successful pprobing, we reset Z to 0.

    G38.2 Z-35 F20
    G92 Z0

    Now, we can actually do the autoleveling using cnc-gcode-controller:

    It is important to understand that cnc-gcode-controller needs a positive number in the Max depth configuration. Otherwise it will just stop above the surface reporting an Alarm.

    I also deleted the Autolevel/Start GCode as it always runs back to the bottom right of my bed for no reason.

    The bed is now level for top side milling. Nothing should be changed anywhere at this point. Load the nc file and start the milling process.

    Under CNC Milling, Load the file for top side, select the checkbox for AutoLeveling and hit Milling.

    After the top side is done, I am discussing if drilling now or later is preferred. There is a good argument against it: AutoLeveling the bottom side with holes in the board already is literally Russian Roulette.

    However, the AutoLeveler in CNC-GCode-Controller only works with positive coordinate systems, which is really really silly. Most PCB generators use a negative coordinate space for either side of the PCB to simplify the alignment of top and bottom side. This should be improved and I think about working on this myself. But I currently don't have time to do that.

    To mill the bottom side, the coordinate system needs to be changed. On my machine, I use a negative x-axis:

    G92 X-160.3
    G0X0Y0

    This will reset the coordinate system and bringing the machine to 0,0 will move the tool head over to the bottom right of the table.

    Now, the z-height must be recalibrated using the same command as above. 

    I strongly suggest moving a bit away from the X0, Y0 coordinate first to get a more reliable Z=0 reading.

    G0 X5 Y5
    G38.2 Z-35 F20
    G92 Z0

    UNFORTUNATELY, the autoleveler does not work for negative coordinate spaces so the bottom side must be milled blind! I haven't found a workaround for this, yet.

    For the outline milling, we change the tool head over to the 1mm endmill, calibrate the Z-height as above and hit mill. This should finalize the CNC process.

    All that's left to do is to clean up the board and solder it up.

    During the writing of these notes, I realized, I have my X-offset set up 0.5mm too far. This results in a mediocre board that I can make work but it's not as pretty as it should have been. Anyways. I'm writing this, so that I don't forget everything next time I'm making a single board.

    UPDATE:

    I figured out a workaround for this issue:
    Configuring GRBL to invert the X-axis after moving to the bottom side coordinate system removes the requirement to work in negative space. ($3 = 1 // or other settings: in my case XYZ all need to be inverted: $3 = 7). In this case, the entire mirroring of the bottom side PCB can be ignored.

  • Creating NC (gCode) files using FlatCAM

    Timo Birnschein10/13/2019 at 23:51 0 comments

    To change the export precision, use the command

    set_sys cncjob_coordinate_format "x%.3f  y%.3f"

    before any other operation

    Top Side Milling:
    ====================

    Load the Gerber file.

    Double click on the top Gerber and generate the geometry using the following parameters:
    Tool dia: 0.2
    Width (# passes): 3
    Pass Overlap: 0.15
    Combine Passes: checked

    Back to the project, select the generated isolation file and set the following parameters to generate the CNC path:

    Cut Z: -0.15 -- Proper Z-leveling is mandatory

    Travel Z: 1.0
    Feed Rate X-Y: 200
    Feed Rate Z (Plunge): 200
    Tool Dia: 0.2
    Multi-Depth: NOT checked

    Back in the project, double click on the selected CNC file, check your tool diameter again and hit Export G-Code

    Top Side Drilling:
    ====================

    Load the Excellon drill file.

    Double click on the drill file, select the tool you want to use from the list and generate the geometry using the following parameters:

    Cut Z: -2
    Travel Z: 1.0
    Feed Rate: 200
    Tool Change: NOT checked

    Back to the project, select the generated CNC file, check the tool diameter, update the plot and then export the G-Code.

    Bottom Side Milling:
    ====================

    Load the Gerber file and go to the double sided tool. Select the bottom Gerber file and hit Mirror Object with the same parameters as used for the outline.

    Mirror Axis: Y
    Axis Location: Point
    Point/Box: (0,0)

    Back to the project, double click on the bottom Gerber and generate the geometry using the following parameters:

    Tool dia: 0.2
    Width (# passes): 3
    Pass Overlap: 0.15
    Combine Passes: checked

    Back to the project, select the generated isolation file and set the following parameters to generate the CNC path:

    Cut Z: -0.15 -- Proper Z-leveling is mandatory.

    Travel Z: 1.0
    Feed Rate X-Y: 200
    Feed Rate Z (Plunge): 200
    Tool Dia: 0.2
    Multi-Depth: NOT checked

    Back in the project, double click on the selected CNC file, check your tool diameter again and hit Export G-Code

    Outline milling:

    ================
    I mill the outlines last. They need to be mirrored using the tools for double sided PCB and the following parameters:

    Mirror Axis: Y
    Axis Location: Point
    Point/Box: (0,0)

    Leave the rest and hit Mirror Object

    Back in the selected tab, select the correct outline file and use the command line tool

    isolate OpenRemote-Edge.Cuts.gbr -dia 1.0 -passes 1 -outname oline

    To generate the custom outlines of the board.

    Then use

    exteriors oline

    To generate a copy of the previously generated outlines but only the exterior outlines.

    Back in the project overview, the olines can now be deleted and only the olines_exteriors remain. That file will now be used to generate the CNC cutting file.

    Select the oline_exteriors file to process the the CNC job with the following parameters:

    Cut Z: -1.6
    Travel Z: 1.0
    Feed Rate: 144
    Tool Dia: 1.0
    Multi-Depth: checked
    Depth/pass: 0.4

    This generates a nice CNC path around the edges of the PCB with a 1mm endmill and multiple passes per full Z.

    Back in the project, double click on the selected CNC file, check your tool diameter again and hit Export G-Code

  • Exporting Gerber

    Timo Birnschein10/13/2019 at 23:44 0 comments

    We start with a finished design:

    This is a simple battery monitor for a boat, reading the voltage of five different batteries and displaying the voltages on a 160x128 LCD display one can buy on ebay for about $3 each.

    This is the breadboard showing it at work:

    Before exporting anything to Gerber, it is important to set the origin of the PCB. This will be used by FlatCAM to understand where to place the PCB and how to process top and bottom. Because one of the layers needs to be mirrored. The mirror takes place around the origin:

    I usually give myself a little space such that the cnc router can actually cut the outlines without going into negative coordinate space.

    To export Gerber for FlatCam, click the export button at the top of the screen:

    Select a folder to export to and deselect everything except the stuff you will likely need like top and bottom layer as well as the edge cuts (these need to be defined!)

    If you need drill files, you also need to click on Generate Drill files:

    Hit Generate Drill File and then Close.

    After the drill file was generated, the Gerber files can be plotted using the Plot button.

    Three different files will be created that we can not use in FlatCam to create the CNC milling files.