Experiment 5: Investigating the Effect of Control on Cobot-C1 Stiffness

Explore how proportional (Kp) and derivative (Kd) control gains, along with torque cutoff adjustments, influence the stiffness and dynamic response of a collaborative robotic arm.

Objectives

  • Understand how control gains affect robot stiffness and compliance
  • Investigate the relationship between Kp, Kd, and robot dynamic response
  • Explore the safety implications of torque cutoff mechanisms
  • Develop practical experience in control parameter tuning
  • Analyze the trade-offs between stiffness, stability, and safety

Key Concepts

  • Proportional Gain (Kp): Controls response to position errors and determines stiffness
  • Derivative Gain (Kd): Controls response to velocity errors and manages damping
  • Torque Cutoff: Safety mechanism that limits maximum torque
  • Robot Stiffness: Resistance to external forces
  • Robot Compliance: Ability to yield to external forces
  • PD Control Law: Mathematical framework for position and velocity control
  • Stability vs. Responsiveness: Trade-offs in gain tuning for collaborative robots

Theory

Control Law Fundamentals

In robot control, especially for collaborative robots using position or torque controllers, the control law can be represented as:

τc = Kp(qd - q) + Kd(q̇d - q̇)

Where:

  • τc: Commanded joint torque vector
  • Kp: Proportional gain matrix/scalar (controls response to position errors)
  • Kd: Derivative gain matrix/scalar (controls response to velocity errors)
  • qd, q: Desired and actual joint positions
  • q̇d, q̇: Desired and actual joint velocities

Understanding Stiffness and Damping

Stiffness (Controlled by Kp)

Stiffness is mainly determined by Kp. Higher Kp values give a stiffer, more resistant robot that holds its position firmly against external forces. The robot will resist being moved from its commanded position.

  • High Kp: Robot feels rigid, strongly resists displacement
  • Low Kp: Robot feels compliant, easily moved by external forces

Damping (Controlled by Kd)

Damping is controlled by Kd. Higher Kd values reduce oscillations and create smoother motion by resisting velocity changes. However, overly high values can cause sluggish behavior and reduced responsiveness.

  • High Kd: Smooth motion, reduced oscillation, but potentially sluggish
  • Low Kd: Fast response, but may oscillate or overshoot

Torque Cutoff Safety Mechanism

The motor controller enforces a safety constraint:

τ = min(τc, τmax)

Where τmax is the maximum safe allowed torque. This ensures the robot never applies excessive or dangerous force even if the computed τc is large. This is critical for collaborative robotics applications where humans may interact with the robot.

Why This Matters for Collaborative Robots

Collaborative robots (cobots) are designed to work safely alongside humans. This requires careful balancing of:

  • Task Performance: Robot must be stiff enough to perform tasks accurately
  • Safety: Robot must be compliant enough to not injure humans on contact
  • Stability: Control must prevent oscillations and unpredictable behavior

Prerequisites

  • Preparation and verification of control software capable of adjusting Kp, Kd, and torque limits
  • Full connection and initialization of the Cobot-C1 robot within a cleared workspace
  • Availability of observation materials and data recording tools
  • Understanding of how to adjust controller gains safely
  • Knowledge of how to reset or recover the system in case of instability

Materials Required

  • Control software supporting Kp, Kd, and torque cutoff parameter changes
  • Linux workstation with Cobot-C1 interface
  • Safety barriers and supervision
  • Prepared observation worksheet
  • PlotJuggler (optional, for detailed data analysis)

Procedure

Pre-Experiment Preparation

  1. Ensure all robot connections and safety checks are complete
  2. Confirm you can adjust Kp, Kd, and torque cutoff in the control software
  3. Prepare a clear, safe workspace

Step 1: Launch the Gains Test Program

Open a terminal and navigate to the experiment directory:

cd dev/MRL/cobot-C1/src/cobo_control/src/Experiments python3 Gains_test.py

Step 2: View Current Gains

Follow terminal prompts; the code will display current (default) gains.

Step 3: Enter Gain Multipliers

When prompted, enter six values for Kp and Kd scaling multipliers (usually the same for each joint).

Example values:

  • Kp: 0.5 0.5 0.5 0.5 0.5 0.5
  • Kd: 0.7 0.7 0.7 0.7 0.7 0.7
