-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exceptions: myactuator_rmd.can.BusError and ProtocolException on repeated path-following commands #11
Comments
Hi Stefan, I have not been able to generate error messages like these previously. I have tried to go for a very simple blocking design throughout the code: So there should always be a request followed by its response and only then a new request can be sent. The only problem where I could imagine this happening is when trying to access the class from multiple threads contemporarily. The code is currently not thread-safe and if somebody tried to send a position set point ( |
Hi Tobit, I'm running Ubuntu 20.04 with a low-latency kernel patch (5.15.0-117-lowlatency) to send commands through a multi-channel usb-CAN adapter to multiple motors distributed over several channels (3-4 motors to each channel). I don't have another CAN adapter that is socketCAN compatible, but the one I'm using is a performance commercial model. Each channel bus is terminated at each end with 120 ohm, and all motors on the channel are essentially 'daisy-chained' (branch length is negligible). My motors are all either RMD-X8-Pro-H 1:6 (V3) or RMD-X8-Pro 1:9 (V2) by the older naming convention. The problem is consistent every time I am controlling multiple motors (whether on a single CAN channel or multiple), but less so for a single motor. I can sometimes replicate either the
When I am controlling multiple motors I make
I don't know much about multi-threading, but I am only running one script at a time. I suppose I was assuming that would mean it would be single-threaded and each request/response would complete before another request was sent as you say, but I could be wrong. |
Hi again Stefan,
Best wishes |
Ah that makes sense about the blocking time. I will have to work to correct that, thanks. Thank you also for the suggestions, I'll continue troubleshooting. Enjoy your holiday! |
Hi Tobit,
I am still investigating, but when using closed-loop position control for path-following (with commands every time step), my system tends to accrue many
myactuator_rmd.can.BusError
exceptions regardless of the time step size used (typically 2 ms but with other time step sizes also). I'm handling the exceptions and it doesn't appear to have a significant effect on path following performance, but after executing a path later individual commands often return amyactuator_rmd_py.ProtocolException: Unexpected response
of the kind used by the path following, e.g.:In this case monitoring the CAN socket reveals a correct (
0x43
) message and response, and the motor does execute the command to write the new acceleration, but it is problematic when you need to read the correct response (e.g., withgetMultiTurnAngle()
). It is as though responses to commands which receive aBusError
accrue in a buffer and then are inappropriately read by later commands.Also, though more rarely, a
BusError
will occur on a command that is not repeated each time step, which I think may cause the command to fail to be sent to the motor (to be confirmed) - potentially disrupting a program. Anecdotally, I think the likelihood of this may increase as moreBusError
's have been accrued (e.g., following execution of a path).As I mentioned I'm still investigating, so I'm not certain whether the bus errors are a result of something in my system or something in the code. I haven't yet dug into your code sufficiently to see what might cause the bus errors there, but maybe you have a better idea? In any case, I wonder if there is a way to clear the response buffer so later commands don't get unexpected responses?
I will continue to look into this on my return at the end of the month, but just wanted to bring it up now in case you have a chance to start thinking about it.
Cheers,
Stefan
The text was updated successfully, but these errors were encountered: