robotology / robots-configuration

Contains robots configuration files
BSD 3-Clause "New" or "Revised" License
14 stars 69 forks source link

Wrong coefficients coupling the eyes' vergence? #228

Closed pattacini closed 12 months ago

pattacini commented 3 years ago

Given that the vergence Vg amounts to the difference between the single eyes' joints L-R (see the wiki), I think that the values contained in the eyes' coupling matrices should be -1.0 1.0 instead of -0.5 0.5.

Differently, as Vs = (L + R) / 2 it turns out that the line immediately above reporting 0.5 0.5 is spot on.

Can this reasoning be assumed correct?

This is somehow linked to https://github.com/robotology/icub-firmware/issues/71.

cc @davidetome @randaz81 @ale-git @traversaro @plinioMoreno

pattacini commented 3 years ago

Any comments on this @ale-git @randaz81 ?

pattacini commented 3 years ago

Discussed this with @randaz81 today, who agrees with what said above. However, the wrong matrix coefficients get subsumed by the PID gains, hence there ain't actually any real control problem.

Given that it's more correct to have -1.0 1.0, it'd be worth updating the conf files anyway.

pattacini commented 3 years ago

Apparently, also matrixE2J should contain coupling terms!

pattacini commented 1 year ago

/remind September 03 let's address this once for good.

octo-reminder[bot] commented 1 year ago

Reminder Sunday, September 3, 2023 10:00 AM (GMT+02:00)

let's address this once for good.

octo-reminder[bot] commented 1 year ago

🔔 @pattacini

let's address this once for good.

pattacini commented 1 year ago

Link in the OP fixed.

pattacini commented 1 year ago

To sum up, here's the list of things that we need to do:

martinaxgloria commented 1 year ago

Hi @pattacini,

as you suggested, I booked iCubGenova11 to do the tests with the new values of eyes' vergence. I took a video of the eyes' movement after the upload:

https://github.com/robotology/robots-configuration/assets/114698424/1adeb6c5-f5f3-4a80-90ab-dce5e693c6f5

I have little experience with it, but the movement seems smooth, also compared to the previous version with the wrong vergence values:

https://github.com/robotology/robots-configuration/assets/114698424/016518b5-3a1f-4f85-969a-ff8347b84727

Do you agree? If yes, I'll proceed with the update of all the maintained robots.

martinaxgloria commented 1 year ago

Just to clarify, I only update this line with -1.0 1.0 instead of -0.5 0.5.

pattacini commented 1 year ago

Great, @martinaxgloria 👍🏻

That's all correct!

The videos are nice. However, given the control context, I would expand on the validation phase by including some data acquisitions of the commands and joint feedback. These traces would help us appreciate small details that are not visible in the videos, like overshoots, rising times...

martinaxgloria commented 1 year ago

You're right @pattacini! I'll do the acquisitions and I'll report here the results.

pattacini commented 1 year ago

You can talk to @davidetome and/or @mfussi66, who do have some code snippets for logging both commands and feedback you may consider reusing.

martinaxgloria commented 12 months ago

Today I plotted the data I've acquired on iCubGenova11 after the change in the vergence coupling matrix and here they are:

image

I hope that these quantities are the ones that @pattacini referred to. In particular, I plotted the encoder, motor encoder, pwm and current values for the eyes_tilt, eyes_vers and eyes_verg joints. These values were obtained by setting a sequence from the yarpmotorgui from the home position, to the upper limit, then the lower limit and then home again for the three eyes' joints. I set a time of 5 sec for each movement (e.g. from home to upper limit in 5 sec). Then I start the acquisition and I ran the code to save the values in order to plot them at the end.

The only particular thing that stands out is the peak of current and duty cycle percentage around the second 45 that corresponds to the eyes_verg joint reaching its upper limit. In your opinion, is it consistent with the movement?

cc @pattacini @mfussi66

pattacini commented 12 months ago

Great that you managed to plot these results 👍🏻 A couple of important points though:

We could also plot the profiles before and after the change.

martinaxgloria commented 12 months ago

Yesterday I repeated the tests acquiring the joint references and the other quantities with much faster movements (0.3 sec per movement). To make a comparison, I also do the tests and the acquisitions before the change:

old and the comparison between the joint encoder angles and the reference values:

encoder_pid_old

After the changes, instead:

new

encoder_pid_new

@mfussi66 noticed that the sampling time it's high (when I did again the acquisitions maybe I accidentally change this parameter and I didn't notice it). So far, I decided to post here the results, but I'll do again the acquisitions and the plots with more samplings to have a more accurate analysis.

cc @pattacini

pattacini commented 12 months ago

Overall, I'm happy with the results and for me it's green light 🟢 Thus, we can proceed with the update of robots-configuration.

@mfussi66 noticed that the sampling time it's high (when I did again the acquisitions maybe I accidentally change this parameter and I didn't notice it). So far, I decided to post here the results, but I'll do again the acquisitions and the plots with more samplings to have a more accurate analysis.

It seems so, yeah. However, what was the sample time you used?

martinaxgloria commented 12 months ago

It seems so, yeah. However, what was the sample time you used?

I computed it from the acquired samples and it is 0.1s

pattacini commented 12 months ago

It seems so, yeah. However, what was the sample time you used?

I computed it from the acquired samples and it is 0.1s

Ok, it's fairly low, but the graphs above demonstrate that the reference is well-tracked anyhow.

For the record, a good sample time when dealing with control issues is 10 ms at the YARP layer.

martinaxgloria commented 12 months ago

Yes, thanks for the clarification @pattacini! So, can I proceed with the update of robots-configuration or it's better to re-do the acquisitions with the right sample time before?

pattacini commented 12 months ago

So, can I proceed with the update of robots-configuration or it's better to re-do the acquisitions with the right sample time before?

Let's proceed with robots-configuration 👍🏻

martinaxgloria commented 12 months ago

PR here:

cc @pattacini