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

[joint-torque-controller] velocity feedback in torque controller #38

Closed
wants to merge 0 commits into from

Conversation

proyan
Copy link
Member

@proyan proyan commented Oct 20, 2017

Adds velocity feedback term in joint-torque-controller.
Currently uses linear interpolation of ddq_des and dq to perform runge-kutta integration of ddq_motor

Deals with #37

DECLARE_SIGNAL_OUT(torque_error_integral, dynamicgraph::Vector); /// integral of the torque tracking error
DECLARE_SIGNAL_OUT(smoothSignDq, dynamicgraph::Vector); /// smooth approximation of sign(dq)
DECLARE_SIGNAL_INNER(dq_motor, dynamicgraph::Vector);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would declare dq_motor as an output signal so that we can plot it for debugging

const Eigen::VectorXd& dq_prev = buffer_dq;
Eigen::VectorXd& dq_motor = buffer_dq_motor;

//Runge Kutta integration y:=dq_motor; dy=f(t,y); y(n) = y_n
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did you feel it was necessary to use a RK4 integration scheme? I think a straightforward Euler integration would do the job just as well, while making the code easier to read.

@@ -266,6 +269,7 @@ def create_balance_controller(robot, conf, motor_params, dt, robot_name='robot')
plug(robot.estimator_ft.contactWrenchRightSole, ctrl.wrench_right_foot);
plug(robot.estimator_ft.contactWrenchLeftSole, ctrl.wrench_left_foot);
plug(ctrl.tau_des, robot.torque_ctrl.jointsTorquesDesired);
plug(ctrl.dv_des, robot.torque_ctrl.jointsAccelerationsDesired);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually dv_des contains also the base accelerations, which should not appear in jointAccelerationsDesired!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Reading the code below I see that actually you take only the last nbJoints values of the signal jointsAccelerationsDesired, so the behavior of the system is correct. In this, the problem is just the name of the signal jointsAccelerationsDesired that is not correct. I suggest to call it dv_des, as the output signal of the balance controller.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since the integration scheme is to be applied only to the joint accelerations and not to the base acceleration, I think your earlier comment might be more suitable. I'll change the size to NJ in the code and use vector selector to plug the required parts from ctrl.dv_des.

@proyan proyan force-pushed the devel branch 2 times, most recently from 9652f7d to d0f1fc9 Compare October 30, 2017 19:33
@andreadelprete
Copy link
Collaborator

Hi Rohan, did you manage to make this work in simulation? If not, maybe it's better to wait before merging...

@proyan
Copy link
Member Author

proyan commented Oct 30, 2017 via email

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.

2 participants