-
Notifications
You must be signed in to change notification settings - Fork 30
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
Friction model coulomb + viscous cannot be used without rebuilding the firmware #396
Comments
@sgiraz, would you mind taking care of this? |
Hi guys, Ok, I can start working on it in the next sprint (Monday 24th) |
A quick update on this activity. As we aim to streamline the code and get only one FW capable of dealing with the entire pool of robots, we foresee to:
This activity will commence this week and will be most likely completed the next sprint. |
Hi guys, I have some updates about this issue. Configuration file changesHere is a snippet example of the configuration file I used to test the new <!-- custom PIDs: begin -->
<group name="TRQ_PID_OUTPUT_CURR">
<param name="controlLaw"> torque </param>
<param name="outputType"> current </param>
<param name="fbkControlUnits"> metric_units </param>
<param name="outputControlUnits"> machine_units </param>
<param name="kp"> 0 </param>
<param name="kd"> 0 </param>
<param name="ki"> 0 </param>
<param name="maxOutput"> 2500 </param>
<param name="maxInt"> 200 </param>
<param name="ko"> 0 </param>
<param name="stictionUp"> 0 </param>
<param name="stictionDown"> 0 </param>
<param name="viscousPos"> 96 </param>
<param name="viscousNeg"> 97 </param>
<param name="coulombPos"> 98 </param>
<param name="coulombNeg"> 99 </param>
+ <param name="threshold"> 11 </param>
<param name="kff"> 1 </param>
- <param name="kbemf"> 0.00 </param>
<param name="filterType"> 0 </param>
<param name="ktau"> 50.0 </param>
</group> icub-main: eomcParserAfter the required changes, as we can see from the image below the icub-firmware-shared:A new threshold parameter has been added to the typedef struct
{
float32_t viscous_pos_val;
float32_t viscous_neg_val;
float32_t coulomb_pos_val;
float32_t coulomb_neg_val;
+ float32_t threshold_val;
} eOmc_FrictionParams_t; EO_VERIFYsizeof(eOmc_FrictionParams_t, 20) icub-firmware:The new parameter reaches correctly the FW level: the USE_VISCOUS_COULOMB macros have been removed and the body of the PID_do_friction_comp has been improved: float PID_do_friction_comp(PID *o, float32_t vel_fbk, float32_t trq_ref)
{
const float32_t MICRO { 1000000.0 };
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->threshold_val)
{
return o->Ktau*(-coulomb_neg_converted + viscous_neg + o->Kff*trq_ref);
}
else if (vel_fbk > o->threshold_val)
{
return o->Ktau*(coulomb_pos_converted + viscous_pos + o->Kff*trq_ref);
}
else
{
return o->Ktau*(o->Kff*trq_ref);
}
} What to do now:
|
Nice! Now that I look at the table of parameters I feel that Also, we should check the units of the new param ahead of the tests. |
Hi @pattacini, I agree with you, I just changed the name of the variable to Now, I proceed to remove the old cc @isorrentino |
This doesn't necessarily imply that we must stick to Then, when undecided or when there are no clear benefits, it's always better to go for more standard units. Important Also, once we pick the units, we need to check whether typical user values for this parameter can be transmitted with the least loss of precision. In this latter respect, |
Hi @isorrentino, Do you believe that We can use
cc @Nicogene |
Then, I'd say that there's no problem with the transmitted precision of Also, If you confirm the latter, then there's a solid reason to stick to |
Hi @sgiraz , Remember that if your parameter is not mandatory, you should not increment the version. Thanks! |
Hi @valegagge, I haven't changed the
Where:
|
Since we decided to add the new Before merging all the repos, I would ask to @isorrentino to give a try on |
Remember that robots located in icebox will always stay unchanged. |
/remind 18 Sep Let's try the new parameter on |
⏰ Reminder
|
I think that leaving the old parameter might be confusing on the user side... |
I agree 👍🏻 |
@sgiraz |
|
Most likely to postpone to next week as ergoCub is going to show off during the IIT anniversary tomorrow. /remind September 26 Let's try the new parameter on ergoCub1.0 S/N:000 (cc @isorrentino @sgiraz @Nicogene) |
⏰ Reminder
|
|
Hi @isorrentino, When you are ready, you can start the tests on this activity. Just FYI, in order to build everything correctly you have to set the version of # Main project
project(
YARP
VERSION 3.9.0
LANGUAGES C CXX
) This is due to the requirement imposed by set(YARP_REQUIRED_VERSION 3.9.0) |
I tried to flash the firmware. I flashed only one board of the right leg (
The value of the parameter is taken from the previous implementation (the hardcoded one) and is in Then, I run the [INFO] EthResource::askBoardVersion() found BOARD right_leg-eb7-j4_5 @ IP 10.0.1.7 of type ems4 with FW = ver 3.73 built on 2023 Aug 29 12:30
[ERROR] EthResource::verifyEPprotocol() for ep = eoprot_endpoint_motioncontrol detected: pc104.version.minor = 25 and board.version.minor = 26
[ERROR] EthResource::verifyEPprotocol() detected mismatching protocol version.minor in BOARD right_leg-eb7-j4_5 with IP 10.0.1.7 for eoprot_endpoint_motioncontrol : annot proceed any further
[ERROR] ACTION REQUIRED: BOARD right_leg-eb7-j4_5 with IP 10.0.1.7 needs a FW update to offer services for eoprot_endpoint_motioncontrol
[ERROR] embObjMotionControl: failed verifyEPprotocol. Cannot continue!
[ERROR] |yarp.dev.PolyDriver|right_leg-eb7-j4_5-mc| Driver <embObjMotionControl> was found but could not open
[WARNING] Cannot open device right_leg-eb7-j4_5-mc
How can I easily solve this error? |
Hi @isorrentino @sgiraz is sick and thus unavailable for a while. This could potentially slow down the tests, but no problem in that sense. The message you reported seems to indicate a mismatch between the FW and the SW. For confirmation, are you also using the |
You are right, I did not recompile |
Perhaps, the best option would be to flash the boards of one entire leg and launch that part only from the Just to get aligned on the things to use:
If this test fails for whatever reason, we can wait for @sgiraz. |
Thank you for the recap. I hope we already have the config file to run only one leg. I'll test this as soon as I have a new slot on the robot. |
Today, I flashed e rebuilt everything reported in #396 (comment). Nevertheless, flashing only the right leg as suggested in #396 (comment)
does not allow to test the friction compensation. Indeed, if we do not run the full robot, we do not have Furthermore, I do not see the new parameter I tried to flash all the EMS boards and start the robot with the usual config file but there are several errors due to incompatible firmware versions. Here the log: |
Hi @isorrentino @sgiraz has recovered and can now follow up on this. |
Hi @isorrentino,
The change has been applied in https://github.com/sgiraz/yarp/blob/81b7f3c0a52f574912bf6c953f927a8e2710b1c7/src/yarpmotorgui/piddlg.ui#L939-L943 Anyway, tomorrow I'll try to verify if there is some kind of mistake about it.
As indicated in the log posted, there is a misalignment between the 2019,134514 <ERROR> EthResource::verifyEPprotocol() for ep = eoprot_endpoint_motioncontrol detected: pc104.version.minor = 26 and board.version.minor = 25
2019,134519 <ERROR> ACTION REQUIRED: BOARD head-eb20-j0_1 with IP 10.0.1.20 needs a FW update to offer services for eoprot_endpoint_motioncontrol To be sure, I can try to regenerate and provide you with the binaries for all the ETH boards. Meanwhile, I recommend verifying that you have the correct versions of |
Hi @isorrentino, Today I found a bug in I just dropped a new PR in You can wait the merge or use my fork for your tests. Anyway, I also regenerated all the binaries for the ETH boards as mentioned above. See the PR updated: Unfortunately I cannot test the torque control mode with our setup due to a missing HW configuration. Thanks to @MSECode for the support with By the way, you shouldn't have any problem on the robot. Let me know. |
So, it seems that it's difficult to test the torque mode in action on a setup, while we tested that the information is delivered to the FW correctly.
This could be problematic these days, given the robot agenda. |
Hi guys, I want to drop here just a quick update. is caused by a preliminary check at FW level from the if (WatchDog_check_expired(&o->trq_fbk_wdog))
{
o->trq_fbk = ZERO;
o->trq_ref = ZERO;
o->trq_err = ZERO;
if (o->trq_control_active)
{
o->fault_state.bits.torque_sensor_timeout = TRUE;
o->control_mode = eomc_controlmode_hwFault;
}
} The watchdog on the WatchDog_set_base_time_msec(&o->trq_fbk_wdog, 2*DEFAULT_WATCHDOG_TIME_MSEC); And it expires because no feedback is provided by the motion controller void Joint_update_torque_fbk(Joint* o, CTRL_UNITS trq_fbk)
{
o->trq_fbk = trq_fbk;
WatchDog_rearm(&o->trq_fbk_wdog);
} Please, @valegagge, feel free to correct me if I made some mistakes or if you want to add further details. As of now, in order to use the torque control mode we need to run the |
as it is meant to be: if the board does not receive torque values cannot work in that mode. and it is |
Hi @sgiraz , So, currently, you need |
Thanks for your confirmation @valegagge. @isorrentino, I'm pretty sure that
Feel free to book the robot to test the new feature requested. Let me know if you need any help on this. cc @Nicogene |
I've booked the robot for Monday the 13th, from 2 pm to 5 pm. @sgiraz. if you are available let's run the tests together so that you are already there in case of any issues or questions. Thanks. |
I had an offline discussion with @sgiraz. Unfortunately, he won't be available on Monday. Nevertheless, I plan to proceed with the tests independently. I've asked @sgiraz to summarize the required robot configuration details (YARP, icub-main versions, and configuration file modifications). This time I'm going to flash all the boards of |
Branches to use per each repo:
With this configuration I get the following error when I run the [INFO] EthResource::askBoardVersion() found BOARD head-eb20-j0_1 @ IP 10.0.1.20 of type mc4plus with FW = ver 3.75 built on 2023 Jul 31 11:30
[ERROR] EthResource::verifyEPprotocol() for ep = eoprot_endpoint_motioncontrol detected: pc104.version.minor = 26 and board.version.minor = 25
[ERROR] EthResource::verifyEPprotocol() detected mismatching protocol version.minor in BOARD head-eb20-j0_1 with IP 10.0.1.20 for eoprot_endpoint_motioncontrol : annot proceed any further
[ERROR] ACTION REQUIRED: BOARD head-eb20-j0_1 with IP 10.0.1.20 needs a FW update to offer services for eoprot_endpoint_motioncontrol
[ERROR] embObjMotionControl: failed verifyEPprotocol. Cannot continue!
[ERROR] |yarp.dev.PolyDriver|head-eb20-j0_1-mc| Driver <embObjMotionControl> was found but could not open
|
To cut this short, we ought to arrange for a shared session on the robot. |
I've booked |
Today @isorrentino and I tested successfully both the new SW and FW on As you can see in the last row of the PID table, there is the new Note Although some quick friction compensation tests provided unexpected results, it's important to consider that these tests differed from previous tests conducted by @isorrentino on cc @Nicogene |
Well done! |
As agreed during the review meeting, next week I'm going to open a PR on robots-configuration@devel in order to apply the changes as described in #396 (comment). |
Hi all, I started to use the coulomb + viscous model for the friction compensation on ergoCub. In order to use it I had to rebuild the firmware and flash the boards of the robot. It would be nice to have the possibility to choose it without rebuilding the firmware.
cc @DanielePucci @sgiraz @marcoaccame @pattacini
The text was updated successfully, but these errors were encountered: