# Need a simple circuit analyzed for its troublesome behavior

#### jkbrand

Joined May 8, 2021
29
You should stop the motor briefly before changing direction.
The motor stops as soon as I lift off the momentary switch and the internal spring returns it to center OFF. I don't think I could press in the other direction fast enough NOT to stop the motor.

#### LesJones

Joined Jan 8, 2017
3,298
jkbrand, Are you SURE that the motor is a permanent magnet motor ? (NOT a shunt wound or series wound motor.)
Only permanent magnet motors reverse with reversing the supply polarity.

Les

#### KeepItSimpleStupid

Joined Mar 4, 2014
4,935
Make sure the motor reverses when changing the polarity.

What you can do is: Use diodes in parallel with the limit switches. The limit switches would be in series with the motor.

1. You have the switch open the circuit when it reaches limit A, then insert a diode so current can flow opposite limit A.
2. Do the same for limit B.

Without the diodes, the motor would just stop when they hit the limit switch and you would not be able to move it in the other direction.

I won't draw the circuit. Just put the limit switches in, activate one. Put the switch in the opposite direction, the motor won;t move. Insert the properly rated diode in the direction that causes the motor to move away from the limit switch. Both limit switches would be closed when movement can occur in both directions.

In your circuit, the limit switch MUST handle the motor and start-up current and wont stop instantly,

Last edited:

#### jkbrand

Joined May 8, 2021
29
jkbrand, Are you SURE that the motor is a permanent magnet motor ? (NOT a shunt wound or series wound motor.)
Only permanent magnet motors reverse with reversing the supply polarity.

Les
Hi Les, Yes, the motor must be a permanent magnet because the motor definitely reverses when the rocker switch
is pressed one way then the other.

#### jkbrand

Joined May 8, 2021
29
Make sure the motor reverses when changing the polarity.

What you can do is: Use diodes in parallel with the limit switches. The limit switches would be in series with the motor.

1. You have the switch open the circuit when it reaches limit A, then insert a diode so current can flow opposite limit A.
2. Do the same for limit B.

Without the diodes, the motor would just stop when they hit the limit switch and you would not be able to move it in the other direction.

I won't draw the circuit. Just put the limit switches in, activate one. Put the switch in the opposite direction, the motor won;t move. Insert the properly rated diode in the direction that causes the motor to move away from the limit switch. Both limit switches would be closed when movement can occur in both directions.

In your circuit, the limit switch MUST handle the motor and start-up current and wont stop instantly,
You know, early on I had the same thought about the potential for diodes to limit direction of flow. Where can I learn more about determining a "properly rated diode"? The motor is small, and at startup, seems to draw no more than .3 amps at 5V as shown by the display on my 10amp DC power supply. In fact, it's so small the leads on the motor are around 22 or 24 gauge.

