Factor-Robotics / odrive_ros2_control

ODrive driver for ros2_control
Apache License 2.0
250 stars 82 forks source link

i cant set the velocity to axis1 , out of loop close #32

Closed bakiiir closed 1 year ago

bakiiir commented 1 year ago

Hey, I have two hoverboard motors and an ODrive. I calibrated the two brushless motors as mentioned in the ODrive documentation. Now, I want to use these motors in ROS. I'm using the ODrive with the odrive_ros2_control package. However, I'm facing an issue where I can only control the velocity of axis0 (joint0). After 5 seconds of loading the controller, joint1 of axis1 goes out of closed-loop control and i cant set the velocity to this joint1 Screenshot from 2023-06-08 00-48-54 Can you suggest where the problem might be? I have used the same diffbot odrive_ros2_control. If you have any questions, please leave a comment and I will provide more information."

bakiiir commented 1 year ago

i have video for this because it +10 mb i cant upload

bakiiir commented 1 year ago

i dont know if someone is working in odrive in ROS i just wanna know why the axis0 and axis1 go out from control loop its start normaly but after while the two axis go out and when i send the velocity the hoverboard motor dont move

bakiiir commented 1 year ago

just update : i think i got the problem where is so when i set the watchdog with same time or deseable for both of axis the axis0 run normly and the axis 1 go out but when i increase the watch dog of the axis1 the axis 0 go out so how i can solve this problem ? i use the same exemple of diffbot with the real odrive (the enabling of watchdog is the urdf and in the configuration of odrive from odrivetool)

borongyuan commented 1 year ago

Yes, watchdog_timeout may still be too short on some platforms. We set up the watchdog in on_init() and feed the dog in on_activate() and write(). So, if you take too long to start, you may not be able to feed the dog in time. The current problem of long startup time is most likely caused by DDS. See https://github.com/Factor-Robotics/odrive_ros2_control/issues/28#issuecomment-1406365742.

bakiiir commented 1 year ago

thanks for replaying @borongyuan but my problem is not take to long to startup , it start the odrive in time but one of the axis go out of control after while ! i will give u exemple i use Diffbot exmple with the real odrive and two hoverboard motor when i launch the launch file the odrive is ready and the two of the axis is in the close loop after i use teleop to send the velocity to start driving the motor the both axis start togather and after 5s the axis 1 go out of control and go out of close control (spin in the idle mode) so what's the problem here ????

bakiiir commented 1 year ago

this is my terminal when i launch diffbot launc file that u provide in your Screenshot from 2023-06-09 14-57-52 and when i have to send the velocity command i use telop Screenshot from 2023-06-09 14-58-31 and i have set my DDS communication before because i have used nav2 to this : Screenshot from 2023-06-09 15-09-42

i have video for my similation running but i cant post it here can u give me your email to give u permition to see it in Google drive My setUp is: ROS Humble and my odrive firmware is 0.5.1 Ubuntu 22.04 thanks for your time :+1:

borongyuan commented 1 year ago

This is most likely an issue releated to watchdog and real-time communication. Linux system is not a real-time system unless the real-time patch is applied. The default configuration of DDS can also cause various problems. So you are using Cyclone DDS. Good choice. Most people find it causes less problems than Fast RTPS. You can refer to the documentation of DDS Tuning information. These will only help you reduce the chances of failures. We need to further investigate the reason. I have also encountered single axis failures before, but very occasionally. If I remember correctly, it is also under the Humble+Cyclone DDS environment. Another thing you can check is, after the failures, shut down ros processes, use odrivetool to dump_errors(). Please check if there are only watchdog related errors. If so, disable watchdog in URDF to temporarily avoid this problem. I'll change the USB communication to asynchronous later to improve performance, but I can't guarantee completion time.

bakiiir commented 1 year ago

hey MR @borongyuan the issue was solved by soldring capasitor in the both of the M1 and M0 (the value of capasitor is 22nF and for me i use 47nf ) u can check th odrive community the error is given [ERROR_ILLEGAL_HALL_STATE]. you can the this link to read more about error