TCL script - drillcncjob

Issue #301 resolved
Brian created an issue

Hi,

When using the TCL Shell and the commands millholesand drillcncjobis there any way of selecting from the Tool Table by diameter and not by its index in the table, as it currently does using the option -tools, this will allow to fully automate the process across many boards and holes sizes.

I need to select 3.0mm holes (unknown in the table position prior to opening in FlatCAM) and mill with a 2.0mm bit to -10.0mm them for alignment pins as the first process (this makes for a perfect fit for the pins that I have), then later in the board process drill all the other holes including tool changes with the exception of the 3.0mm holes

Many Thanks.

Comments (10)

  1. Marius Stanciu

    Hi,

    I think that the original reasoning behind having only references to the actual tools (indexes in the list of tools) rather than having the tools directly specified by diameter is the fact that there is no way to know in advance which diameters are in the tools of the Excellon object.

    I can make this command to spit out a warning message in case that the user is selecting a diameter that is not in the tools of the Excellon object but that means that there is a possibility that whatever commands you have down the chain, may fail due of being starved of inputs.

  2. Brian reporter

    Hi Marius,

    “no way to know in advance which diameters are in the tools of the Excellon object” - surly ‘most’ people would design their boards then pass them through FlatCAM, rather than download a layout and blindly pass it through FlatCAM… so you would (definitely should) know what diameter holes you want to make. in any case if you don't know the diameter of what your drilling/milling then you don’t know what size bit to chuck up at the start or at the next tool change!!

    There is absolutely no way to know in advance to know which diameter is going to be at which index in the tool table. so you cannot fully automate the process if you want only 3.0mm holes drilled

    I understand how and why you need the tool table. but it just seems silly to go from a known parameter (diameter) to an unknown index and not be able to select a tool by the known parameter.

    Brian.

  3. Marius Stanciu

    The idea is that you can certainly mill almost any diameter using a diameter to fit them all. That also assumes that you know the diameters so it’s a chicken-egg paradigm.

    I may have to redesign this as the original one was fit only for the drill holes and there is none for the slots. I will have a look, this was inherited so I have to check so I don’t brake something.

  4. Marius Stanciu

    Ok Brian,

    The MillDrills and MillSlots TclCommand are working now with the milled_dias parameter instead of tools parameter. Where tools parameter was a list of tool indexes now milled_diias is a list of diameters that are in use in the Excellon object. I just realized that I have to make sure to print a message in the Tcl Shell in case that one of the tool diameters requested to be milled is not in the diameters of the Excellon object. To make the user aware of the problem.

    Do you think that in this case the operation should abort completely or is better to continue with the valid diameters and just issue a warning that the etc diameter was not processed due of not having drills holes with that diameter in the object?

  5. Brian reporter

    hummm, if it aborts and throws a message, then its all safe, and nothing bad will happen.

    If it continues with a warning, and the warning message was not acted upon by the user, then the resulting GCode will be missing a set of hole sizes, which could lead to wasted production runs, time, money...

    There is always the imperial to metric conversion factor. I design in imperial (it is just easier due to 0.1” and thousands of an inch landing pads and pin spacing) then import into FlatCAM in MM so my 40 Mil (1 mm) holes are 1.02 mm in the tool table due to the conversion… for me personally for prototyping (using FlatCAM) I stick to 0.5 mm increments in drill/end mill sizes and only come away from this when going to fablab for very specific requirements if needed. so rounding down the tool table sizes to the nearest 0.5 mm could help as an option on the command. rounding up would be dangerous and could break out of the pad.

    Hope this helps!

  6. Marius Stanciu

    Already implemented having the command to abort and throw error. I implemented the same for TclCommandDrillCncJob as for TclCommandMillDrills and TclCommandMillSlots (diameters list instead of tools indexes).

    Sorry, no rounding as this can lead to other issues. There is already a truncation in place (which also rounds) to 2 decimals for tools in METRIC and to 4 decimals when tools are in Imperial. And, as you said, the user has to know what tools it uses.

  7. Marius Stanciu

    Hi Brian,

    I was thinking on this rounding of yours and what I could come up with in order to compensate the rounding errors from units conversion is to have another optional parameter that when stated like:

    drillcncjob test_excellon.drl -drilled_dias 1.0 - tol 10

    will select any tool in the Excellon object test_excellon.drl that have a diameter of 1.0 +/- 10% for processing.
    This way you can specify a tolerance (in percentages) and you no longer need to be spot on on the tool diameter.

  8. Log in to comment