Ora

How to Calculate Robot Velocity?

Published in Robot Kinematics 5 mins read

Calculating robot velocity involves determining both its linear speed and the direction of its movement, as well as its rotational speed if it's turning. This process is fundamental to robot navigation, control, and interaction with its environment.

Understanding Velocity Basics

Velocity is a vector quantity, meaning it has both magnitude (speed) and direction. For robots, this can refer to how fast they are moving forward, backward, or sideways (linear velocity), and how fast they are rotating (angular velocity).

Linear Velocity Calculation

The most straightforward way to understand linear speed is by relating the distance traveled over a period of time.

  • Formula: The basic formula for linear speed is:
    $$v = \frac{d}{t}$$
    Where:

    • $v$ is the linear speed (e.g., meters per second, inches per second).
    • $d$ is the distance traveled (e.g., meters, inches).
    • $t$ is the time taken to travel that distance (e.g., seconds).
  • Practical Application for Robots:

    • Distance ($d$): Robots typically measure distance using sensors like wheel encoders. An encoder attached to a wheel counts revolutions, which can then be converted into linear distance based on the wheel's circumference ($d = \text{number of revolutions} \times \pi \times \text{wheel diameter}$).
    • Time ($t$): This is measured by the robot's internal clock or control system, often at a fixed sampling rate.

    Example: If a robot's wheel has a diameter of 0.1 meters and its encoder registers 10 revolutions in 2 seconds, the distance traveled by the wheel is $10 \times \pi \times 0.1 \approx 3.14$ meters. Its linear speed would then be $3.14 \text{ m} / 2 \text{ s} = 1.57 \text{ m/s}$.

Angular Velocity Calculation

Angular velocity refers to how fast an object is rotating or changing its orientation. This is crucial for robots that need to turn or move along curved paths.

  • Formula: Angular velocity ($\omega$) is defined as the rate of change of an angle over time. Its relationship to linear speed ($v$) for circular motion is:
    $$v = \omega \cdot r$$
    Where:

    • $v$ is the linear speed of a point on the circular path (e.g., m/s).
    • $\omega$ (omega) is the angular speed (in radians per unit of time, e.g., radians/second).
    • $r$ is the radius of the circular path (e.g., meters).
  • Practical Application for Robots:

    • Wheel-Based Robots: For a robot turning, its wheels might move at different linear speeds. The difference in these speeds can be used to calculate the robot's angular velocity around its instantaneous center of rotation.
    • Direct Measurement: Sensors like gyroscopes within an Inertial Measurement Unit (IMU) can directly measure a robot's angular velocity.
    • Deriving Angular Speed ($\omega$): If you know the linear speed ($v$) of a point on the robot and the radius ($r$) of its turn, you can calculate angular speed as $\omega = v/r$. For a robot's wheel rotating, $r$ is the wheel's radius and $v$ is the linear speed of the wheel's contact point with the ground.

    Example: If a robot is turning in a circle with a radius of 0.5 meters, and a point on its outer edge is moving at a linear speed of 0.75 m/s, its angular speed would be $0.75 \text{ m/s} / 0.5 \text{ m} = 1.5 \text{ rad/s}$.

Combining Linear and Angular Velocity for Complex Motion

Many robots, especially wheeled mobile robots like differential drive or omnidirectional robots, exhibit both linear and angular motion simultaneously. Their overall velocity is a combination of these.

  • Differential Drive Robots: These robots use two independent wheels to steer. By controlling the speed of each wheel, they can move straight (both wheels same speed), turn (wheels different speeds), or pivot (wheels opposite speeds).

    • The linear velocity of the robot's center is often the average of the two wheel speeds.
    • The angular velocity is proportional to the difference in wheel speeds, divided by the distance between the wheels (wheelbase).
  • Odometry: A common technique to estimate a robot's position and velocity is odometry, which integrates wheel encoder data over time. By knowing how far each wheel has turned, the robot can infer its change in linear and angular position, and thus its velocity.

Key Sensors for Velocity Calculation

Sensor Type Measurement How it Contributes to Velocity Calculation
Wheel Encoders Rotational position/speed of wheels Primary source for linear distance and, consequently, linear velocity.
IMU (Gyroscope) Angular velocity around an axis Directly measures robot's rotation rate for angular velocity.
IMU (Accelerometer) Linear acceleration Can be integrated to estimate velocity, but prone to drift over time.
LIDAR/Vision (SLAM) Environmental mapping & robot pose (position and orientation) Can track robot's pose changes over time to infer both linear and angular velocity.
GPS Global position Provides velocity information for outdoor robots, but with lower accuracy and update rates than local sensors.

Practical Considerations and Tips

  • Sensor Fusion: For robust velocity estimation, robots often combine data from multiple sensors (e.g., encoders and IMUs) using techniques like a Kalman filter. This helps to compensate for individual sensor limitations and errors.
  • Slippage: Wheel encoders assume perfect traction. If wheels slip on the surface, the calculated velocity will be inaccurate. Sensor fusion helps mitigate this.
  • Sampling Rate: The frequency at which sensor data is read and processed impacts the accuracy and responsiveness of velocity calculations. Higher sampling rates generally provide more up-to-date and precise velocity estimates.
  • Coordinate Frames: It's important to define whether the velocity is being calculated relative to the robot's own body (local frame) or a fixed global reference frame.

By understanding these principles and utilizing appropriate sensors and algorithms, robots can accurately determine their velocity, enabling precise control and autonomous navigation.