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

Sensorless torque estimation added to motor control #527

Open
wants to merge 5 commits into
base: devel
Choose a base branch
from

Conversation

ale-git
Copy link
Contributor

@ale-git ale-git commented Oct 22, 2024

The sensorless torque estimation is based on LuGre friction model, with code automatically generated.

@ale-git ale-git requested a review from marcoaccame October 22, 2024 12:39
@ale-git ale-git self-assigned this Oct 22, 2024
@pattacini
Copy link
Member

Hi @ale-git

This PR has to be updated following up on the most recent developments done in robotology/icub-firmware-models#97.

Also, conflicts need attention.

@@ -138,6 +138,12 @@ void JointSet_config //
o->Jjm = Jjm; o->Sjm = Sjm;
o->Jmj = Jmj; o->Smj = Smj;
o->Sje = Sje;

#if defined(SENSORLESS_TORQUE)
Copy link
Contributor

@marcoaccame marcoaccame Nov 8, 2024

Choose a reason for hiding this comment

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

Hi @ale-git what about making SENSORLESS_TORQUE a bool param transmitted by YRI? does it make sense?

If so, where to add it, maybe inside eOmc_LuGre_params_t?

Moreover eval if eOmc_LuGre_params_t is best placed inside eOmc_joint_config_t or eOmc_motor_config_t.

Then it will be function MController_config_motor() or MController_config_motor() that will manage the eOmc_LuGre_params_t.

Some of the above changes need a change of icub-firmware-shared as well.

@marcoaccame
Copy link
Contributor

Hi @ale-git pls see my previous comments and when ready mark the PR ready for review.