I need help visualizing where in my circuit the proper diodes should go (I admit my understanding of parallel and series connectivity is weak; besides I fear I'm getting too old to have much of anything but a flat learning curve.)

#### LesJones

Joined Jan 8, 2017
3,298
Can yo confirm that the problem occurs at both ends of the travel ? Is it possible that its stopping at the end of the travel due to it hitting a mechanical stop ? I am wondering if you have the limit switches at the wrong end of the travel. Try reversing the wires to the motor. (Or reversing the power supply polarity.)
EDIT. I have just noticed your post #26. I think any of the 1N400x series of diode will do. (x can be 1 to 7 as this just indicates the voltage rating.)

Les.

#### KeepItSimpleStupid

Joined Mar 4, 2014
4,935
I need help visualizing where in my circuit the proper diodes should go
For a visual. Your switch gets the customary X wiring.

For visualization, take each of the motor leads and put a normally closed limit switch there,

You will be putting a diode across each switch. The diode conducts when the arrow is + and the band is negative, Conventional current (+ to -) follows the arrow. One diode will be facing the motor and the other will be facing away from the motor.
Test one limit switch at a time. Move motor. Activate. Reverse direction. Add diode in the direction that allows the motor to move. Do, the other one.

#### jkbrand

Joined May 8, 2021
29
Here is the annotated DPDT switch. Pix of limit switch(es) will follow after I get out to my wood-working shop.View attachment 238003
Below is a photo of the limit switch I'm using, and a photo of my connection to the switch.

#### jkbrand

Joined May 8, 2021
29
For a visual. Your switch gets the customary X wiring.

For visualization, take each of the motor leads and put a normally closed limit switch there,

You will be putting a diode across each switch. The diode conducts when the arrow is + and the band is negative, Conventional current (+ to -) follows the arrow. One diode will be facing the motor and the other will be facing away from the motor.
Test one limit switch at a time. Move motor. Activate. Reverse direction. Add diode in the direction that allows the motor to move. Do, the other one.
Thanks, KISS--You say "Your switch gets the customary X wiring." I really am ignorant in this arena, but I'm trying to learn. I am aware that a diode is polarized and it will allow current to flow in one direction and not in the other. That is the extent of my knowledge of diodes. What is 'customary X wiring' to a lay person? I ask because I think the answer might explain something
I might have wrong. In the meantime I'll work on the diodes to the switch as you've written. Thanks!

#### MisterBill2

Joined Jan 23, 2018
9,035
Once again, the circuit as posted works. trace the current path through either direction. THE diode scheme is OK for when both switches are in series with the motor. That is a very different scheme. But if this is a 2 amp motor then the 1N400x diodes are only one amp and they will fail. And if the diodes can't be near the motor then the wires get complicated.
So now another question: can we see a picture of the motor as it is? Ie it jusst a motor or is there some additional hardware associated with it?

#### LesJones

Joined Jan 8, 2017
3,298
Can you post a picture so that we can follow the wires to check THAT IT IS WIRED as shown in your diagram. I agree with the others that it should work if wired as in the diagram.
Can you confirm that if it is traveling towards end "A" that pressing end "A" micro switch stops the motor and that pressing end "B" micro switch does NOT stop the motor.
Can you confirm that if it is traveling towards end "B" that pressing end "B" micro switch stops the motor and that pressing end "A" micro switch does NOT stop the motor.
I was basing my suggestion of 1N400x series diodes on your current reading of 0.3 amps in post #26

Les.

#### MisterBill2

Joined Jan 23, 2018
9,035
The reason that I asked about the motor is that there are motor ppackages that include switches to stop at the ends of rotation. And so there is a possibility, if it is one of those, that there could be some unintended interaction happening.
It would not be the first time that unseen switches have produced strange results.
Does the motor fail to run either way when you manually operate one of the limit switches when it is not at the end of motion position? That information will assist in making the analysis of the problem. I am thinking that there is more than the circuit shown involved here.
When the system fails to move in the opposite direction, off whichever switch is operated, how do you recover so that it can be run again? Does the power supply have an overload shutdown mode? Please answer these questions.

#### KeepItSimpleStupid

Joined Mar 4, 2014
4,935
"Your switch gets the customary X wiring."
Look at step 3, here: https://www.instructables.com/HOW-TO:-Wire-a-DPDT-rocker-switch-for-reversing-po/
The switch has the typical "X" pattern for a polarity reversal switch.

I'm not too crazy about the DC switch rating (0.3A) and the motor. The good part is that it would be mostly used for interrupting current and not switching current. When an inductive load starts up, the system basically sees the wire resistance for a short time. There is this little rule that says the "current through an inductor cannot change instantaneously"

The construction of a switch does depend on whether AC or DC is used. You actually could have different make and interrupting ratings. For very low current applications there is a "wetting current" specification or the minimum current you should switch. Switches the work with logic thus have precious metal plating.
Take a typical ceiling fan which has a slide switch to reverse polarity. The switch will last a long time if you turn off the motor first before switching.

For now, not sure how to add limit switches, but this https://www.canakit.com/Media/Manuals/UK1122.pdf MIGHT be good choice. You might need some "glue logic" to make the limit switches work and also brake the motor. "glue logic" is a term for a small circuit designed to change the behavior of another or interface to it.

You would have the logic inputs of:

Direction
Enable
Limit switch A
Limit switch B

and outputs of
Direction and Enable

You can "cheat" and use two 74150 Ic's e.g. https://www.jameco.com/shop/ProductDisplay?catalogId=10001&langId=-1&storeId=10001&productId=49509

The inputs would have pull up resistors or pull down resistors. TTL does float high when an input is disconnected.
A pull-up could be like a 1K resistor. Pull up means connected to +5, pull down gnd.

You assign the inputs A, B, C and D and one 74150 would control direction and the other enable.

You can easily make any truth table you want by connecting what you want. e.g. if D, C, B and A are all low, the output (W) is NOT E0. or the reverse of what E0 is tied too (GND or +5).

Just for reference, the enable input is usually pulse width modulated which controls speed.

Your DPDT switch would control direction and enable. One pole would be direction and the other enable.
With TTL, you would generally want enable to be not enable so if the switch is disconnected, the motor stops.

We have no idea the application or how reliable this thing has to be. Breadboarding two IC's, two ceramic capacitors and 4 resistors might be over your head.

I'd probably use a SIP header and a shunt. e.g. 3 rows of 16. https://www.peconnectors.com/pin-headers-straight-1x-row-.100/hws16317/ and these: https://www.peconnectors.com/index.php?p=catalog&mode=search&search_str=shunt

The middle row is the not E? pins, the ends GND and +5. You just move the shunts to a 1 or 0 until you get it right.

The advantage of speed control is torque remains constant. 100% could be full speed or 100% could be off.

PWM boards are available on ebay too.

#### MisterBill2

Joined Jan 23, 2018
9,035
Look at step 3, here: https://www.instructables.com/HOW-TO:-Wire-a-DPDT-rocker-switch-for-reversing-po/
The switch has the typical "X" pattern for a polarity reversal switch.

I'm not too crazy about the DC switch rating (0.3A) and the motor. The good part is that it would be mostly used for interrupting current and not switching current. When an inductive load starts up, the system basically sees the wire resistance for a short time. There is this little rule that says the "current through an inductor cannot change instantaneously"

The construction of a switch does depend on whether AC or DC is used. You actually could have different make and interrupting ratings. For very low current applications there is a "wetting current" specification or the minimum current you should switch. Switches the work with logic thus have precious metal plating.
Take a typical ceiling fan which has a slide switch to reverse polarity. The switch will last a long time if you turn off the motor first before switching.

For now, not sure how to add limit switches, but this https://www.canakit.com/Media/Manuals/UK1122.pdf MIGHT be good choice. You might need some "glue logic" to make the limit switches work and also brake the motor. "glue logic" is a term for a small circuit designed to change the behavior of another or interface to it.

You would have the logic inputs of:

Direction
Enable
Limit switch A
Limit switch B

and outputs of
Direction and Enable

You can "cheat" and use two 74150 Ic's e.g. https://www.jameco.com/shop/ProductDisplay?catalogId=10001&langId=-1&storeId=10001&productId=49509

The inputs would have pull up resistors or pull down resistors. TTL does float high when an input is disconnected.
A pull-up could be like a 1K resistor. Pull up means connected to +5, pull down gnd.

You assign the inputs A, B, C and D and one 74150 would control direction and the other enable.

You can easily make any truth table you want by connecting what you want. e.g. if D, C, B and A are all low, the output (W) is NOT E0. or the reverse of what E0 is tied too (GND or +5).

Just for reference, the enable input is usually pulse width modulated which controls speed.

Your DPDT switch would control direction and enable. One pole would be direction and the other enable.
With TTL, you would generally want enable to be not enable so if the switch is disconnected, the motor stops.

We have no idea the application or how reliable this thing has to be. Breadboarding two IC's, two ceramic capacitors and 4 resistors might be over your head.

I'd probably use a SIP header and a shunt. e.g. 3 rows of 16. https://www.peconnectors.com/pin-headers-straight-1x-row-.100/hws16317/ and these: https://www.peconnectors.com/index.php?p=catalog&mode=search&search_str=shunt

The middle row is the not E? pins, the ends GND and +5. You just move the shunts to a 1 or 0 until you get it right.

The advantage of speed control is torque remains constant. 100% could be full speed or 100% could be off.

PWM boards are available on ebay too.
While this proposed scheme could probably be made to function, it is vastly more complex than the application requires. It is the exact opposite of the directive "Keep It Simple, Sir."

#### KeepItSimpleStupid

Joined Mar 4, 2014
4,935
While this proposed scheme could probably be made to function, it is vastly more complex than the application requires.
We don't even know the application, so you can't make that statement.

#### MisterBill2

Joined Jan 23, 2018
9,035
Yes, my statement in post #35 would be valid for the reason that the TS had already decided that limit switch control would be adequate, and also because the chosen mode of control is with a spring return manually operated switch.

#### jkbrand

Joined May 8, 2021
29
Once again, the circuit as posted works. trace the current path through either direction. THE diode scheme is OK for when both switches are in series with the motor. That is a very different scheme. But if this is a 2 amp motor then the 1N400x diodes are only one amp and they will fail. And if the diodes can't be near the motor then the wires get complicated.
So now another question: can we see a picture of the motor as it is? Ie it jusst a motor or is there some additional hardware associated with it?
Here is a picture of my motor. It is small with an integrated gear box.

• Rated voltage-12V DC, No load speed-16rpm, no load current-350mA, Rated speed-12rpm, rated torque-70kg.cm, rated current-1.6A, Reducer ratio-1:505.10KG.CM torque means that the motor can drive an object with a distance of 1cm from the center of the shaft and a weight of 10kg. If the distance is 10cm, the weight of the object is 1kg. If the weight of the driven object is greater than the rated load, the motor speed will slow down and the motor may be damaged.
• Feature: Output Shaft Diameter: 8mm; The motor is Gear DC motor with micro-turbine worm, you can change the wiring-connection to change motor rotation. -Turbo worm geared motor with self-lock, that is, in the case of motor without electric, the output axis is fixed, self-lock. -The reducer output shaft arranged vertically with the motor shaft, whole motor output

#### jkbrand

Joined May 8, 2021
29
Can you post a picture so that we can follow the wires to check THAT IT IS WIRED as shown in your diagram. I agree with the others that it should work if wired as in the diagram.
Can you confirm that if it is traveling towards end "A" that pressing end "A" micro switch stops the motor and that pressing end "B" micro switch does NOT stop the motor.
Can you confirm that if it is traveling towards end "B" that pressing end "B" micro switch stops the motor and that pressing end "A" micro switch does NOT stop the motor.
I was basing my suggestion of 1N400x series diodes on your current reading of 0.3 amps in post #26

Les.
I will try to take a pic of the wiring tomorrow when I get back home. In the meantime, I can confirm that pressing end "A" stops the motor. Pressing end "B" as I recall also stops the motor. Same, I think, with the other limit switch, but let me check tomorrow to be sure. Thanks for weighing in.

#### LesJones

Joined Jan 8, 2017
3,298
In post #39 are you saying that if the motor is moving in either direction pressing either limit switch causes it to stop ? We need to understand EXACTLY how it is behaving to help diagnose possible causes of the problem.

Les.