-
Notifications
You must be signed in to change notification settings - Fork 44
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
Problem with velocity from micro drivers #92
Comments
@wxmerkt, hi, what do you mean by "when the SPI frequency is too high"? Do you see these problems only when the SPI connection speed between the master board and udriver is at 6/8 Mhz and not at 4 Mhz or what do you mean? |
When the SPI frequency is at 6/8 MHz, we see the position signal frequently dropping to zero. With the SPI frequency at 4 MHz, the position signal looks great. However, we still see outliers in the velocity signal when commanding a zero-order hold. Since the joint isn't moving at this time, this might be something different to #91. I am currently not on hardware so won't be able to get newer logs to check |
Hi, this is actually an issue related to the udriver firmware https://github.com/open-dynamic-robot-initiative/udriver_firmware The velocity estimation is computed by a TI library and we observed two bug with it: I tried to address this two problems by implementing my own velocity estimation from encoder reading but quickly realize that the CPU budget left on the microcontroller is close to 0, and my computation interfered with the communication. About communication, with SPI, we need to react to an asynchronous incoming communication and provide the SPI fifo with sensor data and reading command data. Due to the limited SPi fifo buffer size of the MCU used in the udriver, we need to fill it with the CPU core on the go and consume cpu time on spi interupt. If SPI fails for other reason, like noisy lines, it is possible that no transfer happens during all the trials. Ye are actively preparing the next version of the udriver that will use a much capable MCU with much more communication bandwidth, proper SPI with DMA, and 3 CPU cores. One will be dedicated to the FOC including sensor reading and state estimation, one dedicated to the communication, and one left for user code or future development. The new design is hosted here: https://github.com/open-dynamic-robot-initiative/open-motor-driver-initiative I know this is not very satisfying since we will need to update the hardware, but I have no firmware solution to those issues. |
Thank you for the very detailed response @thomasfla and explaining the symptoms we've observed. Regarding:
We have observed this precisely and are now considering 1 as 0, i.e. if the reported velocity is +/-0.006 radian after considering the conversion factor and gear ratio, we are setting it to zero. This works well with the current hardware :-) |
Thanks for the detailed explanation @thomasfla and the insight on how to fix it @wxmerkt !
Do you think this is something we should bake into the official software library? I wonder if we should have something like a minimal velocity in the odri_control_interface and if the velocity is below this threshold, set the velocity to zero as you describe. What do you think? |
Should we change the default communication speed from 6 Mhz down to 4 Mhz? What do you think @thomasfla ? As @wxmerkt says, using the speed of 4 Mhz we are able to control the robot quite well so I am not sure if a higher speed is buying us much but rather cause us troubles. |
Yes, that's a good idea. Maybe implementing it in the SDK directly is better since the LSB is registered here but abstracted on higher layer.
Yes, I think it worth investigating it. I propose to test it at LAAS and take some measurement with a scope. Could we wait for a month or so that I finish the power board integration and test it in 4Mhz? |
Good point about implementing it in the master-board-sdk instead. I will look into this next week.
Waiting for the power board to be ready and do a proper investigation of the entire system makes sense totally sense. About 6 Mhz to 4 Mhz: While 4 Mhz might be slower, we might be overall still faster if we can avoid the SPI retries that we had to introduce to get a stable 6 Mhz working. |
Set close to zero velocity to zero. Fixes #92
As reported by @wxmerkt in #89:
We should look into this and try to fix it on the firmware level (either master board or udrivers).
The text was updated successfully, but these errors were encountered: