ros-controls / ros_controllers

Generic robotic controllers to accompany ros_control
http://wiki.ros.org/ros_control
BSD 3-Clause "New" or "Revised" License
562 stars 525 forks source link

Enabling velocity feedforward is reducing max velocity planned by controller #409

Open ssnover95x opened 5 years ago

ssnover95x commented 5 years ago

I'm currently tuning some prismatic joint in order to speed them up so movements take less time. In doing so I've been configuring the PID terms and the velocity feed forward term of the controller, which is a velocity_controllers/JointTrajectoryController.

I found that changing the velocity feed forward term from 0 (disabled) to 1.0 with the same PID terms resulted in the initial step in the desired velocity value to change from 0.2 to 0.1 for the same change in position requested of each control configuration.

It's not clear to me why this is, it slows down the movement significantly. Is there a way to prevent it from doing this and planning to actually reach the joint's max velocity?

HasanFarag commented 4 years ago

@ssnover95x How do you disable and enable velocity feed forward term? since I did not think they edit that velocity feed forward term in the velocity_controllers?

commanded_velocity = pidcontroller.computeCommand(error, velerror, period); joint.setCommand(commanded_velocity);

It is not const double feed_fwd_vel = desired_state.velocity[i]; const double feedbackvel = pids[i]->computeCommand(error, vel_error, period); commanded_velocity= feed_fwd_vel + feedbackvel; joint.setCommand(commanded_velocity);