DC motors and switches and relays, oh my...

Can anybody come up with a clever way to do this?

I have two wires coming in. The other end is connected to DC motor controlling IC that I have no control over. Sometimes 12 volts is on one wire to rotate the motor one direction. Sometimes 12 volts is on the other to reverse the direction.

Once the motor has rotated a certain amount, a contact switch is opened by it in both directions. The problem is that the motor continues to turn for a bit more after the switch has been opened. I want the motor to stop immediately after the switch is opened.
Then when the motor is reversed i want it to stop when it reaches and opens the other contact switch.

So initial position, switch one is open, switch two is closed. Motor starts to rotate. While the motor is rotating, both switches are closed until it reaches the other switch. At that point switch one is still closed and switch two is open.
At this point I want to cut the power to the motor.
Then the motor starts rotating back the way it came. Both switches closed until it reaches the starting position. There the switch one is opened again and switch two is closed.
At this point I want power cut to the motor.

Ideally I’d like to avoid needing a circuit board. Maybe just have a relay or two superglued in place. I have access to the contacts for the switches and the contacts for the dc motor and the two wires coming in.

The cheaper the solution the better! :slight_smile:

I don’t have time right at the moment to work it out but might be able to later tonight. Quick question though: do you know why your motor currently rotates past the point where the switch opens? Is that the controls doing it or a result of inertia?

Without knowing anything about your specific application, I would suggest putting an adjustable cam on the motor shaft, and some hard stops at the correct locations.

The controls are doing it. I forgot to mention that the switches signal back to the ‘black box’. The motor has a small hard-coded delay that I would like to eliminate basically.

Unfortunately, a mechanical solution wouldn’t stop the motor from continuing to try and it would over-current.

No, just adjust it so the switch trips just before the mechanical stop.

Are you hoping to bypass the existing controls to get rid of the stop delay? Do you have access directly to the motor leads?

Yes exactly.

And yes I have access to the motor and its leads. I can remove the wires and place something in between the motor control wires and the motor itself. I also can wire to the switches to be able to use those signals.

Edited to add: What I cannot change is at what point the switches get triggered.

That won’t be too bad then. Do you already have relays in mind that you want to use? And what about start/stop/reverse switches? Are they existing or do you need to add some?

No relays in mind.
I was hoping that there would be one I could buy from digikey for 2 bucks that would already do the logic needed. But I don’t think there is one. :slight_smile:

A magic relay that would break the connection to the motor for a second when it got a signal from the contact switch would work great. I don’t think those exist though.

Starting, stopping, and reversing are out of my control and come from the ‘black box’.
By the way, the only source of 12 V would be the motor wires themselves. And which wire has 12V of course depends on which direction the motor is to go.

The motor can’t supply voltage unless you’re mechanically driving the shaft in which case it operates as a generator. You have to find a way to feed the motor the voltage it needs. There must be 12Vdc fed to the controller that could be tapped into somehow.

I meant the 12 V is coming from the motor wires that are coming from the ‘black box’. (Actually, I know what’s in the black box. It’s a DC motor control IC on the other side of those wires. I just can’t tamper with what’s in the black box)

Gotcha, just wanted to be sure I understand. So it sounds like the start, stop, etc. don’t need to change, you need to drop out the supply voltage when the switch opens and give control back to the controller after it has stopped and it is ready to reverse.

You are correct. I’m afraid the limitations might make it difficult without adding additional transistors or discrete logic components or other extra crapola.

Why not just use 2 relays, 1 whose coil is activated by the opening of the CW limit switch and one by the CCW limit switch? Put the CW motor lead in the CW relay NO position, and the CCW motor lead in the CCW relay NO position. When both limit switches are closed, the controller is free to do whatever the hell it wants. When it reaches a limit switch, power is cut to that direction and can only come through the reverse lead, which the controller will activate as it pleases.

Also, you can place the control wires (from the limit switches) in the NC positions in their respective relays and bring that back to the controller. Then nothing has changed as far as the controller is concerned.

I meant “closing” of the limit switches, and another NO contact for the control wires. You want the directional lead of the motor cut off the moment the respected limit switch is opened, and for the controller to see the signal the same as it always did.

Sorry, just doing this off the top of my head.

I think your idea sounds pretty good.

Remember to size your relay for the inrush current of the motor or they won’t last very long. Do you happen to know how much current the motor draws under full load or what type it is (other than just DC)?

I haven’t gotten a chance to look at hekk’s idea yet, but the current draw is about 280ma and it’s a brushed dc motor.

The start current varies from motor to motor. For a small one like that it’s probably about five times the FLA. If you use a power relay it’ll likely have good enough ratings to take the current well. The collapsing field each time the motor reverses can stress things too. Just keep the ratings in mind when selecting your relays so you don’t end up going through them too quickly. I tried searching Digi-Key’s site but the search isn’t working very well for me.

I think thismight work since I have access to ground through the limit switch wires.
Is this about what you were thinking? Excuse the crappy drawing please.
I think it’ll work as long as the motor controlling IC doesn’t have some sort of weird GFCI thing going on.

You’ve got the right idea, but the execution is wrong. You don’t have to switch the motor lead to ground when the relay pops, you just need to cut power. And I doubt that is how your limit switches are wired IRL… depending on wether they are sinking or sourcing inputs to the IC… how many wires come out of the box?