roboticslab-uc3m / yarp-devices

A place for YARP devices
https://robots.uc3m.es/yarp-devices/
9 stars 7 forks source link

Implement yarp::dev::ICurrentControl #187

Closed AlvaroMartinezR closed 5 years ago

AlvaroMartinezR commented 6 years ago

When trying to diagnose the problems with the gait of TEO, @munozyanez and me encountered the new functions of YARP for current control. This is a reminder for @jgvictores

AlvaroMartinezR commented 6 years ago

Even though we have the getTorque functions, @jgvictores thought it was necessary. Documentation: http://www.yarp.it/ICurrentControl_8h_source.html

jgvictores commented 6 years ago

Renamed as Think about, adding low priority status. Similar to #157

PeterBowman commented 6 years ago

Loosely related: the yarp::dev::ITorqueControl interface provides access to internal motor parameters (setter, getter). Available: bemf (back electromotive force), bemf_scale, ktau, ktau_scale (via yarp::dev::MotorTorqueParameters).

PeterBowman commented 5 years ago

Note: we set torques via setRefTorque (conveniently expressed in terms of motor current here), but getTorque reads motor current (ref).

jgvictores commented 5 years ago

Note: we set torques via setRefTorque (conveniently expressed in terms of motor current here), but getTorque reads motor current (ref).

True. I was aware of this fact but never documented it, sorry. ^^ We can estimate the torque via the instantaneous current consumption and the motor constant K. On a side note, I recall on the iCub they had a separate module based on iKin/iDyn to estimate torques applied on joints given joint positions and measurements from a f/t sensor (setup similar to ours).

PeterBowman commented 5 years ago

Note to self: split torque and current commands added at https://github.com/roboticslab-uc3m/yarp-devices/commit/89e22a7a896ce48ea82dd3791ab94b08b39e0a2f.

PeterBowman commented 5 years ago

On start, frontal leg joints move sidewards. This is caused by a 0.5 A offset configured in the current controller, intended for gravity compensation. Such value can be accessed in EasySetup, drive setup window, current controller section, "Tune" option. This setting needs to be disabled.

PeterBowman commented 5 years ago

Another note to self: query the iPOS drive for its peak current on device start. This value is immutable, drive-dependent and is involved in the conversion from and to internal current units.

PeterBowman commented 5 years ago

All done at https://github.com/roboticslab-uc3m/yarp-devices/commit/0484b8a1712d0eb33ed3bfc6ba3160260c749896.

jgvictores commented 5 years ago

@PeterBowman Thanks!!!