Machine Skew Correction - fixed for next version

Issue #550 new
Timo Birnschein created an issue

My machine has a skewed Y axis. For PCB milling, this is an issue as small vias get destroyed when I drill holes.

To compensate for that, I’m attempting to implement a very simple skew correction. However, this needs to be one way for the top side and in my case the other way for the bottom side.

This image is dramatically exaggerated but it shows what I’m attempting to do.

Since the software is quite complex, my naïve approach is to create two different grbl11 preprocessors, one for top and one for bottom, with different settings but hard-coding this seems extreme. I’d love to add this to the settings and make it configurable.

Any pointers you could provide?

Here is the basic correction code that yields above cnc job result from grbl1.1.py:

    def position_code(self, p):
        return ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \
               (p.coords_decimals, p.x + (p.y / 100 * 3), p.coords_decimals, p.y)

See line three. My machine has a 160x100mm bed so calculating this is trivial. The number 3 is the skew at 100mm travel in Y. Realistically, this is more like 0.075mm but I wanted to show what I have in mind with a dramatic value.

Comments (11)

  1. Marius Stanciu

    Hi Timo,

    What FlatCAM version are you using? In FlatCAM beta 9.xxx there is such a thing like Skew included in the Transformation Tool (Plugin).

  2. Timo Birnschein reporter

    I’m using the latest beta 8.994. I missed this tool box. I’ll look into it. However, a setting for top and bottom via checkbox or similar for skew would make my workflow easier. Selecting the right preprocessor (one for top and one for bottom milling) is currently my preferred way to go as it makes it dead simple to select the correct skew settings instead of starting a tool, entering the right values, applying it and then using one preprocessor.

    I’ll try this for a bit and let you know how it goes. Maybe there is a way to make this easier to use and more universal.

  3. Marius Stanciu

    The Transform Plugin (Menu → Options → Object Transform) apply on the geometry (or Gerber). I did not verify the status as of yet but I did try to make it apply over the GCode directly on and off but the results were not so good.

    I could add in the Preferences → CNC-Job tab something like this:
    A new category named corrections where we can define the bed size and then a skew_x, skew_y and offset_x, offset_y. Then modify all the preprocessors to take into consideration those parameters as per your suggestion. But that will not be a distinction between top/bottom since a CNC malfunction (the bed not square) is something general.

  4. Timo Birnschein reporter

    The primary reason why top and bottom needs to be handled differently on my machine is because I don’t use the double sided PCB tool but instead flip the PCB over and use the same corner on the PCB aligned with the other side of the bed. That makes setup very easy on my end since I really just need to flip the board and turn the vacuum table back on:

    I like the idea of having some additional parameters for this in the settings that I can then use in the preprocessor. For me, one single parameter would be sufficient such that I don’t need to hard-code my skew setting in the grbl11.py file (which then requires me to restart flatcam for the change to propagate).

  5. Marius Stanciu

    @Timo Birnschein

    I just finished the GUI in Preferences and started to work on the default preprocessor after which I will propagate the changes to the other preprocessors.

    BTW, the equation you use above is the classic x_fin = x_init + y/m where m is the slope (tangent) isn’t it? The tangent(slope) is calculated from the skew and from the bed size.

  6. Timo Birnschein reporter

    From the looks of it, your skew is different from my skew. I’m correcting a parallel shift, you are correcting an oval as it seems.

  7. Timo Birnschein reporter

    Oh wait. I suppose your example picture shows a symmetrical skew on both axis. That makes sense…

  8. Marius Stanciu

    In the last picture I am showing the result with the settings shown in the first picture: offet on X, offset on Y, skew on X, skew on Y. They don’t have to be symmetrical it was just a choice I made.
    Actually my CNC also adds a non-symmetrical skew but on both axes. It’s almost negligible but it’s still there and through those settings I could take care of those in one shot.

  9. Log in to comment