/youbot_tune_pid

source code to tune joint pid parameters for youbot arm

Primary LanguageC++

youBot_pid

==============

The default controller parameters from manufactory are not optimal, it leads to delay and overshoot in the motion. This repository contains source code to tune youbot arm pid parameters. The code has been developed under the following setup:

  • Ubuntu 14.04 with ROS-indigo

Before You Tune The PID Parameters!

In order to tune pid parameters for each joint, you will have to have a overview of cascade control loops for the KUKA youBot arm. You can find a description of the motor controller in the following link:

http://www.robocupatwork.org/download/RoboCup-At-Work_Camp_2012/RAW_Camp2012-Jan-Paulus_youBotAPI.pdf

Installation

Dependencies

yoBot driver:

sudo apt-get install ros-indigo-youbot-driver

The brics_actuator packages:

sudo apt-get install ros-insigo-brics-actuator

Additionally, you need an adapted version of the ros wrapper of the driver which you have to clone into the src folder of your catkin workspace

cd catkin_ws/src
git clone https://github.com/uzh-rpg/youbot_driver_ros_interface.git

this is an adapted version, which provides torque command interface.

youBot_Arm_configurator is used to configure parameters.

rqt_plot package is used to visualize responses.

sudo apt-get install ros-indigo-rqt-plot

Main Installation

You can download the source code by running

cd catkin_ws/src
git clone https://github.com/chaolmu/youbot_tune_pid.git

Then, you can simply compile it

cd catkin_ws
catkin_make

Basic Usage

Since it is a cascade controller, you have to start tuning with inner loop. It means current loop -> velocity loop -> position loop.

current loop

The current controller should be tested without moving the joint. PID parameters could be tuned with respect to step response. We normally use a simple I-controller for current loop. Disable arm calibration in youbot ros wrapper if you want joints stay (YouBotOODLWrapper.cpp line 154: calibrateManipulator()).

[WARNING]: You have to move the joint, which will be tested, to its stop manually after switch off motors per service: /arm_1/switchOffMotors and give the input in the direction that joint will not leave its stop. Otherwise hardware damage may occur!

[WARNING]: Joint 3 has opposite direction with compare to others.

Here are step response before and after tuning:

alt tag alt tag

velocity loop

To tuning parameters you have to disable ramp generator. The velocity controller could be tested with step response, the control loop can't be faster when it reaches max. acceleration. The following ability can be tested with trapezoid input.

A example before and after tuning:

alt tag alt tag

position loop

For position loop a simple P-controller will be regularly configured.

A example after tuning (ramp generator enabled): alt tag