-
Notifications
You must be signed in to change notification settings - Fork 31
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
The joint calibrates, but could not reach the startup position #536
Comments
In order to study this specific behavior we have chosen to force the calibration timeout to happen. In order to do so in the setup I've calibrated the device with a very low value of PWM, i.e. ~680.
Thus this is what happens from a sw level point of view.
As you can see, the position is still changing also after the error message of the calibration timeout has been sent to the board and the controller asked, failing ( This behavior is also clear if we take a look to the graph of the data dumped from the joint. In fact, it is possible to see that the robot gets calibrated and set is RUN mode. Moreover, when shutting down the yri the robots goes to the parking position
as it is clear form the graph, in this case the calibration did not finished because the timer expired before reaching the hard stop limit. cc: @valegagge |
Since PR opened I'll move to review |
Hi @MSECode , |
Considering what said and seen, we have understood that the problem is mainly related to that fact that --> when the icub-firmware/emBODY/eBcode/arch-arm/embobj/plus/mc/JointSet.c Lines 514 to 522 in d407b75
FORCE_IDLE . Therefore, in the corner case described above, where we have the icub-main calibration timeout expired but not the controller calibration timeout, we ask the robot to go in IDLE but that is not enough for the robot for stopping the calibration procedure.Therefore to (temporarily) solve this we need to decide if it is preferred to make the parametricCalibratorEth asking for the FORCE_IDLE control mode instead of just IDLE at these lines: https://github.com/robotology/icub-main/blob/master/src/libraries/icubmod/parametricCalibratorEth/parametricCalibratorEth.cpp#L762-L768, or we need to change the logic in the fw side where we need to stop the calibration even when control mode IDLE is received.What do u think: @valegagge @ale-git @pattacini On top of this I would add that I think that the core problem of this is related to the fact that during a calibration procedure that is managed both from icub-main part and icub-firmware part we are using 2 different timeouts that:
Anyway, where do you think to add the fix? I would propose to make icub-main asking for the |
Hi @MSECode Good that you narrowed down the root cause of the problem 👍🏻 A quick but well-tested fix (to rule out side effects), like the one you mentioned, is fine. However, I suggest getting an overall view of the underlying state machine, essentially to master the reason why we implemented the two timeouts in the first place. |
Hi @pattacini, the yarprobotinterface calibration timeout is referred not to the calibration itself (the name is slightly misleading), but to the reaching of the startup position once the calibration is done, performed by a positionMove command: if the joint can't reach the startup position, it is supposed that something went wrong and the joint is set in idle and the calibration output lower pwm limit is maintained. The board calibration timeout is referred instead to the encoder calibration itself. For example, in the type 10 calibration, the joint returns in unconfigured state if the hard stop has not been detected for some reason before the timeout. |
What @ale-git wrote above should clarify why there are two different timeouts 👍🏻 If I got it right, the high-level timeout should start being active only upon issuing the @MSECode I'm no longer sure that your quick fix can have the green light. |
Yes,what @ale-git said is totally correct. The issue I've seen here, which I think is just happening with the calibration 10, it's due to the fact that, if the joint reaches the hard stop position after the high level timeout expires but while the high level timeout is still going, the joint then is moved to the startup position and set in RUN but it will be configured with the so called safe pids, but the user has not a clear vision of this since the joint will appear as correctly calibrated (this is true if it does not look to the yri logs) |
Hi guys, Here the link to the code |
Not clear to me... Frankly, as a general comment, I feel the need for a diagram depicting all the components at stake as well as their interactions. This diagram should also serve as documentation to get everyone aligned. Is there already something available in this respect? Then, timeouts are weak patterns that we tend to use to keep things simple. In this situation, if there are 2 timeouts, 1 at low level (calibration) and 1 at high level (homing), each checking two different operations taking place serially, I would say that there's some robustness. Instead, if there are 3 timeouts as @valegagge suggests (did I get it right?), 1 at low level (icub-firmware:calibration) and 2 at high level (icub-main:calibration and icub-main:homing), whose 1 checks what is being checked already by another piece of code elsewhere, well, things start getting quite weak... |
Hi @pattacini , this is a mess! |
I created the fisrt draft of the state machine of the ParametricCalibratorETh strictly related to the current implementation. This is the first step toward the sw architecture definition of the calibrator. I hope this diagram can help @MSECode to understand better what is going on. I'm available to discuss any questions and improve the diagram itself. |
After discussion and analysis on the bench setup w/ @valegagge we have observed the following: Behavior 1 --> calibrator on icub-main requesting
|
Unfortunately, I have really no time these days for an in-depth reading. |
I created a new repo to address the whole activity on the calibrator both high-level and embedded. I don't want to close this issue for now, because we need to understand how to address its fix (This bug is very annoying during the robot usage). So, for now, I report it in a list of bugs we need to address. https://github.com/icub-tech-iit/study-calibrator/issues/1 |
In this issue we are going to investigate the problem about the joint failing the calibration and going in timeout observed in other issues and already mentioned as the second main problem in the body of this issue #529 and collected among the major issues that we have observed in the joints that mount an AMO encoder, and that have been collected in this table: https://github.com/icub-tech-iit/study-encoders/issues/22#issuecomment-2464924451
In different occasions we have observed that, even if the joint sometimes fails to calibrate (we are not 100% sure why this is happening), it tends to still reach the hard stop limit when using calibration type 10.
DoD
Problem analyzed, understood and possible solution proposed.
The text was updated successfully, but these errors were encountered: