# Seeking circuit ideas....

Discussion in 'Electronic Basics' started by davidd31415, Jul 19, 2005.

1. ### davidd31415Guest

I am trying to find a way to modify a circuit that is designed to
control two DC motors such that it will control two DC motors that
share a common. The motors run in two directions and this is done by
swapping the positive and negative outputs of a 12VDC power supply
(i.e. no -12V supply to work with). Because the motors are
controlled by an 8-position joystick (up, down, left, right, and
diagonals) I am running into a problem...

If the joystick is pushed in two of the diagonal directions, 12V and 0V
are shorted together on the common. I must be able to use the circuit
for the non-common-sharing motors, so there are still 4 outputs from
the circuit; I am jumping two of them together (motor 1- and motor 2-)
to handle the common; when these outputs are not the same, the short is
occurring.

I am looking for a way to handle the short condition; it does not
matter if either motor runs when the joystick is pushed diagonally.

Aside from installing a switch that does not have diagonal directions,
the solution I have come up with so far is to connect relays to the
non-common wires on each of the motors and wire the contacts such that
they open the opposite motor circuit when 12V is applied to a given
motor. I'm thinking this way the relay would prevent the short from
occurring...

motor1(+) ------------[O]motor1--Orelay1--o ground
|
| ---------| |------ motor1 (-)
| / relay2 contact (normally closed)
| \
| ---------| |------ motor2 (-)
| relay1 contact (normally closed)

|
motor2(+) ------------[O]motor2--Orelay2--o ground

Any thoughts on this? Possible? Bad idea? Better ideas?

Thanks for any feedback,

David.

2. ### ChrisGuest

Hi, Dave. Most "digital" joysticks have 4 switches tied to a single
common, for joystick North, East, South and West directions. Sometimes
you have to do a bit of a hack to get the non-common sides of the
switches separated from the rest of the circuitry, but I'll assume
you've already done that, and have a joystick control that looks like
this (view in fixed font or M\$ Notepad):

