Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

L298 Short-circuit protection

Status
Not open for further replies.
Well, I can't get a stable and consistent output on this... Changing the resistors on the LM339 worked randomly (I should get a cleaner development environment) but seems not to be the correct answer as the DCC Accessory Decoder still sucks too much current.

Sorry for digging this up again but I think I might attempt the second method of the low pass filter on the LM339 output. It seems like a good idea, I just need to get the right calculations...

Wikipedia tells me 1/ PI x 2 x R x C.
Where R is inline with the output of the LM339 and C is to ground from the other side of R.
What is the base value for standard calculations though? R is Ohms and C is uF? or just farads?
Trial and error is so much more fun :)
 
Hello again Steve,


The base units you should use are Ohms and Farads and Hertz. You can use
other units but you are better off sticking to those alone unless the formula
specifically states otherwise.

You can also look at it in the 'time domain', where you use time t instead
of frequency F. Doing this you would get:

t=R*C {seconds, ohms, farads}

and as you can see it is slightly simpler to think of it this way.

Time t here is the delay time, and because we have R*C on the
right this represents what is called one 'time constant'. One time
constant is the time it takes to reach 63 percent of the total
applied voltage. If rem right you are working with 5 volts, so
this would mean one time constant is the time it takes to reach
5 times 0.63 or about 3.2 volts. If you set the trip point of the
next comparator stage to 3.2 volts then you will be working with
one time constant, and the time it takes to trip will be t in the
above equation.

Maybe you should post your most current schematic so i can
take a look and refresh my mind as to what the circuit looks like
plus get a look at the most current one. I've worked with
people on probably 200 different circuits plus some of my
own since then so it will be good for me to look at yours
anew just to make sure we are doing this right.

I can keep an eye out or you can PM me when you post the
newest schematic or a link.
 
MrAl,

See attached for my most current schematic.

As for the new addition... do I need to throw the output of the filter into another section of the LM339 for comparison? (I do have 2 blocks free) or can I just use the output directly to the trigger in my 556?
My real question would be at what point does the 556 trigger? If it's a high/low then the delay of the filter would have to be a lot larger to keep the voltage way down a lot longer.
Otherwise I could see that routing the output into another comparitor at the full 5v would be a lot easier? No need for the pull up/down resistors and then the output tied directly into the trigger as per usual.

Thanks again for your help... If you ever need help with programming then give me a yell :)
 

Attachments

  • most-recent.png
    most-recent.png
    24.5 KB · Views: 657
Hi again,


You can try a cap from pin 1 to ground first i guess,
or yes put another comparator section in series with that one
and work with that input. This will give a nice clean output.

What programming languages are you familiar with?
 
I've just been tinkering with an 0.01uf and 0.1uf cap directly from Trig on the 556 (the left side) and ground.
The 0.1uf cap would allow the short to continue for a long time... or, i didn't let it go past 3 seconds.
The 0.01uf cap wouldn't change anything, the trip triggered as soon as usual.
Based on the calculations, this doesn't make sense at all... but I suppose the resistor is required to actually slow down the charge rate...

From my calculations, I would need a 100K resistor and 10uf Cap to get a 1s delay to the ~3.4v threshold?

I'll muck around with it a lot more tonight...

As for programming, I'm a software engineer by trade and currently work in the .NET realm. Have often dabbled in C/C++/ASM but only for hobby purposes.
 
Hi again Steve,


Can you show me where you connected this cap?

I'm thinking of writing an in process DLL at some point for Windows.
 
As the trig input from the 556 is direct from the LM339 output, I thought I'd throw it closer to the 556 as the ground was right next to it.
 

Attachments

  • capconnection.PNG
    capconnection.PNG
    9 KB · Views: 685
Hi Steve,

Ok, that looks like the cap is connected to the wrong TRIG input. It's
the other TRIG input we want to play with, on the right side of that
drawing (the green line).


Oh ok, i see you are working on the other side so that should be ok.
So the next thing to do then is wire in another section of the LM339.
We'll work with this next.
 
Last edited:
I have both triggers in use... they run via a section of the LM339 each and come off both of the 'sense' pins on the L298.
So I was just testing one side of the L298.
I'm more than happy to also test it on the other trip circuit.
 
Hi Steve,

Sorry, i updated my last post that acknowledges that you are using the
left section rather than the right section.

Ok here is the route we will take...

Wire in another comparator section with its - input connected to two
resistors that provide a 2.5 to 3v reference voltage. The + input connects
to the cap of a low pass filter, and the resistor of the low pass filter
connects to the output of the first section. The delay can then be
programmed independent of the other parts of the circuit which means
we should be able to vary the resistor. 100k and 10uf will get us about
1 second delay. If that's not enough, we'll just have to go higher.

EDIT:
Wait, i think the 556 has comparators inside, so perhaps just a low pass filter
connected to the output of the first comparator. The 100k and 10uf
cap should still work for the first test.
 
Last edited:
Ok, the answer is this... no resistor and a 10uf (electrolytic, as that's what I had on hand) from the output of the LM339 to ground.
And it works perfectly... cuts of in a short, even on a very little short that I was having issues with previously.

The resistor seemed to not work at all... I can't even remember what the result was... it just allowed the short to occur, if I remember correctly.

The issue actually is that the Capacitor is always charged... and when the short comes, the output drops to 0... so the residual discharge drops the output... the resistor would slow the discharge, which is not the answer.

Now, on power on the short lights stay lit as the caps charge, but then all comes to life and works like a charm.

I don't know if the current solution is acceptable, but-it-works(tm) ;)


Thanks again!!
 
Hi Steve,

Glad to hear you got it working.
Just in case the LM339 burns out, go back to trying a resistor and cap.
Maybe make the resistor smaller this time.
 
Status
Not open for further replies.

Latest threads

Back
Top