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

How to Tune Parameters for Velocity Controller #719

Closed
1 task done
Yeesha-R opened this issue Aug 15, 2024 · 1 comment
Closed
1 task done

How to Tune Parameters for Velocity Controller #719

Yeesha-R opened this issue Aug 15, 2024 · 1 comment

Comments

@Yeesha-R
Copy link

Yeesha-R commented Aug 15, 2024

Affected ROS Driver version(s)

ROS noetic

Used ROS distribution.

Noetic

Which combination of platform is the ROS driver running on.

Linux with realtime patch

How is the UR ROS Driver installed.

Build both the ROS driver and UR Client Library from source

Which robot platform is the driver connected to.

UR E-series robot, Real robot

Robot SW / URSim version(s)

5.12.4

How is the ROS driver used.

Through the robot teach pendant using External Control URCap

Issue details

Summary

I want to reduce the stiffness of my robot joints by tuning the PID values of the controller.

Issue details

I am controlling my UR5e robot arm with ROS.
I tried to modify the proportional (P) values within the scaled_vel_joint_traj_controller in my .yaml file (see the code below).

scaled_vel_joint_traj_controller:
   type: velocity_controllers/ScaledJointTrajectoryController
   joints: *robot_joints
   constraints:
      goal_time: 0.6
      stopped_velocity_tolerance: 0.05
      shoulder_pan_joint: {trajectory: 0.1, goal: 0.1}
      shoulder_lift_joint: {trajectory: 0.1, goal: 0.1}
      elbow_joint: {trajectory: 0.1, goal: 0.1}
      wrist_1_joint: {trajectory: 0.1, goal: 0.1}
      wrist_2_joint: {trajectory: 0.1, goal: 0.1}
      wrist_3_joint: {trajectory: 0.1, goal: 0.1}
   gains:
      #!!These values have not been optimized!!
      shoulder_pan_joint:  {p: 5.0,  i: 0.05, d: 0.1, i_clamp: 1}
      shoulder_lift_joint: {p: 5.0,  i: 0.05, d: 0.1, i_clamp: 1}
      elbow_joint:         {p: 5.0,  i: 0.05, d: 0.1, i_clamp: 1}
      wrist_1_joint:       {p: 5.0,  i: 0.05, d: 0.1, i_clamp: 1}
      wrist_2_joint:       {p: 5.0,  i: 0.05, d: 0.1, i_clamp: 1}
      wrist_3_joint:       {p: 5.0,  i: 0.05, d: 0.1, i_clamp: 1}
   # Use a feedforward term to reduce the size of PID gains
   velocity_ff:
      shoulder_pan_joint: 1.0
      shoulder_lift_joint: 1.0
      elbow_joint: 1.0
      wrist_1_joint: 1.0
      wrist_2_joint: 1.0
      wrist_3_joint: 1.0
   stop_trajectory_duration: 0.5
   state_publish_rate: *loop_hz
   action_monitor_rate: 20

Initially, I increased the P value of the shoulder_pan_joint to 6.0, which caused the controller to produce some noise. I then changed the P value back to the default value of 5.0. Afterwards, I experimented with random values between 3.0 and 6.5, and the noise stopped, but the stiffness of the base joint did not change. Additionally, I updated the transmission_hw_interface in the .xacro file to EffortJointInterface using the following line
transmission_hw_interface:=hardware_interface/EffortJointInterface

My questions are:

  1. Is it possible to include PID tuning in the scaled_pos_joint_traj_controller?

  2. How can I effectively reduce the stiffness of the joints? I am particularly interested in reducing the stiffness when the robot is in freedrive mode.

  3. How can I effectively tune the PID values to achieve my goal of reducing the joint stiffness?

Thank you.

Relevant log output

No response

Accept Public visibility

  • I agree to make this context public
@fmauch
Copy link
Collaborator

fmauch commented Sep 4, 2024

  1. Is it possible to include PID tuning in the scaled_pos_joint_traj_controller?

I'm not sure what you mean by that. It is definitively possible to change the values, as you did, but that will also definitively have side-effects, as you experienced.

  1. How can I effectively reduce the stiffness of the joints? I am particularly interested in reducing the stiffness when the robot is in freedrive mode.

Reducing stiffness in the freedrive is not possible to my knowledge. (It isn't even activatable from ROS at the moment, see #573).

I don't really see a relation of that to the velocity-based trajectory controller.

  1. How can I effectively tune the PID values to achieve my goal of reducing the joint stiffness?

I think the above answers answer that already.

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

No branches or pull requests

2 participants