` .-----------------o COM
` |
` |
` | _/
` o---o/ o---------o N
` |
` |
` | _/
` o---o/ o---------o E
` |
` |
` | _/
` o---o/ o---------o S
` |
` |
` | _/
` '---o/ o---------o W
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

I'm also hearing you say you've got two small DC motors with one wire
in common, both of which you want to operate bidirectionally:

` J3
` o
` |
` |
` |
` _ | _
` / \ | / \
` J1o----(M 1)----o----(M 2)----oJ2
` \_/ \_/
`
Sometimes, the biggest problem in finding an electrical/electronic
solution to a problem is defining the problem well. Please post back
with information on exactly what you want to happen on each of the
following 9 states:

.---------------------------.
| DIRECTION | M1 | M2 |
|-------------|------|------|
| N | | |
|-------------|------|------|
| NE | | |
|-------------|------|------|
| E | | |
|-------------|------|------|
| SE | | |
|-------------|------|------|
| S | | |
|-------------|------|------|
| SW | | |
|-------------|------|------|
| W | | |
|-------------|------|------|
| W | | |
|-------------|------|------|
| NONE | | |
'---------------------------'
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

With NONE being the joystick center position. For each blank, you
should have CW for motor CW direction, CCW, or OFF.

If I'm reading your post properly, you can't do what you're asking with
a single 12VDC supply. The motor J3 (motor common) can't be both + and
- at the same time, at least with a single 12V supply.

The best solution might be to add in a second 12V supply, tying the +
of the second supply to the - of the first. That will give you a
+/-12VDC supply. You can then switch in +12V to J1 or J2 or both if
you want them to go CW, and -12V if you want them to go CCW. J3 would
always stay at 0V. That should be a trivial relay logic problem.

Feel free to post again.

Good luck
Chris

3. ### ehsjrGuest

As I understand it:
1) Your problem is created by a jumper that connects two outputs
together: Motoroutput1 and Motoroutput2.
2) The problem occurs only when the joystick is in a diagonal
position.
3) When the joystick is in a diagonal position, it does not
matter whether either of the two common motors move or not.

If that is the case, here is what I think will solve it:
Simply open the jumper with a relay contact when the joystick
is in one of the "bad" positions.

---[Motor1output]---+
|
[RelayContact] (normally closed)
|
---[Motor2Output]---+

|

Ed

4. ### davidd31415Guest

Ehsjr,

Your understanding of my problem is correct. The relay idea sounds
great, but I need a method to energize the relay. The joystick has 4
sets of outputs and when it is pushed in any of the "bad" two sets of
outputs are activated simultaneously (there are not 4 separate sets of
outputs, unfortunately). This is why I'm thinking the use of two
relays may work, but I'm worried that fuses may still have time to blow
before the relay opens, preventing the short. Perhaps slow blowing
fuses and semiconductor switches will work ? I'm guessing normal
mechanical relays will be too slow for this application.

5. ### davidd31415Guest

Hi Chris,

I'll have to download that ASCII-circuit maker!

Adding a second 12V supply (or changing out the switch) may be what I
need to do. Regarding the truth table, I basically need:

N - M1 CW
S - M1 CCW
E - M2 CW
W - M2 CCW
NE, NW, SE, and SW do not need to do anything, but most importantly
they must not blow a fuse .

As I just replied to ehsjr, the 8-position switch has 4 sets of outputs
(2 each for N, S, E, and W)...

I'm starting to work towards redesigning the motor controller as it
does not seem like there is a single quick-fix for this.

Thanks again,

David.

6. ### ehsjrGuest

Ok, so if I understand it, diagonal is indicated by
one of the following combinations:
N+E
N+W
S+E
S+W

You can do that with 2 transistors, 2 resistors,
and some diodes:
+---[DIODE]---+
| |
c---+----relay----+--- +Vcc
South---[DIODE]---+---[R1]---b
| e
North---[DIODE]---+ |
|
|
c
East----[DIODE]---+---[R2]---b
| e
West----[DIODE]---+ |
Gnd

R1 and R2 are 330 ohms. The transistors are PN2222A.
The relay needs to be sized for the voltage (Vcc) and
for the current that the motors will draw.
The diodes are 1N400x. The banded end is on the right
for each of the diodes above: --->|---

Ed

7. ### ChrisGuest

Hi, David. The wording of your question left a lot of ambiguity in
what you wanted. But I looked again at the wording of your post later,
and had some time to make a best guess as to what you want. There is a
way to do what I figure you want without a negative power supply, if
you don't mind using four DPDT relays instead of two SPST.

This setup will have the following truth table:

` .---------------------------.
` | DIRECTION | M1 | M2 |
` |-------------|------|------|
` | N | CW | OFF |
` |-------------|------|------|
` | NE | OFF | OFF |
` |-------------|------|------|
` | E | OFF | CW |
` |-------------|------|------|
` | SE | OFF | OFF |
` |-------------|------|------|
` | S | CCW | OFF |
` |-------------|------|------|
` | SW | OFF | OFF |
` |-------------|------|------|
` | W | OFF | CCW |
` |-------------|------|------|
` | NW | OFF | OFF |
` |-------------|------|------|
` | NONE | OFF | OFF |
` '---------------------------'
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

The circuit below has the advantage of locking each motor out until the
relays have changed state, preventing even momentary short circuits of
the power supply. Here it is (view in fixed font or M\$ Notepad):

