1
\$\begingroup\$

I am working on a custom pan and tilt system in which the "pan" and "tilt" motors will be powered with a pair of PWM motor drivers. In other words, each motor will have its own driver. The drivers themselves will receive commands from an arduino nano, which in turn will receive control inputs from a 4-way switch joystick. The motors will only be powered one at a time, since the joystick is gated.

So far, this is pretty easy. The tricky part is that the cable I'm constrained to using only has three conductors available for the motors! The two motors will have to share a conductor. I'm struggling to come up with ways to power the motors, since sending power to one of them will, in most configurations I've come up with, also send power to the other motor.

The best I could come up with was to run a lead from each motor through an NC switch on the joystick such that the circuit from the stationary motor would be shorted out every time the shared conductor receives power. In my head, this makes sense, but I have a feeling that this might fry my PWM drivers.

enter image description here

My other idea was to use four logic-level NC relays and run the motor leads through them on the controller-side. Then, I could use code to completely disconnect the "stationary" motor from its driver every time the other motor is powered. But, now I'd have to deal with some delays every time I quickly switch from one motor to the other. For example, if I go "up" and then "left" in quick succession, it would take time for the relays for the "left/right" motor to turn off and close the circuit.

enter image description here

What do you guys think? This seems like the type of problem that a clever switch arrangement could solve, but I can't seem to crack it.

\$\endgroup\$
6
  • \$\begingroup\$ I guess the main problem is that, with 3 conductors, theres no way to have the motors rotate in opposite directions (or the same direction, depending how you wire them) at the same time, unless you split the rail or have negative voltages(i.e. -5V, 0V, +5V) \$\endgroup\$
    – BeB00
    Sep 1, 2020 at 17:42
  • \$\begingroup\$ @BeB00 No need to power both motors simultaneously. Only one will be powered at a time; the joystick is gated. I'll edit the original post to reflect this detail. \$\endgroup\$ Sep 1, 2020 at 17:46
  • \$\begingroup\$ I think you still need the additional relays, but electronic ones (solid state relais) should do the trick with switching fast... \$\endgroup\$
    – schnedan
    Sep 1, 2020 at 18:01
  • \$\begingroup\$ If you only need to power one motor at a time, i'm confused as to why this is a problem. Just dont activate both drivers at once, and put the one that you're not using into coast (not brake) mode. You shouldn't need any relays or switching, just connect the motors do the drivers as you would normally (with both drivers sharing the middle pin) \$\endgroup\$
    – BeB00
    Sep 1, 2020 at 21:53
  • 1
    \$\begingroup\$ If you need it to be braked, then you could add a relay or SSR to short the contacts together for each motor. Theres a small chance that the PWM driver already has that, but its more likely that in brake mode it just grounds both output pins. \$\endgroup\$
    – BeB00
    Sep 2, 2020 at 17:04

2 Answers 2

1
\$\begingroup\$

put the arduino and the drivers next to the motors and don't combine any of the motor wires

put the joystick on the end of the cable and use it to switch resistors that can be read by one of the areduinos analog inputs to determin what the joystick is doing.

eg:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
1
\$\begingroup\$

there's another way to run two motors over a 3 wire cable, but it uses different parts to those you've chosen.

instead of the PWM drives use LM2596 buck modules and just switch them between buck (positive voltage) and buck-boost (negative voltage) mode using the with the joystick switches.

set the voltage preset on the LM2596 module to get your desired run speed.

schematic

simulate this circuit – Schematic created using CircuitLab

As you can see the controls rest with the motor braked, activating the "up" control makes a positive voltage for the motor and activating the "down" control makes a negative voltage.

use another buck module and the other pair of joystick switches, for the other motor and ground the common motor wire.

Given that you have double switches and your joystick is 4 way (not 8 way)so that only one pair of switches can coperate at any time, you could do it this way too.

schematic

simulate this circuit

This keeps the unused X ort Y wire shorted to the common wire you could possilby sense the voltage on X Y and C to determine which way the joystick is being pressed if the arduino needs to know that. and also allows a grounded supply but sacrifices grounding ofg the common motor wire.

Anther solution leaves the ardino in control of the motor's speed and direction but uses only a single motor driver.

schematic

simulate this circuit

\$\endgroup\$
5
  • \$\begingroup\$ Okay, I figured out a way to arrange the switches on the joystick to make this work. However, this brings up two additional questions. The first one is easy: If I take the 10 or 20k pot off this LM2596 based module, you think I could solder in a replacement panel-mount pot? Second question: How would I go about limiting the current to the motors? \$\endgroup\$ Sep 2, 2020 at 17:28
  • \$\begingroup\$ 1: remote pot: yes, 2:it's hard to say without knowing why \$\endgroup\$ Sep 2, 2020 at 20:13
  • \$\begingroup\$ They sure get expensive on amazon, \$\endgroup\$ Sep 2, 2020 at 21:17
  • \$\begingroup\$ I was thinking that current limiting could be applied for the motors when they reach end-stops and enter a stall condition. These LM2596 based modules tend to have a current limit in their spec sheets, but idk if relying on this is a good idea for limiting stall current. I'm worried about overheating the module. \$\endgroup\$ Sep 4, 2020 at 15:27
  • \$\begingroup\$ you can get DC-DC modules with voltage and current limits. and yeah there is a way to do this such that onlt one DC-DC modules is needed seing as your joystick is gated and double switched: use one layer for positive and one for negative. \$\endgroup\$ Sep 4, 2020 at 20:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.