0
$\begingroup$

I am using arduino mega to run 4 motors via 4 motor controllers. I am using a ps2 controller as the remote control. When the joystick is at rest, the motor should stop.

The problem is the motor still moves randomly when the joystick is at rest. Sometimes, the joystick can only produce forward motion on the motor but not backward. Is this the grounding issue or the PS2 remote control issue ir others.. Does the GND from the arduino board have to be connected to the GND from the external battery?

How can I troubleshoot this?

Thanks.

$\endgroup$
1
$\begingroup$

In most cases, ALL of your ground reference and power return pins and wires should be tied together, preferably with a star configuration to avoid ground loops.

In a star configuration, the ground (return) wires from all your devices are connected to a single, physical point in your circuit. It is best that this point is close to your battery, preferably a power distribution board (board with multiple parallel power ports) connected at the battery plug.

Devices that commonly share ground are microcontrollers, batteries, RC receivers and servo motors.

$\endgroup$
2
  • $\begingroup$ Thanks @George for the feedback. In a star configuration, if the center point is the arduino, then every GND wires should be connected back to the arduino? Another question, If they are not grounded together, would it cause the joystick readings at rest to fluctuate which then affect the motor behavior? $\endgroup$
    – goddar
    Jan 9 '16 at 15:26
  • $\begingroup$ I edited the answer in response to your first question. Grounding everything on the arduino might not be practical. As for the joystick, if it doesn't share ground with the arduino, then yes, you have it essentially unconnected and hence the input port of the arduino is essentially not connected anywhere, hence reading arbitrary signals. $\endgroup$
    – George ZP
    Jan 9 '16 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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