Close



Results 1 to 10 of 10
  1. #1
    Senior Engineer
    Join Date
    Jun 2014
    Location
    Burnley, UK
    Posts
    1,662

    What does G29 actually do?

    RepRap wiki says:
    Probes the bed at 3 or more points. The printer must be homed with G28 before G29.
    Which is about as much use as a chocolate teapot.

    Does it just spew the data out of the serial / USB port or does it use it to modify the Z values while extruding?

    I need to probe the 4 corners of my PCB and use the data to modify the Z value on cuts such that with a PCB that is say X30 Y40 if I send G0 X10 Y15 Z0.03 the move performed is actually G0 X10 Y15 Z(0.05 + 10*probeZx/30 + 15*probeZy/40).

    Is this what it does?

    I had this implemented on my CNC mill when I had LinuxCNC on it but I recently moved over to Marlin and need it because the Z cuts ideally are just the thickness of the copper (0.007 inches), any amount of not level screws the board, I either have to set the cut too deep or I get bits that are not cut. Spending an hour making sure the board is absolutely level is not really an option.

  2. #2
    Senior Engineer
    Join Date
    Jun 2014
    Location
    Burnley, UK
    Posts
    1,662
    And the answer to that question is yes it does use the matrix and what a huge difference it makes to the PCB quality.

    Happy puppy.

  3. #3
    Staff Engineer LambdaFF's Avatar
    Join Date
    Jan 2014
    Location
    France, Aix en Provence
    Posts
    1,139
    What is does : it uses the 3 or more measure points to calculate an average plane that minimizes the error (least square matrix) at each measured point. So with the hypothesis that the bed is perfectly plane but not level, your end up with a software correction that makes your hot end travel in this corrected plane instead of askew.
    Why you need to perform a Z measure first (G28) : the G29 command has the head move very slowly down from about a 1cm above the Z0 value probed with G28. And I think after 2cms of down Z movement it considers it has gotten a Z switch signal (obviously it stops moving if it does get a switch signal before). So if you didn't perform your G28 before, and the Z0 value is false by a big amount, you risk either to move at high speed into the bed or to do the 2 cms of probing without actually getting to the bed.
    Last edited by LambdaFF; 09-07-2015 at 02:42 AM.

  4. #4
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    Why you need to perform a Z measure first (G28) : the G29 command has the head move very slowly down from about a 1cm above the Z0 value probed with G28. And I think after 2cms of down Z movement it considers it has gotten a Z switch signal (obviously it stops moving if it does get a switch signal before). So if you didn't perform your G28 before, and the Z0 value is false by a big amount, you risk either to move at high speed into the bed or to do the 2 cms of probing without actually getting to the bed.
    Well... That is true... But it is a little bit more complicated than that. Once the G29 has been run, the 'Correction Matrix' is non-diagonal. Which means any movement gets 'corrected' by the Correction Matrix. When probing the bed, Marlin is telling the probe to go straight down. However, if there is already a correction matrix (that is non-diagonal) the Z Probes will not be moving purely in the Z direction.

    If the bed is fairly level, it won't be enough to mess things up. But it does add an extra and unwanted level of complexity. So the G28 replaces the Correction Matrix with a diagonal, unity matrix. And with that it is much easier to have confidence in your Z Probe numbers.

  5. #5
    Senior Engineer
    Join Date
    Jun 2014
    Location
    Burnley, UK
    Posts
    1,662
    Does it get corrected by only the matrix value or does it get corrected by (X/Xprobe)* XprobeZ value?

    That is to say that assuming the PCB is flat but not level is there any difference between only probing the 4 corners of the PCB and probing a greater number of places within the PCB perimeter?

    Adding this has certainly improved the PCBs it makes. I'll stick a picture up of before and after.

  6. #6
    Senior Engineer
    Join Date
    Jun 2014
    Location
    Burnley, UK
    Posts
    1,662
    The four on the left are too deep, you can see that the tracks are obliterated. The bottom right is too shallow, it is OK about half way up the board but too deep at the bottom and not deep enough at the top. The one on the top right is with autoZ enabled with a 4 point measure (each corner). You can see that it is not quite cut deep enough, this I expected as it is a 0.05 mm cut and the copper is 0.053 mm thick.

    A complete solution to the problem and quite easy to implement once I had changed the G29 command to accept Xxx Yxx Px as input parameters for board size and number of points, in this example G29 X30 Y30 P2 (P2 = 4 points)

    Better picture here: http://imgur.com/Ni1wG7Y
    Attached Images Attached Images
    Last edited by Mjolinor; 09-08-2015 at 09:57 AM.

  7. #7
    Staff Engineer Davo's Avatar
    Join Date
    Nov 2013
    Location
    Atlanta, GA
    Posts
    1,085
    Follow Davo On Twitter Add Davo on Facebook Add Davo on Google+ Add Davo on Shapeways Add Davo on Thingiverse
    Mjolinor,

    Please help me to understand why you prefer to account for the bed not being level over leveling the bed. Is it too hard to level the bed?

    Thanks,
    Davo

  8. #8
    Senior Engineer
    Join Date
    Jun 2014
    Location
    Burnley, UK
    Posts
    1,662
    It needs to be level to 0.0005 inches which means a DTI on the cutter head. I also have no way to adjust the bed / axes. This is a CNC machine, not a 3d printer and it is made of solid aluminium with lead screws, so pretty substantial. The PCB is not level in a lot of ways so if I probe 16 points they will be up as well as down on the front left reference point. If I put double sided tape over the whole of the back of the PCB and make sure it is firmly stuck to the bed all over then it will be OK without the auto Z adjust but then you snap the PCB taking it off. The bed itself is smooth, flat and level WRT both the X and Y axes, sticky tape and cheap copper backed board add a variable that can only be accounted for by auto Z adjust.

  9. #9
    Staff Engineer Davo's Avatar
    Join Date
    Nov 2013
    Location
    Atlanta, GA
    Posts
    1,085
    Follow Davo On Twitter Add Davo on Facebook Add Davo on Google+ Add Davo on Shapeways Add Davo on Thingiverse
    Fair enough.

    Thanks.

  10. #10
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    Quote Originally Posted by Mjolinor View Post
    Does it get corrected by only the matrix value or does it get corrected by (X/Xprobe)* XprobeZ value?
    The Correction matrix starts at unity (unless you are saving the matrix to EEPROM). The G29 command probes some number of points and using those points to build the correction matrix. There are a number of algorithms that G29 knows how to use. 3-Point was the original just because it was very easy and intuitive. 3 non-linear points define a plane. So the strategy was to measure 2 corners on one side and one more point at the middle on the other side. From this, the plane can be defined. Later the 'Accurate Bed Leveling' allowed more points to be sampled in a grid. A least squares algorithm was applied to find the 'Best Fitting' plane through the points. The Deltas usually do a circular pattern but still feed those into a least squares algorithm.

    Once the best equation for a plane is discovered, this is converted into a 'Correction Matrix'. From this point on.... every desired [X,Y,Z] coordinate is multiplied by the 'Correction Matrix' to generate the machine coordinate [X',Y',Z'] that the machine will move to. (Technically... this always happens. But with the correction matrix at unity, it does all the work to translate the coordinates, they just always end up with the same values that they started with.)

    That picture of your milled circuit board is impressive!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •