Runaway?

General discussion of using Roboclaw motor controllers
ecorrales
Posts: 33
Joined: Sun May 06, 2018 5:06 am

Runaway?

Postby ecorrales » Tue Aug 07, 2018 8:40 am

Hello,

Successfully communicating / controlling a Roboclaw over USB (Raspberry). C++. USB. Boost libraries.

Every so often, probably once every 15-20 mins, sometimes even longer, my program loses control of the Roboclaw. Mostly when the robot has bumped up against something, or too many back-n-forth commands. Whatever the last command was, that's what it will continue to do.

I've attempted to kill the program, re-start it.. some times it is successful in opening communications again, and just sending another command gets the Roboclaw out of that 'stuck' condition.

But not always. Sometimes even though communication is re-established (port opens, no error, etc).. can't seem to get the Roboclaw to respond.

Other times, unable to even re-open serial port.

For both of those , I either have to disconnect/reconnect USB cable, or even power-cycle the Roboclaw.

I have (I think) plenty of separation between high-current area and logic, also have shielded cable, I have ferret coils, etc etc.. Even have a USB opto-isolator.

The Roboclaw and Raspberry have separate power feeds from the main battery.

The oscilloscope doesnt show any real noise on the various lines.



Any suggestions?

User avatar
Basicmicro Support
Posts: 1003
Joined: Thu Feb 26, 2015 9:45 pm

Re: Runaway?

Postby Basicmicro Support » Tue Aug 07, 2018 9:09 am

USB is a low voltage signal with a very high frequency. Noise can cause it to fail. Motors are noisy. I recommend using the RPi TTL Uart instead of USB if you are having communications failures. You can minimise noise but you cant completely elliminate so there is always the possibility there could ba a USB comminications problem.This is usually a Windows problem more than a Linux problem but the basic physics still apply(Linux is just usually better recovering from a USB error).

The fact this seems to happen when you bump in to things would indicate stall conditiuons are happening which produce alot of noise. Also you could be browning out the electronics. Your description does show several different methods of causing problems so it could be more than one cause as well. I suspect if you change to TTL serial you will no longer have these problems or atleast elliminate some of them(eg if brown out is an issue TTL isnt going to fix it so you may need to use a seperate logic battery).

Also check your wiring in general. Your ground should be in a star from the power source for best results. Or a line but no loops if you can help it. If you have a loop keep it as short as possible.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests

cron