Important: Start with conservative values (0.5-1.0 for Kp, 0.5-0.8 for Kd). Only change one parameter at a time to isolate effects.

Step 4: Observe Robot Behavior

The robot will move to the requested pose and hold while gains are active.

Step 5: Manual Testing

Manually press down on the Cobot's end-effector or logo to feel the degree of resistance (stiffness). Observe how the robot responds to your force.

What to Feel For:

  • Stiffness: How much force is required to move the robot?
  • Compliance: How easily does the robot yield to your force?
  • Oscillation: Does the robot shake or vibrate after you release it?
  • Recovery: How quickly does it return to the commanded position?

Step 6: Handle Unexpected Behavior

If the robot "falls down" or acts unexpectedly (likely due to torque cutoff):

  • Refer to manual for reset instructions
  • Reinitialize and repeat with different gain values

Step 7: Iterate

Change gain multipliers as desired for additional trials. Test at least 5 different combinations.

Step 8: Exit

When finished, press Ctrl+C to return to home position and reset gains to defaults.

Using PlotJuggler for Data Visualization

Monitor the following ROS topics using PlotJuggler:

  • /cobo/joint_state_act - Joint states (position, velocity, effort)
  • /cobo/motor_gain_multiplier - Current gain multiplier values

What to Monitor

Joint Position Stability

  • Joints should hold steady with proper gains
  • Oscillation or drift suggests poor settings

Effort (Torque) Trends

  • Higher gains often yield higher efforts
  • Spikes suggest torque limiter activation or instability

Velocity Behavior

  • Watch for oscillation or jitter at high gains
  • Lower gains should show less jitter

Correlate Gain Multiplier Changes

Confirm that entering new multipliers updates the gain plots in PlotJuggler.

Observation and Documentation

Record for Each Trial

  • Stiffness and compliance (subjective feel, 1-5 scale)
  • Damping or oscillation behavior (Yes/No)
  • Safety and stability observations
  • Only adjust one parameter at a time to isolate effects

Extract from PlotJuggler

  • Max Effort (/cobo/joint_state_act/effort): Peak joint torque in Nm
  • Max Velocity (/cobo/joint_state_act/velocity): Highest joint velocity in deg/s

Observation Table

TestKp ValueKd ValueStiffness (1-5)Oscillation (Y/N)Max Effort (Nm)Max Velocity (deg/s)Notes
1
2
3
4
5

Analysis and Reflection

After completing the experiment, analyze:

  • How does increasing Kp affect stiffness? What happens when Kp is too high or too low?
  • How does Kd affect oscillation and damping? What is the optimal range?
  • How does the torque cutoff affect performance? When does it activate?
  • What are the optimal gain settings that balance compliance and stability?
  • How would different applications (assembly vs. human interaction) require different settings?

Sources of Error and Precautions

Potential Sources of Error

  • Inaccurate recording of parameters/gains
  • Unintended collisions or external disturbances
  • Inconsistent manual force application during testing
  • Environmental factors (temperature, mechanical wear)

Safety Precautions

  • Increment parameters slowly; don't exceed safe limits
  • Workspace must be clear; avoid abrupt manipulations
  • Use barriers and supervision as needed
  • Stop immediately on erratic movement or unusual noise
  • Never set both Kp and Kd to very high values simultaneously
  • Always test new gain settings with low values first

Learning Outcomes

  • Understand the effect of controller gain parameters on robotic motion and stability
  • Recognize the relationship between gain selection, compliance, and safety in collaborative robots
  • Appreciate practical considerations involved in balancing stiffness and responsiveness
  • Identify trends linking gain parameters to observed behaviors in real experiments
  • Develop intuition for control parameter tuning in real robotic systems
Key Insight: In collaborative robotics, the "best" control gains are not necessarily those that provide the stiffest or fastest response, but those that balance task performance with human safety and comfort.

Suggested Gain Values for Testing

Test ScenarioKp MultiplierKd MultiplierExpected Behavior
Very Compliant0.30.5Very soft, easy to move
Moderately Compliant0.60.7Balanced compliance
Nominal1.01.0Default factory settings
Stiff1.30.9Rigid, holds position well
Very Stiff (Caution!)1.51.0Very rigid, may oscillate