` +12V GND
` | CRY3(S) W |
` | ||/ ___ _/ |
` | CRY1(N) ||--------o-------------o----UUU----o--o/ o---o
` | ||/ /|| | | RY4(W) | |
` | ||-------| | '----|<-----' |
` | /|| || | E |
` o-------| ||----. | ___ _/ |
` | || || | '-------------o----UUU----o--o/ o---o
` | ||---. | | RY2(E) | |
` | || | | '----|<-----' |
` | | '--------------------. |
` | | | CRY3(S) |
` | | | || |
` | | .----------------)---------||--------o
` | | | | || |
` | | | _ | CRY1(N) |
` | | | / \ | || |
` | '-------------o-----(N-S)------o---------||--------o
` | \_/ | || |
` | M1 | |
` | _ | CRY2(E) |
` | / \ | || |
` | .-------------o-----(E-W)------o---------||--------o
` | | | \_/ | || |
` | | | M2 | CRY4(W) |
` | | | | || |
` | | '----------------)---------||--------o
` | | | || |
` | CRY2(E)| .--------------------' |
` | || | | N |
` | ||---'CRY4(W) | ___ _/ |
` | || || | .-------------o----UUU----o--o/ o---o
` o-------| ||-----' | | RY1(N) | |
` | ||/ || | '----|<-----' |
` | ||------| | S |
` | /|| ||/ | ___ _/ |
` | ||---------o-------------o----UUU----o--o/ o---o
` | /|| | RY3(S) | |
` | '----|<-----' |
` | |
(created by AACircuit v1.28.5 beta 02/06/05 www.tech-chat.de)

You've got four joystick switches, N(orth), E(ast), S(outh), and
W(est), as discussed in the prior post. In this circuit, the four
switch commons have been preserved as mentioned above in this morning's
post. Each joystick position has a relay associated with it: RY1(N),
RY2(E), RY3(S), and RY4(W). Also, as per your job requirement, you can
see that both motors share a common wire, again as above. Each relay
has a diode across it to minimize arcing on the joystick switches. The
circuit has mirror controls for M1 (North-South) and M2 (East-West).
Let's look at the top motor circuit (M1) to determine how it works.

The top relay contacts control the N-S motor. As you can see, if
either RY1(N) or RY3(S) is on, the E and W switches won't turn on their
relays. Along with the same circuit below, this ensures that both
motors can't be on at once. When RY1 is on, + is applied to the left
side of the motor in the diagram, and - is applied to the right side.
When RY3 is on, + is applied to the right side, and - to the left side.
This would be a problem if it were possible to have N and S on at the
same time, but the joystick is set up so this can't happen (the
joystick can't be up and down at the same time). The same setup
applies to M2, so both motors are controlled without short circuits.

I'm really hoping you've got an industrial joystick with microswitches
that can handle the current of a small control relay (typically 30 to
120mA at 12VDC). If you've got a "digital" PC joystick, your switches
aren't made to handle inductive loads at all, and typically will only
handle a 50mA max resistive load current. If that's the case, you're
not entirely lost. If you've got one of those game joysticks, you can
replace the switch action with a switch driving a transistor that
drives the relay. Mark off each switch in the above circuit like this:

` COM
` |
` |
` ___ A _/ B |
` -UUU---o---o---o/ o--o----o
` | |
` -|<----' |
` |
` |
(created by AACircuit v1.28.5 beta 02/06/05 www.tech-chat.de)

and replace it at the points A and B with this:

` A
` +12V o
` | |
` | |
` | |
` | _/ ___ |/
` o--o/ o--|___|- -|2N3904
` | 1K | |>
` | .-. |
` | | | |
` | 10K| | |
` | '-' |
` | | |
` | '---o
` |
` o
` B
(created by AACircuit v1.28.5 beta 02/06/05 www.tech-chat.de)

You can still have all the switch commons tied together. This will
allow the PC/gamer joystick to drive a 12VDC relay coil of up to 1.2
watts (100mA).

I hope this has been of use. Please post again if you have a game
joystick, or if you have any further questions or problems.

Good luck
Chris

8. ### ChrisGuest

Small Revision:

` A
` +12V o
` | |
` | o------.
` | | |
` | _/ ___ |/ |
` o--o/ o--|___|- -|2N3904 -
` | 1K | |> ^
` | .-. | |1N4002
` | | | | |
` | 10K| | | |
` | '-' o------'
` | | |
` | '---o
` |
` o
` B
(created by AACircuit v1.28.5 beta 02/06/05 www.tech-chat.de)

Good luck
Chris

9. ### John PopelishGuest

Shouldn't that diode be across the relay coil?

10. ### ehsjrGuest

I left out the issue you so correctly raised about
timing. That solution is simple, too. I'll draw
the full schematic below. The circuit description
follows.

