I have not worked with that H-bridge chip, so I can't offer any suggestions based on direct experience, but I have some questions.
Can you explain in more detail what you are trying to do?
You have IN1 and IN2 tied off to +5 and gnd respectively. Are you doing that as a temporary expedient so that you can examine the current chopping independent of the stepper stepping?
What then is the signal that you are applying to the + input of the comparator? And what is the purpose of the RC network on the output of the comparator?
thanks!
IN1 and IN2 is just for test, 1V applied to the + input of the comparator is for test too.
R1 C1 is for a delay.
i tried at first without C1 then the current will raise fast.
I don't think the design will work. When the fets turn off, the voltage across the sense resistor will go negative and cause the comparator to switch state immediately. While it is probably possible to tweak the circuit to make it work, you shouldn't bother. There are too many limitations with this approach. Why not just use the chip the way it was intended? Use the mcu to control the PWM.
The R1 C1 is a delay for prevent the comparator to switch state too quickly.
Just have a try.
It looks like the comparator will operate in the linear region rather than snap on and off.
i used Oscilloscope, saw the comparator worked fine, but the oblique wave on the "enable" pin make L6203 worked worse.
ch1 is the out1 pin
ch2 is the en pin (1V/DIV)
Attachment 212372
Can you explain what is the advantage this method? The off time is very imprecise because it depends on non-repeatable analog characteristics of a digital gate. It also uses the same number of chips as a "proper" chopper design.
Modulate in1 and in2 as follow.
Detect the current with the comparator as usual, but connect it's output to a mcu interrupt pin. When the set current is detected, drive in1 (or in2) low for 50 uS or so. The mcu should be quite fast, 20 mips or higher in order to avoid jitter.
I found use the 'En' pin control L6203 seems a bad idea,
so i changed the circuit with a d-trigger to control the 2 input pin of L6203.
Now it can lock the stepper quietly, but the stepper can't rotation, just rotor trembling?
Attachment 215344
What waveform do you get across R1?