# Need a latching circuit for DC motor

#### vrainom

Joined Sep 8, 2011
126
The 1/10 current proportion is called "hard saturation" as opposed to "soft saturation" wich would be to drive the transistor with just the necessary current to drive the load.

i.e: if a transistor has a gain of 100 you would only need a 100 ohms input resistor to drive a 1 ohm load, but in practice not every transistor would have an exact 100 gain, some will have more, some less, so with the 100 resistor some transistors would be under driven. So when we need them to act as switches, fully on or fully off, the best approach is to "hard saturate" them to make sure they operate as we expect.

Last edited:

#### Dimitris76

Joined Jul 17, 2011
45
Great Info!

It's important for me to understand why we do like we do. Thank you educating me. You guys are awesome!

-----

I built the circuit, double checked everything and connected the power.

And it behaves like this:
As soon as the momentary push button switch is closed (I short circuited with the tweezers instead) the motor starts spinning to extend the actuator arm. When the end point is reached though, the motor stops (due to the internal limit-switches in the linear actuator) but the circuit does not unlatch to retract the arm. I measure 12v across the relay's coil.
The only way to retract is to cycle the power.

Here is the board layout.

I just replaced the R4 (33k) with two 10k resistors and a 20k trimpot and I have used a 2N3704 transistor (instead of the 2N4401 that SgtWookie suggested...

What could be wrong here?

-----

Ok, I did some trouble shooting and measured the voltage at pins 3 and 6 (non-inverting input A and inverting input B - connected together) on LM393.

-At rest state as soon as I connect power to the circuit board I measure 12.45v as expected.
-When I push the button and as long as the motor runs I get 0.098v, which sounds pretty normal for a voltage drop across the 0.1 Ohm R1 resistor (approx. 1 amp without load).
-Then the motor stops and I measure 0.016v!!!
Now that does not sound right. With the motor off and no current flowing I would expect 0v drop across the 0.1 Ohm resistor.

With the voltage across the 33 Ohm R3 resistor being 0.013v it's no wonder the window comparator's output does not go low.
The voltage is still IN the window!

When I measure voltage between a common ground and pins 3, 6 as well as on the IC side of R7 I get those 0.016 volts - on the other leg of R7 and R1 though the voltage is 0. I suspected the diode D2 might leak a little current through so I temporarily unsoldered it but that didn't help either...

Any ideas?

Dimitrios

Last edited by a moderator:

#### SgtWookie

Joined Jul 17, 2007
22,230
Gee, that's strange.

Are you certain that the Zener diodes are back-to-back like they are shown on the schematic? I cannot tell from the photographs.

If you disconnect the actuator (on one end at least) from the circuit, and provide 12v across it, does it still draw 160mA when it is at the limit?

If the actuator draws 160mA current even when sitting still against a limit, then replace R2 and R3 with 510 Ohm resistors.

#### Dimitris76

Joined Jul 17, 2011
45
I am pretty sure the actuator is not drawing any current at it's end point because the voltage is zero between point A on the circuit board's output and Ground.

So there is no measurable voltage drop across R1 or between ZD2 anode and ground. I measure 0.016 volts though between ground and R7's other side as well as on pin 3, 6 of LM393, D2 anode and D3 cathode...

-----

Could it be a slight leak of current through the LM393's 3, 6 pins and ground that keeps the voltage up?
0.016v /1000 ohm =0.000016 Amp.
Even 16 uA could mess things up...

I am looking at the datasheet from National Semiconductor and it shows a 100k resistor instead of 1k at R7.

Dimitrios

Last edited by a moderator:

#### SgtWookie

Joined Jul 17, 2007
22,230
Hmm, it could be.

Instead of 33 Ohms, try replacing R3 with one just somewhat larger; like 62 Ohms.

I didn't plan on any leakage when I simulated it. I simply had to make some guesses what I thought would be good thresholds. I was close...

#### Dimitris76

Joined Jul 17, 2011
45
Upping R3? Will do!

Dimitrios

EDIT: "Why not increase R7 instead?" Dumb question...

Last edited:

#### SgtWookie

Joined Jul 17, 2007
22,230
No, don't change R7. Normally, R7 should have virtually no voltage across it; it is there simply to limit the current in case the voltage exceeds the power rails, and protection diodes D2, D3 start conducting.

#### Dimitris76

Joined Jul 17, 2011
45
The plot thickens!

I replaced the 33 ohm R3 with a 98 ohm resistor and the circuit behaves the exact same way.

What's more interesting though is that not only the voltage across R3 did increase and measures now 0.036v (it was 0.013 before) but the voltage at pins 3 and 6 that I wanted to surpass increased as well!
It now measures 0.047v instead of 0.016v - which means that it somehow increased proportionally.

I has to be something obvious going on here but I just can't figure it out...

-----

I followed up the voltage for about 15 mins.
The voltage across R3 was all the time a steady 0.036v but I have noticed that the voltage at pins 3/6 gradually dropped from 0.047v to 0.035v.
The circuit did not unlatch though...

-----

SgtWookie,

any ideas what might be wrong here?

-----

I went over the hole circuit again and can't find any shorts/mistakes.

Could a faulty LM393 behave this way? How do they usually fail?

-----

I temporarily shorted R7 and the voltage at LM393's pins 3/6 shows now 0 zero, as expected when the motor stops running.
The relay didn't unlatch though...

I suspect that LM393 can not sink to ground all that current that flows through the 3.3k resistor, so the NPN transistor never turns completely off in order to release the coil.

I had another look at the RT424012 relay's datasheet
https://www1.elfa.se/data1/wwwroot/assets/datasheets/tpRT2_data_e.pdf

and saw that the coil activates at 8.4 volts but the voltage needs to drop to 1.2v inroder to release!

So could this 3.3k pullup resistor be of too low value?

StgWookie,

Dimitrios

Last edited by a moderator:

#### #12

Joined Nov 30, 2010
18,224
This is a Sears trash compactor. Maybe you can get some ideas from it because it starts a motor, stops at the end if you want it to, or not, reverses, and stops at the end of that stroke.

#### Attachments

• 4.3 KB Views: 26

#### Dimitris76

Joined Jul 17, 2011
45
#12,

Thank you for your responce and the attached schematic!

Unfortunately the trash compactor is using external end switches - something that I need to avoid at any cost.

I am all ears for troubleshooting ideas.

Dimitrios

#### SgtWookie

Joined Jul 17, 2007
22,230
Gosh, I'm sorry Dimitrios - I missed your post.

I'm going to have to look at this some more; it takes me a bit to re-familiarize myself with the circuit every time I look at it.

#### Dimitris76

Joined Jul 17, 2011
45
No worries SgtWookie!

My relay has a huge voltage hysterisis. It takes 8.4 volts to activate the coil and the voltage has to drop to 1.2v to release.

Then I measured the voltage across the coil and found out that it was permanently around 4.2v, i.e. the Vce voltage across the transistor's legs was 8.2v both before and after the circuit activation. The coil voltage went up to 12.4v only momentarily while the push button was manually depressed.

That led me to believe that the NPN transistor was faulty so I replaced the 2N3704 with a BC182L and the voltage across the coil goes up to 12.4volts and stays there after releasing the push button, but the LM393 wont go low when the motor stops, so I am back to square one.

I would love to try another LM393 at this point but driving 100 miles tomorrow only for that without knowing if it's faulty in the first place does not feel good... LoL

Dimitrios

#### SgtWookie

Joined Jul 17, 2007
22,230
Try disconnecting the base of Q1 from the outputs of U2 and the 3.3k resistor R5.
You should then be able to see the outputs of U2 go to Vcc when IN is either above HI or below LO, and under 0.5v when IN is between HI and LO.

If the base of Q1 is connected to Vcc via a 3.3k resistor, the relay should energize.
If the base of Q1 is <= 0.5v, the relay should de-energize.

#### Dimitris76

Joined Jul 17, 2011
45
I understand your troubleshooting thinking but this statement of yours:

"You should then be able to see the outputs of U2 go to Vcc when IN is either above HI or below LO, and under 0.5v when IN is between HI and LO."

are you sure it is right?

According to this document
http://home.cogeco.ca/~rpaisley4/Comparators.html

it's the opposite...

Dimitrios

#### SgtWookie

Joined Jul 17, 2007
22,230
Dimitrios,
Rob Paisley's window comparator works just the same as the one in the schematic.

Perhaps it's confusing you because Rob wrote that the LED will be off if the input voltage is within the window. That's because neither comparator will be sinking current, and the pull-up resistor will have the outputs at +V.
[eta]
Ah, I see - I worded it backwards.

I should have written:

You should then be able to see the outputs of U2 go under 0.5v when IN is either above HI or below LO, and nearly to Vcc when IN is between HI and LO.

#### Dimitris76

Joined Jul 17, 2011
45
Dear SgtWookie,

the original circuit you posted on #16 works now like a charm!

My conclusion is that the first LM393 was simply faulty.

Thank You Very Much for you help!

Kind Regards,
Dimitrios

#### SgtWookie

Joined Jul 17, 2007
22,230
Ahaa, that would explain the odd problems you were having!

I'm certainly glad that you replaced the LM393. It's pretty difficult trying to guess what's happening from across the big pond.

I was about to suggest that you pull it out of the circuit and test it, but if it's working well now - no problem!