diff_drive_controller oscillates with jerk limits

asked 2021-07-13 14:14:28 -0600

PaddyCube gravatar image

updated 2021-07-13 14:15:48 -0600

Hello community,

I use diff_drive_controller for a 2-wheeled robot. Until now only teleop to ease things and get the basics done.

When I use jerk limits, acceleration seems to fit but when robot should stop (linear velocity = 0.0m/s), it starts to oscillate forward/backward for a huge amount of time. My first idea was bad PID settings. But I wasn't able to tune them so I tried without any PID. Even in this case, it oscillate (see pictures). image description image description

If I disable jerk_limits, it works correct and robot stops after de-acceleration. Any idea whats wrong here? I added some plots containing the cmd_vel I send to controller and the output cmd of one wheel. In all cases, I set linear velocity to 1m/s. image description

Any ideas what's wrong here?

    hoverboard_joint_publisher:
  type: "joint_state_controller/JointStateController"
  publish_rate: 50
  left_wheel  : 'left_wheel'
  right_wheel : 'right_wheel'

hoverboard_velocity_controller:
  type        : "diff_drive_controller/DiffDriveController"
  left_wheel  : 'left_wheel'
  right_wheel : 'right_wheel'
  publish_rate: 50.0               # default: 50
  pose_covariance_diagonal : [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
  twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]

  # Wheel separation and diameter. These are both optional.
  # diff_drive_controller will attempt to read either one or both from the
  # URDF if not specified as a parameter
  wheel_separation : 0.32
  wheel_radius : 0.0825

  # Wheel separation and radius multipliers
  wheel_separation_multiplier: 1.0 # default: 1.0
  wheel_radius_multiplier    : 1.0 # default: 1.0

  # Velocity commands timeout [s], default 0.5
  cmd_vel_timeout: 0.5

  # Base frame_id
  base_frame_id: base_footprint #default: base_link
  allow_multiple_cmd_vel_publishers: true
  odom_frame_id: '/raw_odom'
  enable_odom_tf: false

  # Velocity and acceleration limits
  # Whenever a min_* is unspecified, default to -max_*
  linear:
    x:
      has_velocity_limits    : true
      max_velocity           : 1.0  # m/s
      has_acceleration_limits: true
      max_acceleration       : 0.5  # m/s^2
      has_jerk_limits        : true
      max_jerk               : 0.1  # m/s^3
  angular:
    z:
      has_velocity_limits    : true # was true
      max_velocity           : 6.28  # rad/s
      has_acceleration_limits: true # was true
      max_acceleration       : 3.14  # rad/s^2
      has_jerk_limits        : true
      max_jerk               : 3.14  # rad/s^3
edit retag flag offensive close merge delete

Comments

Something to note (also in relation to your previous #q382088): the "limits" here are hard, saturation type limits. They'll be used to implement a cut-off of the incoming signal.

You seem to be looking for a ramp-up/down behaviour, which is not what I believe the diff_drive_controller implements.

Packages like yocs_velocity_smoother are used for ramping up and down (be sure to check the kinetic tab for more extensive documentation).

gvdhoorn gravatar image gvdhoorn  ( 2021-07-14 04:54:32 -0600 )edit