ros_serial loses sync with Arduino only when motors are running

asked 2019-01-13 00:41:55 -0500

strider gravatar image

updated 2019-01-15 00:13:27 -0500

We have an Intel NUC communicating with an Arduino Mega using ros_serial. There are several motors attached to our bot. The motors are controlled using a BlueRobotics Basic ESC Rev 3 which takes a PWM value from the Arduino. When we are sending messages to Arduino while keeping the motors off, everything is working perfectly. We can send as many messages as we want, as frequently as we want and with any values of PWM. But when we are trying to send a message when all the motors are powered, ros_serial loses sync after a few messages. We are unable to debug this issue since the only apparent change for us is the current drawn by the motors. Can anyone help us with this? We are using ROS Kinetic with Ubuntu 16.04

Edit: Link to circuit flowchart:

edit retag flag offensive close merge delete



The motors and the driver don't just draw current from the power supply, they create electrical noise that can cause issues as you're experiencing. Without more info about your setup though it would be hard to guess what is causing issue.

Schematic available?

billy gravatar image billy  ( 2019-01-13 03:57:28 -0500 )edit

Is your Arduino powered by the same power line as the motors? I experienced a lot of blackouts with my Arduino when motors are operational due to power fluctations created due to the back EMF.. Also, electrical / inductive interference is a big possibility if your motors are big enough.

Hypomania gravatar image Hypomania  ( 2019-01-14 01:25:00 -0500 )edit

@billy, that's our guess too but we don't know how to fix it. I added a link to the circuit flowchart in the question.

strider gravatar image strider  ( 2019-01-15 00:15:39 -0500 )edit

@Hypomania, the Arduino is powered by the USB port connected to the onboard computer (NUC) but they all share the same ground. Could that be a reason? There are other USB devices connected to the NUC like cameras and IMU and they are working fine.

strider gravatar image strider  ( 2019-01-15 00:16:05 -0500 )edit

I would look at the potential ground link between the motors, motor controllers and the Arduino. If you have a scope handy I'd hook it up and see how noisy that part of your ground is. Potential solution could be to opto-isolate the PWM signals between your Arduino and motor controllers.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-01-15 03:49:26 -0500 )edit

This remove the need for a direct ground link between the controllers and the Arduino

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-01-15 03:49:54 -0500 )edit

@strider, what Pete said, that's the only relation between your motors and Arduino. Apart from that, it could be inductive or capacitive noise depending on how big the motors are.

Hypomania gravatar image Hypomania  ( 2019-01-15 07:58:48 -0500 )edit