Please see the following LTspice schematic:
This is an excitation circuit for a fluxgate current sensor. The inductor L1 models the magnetic core's B-H loop and dimension along with a sensing winding of 10 turns. The DRV8837 is a H-bridge driver, it is used to run forward and reverse direction currents through the sensing coil in order to drive the magnetic core into saturation in both direction repeatedly for excitation. When current reaches ~30mA, the core is deep in saturation so the direction of current should be reversed. This is done by the TL07XH_TL08XH amplifiying the voltage drop on resistor RSHUNT 20 times, so that it outputs 2.5V(offset) + 0.6V when there is +30mA on the sensing coil and 2.5V - 0.6V at -30mA. The LMV331 with feedback and biasing resistors creates an inverting comparator with hysteresis, with VOH = 3.1V and VOL = 1.9V. Its output and its output's complement are then used to control the H bridge driver.
This circuit is not behaving as expected in LTspice simulations. Especially at node ph+ (output of comparator), voltage settles at 2.5V after just one rising and falling edge:
Current on excitation winding is at constant 2A:
Initial waveforms at VOA, ph+ and REF, which then all settle to constant value:
Same circuit with some LTspice built in models from Analog Devices, and the circuit simulation gives expected result:
Current waveform on the inductor L1. Peaks aren't exactly at 30mA (Why is this? The postive peak is pretty far away from 30mA at 42mA), but the waveform is same as expected.:
It could be that the TL07XH and/or the LMV331 are not usable for this particular circuit, but I could not see any specification that does not meet the criterion. I am also not sure if it's an good idea to use an H bridge motor driver (DRV8837) for an application like this, but it's cheap considering it integrates the MOSFETS as well, and it has built in dead time so there is no need for dead time insertion circuit.
Although this question is related to LTspice, but any general advice on this circuit would be very helpful!
Vhigh
for component A1? \$\endgroup\$buf
, run the comparator output into it, and then run both outputs of thebuf
into the DRV8837? \$\endgroup\$