@@ -340,7 +340,7 @@
<MiscControls>-DxdebugNOicc -DxYRI_uses_MC_foc_actuator_descriptor_generic -DxuseMCfoc_actuator_descriptor_generic -Wno-pragma-pack -Wno-deprecated-register -DEMBOT_USE_rtos_osal -DIPAL_use_cfg2 -DUSE_EMBOT_theHandler -DUSE_EMBOT_theServices -DUSE_EMBOT_theServicesMC</MiscControls>
<Define>USE_ICC_COMM USE_EMBOT_HW EMBOBJ_USE_EMBOT USE_STM32HAL STM32HAL_BOARD_AMC STM32HAL_DRIVER_V1A0 WRIST_MK2</Define>
<Undefine></Undefine>
<IncludePath>..\..\..\..\..\libs\lowlevel\stm32hal\api;..\..\..\..\..\libs\highlevel\abslayer\osal\api;..\..\..\..\..\..\..\..\..\icub-firmware-shared\embot\core;..\..\..\..\..\embot\hw;..\..\..\..\..\embot\os;..\..\..\..\..\embot\app;..\..\..\..\..\libs\midware\eventviewer\api;..\..\..\..\..\libs\highlevel\abslayer\ipal\api;--..\..\..\..\..\libs\highlevel\abslayer\hal2\api;..\..\..\..\..\..\..\..\..\icub-firmware-shared\eth\embobj\core\core;..\..\..\..\..\embobj\core\exec\multitask;..\..\..\..\..\embobj\plus\ipnet;..\src\emb-env;..\..\..\..\..\..\..\..\..\icub-firmware-shared\embot\prot\eth;..\..\..\bsp;..\cfg;..\..\..\bsp\ethdriver;..\..\..\..\..\libs\highlevel\services\embenv\api;..\..\..\..\..\embobj\plus\embenv;..\..\..\..\..\libs\highlevel\abslayer\hal2\api;..\..\..\..\..\embobj\plus\ctrloop;..\..\..\..\..\..\..\..\..\icub-firmware-shared\eth\embobj\plus\comm-v2\icub;..\..\..\..\..\..\..\..\..\icub-firmware-shared\can\canProtocolLib;..\..\..\..\..\embot\app\eth;.;..\..\..\..\..\..\..\..\..\icub-firmware-shared\eth\embobj\plus\comm-v2\transport;..\..\..\..\..\..\..\..\..\icub-firmware-shared\eth\embobj\plus\comm-v2\protocol\api;..\cfg\protocol\rop;..\..\..\..\..\embobj\plus\can;..\..\..\..\ems004\appl\v2\src\eoappservices;..\..\..\..\..\embobj\plus\board;..\..\..\..\..\..\..\..\..\icub-firmware-shared\embot\tools;..\..\..\..\..\mbd\kalman_filter;..\..\..\..\..\embobj\plus\mc;..\..\..\..\..\libs\midware\hl-plus\api;..\..\..\..\..\embot\prot\can;..\..\..\..\..\mbd\wrist_decoupler</IncludePath>
<IncludePath>..\..\..\..\..\libs\lowlevel\stm32hal\api;..\..\..\..\..\libs\highlevel\abslayer\osal\api;..\..\..\..\..\..\..\..\..\icub-firmware-shared\embot\core;..\..\..\..\..\embot\hw;..\..\..\..\..\embot\os;..\..\..\..\..\embot\app;..\..\..\..\..\libs\midware\eventviewer\api;..\..\..\..\..\libs\highlevel\abslayer\ipal\api;--..\..\..\..\..\libs\highlevel\abslayer\hal2\api;..\..\..\..\..\..\..\..\..\icub-firmware-shared\eth\embobj\core\core;..\..\..\..\..\embobj\core\exec\multitask;..\..\..\..\..\embobj\plus\ipnet;..\src\emb-env;..\..\..\..\..\..\..\..\..\icub-firmware-shared\embot\prot\eth;..\..\..\bsp;..\cfg;..\..\..\bsp\ethdriver;..\..\..\..\..\libs\highlevel\services\embenv\api;..\..\..\..\..\embobj\plus\embenv;..\..\..\..\..\libs\highlevel\abslayer\hal2\api;..\..\..\..\..\embobj\plus\ctrloop;..\..\..\..\..\..\..\..\..\icub-firmware-shared\eth\embobj\plus\comm-v2\icub;..\..\..\..\..\..\..\..\..\icub-firmware-shared\can\canProtocolLib;..\..\..\..\..\embot\app\eth;.;..\..\..\..\..\..\..\..\..\icub-firmware-shared\eth\embobj\plus\comm-v2\transport;..\..\..\..\..\..\..\..\..\icub-firmware-shared\eth\embobj\plus\comm-v2\protocol\api;..\cfg\protocol\rop;..\..\..\..\..\embobj\plus\can;..\..\..\..\ems004\appl\v2\src\eoappservices;..\..\..\..\..\embobj\plus\board;..\..\..\..\..\..\..\..\..\icub-firmware-shared\embot\tools;..\..\..\..\..\mbd\kalman_filter;..\..\..\..\..\embobj\plus\mc;..\..\..\..\..\libs\midware\hl-plus\api;..\..\..\..\..\embot\prot\can;..\..\..\..\..\mbd\wrist_decoupler;..\..\..\..\..\mbd\torque_estimator</IncludePath>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a clarification: the project of the amc in here contains TorqueEstimator.cpp but it does not use it because SENSORLESS_TORQUE is not defined. It can be OK.

Copy link
Contributor

@marcoaccame marcoaccame left a comment

Choose a reason for hiding this comment

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

The PR is fine.

But before merging let's wait:

@ale-git ale-git force-pushed the sensorless-torque branch 2 times, most recently from 589a207 to 7e6fcf6 Compare November 19, 2024 15:31
ale-git added a commit to ale-git/icub-firmware-build that referenced this pull request Nov 19, 2024
Added LuGre friction model for sensorless torque estimation.

Built on
- robotology/icub-firmware#527
- robotology/icub-firmware-shared#99
@ale-git ale-git marked this pull request as ready for review November 20, 2024 09:56
And alternative experimental torque control function is added in Motor.c
- LuGre model configuration moved to motor configuration
- callbacks for independent configuration removed

Coupled jointset management.
@ale-git
Copy link
Contributor Author

ale-git commented Dec 24, 2024

I've rebased and updated the version, ready for merge.

ale-git added a commit to ale-git/icub-firmware-build that referenced this pull request Dec 24, 2024
@pattacini
Copy link
Member

Hi @marcoaccame
Can we merge this PR?

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

Successfully merging this pull request may close these issues.

3 participants