Page 1 of 1

RoboClaw 2x15A Motor Controller (V5E) - Freeze/Hang

Posted: Tue Mar 12, 2019 7:41 am
by davidlu

After I have updated the my roboclaw to the latest firmware (v4.1.29), the roboclaw would freeze(motor stops rotating) after I run the example python script( and in ubuntu for a while. After I killed the script and rerun the script, the motor would run for a while and then freeze again. The timing that the freeze occurs is not consistent. Sometime happens very fast sometime it would take a while.

Previously, before updating the firmware, the roboclaw was working perfectly.

Is it possible to downgrade the firmware? Or is there any fix to prevent the freeze?

Hope someone could enlighten me.


Re: RoboClaw 2x15A Motor Controller (V5E) - Freeze/Hang

Posted: Tue Mar 12, 2019 1:11 pm
by Basicmicro Support
Please contact We have a prerelease that may help out(reduced command latency). The change may be related to your problem or not. We have not had any reports of this kind of problem so it may be unrelated but lets check if you have the same problem with the pre-release first before downgrading to an older release.

Re: RoboClaw 2x15A Motor Controller (V5E) - Freeze/Hang

Posted: Tue Mar 12, 2019 1:46 pm
by ChrisA
I see the same problem using ROS I get hangs and freezes. Then I added a write timeout and now get timeout exceptions.

The problem might be in Py Serial. Without setting the write timeout i would hang "forever" but the timeout prevents that

Here is my modification to (write_timeout=0.1 fixes the hang on writes problem)

Code: Select all

def Open(comport, rate):
    global port
    port = serial.Serial(comport,

I have a very small Python test script that can 100% reproduce the problem.

I have not tried the Supplied test scripts. I think I will

That said, I have not yet ruled out a hardware problem. Perhaps EMI from the motor and power cables is getting into the USB cable? I'll try using zip-ties to keep all the wires apart.

I do think it is a roboclaw firmware issue because a reset always fixes the problem. But this is REALLY hard to debug because we don't have access to the roboclaw's view of the USB interface. It is a black box.

Re: RoboClaw 2x15A Motor Controller (V5E) - Freeze/Hang

Posted: Wed Mar 13, 2019 10:47 am
by Basicmicro Support
A real serial port write will never freeze or timeout(unless there is something wrong with the PC) because we dont use flow control.

USB virtual serial ports are different. If there is a problem they can cause a Write to hang. USB does NOT like noise. DC motors produce a lot of noise. USB is not considered a robust communications connection. It is fine for setup and basic testing.

By definition Writes to a serial will output data without regards to the Roboclaw state because we do not use hardware flow control on a actual serial port. However when using USB this is not true because USB has flow control of its own. If USB has a glitch it can cause a Write to fail(either locking up or timing out as you are showing).

Reseting the Roboclaw just causes the USB port to reinit on both the Roboclaw and the PC which is how you fix a hung USB port on a PC. BUt that does pretty conclusivley indicate the problem is the USB port connection. I started using a USB isolation adapter and have zero(so far) USB glitches since.

Here is an amazon link to the one I purchased: ... B00XXPO4UG