No motivation letter here.
Well, I got one Cartographer, and I want to run it on the mainline.
So, bootable config. There is either PA9/PA10, or PA11/PA12
Katapult USB/CAN Example
Micro-controller Architecture (STMicroelectronics STM32) --->
Processor model (STM32F042) --->
Build Katapult deployment application (Do not build) --->
Clock Reference (24 MHz crystal) --->
Communication interface (USB (on PA9/PA10)) --->
Application start offset (8KiB offset) --->
USB ids --->
() GPIO pins to set on bootloader entry
[*] Support bootloader entry on rapid double click of reset button
[ ] Enable bootloader entry on button (or gpio) state
[*] Enable Status LED
(PB5) Status LED GPIO Pin
Micro-controller Architecture (STMicroelectronics STM32) --->
Processor model (STM32F042) --->
Build Katapult deployment application (Do not build) --->
Clock Reference (24 MHz crystal) --->
Communication interface (CAN bus (on PA9/PA10)) --->
Application start offset (8KiB offset) --->
(1000000) CAN bus speed
(PA1) GPIO pins to set on bootloader entry
[*] Support bootloader entry on rapid double click of reset button
[ ] Enable bootloader entry on button (or gpio) state
[*] Enable Status LED
(PB5) Status LED GPIO Pin
Klipper USB/CAN make menuconfig
[*] Enable extra low-level configuration options
Micro-controller Architecture (STMicroelectronics STM32) --->
Processor model (STM32F042) --->
Bootloader offset (No bootloader) ---> # Katapult (8KiB bootloader)
Clock Reference (24 MHz crystal) --->
Communication interface (USB (on PA9/PA10)) --->
USB ids --->
Optional features (to reduce code size) --->
[ ] Optimize stepper code for 'step on both edges'
() GPIO pins to set at micro-controller startup
....
[*] Support micro-controller based ADC (analog to digital)
[*] Support communicating with external chips via SPI bus
[*] Support software based SPI "bit-banging"
[*] Support communicating with external chips via I2C bus
[*] Support software based I2C "bit-banging"
[*] Support hardware PWM (pulse width modulation) # Not yet implemented in mainline
[*] Support GPIO based button reading
[ ] Support Trinamic stepper motor driver UART communication
[ ] Support 'neopixel' type LED control
[*] Support measuring fan tachometer GPIO pins
*** LCD chips ***
[ ] Support ST7920 LCD display
[ ] Support HD44780 LCD display
*** Accelerometer chips ***
[*] Support adxl accelerometers
[ ] Support lis2dw and lis3dh 3-axis accelerometers
[ ] Support MPU accelerometers
[ ] Support ICM20948 accelerometer
*** External ADC type chips ***
[ ] Support thermocouple MAX sensors
[ ] Support HX711 and HX717 ADC chips
[ ] Support ADS 1220 ADC chip
*** Other external sensor chips ***
[*] Support ldc1612 eddy current sensor
[ ] Support angle sensors
[*] Enable extra low-level configuration options
Micro-controller Architecture (STMicroelectronics STM32) --->
Processor model (STM32F042) --->
Bootloader offset (8KiB bootloader) --->
Clock Reference (24 MHz crystal) --->
Communication interface (CAN bus (on PA9/PA10)) --->
Optional features (to reduce code size) --->
(1000000) CAN bus speed
[*] Optimize stepper code for 'step on both edges'
(PA1) GPIO pins to set at micro-controller startup
....
Features section same as above
To get a rough idea of the sensor’s resolution distribution.
There are 2.5mm and 3.5mm sensor offsets from the bed.
Less crude graph script
# File name carto_2.5mm.data
0.050000:3246332.946,0.090000:3240873.962,0.130000:3235619.030,
0.170000:3230460.204,0.210000:3225456.210,0.250000:3220565.179,
0.290000:3215833.924,0.330000:3211168.165,0.370000:3206666.099,
0.410000:3202239.178,0.450000:3197979.178,0.490000:3193769.752,
#!/usr/bin/python3
import os
import glob
import matplotlib.pyplot as plt
data_files = sorted(glob.glob("*mm.data"))
plt.figure(figsize=(10, 6))
for filename in data_files:
# Extract postfix from filename (e.g. 30c from "carto_30c.data")
name = os.path.basename(filename).split("_", 1)[1].replace(".data", "")
z_values = []
freq_values = []
with open(filename, 'r') as f:
content = f.read().strip().replace("\n", "")
pairs = [p for p in content.split(",") if p]
for pair in pairs:
z, freq = pair.split(":")
z_values.append(float(z))
freq_values.append(float(freq))
plt.plot(z_values, freq_values, label=f"{name}", marker='.', linestyle='-', linewidth=1)
plt.title("Sensor Frequency vs. Z Height")
plt.xlabel("Z Height (mm)")
plt.ylabel("Frequency (Hz)")
plt.legend(title="File name")
plt.xticks([i / 10 for i in range(0, 450, 10)])
plt.grid(True)
plt.tight_layout()
plt.show()
"""
pairs = re.findall(r'([\d\.]+):([\d\.]+)', data)
Z = [float(z) for z, _ in pairs]
freq = [float(f) for _, f in pairs]
plt.figure(figsize=(10, 6))
plt.plot(Z, freq, marker='.', linestyle='-', linewidth=1)
plt.title("Z vs Frequency")
plt.xlabel("Z mm")
plt.ylabel("Frequency")
plt.xticks(np.arange(min(Z), max(Z) + 1, 2.0))
plt.grid(True)
plt.tight_layout()
plt.show()
Well, that explains why the eddy probe feels unusable with temperature drift with adequate z values, like 2-3 mm (in my opinion, that was adequate).
So, it seems that from a homing/probing perspective, it may make sense to use the lowest Z offset possible and probably calibrate it around some temperature mid-point.
It looks like higher temperature → lower frequency.
And that happens, the MCU frequency is also lower:
But MCU is the source of the frequency for the LDC1612, so the thermal drift can be amplified by the oscillator drift, and so the MCU drift.
Let’s assume my measurements are more or less accurate (they are not precise).
(Probably it would be better to simply heat the carto with a hairdryer, instead of gradually heating the hotend, bed, and rerun of probe calibration).
And calculate the frequency difference for several points:
LDC1612’s datasheet and application manuals (https://www.ti.com/lit/an/snoa950/snoa950.pdf) stated that a change in the IDRIVE current would shift the frequency output.
And we want to avoid hitting the 1.8V.
Because my sensor want IDRIVE 19 at mid-air, 20 at being close to the bed, and 21 when heated, there are data about that.
(With enabled IDRIVE boost).
20 and 21 will hit 1.8v at distance > 4mm.
19 would hit <1.2v at distance ~ 2.5 + 3 mm. Where 2.5 is my current nozzle offset and 3 is z_offset.
G90
G0 X205 Y202.5 Z0
LDC_SET_DRIVE_CURRENT CHIP=carto VALUE=19 # It is a custom command
PROBE_EDDY_CURRENT_CALIBRATE CHIP=carto
It seems insignificant to my taste.
Like, if we do overdrive it a little, it should perform okayish as long as the current is constant and vice versa.
I should say, that increasing the current increase the overall frequency range a little. Not sure if it worth it.