Trigger an interrupt with an ADC

I have a project where I need to add current monitoring protection to a motor controller.

A microcontroller reads the shunt or hall sensor voltage and throttles back the current if the limit is exceeded.

The problem comes if a short circuit occurs. Way before the uC has time to go trough the loop and actuate, a mosfet is already blow. I currently use discrete logic to detect such events, trigered to a interrupt pin. But is there a way I could use the uC without aditional external logic in order to simplify the project?

casemod: Way before the uC has time ...

How quickly do you need to respond to these events?

If a short circuit is reasonably foreseeable then it would be sensible to design the hardware to cope with that rather than rely on a microcontroller to notice and react to it.

See page 58 of the '328P datasheet - there is an analog comparator interrupt. Perhaps you could take advantage of that, shut down the current when some voltage is exceeded, or goes too low (dragged down by a short).

PeterH: If a short circuit is reasonably foreseeable then it would be sensible to design the hardware to cope with that rather than rely on a microcontroller to notice and react to it.

I think this is the sensible approach. You could then use the Arduino to light a warning light or sound a buzzer. But I think it would be too difficult to design an Arduino system that would 100% protect against a short circuit. How would you prove that such a system works? What happens if the Arduino crashes for some other reason?

...R

PeterH: How quickly do you need to respond to these events?

5uS fits well within mosft Mosfet/IGBT's S/C Ratings

PeterH: If a short circuit is reasonably foreseeable then it would be sensible to design the hardware to cope with that rather than rely on a microcontroller to notice and react to it.

Nothing new there. But ultimatelly the microcontroller will have to react to it and disable the outputs. Lets have an example - An inteligent power module (6 pack IGBT or similar). I managed to prove I could burn one last year, altough it is said to be nearly impossible.

I need to find a decent schematic for the current monitoring module and wire it to the output buffer, perhaps with a 1s delay

CrossRoads: See page 58 of the '328P datasheet - there is an analog comparator interrupt. Perhaps you could take advantage of that, shut down the current when some voltage is exceeded, or goes too low (dragged down by a short).

I was thinking about that. Wondering how long the interrupt will take to react tough.

casemod: ultimatelly the microcontroller will have to react to it and disable the outputs.

I was thinking of something that behaved like a resettable fuse - either self-resetting, or manually resetting. It might be possible to achieve something like that by designing some sort of threshold detector into the output circuit so that the output driver gets pulled to an inactive state when the supply voltage dips, or the supply current rises, or something like that. Alternatively, you might be able to find a smart fuse that does a similar job - I know that this sort of thing is available for 12V DC supplies because they're often used for in-car circuits, but I don't know whether they're available for your voltage / current range and response speed; it would be worth looking, anyway.

PeterH: I was thinking of something that behaved like a resettable fuse - either self-resetting, or manually resetting. It might be possible to achieve something like that by designing some sort of threshold detector into the output circuit so that the output driver gets pulled to an inactive state when the supply voltage dips, or the supply current rises, or something like that. Alternatively, you might be able to find a smart fuse that does a similar job - I know that this sort of thing is available for 12V DC supplies because they're often used for in-car circuits, but I don't know whether they're available for your voltage / current range and response speed; it would be worth looking, anyway.

Thats would take way too much time. Tipically such fuses are actually thermal. The major damage happens when the electrolitic capacitor sends its charge trough a short circuit, shorting the power switch (IGBT/Mosfet). That all hapens in 1ms or less. tipically the supply current thereafter is much smaller.

I might try to make a one shot circuit with a 555 or a flip flop. Essentially after a fault condition it would stay trigered until a reset ocurred. The output would be cut by the output buffer and hopefully the uC would only have to display an error message whenever if felt it was right.

The ATtiny861 has a "Fault Protection Unit" that seems like a perfect fit.

casemod: The major damage happens when the electrolitic capacitor sends its charge trough a short circuit, shorting the power switch (IGBT/Mosfet). That all hapens in 1ms or less. tipically the supply current thereafter is much smaller.

There's nothing stopping you from designing an analog circuit to detect the voltage/current change when the short occurs and use that to turn off the output driver. This is what I was trying to describe when I wrote "gets pulled to an inactive state".

PeterH: There's nothing stopping you from designing an analog circuit to detect the voltage/current change when the short occurs and use that to turn off the output driver. This is what I was trying to describe when I wrote "gets pulled to an inactive state".

Thats what I currently do.

I have a 74LS541 buffer disabling the outputs for the IGBT's when a certain current limit is exceeded, but if there was a way to make this fast enough using just the uC that would be fantastic.