PrusaOwners / Marlin

Optimized firmware for RepRap 3D printers based on the Arduino platform.
http://www.marlinfw.org/
GNU General Public License v3.0
15 stars 4 forks source link

PINDA temp compensation auto-calibrate #8

Open matthew-humphrey opened 5 years ago

matthew-humphrey commented 5 years ago

Summary

Add a g-code which triggers an automatic process to populate the PINDA temperature compensation table.

Background

The PINDA2 probe used in Prusa MK3 printers has a temperature dependency. This probe has a built-in thermistor which allows the microcontroller to read the probe temperature before performing Z height measurements. By combining this temperature measurement with a temperature compensation table, the MCU can perform an approximate compensation for this temperature dependency, producing more consistent results over the range of temperatures.

The temperature compensation values vary from printer to printer, and even over time. Because of this, the end user must measure these temperature compensation values. This process is time consuming and too difficult for most users. By providing a way to automate this process, it can be accessible to everyone, and can be something users can run frequently to keep their printer tuned even as the temperature compensation values drift over time.

Details

The basic process will work as follows:

  1. The user will send a g-code (TBD) to the printer specifying the parameters for the calibration. This could include a starting temperature and temperature increment or ending temperature.
  2. The printer will move the print head to the center of the bed and some height well away from the heatbed (100mm is good).
  3. The printer will heat the heatbed to some nominal temperature.
  4. The printer will lower the print head until the probe fires (using the existing firmware probing routine, which does a "double tap" measurement) and record this value and the current probe temperature as the base value.
  5. The printer will leave the print head at its current (low) position and wait for the probe to reach the next target temperature.
  6. The printer will raise the probe some nominal amount (2mm), and then lower the print head until the probe fires (again using the existing firmware Z probing routine). The value will be recorded as the second value in the temperature compensation table.
  7. This process repeats until all points have been measured, or until we timeout waiting on the probe to reach some temperature. If a timeout occurs, it means that the max temperature specified in g-code is not practically possible, and so we just end the process early with a smaller compensation table.
  8. The printer outputs the compensation table to the serial port, and if specified in the g-code, updates the table values in EEPROM (and activates temperature compensation?).