-
Notifications
You must be signed in to change notification settings - Fork 384
[Admittance] applies control frame transform to mass matrix #1139
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
base: master
Are you sure you want to change the base?
[Admittance] applies control frame transform to mass matrix #1139
Conversation
Maybe @pac48 can comment on this? |
Any update on this? |
@MarcoMagriDev Can the math be simplified? For example
We can distribute
|
@pac48 yes i think we can. Here is the complete reasoning behind:
Should I update the PR with this modification? |
@MarcoMagriDev Yes, I think it will reduce unnecessary computation and make the math more clear. Currently, each vector is rotated into the control frame, multiplied by the matrix, then rotated back to the base frame. It makes sense to do the math in the control frame and only rotate back to the base frame as the last step. |
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
@MarcoMagriDev Could you address the last request please? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1139 +/- ##
==========================================
- Coverage 85.22% 85.21% -0.02%
==========================================
Files 127 127
Lines 12006 12015 +9
Branches 1010 1010
==========================================
+ Hits 10232 10238 +6
- Misses 1458 1460 +2
- Partials 316 317 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
@christophfroehlich I just pushed a new commit that should address the request from @pac48. Not entirely sure if it aligns perfectly with what was expected — happy to discuss and adjust it further if needed! |
// Compute admittance control law in the base frame: F = M*x_ddot + D*x_dot + K*x | ||
Eigen::Matrix<double, 6, 1> X_ddot = | ||
admittance_state.mass_inv.cwiseProduct(F_base - D * X_dot - K * X); | ||
Eigen::Matrix<double, 6, 1> X_ddot = rot_base_control_6d * M_inv * | ||
(F_control - D * rot_base_control_6d.transpose() * X_dot - | ||
K * rot_base_control_6d.transpose() * X); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but it might be a good idea to update the comment "F = Mx_ddot + Dx_dot + K*x"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarcoMagriDev could you fix the comment as requested please?
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
In admittance control mass matrix is not transformed to the control frame. This will reflect in two main issues:
damping_ratio
under assumption that mass and stiffness are in the same reference frame but this at the end is not the case (mass in base and stiffness in control). This (I think) may cause an under/over-damped behavior if the masses of the two involved axis (x
andz
in the example) has very different values.How to reproduce
For simplicity, suppose to be in a configuration with the

control_frame
having thez
axis coincident with thex
axis of robot base like the following:The admittance controller is configured with the following admittance parameters:
Now, faking force readings we are able to make the robot move due to compliance:
Changing the value of the parameter
admittance.mass
to [1.0, 1.0, 100.0, 0.05, 0.05, 0.05] and repeating the previous experiment should end up in ashorter
motion performed by the TCP but this is not the case. Instead, by settingadmittance.mass
to [100.0, 1.0, 1.0, 0.05, 0.05, 0.05] the motion amplitude is reduced.The effect of the missing transformation can be seen clearly in this case due to the selected configuration and since we are exasperating asymmetry in desired masses.
Proposed solution
Apply the same operations done for
stiffness
anddamping
also to themass_inv
Note: what about defining a new method or lambda function to avoid to repeat the same code for each matrix? Let me know so that I can open a new PR for that