-
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
Fix AMO calibration 10 #529
Comments
Today, we have done some test when calibrating the joint using the AMO encoder configured using calibration type 10.
First calibration --> Hard limit reached but need to check why we have that offset on the raw valuesSecond calibration --> Hard limit not reached but joint calibrated and
|
Good catch @MSECode !
Probably yes! something related to the abs_encoder calibration flag.... this is just a guess... |
Hi @valegagge, While if we restart the yri without switching off and on the boards it is clear to see from the logs underlines in this image that the joint position read by the odometry is always zero. While we are restarting to read only after the calibration phase, which as the other tests is not spanning till the hardstop position. Thus, this test confirm what we were observing the other day through the dumped data. After some other tests, I've noticed that when the boards are not restarted, the method log-calibration-10-noboardrestart-test2.log |
For the second problem: we have some logs of the robot here. |
After some tests and debug lines used we understood what is most likely to be the core of the problem related to the fact that sometimes the calibration process is failing, i.e. the joint is not reaching the hard-stop position.
In order to test my thought I added a huge delay of 3 seconds to the sending of the calibration command on icub-main just to be sure that the As a side note I would say that when the calibration was not completing correctly the joint also was skipping the parking at the stop of the session.
As you can see in these logs, why the controller is considering the joint calibrated at this point since:
Finally, if you look at the logs the position we are reading in the initialization phase (which are in iCubDegrees) have really little variations so this tells us that the encoder at the end is reading fine. The different sessions are divided by some white lines. some-logs-for-calibration10-starting.log So this is my analysis, we can know discuss about how to made the code more robust and how to correctly manage the state machine of the calibration also thinking about doing that with other calibration types and/or encoders. cc: @valegagge @maggia80 |
@MSECode thanks for the explanation. I would certainly add a threshold. There is already a threshold parameter used for the home position, we could use the same principle, inserting the threshold in one of the not-used parameters of the calibrator. |
Hi @MSECode , If during the tests you'll notice that for the In addition, the Finally, I think could be interesting to understand why @ale-git implemented the check on the exact values instead of using a threshold. |
That's good. |
Considering those problems risen in this comment after a brief discussion w/ @valegagge, we have chosen to add some other debug lines to understand a couple of things more. Specifically, we realized from the trace logs of the previous runs that when the calibration was failing, that used to happen more or less exactly 1 second after the reception of the command from the callback. And considering that out
From this logs you can see how the method is exiting with TRUE:
Furthermore, as you can see from this lines: icub-firmware/emBODY/eBcode/arch-arm/embobj/plus/mc/AbsEncoder.c Lines 497 to 504 in 49a2f90
position_sure . Thus, this finally explains the errors we were observing.
|
After discussion on the open points w/ @ale-git and @valegagge we clarify all the doubts that have been previously left open and applying some changes to the code we have now a procedure for the calibration type 10 that works always fine, even when we decide to restart or not the boards after the de-initialization of the services.
I've tested the modified on the bench setup we are using for tests and is working good. |
Hi @MSECode , In addition please add the script you use to plot the data in the thanks |
So, the green dashed line in the graph, which is the raw position of the encoder rescaled to degrees, has been calculated with this formula:
|
On the test bench we have observed that everything works as expected. Therefore, I'm gonna open a PR. However, I'll keep it in draft since we need to test the changes on the robot too. As a matter of fact, since we have modified some of the temporizations in the calibration phase and we just tested them on a setup composed of a single joint, we need to check that on the robot the calibration sequence of the joints is still kept. That is, in fact, a delicate part considering that, in order to minimize efforts on the links, we are moving the joint following a specific order. |
Hi @MSECode, Thanks |
During the experiments on the robot, we experienced a lot of issues related to the AMO calibration 10.
In this issue we want to address two of these problems.
Problem 1: after the second run of YRI the joint calibrated without reaching the hw-stop
We got to reproduce the problem on the AMO setup. see here.
for those who haven't access to that repo I report here what we noticed:
Problem 2: the joint calibrates, but could not reach the startup position.
For example, on the robot, we noticed that the knee reached the hw-stop (leg fully extended) but it could not reach the startup position (bent-leg). We still aren't able to reproduce this behavior on the setup.
TIPS -How to fix the bug
Already with @MSECode we browsed the code and with the help of @ale-git we understood we need to put the correct value of this threshold.
It is important to notice that this type of calibration is used also for the calibration of motors that need a different threshold value .
We don't know how this bug affects the calibration behaviour, but for sure it is a bug and we need to fix it.
Dod
We want to:
cc @MSECode
The text was updated successfully, but these errors were encountered: