Skip to content
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

Add friction + coulomb + threshold parameters #599

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

sgiraz
Copy link
Contributor

@sgiraz sgiraz commented Dec 7, 2023

What's new:

The new friction compensation law is the following one (see also the source code):

float PID_do_friction_comp(PID *o, float32_t vel_fbk, float32_t trq_ref)
{
    const float32_t MICRO { 1000000.0 }; // conversion from Nm into microNm
    const float32_t coulomb_pos_converted = o->coulomb_pos_val * MICRO;
    const float32_t coulomb_neg_converted = o->coulomb_neg_val * MICRO;
    
    const float32_t viscous_neg = o->viscous_neg_val * vel_fbk;
    const float32_t viscous_pos = o->viscous_pos_val * vel_fbk;
    
    if (vel_fbk <= -o->velocityThres_val)
    {
        return o->Ktau*(-coulomb_neg_converted + viscous_neg + o->Kff*trq_ref);
    }
    else if (vel_fbk > o->velocityThres_val)
    {
        return o->Ktau*(coulomb_pos_converted + viscous_pos + o->Kff*trq_ref);
    }
    else
    {
        return o->Ktau*(o->Kff*trq_ref);
    }
}

Note:

  • The following robots will be affected by this changes:
# robot
1 ergoCubSN000
2 ergoCubSN001
3 iCubEdinburg01
4 iCubErzelli01
5 iCubErzelli02
6 iCubGenova02
7 iCubGenova07
8 iCubGenova08
9 iCubGenova10
10 iCubGenova11
11 iCubLisboa01
12 iCubNancy01
13 iCubPargue01
14 iCubShanghai01
15 iCubShenzhen01
16 iCubSingapore01
17 iCubTemplates
18 iCubValparaiso01
19 iCubWaterloo01
20 iCubZagreb01

cc @isorrentino @marcoaccame @Nicogene

Copy link
Member

@pattacini pattacini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sgiraz

To guarantee back-compatibility, we need to make sure that the values of viscousPos and viscousNeg equate to the values of kbemf1. This is true for most of the robots but NOT for those where kbemef <> 0.

Thus, there are robots requiring a fix.

Footnotes

  1. See https://github.com/robotology/icub-firmware/pull/410/files.

- viscouPos and viscousNeg have the same values of kbemf
@sgiraz
Copy link
Contributor Author

sgiraz commented Dec 12, 2023

To guarantee back-compatibility, we need to make sure that the values of viscousPos and viscousNeg must equate the values of kbemf1. This is true for most of the robots but NOT for those where kbemef <> 0.

Hi @pattacini,

Changes applied! Thanks for your feedback.

Copy link
Member

@pattacini pattacini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @sgiraz!

I'll wait a bit for @isorrentino and/or @GiulioRomualdi to check the changes for ergoCub before merging.

@pattacini
Copy link
Member

/remind December 18, merge the PR.

Copy link

octo-reminder bot commented Dec 13, 2023

Reminder
Monday, December 18, 2023 10:00 AM (GMT+01:00)

, merge the PR.

@isorrentino
Copy link
Contributor

The modifications seem okay. Obviously, the parameters provided are not the ones that make the joints work in torque, but with those values we are confident that nothing will happen if the torque control is activated.

@pattacini pattacini merged commit 2c54472 into robotology:devel Dec 13, 2023
1 check passed
Copy link

octo-reminder bot commented Dec 18, 2023

🔔 @pattacini

, merge the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants