robotology / robots-configuration

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

Add friction + coulomb + threshold parameters #599

Closed sgiraz closed 10 months ago

sgiraz commented 10 months ago

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:

# 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

sgiraz commented 10 months ago

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.

pattacini commented 10 months ago

/remind December 18, merge the PR.

octo-reminder[bot] commented 10 months ago

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

, merge the PR.

isorrentino commented 10 months ago

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.

octo-reminder[bot] commented 10 months ago

🔔 @pattacini

, merge the PR.