Help with negative spikes or battery sag with PWM

Thread Starter

DiegoFC

Joined Mar 15, 2023
3
Hello,

At first I must say sorry for my english, please ask me if you can't understand something that I'm writing

I'm designing a circuit to heat a nichrome coil using PWM and a mosfet. Supply source are two 18650 high drain batteries in series.
Also I need to sense current across the wire and detect short circuit to stop PWM signal and turn off the mosfet



I'm using an Attiny1616 as mcu

This is my circuit:

1703871556327.png

Q3 is for reverse battery protection.

Q1 is for swiching, Frequency is 1,2Khz

INA381 sense the current, set the Alert threshold with Vref (from Attiny1616 DAC) and Alert is attached to an Interrupt pin of the Attiny

OUT net is attached to Attiny ADC pin to mesure current

MCP1703 is the LDO for Attiny and INA381 Vin



The circuit works great, PWM heat up the wire, I can sense current without problem, I can set current limit with Vref, the interrupt is triggered and turn off the mosfet

but the issue is when I try short circuit protection.



When I force a short circuit, Attiny resets and sometimes MCP1703 blow up.



I think may be a negative spike or voltage sag in the battery are guilty of this behavior but I'm a newbie with electronics so need your help to figure out waht is the cause of this

Thanks in advance
 

Ian0

Joined Aug 7, 2020
13,165
After a short circuit is detected (which already has a 1ms delay due to R9/C6) how long does it take before the drive to the MOSFET is switched off?
What happens if you make C8 MUCH larger (say 100uF or 1000uF)?
 

Thread Starter

DiegoFC

Joined Mar 15, 2023
3
After a short circuit is detected (which already has a 1ms delay due to R9/C6) how long does it take before the drive to the MOSFET is switched off?
What happens if you make C8 MUCH larger (say 100uF or 1000uF)?

Hello Ian0, thanks for your reply

OUT net is just to read current value, INA381 has a separate comparator to compare volts in VOUT versus CMPIN, if VOUT pin is bigger than VRef then Alert pin goes low and trigger the interrupt. R9/C9 is only to smooth the signal to the ADC pin in the Attiny.

But you are rigth about C8, I add 2 10uf capacitors and now the circuit can dectect the short circuit

Thank you very much for your help, if you have another advice to improve my circuit will be very welcome
 

Ian0

Joined Aug 7, 2020
13,165
Hello Ian0, thanks for your reply

OUT net is just to read current value, INA381 has a separate comparator to compare volts in VOUT versus CMPIN, if VOUT pin is bigger than VRef then Alert pin goes low and trigger the interrupt. R9/C9 is only to smooth the signal to the ADC pin in the Attiny.

But you are rigth about C8, I add 2 10uf capacitors and now the circuit can dectect the short circuit

Thank you very much for your help, if you have another advice to improve my circuit will be very welcome
I'm glad it has improved it. How much damage can the short circuit do before it is detected? I suspect it may depend a lot on the power supply. If you use something really low impedance like a lead-acid battery, it may blow things up before it has chance to react.
What happens if the processor is delayed by an interrupt routine? It is generally preferable to do short circuit protection in the analogue domain!
 

Thread Starter

DiegoFC

Joined Mar 15, 2023
3
Principal damage is the battery itself. In case of a short van explode
I'm glad it has improved it. How much damage can the short circuit do before it is detected? I suspect it may depend a lot on the power supply. If you use something really low impedance like a lead-acid battery, it may blow things up before it has chance to react.
What happens if the processor is delayed by an interrupt routine? It is generally preferable to do short circuit protection in the analogue domain!
Main damage is battery explode

I'm thinking in use the Alert pin of INA381 to drive a little mosfet attached to the gate of the switching mosfet. When Alert pin goes low, active the little mosfet and put gate to ground

What do you think?
 

Ian0

Joined Aug 7, 2020
13,165
I'm thinking in use the Alert pin of INA381 to drive a little mosfet attached to the gate of the switching mosfet. When Alert pin goes low, active the little mosfet and put gate to ground

What do you think?
I think it might oscillate, but if it gives a clean switching waveform that might not be a problem.
 
Top