This thread explores the method of tracking the target decay curve (pulse induction) by variation in time(dt).
It is entirely experimental, to test the method and to see how far it can be developed.
It is inspired by the PICKINI.
In a time-domain pulse induction metal detector, the DAC's job is to generate the precise slicing level reference voltage. This reference voltage acts as a razor-thin tripwire line just above the noise floor. When the high-voltage coil flyback pulse decays and drops below this exact DAC voltage level, the internal comparator trips, allowing the timer to calculate the target pulse width (dt). Here is my understanding of how the code will work: to generate the slicing level:
Remember I am using a bi-polar TX drive
DAC Bit Depth: 8-Bit Dual Cores (Precision 256 Steps)(PIC18F16Q41)
DAC1 directly to the internal positive input of Comparator 1
DAC2 directly to the internal positive input of Comparator 2
The slicing voltage stays completely inside the chip. Resolution is 19.53mV per step(5V)
The 12-bit ADC fires a rapid, hardware-averaged 16-sample burst reading across the VOP and VON signal paths. This lets the firmware know exactly where the analog baseline is resting during the "quiet" period after the coil flyback and all target eddy currents have decayed completely to zero.
Next, the firmware reads the voltage coming from the 10kΩ linear sensitivity potentiometer via the ADC. If the user turns the knob all the way up, it means they want maximum depth, so the slicing level needs to sit as close to the baseline as possible.
Now, the code combines these two real-time values:
DAC1 slicing level (VOP) = VOP baseline + sensitivity offset
DAC2 slicing level (VON) = VON baseline + sensitivity offset
VOP slicing level:
Real-Time 12-Bit ADC Baseline Capture
Math Equation: Baseline + Sensitivity Offset
Write Number directly to Register: DAC1CON
Internal Silicon Core routes slicing level tripwire to Comparator 1
repeat for VON
Because this entire calculation and register update takes less than a single microsecond, the firmware does it seamlessly once per pulse cycle (up to 1,000 times a second). If a wave sweeps over the sand or the battery supply dips, the baseline shifts, the ADC catches it instantly, and the DAC dynamically recalculates the new slicing height for the very next pulse. There are absolutely no voltage jumps across external capacitors, meaning zero blind settlement delays and perfect real-time drift immunity!
At least in theory!

================================================== ==============
TRANSMIT CYCLE - NET VOLTAGE AT MCU - ACTIVE INTERNAL COMPARATOR
================================================== ==============
Cycle A (Positive) - VOP is POSITIVE (>0V) - COMPARATOR 1 processes VOP.
VON is Negative (<0V) - (Comparator 2 ignores the clipped VON line).
Cycle B (Negative) - VOP is Negative (<0V) - (Comparator 1 ignores the clipped VOP line).
VON is POSITIVE (>0V) - COMPARATOR 2 processes VON.
Also, to run a proper subtractive ground balance loop, the firmware must capture the decay time width (dt) at two distinct signal heights within the exact same pulse window: an Early Sample (t₁) and a Late Sample (t₂)
Because the PIC18F16Q41 features twin peripheral sets, the software configures them to act as two independent stopwatches running in parallel.
It is entirely experimental, to test the method and to see how far it can be developed.
It is inspired by the PICKINI.
In a time-domain pulse induction metal detector, the DAC's job is to generate the precise slicing level reference voltage. This reference voltage acts as a razor-thin tripwire line just above the noise floor. When the high-voltage coil flyback pulse decays and drops below this exact DAC voltage level, the internal comparator trips, allowing the timer to calculate the target pulse width (dt). Here is my understanding of how the code will work: to generate the slicing level:
Remember I am using a bi-polar TX drive
DAC Bit Depth: 8-Bit Dual Cores (Precision 256 Steps)(PIC18F16Q41)
DAC1 directly to the internal positive input of Comparator 1
DAC2 directly to the internal positive input of Comparator 2
The slicing voltage stays completely inside the chip. Resolution is 19.53mV per step(5V)
The 12-bit ADC fires a rapid, hardware-averaged 16-sample burst reading across the VOP and VON signal paths. This lets the firmware know exactly where the analog baseline is resting during the "quiet" period after the coil flyback and all target eddy currents have decayed completely to zero.
Next, the firmware reads the voltage coming from the 10kΩ linear sensitivity potentiometer via the ADC. If the user turns the knob all the way up, it means they want maximum depth, so the slicing level needs to sit as close to the baseline as possible.
Now, the code combines these two real-time values:
DAC1 slicing level (VOP) = VOP baseline + sensitivity offset
DAC2 slicing level (VON) = VON baseline + sensitivity offset
VOP slicing level:
Real-Time 12-Bit ADC Baseline Capture
Math Equation: Baseline + Sensitivity Offset
Write Number directly to Register: DAC1CON
Internal Silicon Core routes slicing level tripwire to Comparator 1
repeat for VON
Because this entire calculation and register update takes less than a single microsecond, the firmware does it seamlessly once per pulse cycle (up to 1,000 times a second). If a wave sweeps over the sand or the battery supply dips, the baseline shifts, the ADC catches it instantly, and the DAC dynamically recalculates the new slicing height for the very next pulse. There are absolutely no voltage jumps across external capacitors, meaning zero blind settlement delays and perfect real-time drift immunity!
At least in theory!
================================================== ==============
TRANSMIT CYCLE - NET VOLTAGE AT MCU - ACTIVE INTERNAL COMPARATOR
================================================== ==============
Cycle A (Positive) - VOP is POSITIVE (>0V) - COMPARATOR 1 processes VOP.
VON is Negative (<0V) - (Comparator 2 ignores the clipped VON line).
Cycle B (Negative) - VOP is Negative (<0V) - (Comparator 1 ignores the clipped VOP line).
VON is POSITIVE (>0V) - COMPARATOR 2 processes VON.
Also, to run a proper subtractive ground balance loop, the firmware must capture the decay time width (dt) at two distinct signal heights within the exact same pulse window: an Early Sample (t₁) and a Late Sample (t₂)
Because the PIC18F16Q41 features twin peripheral sets, the software configures them to act as two independent stopwatches running in parallel.
Comment