Implementing Grid Compensation (M557)

User avatar
CRPerryJr
Printmaster!
Posts: 107
Joined: Mon Mar 30, 2015 7:21 pm
Location: Hartland, MI

Implementing Grid Compensation (M557)

Postby CRPerryJr » Thu Dec 15, 2016 9:28 pm

This is from another post, but I thought it was different enough to have it's own thread...

How do you implement Grid Compensation on a Max V2 with the Duet 0.85 and firmware 1.17RC1/DWC 1.13?

What I've done so far is:

1. Removed bed.g
2. Added M557 R150 S25 to config.g
3. Modified the reprap.htm file under /www on the SD card and changed the G32 button (Auto Delta Calibration) to G29

It seems to work, covers the whole bed, gives me 96 probe points and saves the data to file heightmap.csv. But it leaves the print head close to the bed, and doesn't home before doing another consecutive G29.
Also, is there a way to change the bed level button on the Paneldue to use G29 instead of G32?

Has anyone implemented this on their Max? If so, can you share how you did it? There's got to be a better way than I did it.
Thanks!
SeeMeCNC Rostock Max V2
Makerbot Replicator Gen 5

User avatar
mhackney
ULTIMATE 3D JEDDI
Posts: 5404
Joined: Mon Mar 26, 2012 4:15 pm
Location: MA, USA
Contact:

Re: Implementing Grid Compensation (M557)

Postby mhackney » Thu Dec 15, 2016 10:47 pm

A couple of pointers and clarifications. I consulted with David on requirements and was (I believe) the first tester for grid compensation (1.17 dev builds). David gave me a few tips which I'll share along with my own experience.

Firstly, remember that auto calibration (G32) and delta grid compensation (G29) are two different but complimentary things. It is always best to have a good mechanical build and then perform auto calibration.

G32 uses bed.g to define the probe points for the calibration. Don't remove bed.g, you need it for calibration.
G29 creates a height map file: /sys/heightmap.csv. G29 S2 (load height map from file) is implemented in 1.17RC1 and later. The grid is defined with the M557 command (see below).

How To Use G32 and G29
First you should calibrate normally with G32. After calibration, you can run G29 grid compensation. Keep in mind that any sort of G32 probing (calibration) after G29 (compensation) will cancel the height map. Also keep in mind that G29 will refuse to run (and generate an error message on the console) if you do not home (G28) first. Here's what David recommends - and I created a macro to do this easily:

  • run G32 to calibrate
  • do not home (G28) after the G32 so that any variation in the endstop switch trigger positions is taken out by auto calibration
  • then run G29 to generate the height map and enable grid compensation

To use grid compensation, you need to define the grid with M557. This supports both rectangular and round beds. So for a delta you use something like:

M557 R100 S20 ; define a grid with the specified radius and spacing

I simply add this to my macro. Note that Duet 0.6.5 and .8 allow up to 121 grid points whereas DuetWifi allows up to 441 points.

I wouldn't recommend modifying rerap.html or any of the other web server files - use macros to do this. You sould not need to run G29 mutliple times back to back. I add a G0 Z200 (I recall( at the end of my macro to raise the nozzle up to 200mm. I am sure David will add support to the PanelDue once the firmware implementation is complete and hardened.

Sublime Layers - my blog on Musings and Experiments in 3D Printing Technology and Art

Start Here:
A Strategy for Successful (and Great) Prints

Strategies for Resolving Print Artifacts

The Eclectic Angler

User avatar
CRPerryJr
Printmaster!
Posts: 107
Joined: Mon Mar 30, 2015 7:21 pm
Location: Hartland, MI

Re: Implementing Grid Compensation (M557)

Postby CRPerryJr » Fri Dec 16, 2016 1:38 am

Thanks much mhackney! your explaination clarified the process greatly! I'll get it all together tomorrow and post my results.
SeeMeCNC Rostock Max V2
Makerbot Replicator Gen 5

dc42
Printmaster!
Posts: 323
Joined: Mon Mar 07, 2016 10:17 am

Re: Implementing Grid Compensation (M557)

Postby dc42 » Fri Dec 16, 2016 2:05 pm

Just a few things to add to mhackney's response:

- G29 S1 (load height map from file) is implemented in 1.17RC1 (and so is tapering of grid bed compensation)
- Some people like to add G29 to the end of bed.g
- The G30 commands in bed.g accept H parameters to compensate for variation in the probe trigger height with XY position. There is no equivalent compensation for G29. If your Z probe trigger height varies significantly with XY position for any reason, then you won't get good results from G29.

User avatar
mhackney
ULTIMATE 3D JEDDI
Posts: 5404
Joined: Mon Mar 26, 2012 4:15 pm
Location: MA, USA
Contact:

Re: Implementing Grid Compensation (M557)

Postby mhackney » Fri Dec 16, 2016 5:40 pm

I missed the RC post David, thanks! I'll edit the post above to clarify that.

Sublime Layers - my blog on Musings and Experiments in 3D Printing Technology and Art

Start Here:
A Strategy for Successful (and Great) Prints

Strategies for Resolving Print Artifacts

The Eclectic Angler

User avatar
gestalt73
Printmaster!
Posts: 345
Joined: Wed Aug 07, 2013 11:10 am
Location: Anaheim, CA

Re: Implementing Grid Compensation (M557)

Postby gestalt73 » Fri Dec 16, 2016 6:40 pm

I'm having so much fun with the new Duet Wifi and dc42's firmware.

https://github.com/dc42/RepRapFirmware/blob/dev/WHATS_NEW

I thought that load height map was done using M375?

User avatar
mhackney
ULTIMATE 3D JEDDI
Posts: 5404
Joined: Mon Mar 26, 2012 4:15 pm
Location: MA, USA
Contact:

Re: Implementing Grid Compensation (M557)

Postby mhackney » Fri Dec 16, 2016 7:47 pm

David does a great job keeping the gcode docs updated on reprap wiki. That's a good place to check. http://reprap.org/wiki/G-code

Sublime Layers - my blog on Musings and Experiments in 3D Printing Technology and Art

Start Here:
A Strategy for Successful (and Great) Prints

Strategies for Resolving Print Artifacts

The Eclectic Angler

dc42
Printmaster!
Posts: 323
Joined: Mon Mar 07, 2016 10:17 am

Re: Implementing Grid Compensation (M557)

Postby dc42 » Sun Dec 18, 2016 3:56 am

gestalt73 wrote:I'm having so much fun with the new Duet Wifi and dc42's firmware.

https://github.com/dc42/RepRapFirmware/blob/dev/WHATS_NEW

I thought that load height map was done using M375?

I implemented G29 S1 first, then I found that M375 had been defined. So now they both do the same thing.


Return to “Duet”

Who is online

Users browsing this forum: No registered users and 1 guest