---[Motor1output]---+
|
+------------+
| |
[Snubber] [RY1Contact] (normally closed)
| |
+------------+
| |
[Snubber] [RY2Contact] (normally open)
| |
+------------+
|
---[Motor2Output]---+
D5
+------>|-----+
| |
D1 c---+----[RY1]----+--- +Vcc
South--->|---+---[R1]---+-----b
| | e Q1
North--->|---+ [R4] |
D2 | | +-------------------------+

| | |
| | |
| +---Gnd |
D6 \ / | D8 |
----- | +----->|----+ |
| [R5] | | |
| | c---+---[RY2]---+--- +Vcc |
+---[R3]---+---b |
| | + e Q3 |
| [C1] | |
| | | |
----- +----+ |
D7 / \ | |
| Gnd |
| |
| |
D3 | c---------------------------+
East---->|---+---[R2]---+---b Q2
| | e
West---->|---+ [R6] |
D4 | |
+----+
|
Gnd

C1 - 1uF, voltage rating at least 2x Vcc
D1-D8 - 1N400x
R1,R2, - 330 ohms
R3 - 1K
R4,R5 - 10K
R6 - 47K
Q1,Q2 - PN2222A
Q3 - TIP120
Snubber - a capacitor in series with a resistor.
Compute the cap value at 1uF per amp of motor current,
and 3x motor voltage. Compute the resistor at 1 ohm per
volt of motor voltage, and use a 1 watt resistor. These
are rough numbers, so you can use anything near the
computed values.

Diodes D1 and D2 form an OR gate. A plus on either South OR North
will turn on Q1 via R1. R4 biases Q1 off in the absence of
a plus on South or North. The same description applies to the
second OR gate (East/West) and its components D3,D4,R2,R6 and Q2

The emitter of Q1 is fed by the collector of Q2. Therefore,
both Q1 AND Q2 must be turned on for RY1 to be energized -
an AND gate.

In English:
Either North |OR| South |AND| either East |OR| West
from the joystick is a diagonal. That's 2 ORs and one AND,
just what is in the circuit.

RY1 - the "diagonal" relay, opens the offending jumper -
the connection between Motoroutput1 and Motoroutput2
when it is energized, and it is energized any time the
joystick is diagonal.

Diodes D6 and D7 form a third OR gate. If any (or all)
of the inputs North, South, East or West is plus, Q3 will
be turned on via R3, energizing RY2. The turn on of Q3
is delayed roughly 1 mS while C1 charges. R5 biases Q3 off
in the absence of any input from the joystick, and discharges
C1.

RY1 and RY2 form another AND gate.
RY2 must be de-energized AND RY1 must be energized for the
connection to exist between Motoroutput1 and Motoroutput2.
It cannot exist until RY2 has transferred. It takes, as
a rough average, about 8 mS for a relay to transfer.
The closed contacts break long before the open contacts
touch. So if we energize both RY1 and RY2 at the same
time, RY1 will break the connection long before RY2
makes the connection. An additional delay is added to
ensure that RY1 begins to energize before RY2.

The relay contacts are important. They must be capable
of handling the current that the motors draw.
If Vcc is 12 volts and the motors draw a lot of current,
automotive power relays are a good choice for your
relays. Something like RLY-443 from Allelectronics
http://www.allelectronics.com/
will handle 40 amps.

Ed

11. ### ChrisGuest

Thanks for the heads-up, Mr. Popelish. The switch/transistor
combination is just to replace the switch in the prior post, if he's
got a Pretendo-type "digital" joystick that only switches a small DC
signal.

There's already a diode across the relay in the first ASCII diagram
above. The idea was just to insert the switch/transistor combination
at points A and B in place of the switch alone. I guess I wasn't too
clear on that.

Goofy relay logic. Gotta love it. Sometimes it seems like you just
put diodes and suppressors everywhere, and let St. Liebowitz himself
sort 'em out.

Thanks again for the note. It's good to know someone's checking. I
guess Rich Grise would say I owe you a beer.

Chris

12. ### davidd31415Guest

Thanks Chris, I'm glad you could figure out what I was tring to do,
that's exactly what I was looking for. Looking at the circuit gives me
a bit of insight into the design of relay-logic circuits.

I do have an industrial joystick and it should have no problems with
the currents. Thanks again for taking the time to post and explain
that!

David