# Line Maze Physics

Topics:
• What is a robot's top speed?
• How fast can a stopped robot be stopped somewhere else (straight ahead)?
• How fast can a robot rotate in place?
• How fast can a robot finish a maze?

## What is a robot's top speed?

Primary factors that control top speed:

• motor speed
• gear ratio
• wheel diameter

ωmotor: rpmmotor * 1rps/60rpm * 2*π

ωwheel: ωmotor / gear_ratio

Note:

• ω is the standard symbol for angular velocity, measured in radians per second (rad/s)
• there are 2 * π radians in one circle

The above ignores:

• motor friction, gearbox friction, axle friction, etc. (these will reduce actual top speed significantly)
• air resistance (typically insignificant)

Example:

• motor: 20,000 rpm
• gear ratio: 50:1
• wheel diameter: 1.5"
ωmotor: 20,000 rpm * 1rps/60rpm * 2*π = 2094 rad/s

speed: 41.9 rad/s * 1.5"/2 = 31.4 in/s

Friction effects may make the actual top speed closer to 20 in/s.

Note: If you have a target top speed for your robot, do the above calculations before ordering parts and constructing an entire robot only to find out it's not what you wanted. For example, if you want to achieve 1 meter per second (about 39 inches per second), the above combination would not provide that, so in that case you should consider one or more of: a faster motor, less gear reduction, larger diameter wheels

## How fast can a stopped robot be stopped somewhere else (straight ahead)?

If a robot is sitting at point A, and is pointed at point B, and needs to get to point B and stop there, then the sequence to use for best speed is:

• start at A
• accelerate (at top acceleration)
• travel at top speed (only if distance between A and B is large enough that top speed is reached)
• decelerate (at top deceleration)
• arrive at B (just as velocity returns to 0)

The previous section already addressed how top speed is determined. That leaves top acceleration (and deceleration).

Primary factors that control top acceleration:

• motor torque
• gear ratio
• (static) coefficient of friction (between drive wheels and surface)
• weight on (drive) wheels
• robot mass

drive_accel = motor_torque * gear_ratio / (wheel_radius * robot_mass)
traction_accel = weight_on_wheels * coefficient_of_friction / robot_mass
max_accel = min(drive_accel, traction_accel)

Notes:

• The above is assuming a level surface (which is the case for the line maze contest).
• If you try to use a drive_accel greater than traction_accel, the wheels will slip.
• If different drive wheels have a different amount of weight on them, or are made of different materials (and therefore have different coefficients of friction), then the traction_accel should be computed for each wheel independently and then the individual accelerations can be added together.
• When drive_accel is the limiting factor, max instantaneous acceleration will typically be dependent on current velocity. This is due to motor torque typically being dependent on motor speed. Some motors have published specs for this torque/speed curve, but many motors have no such published specs. Max motor torque is (by definition) equal to stall torque at 0 speed and equal to 0 at max motor speed, and a (very) rough/conversative approximation is that torque varies linearly between those two points.
• It might be useful to measure/publish coefficients of friction for common robot wheels vs common surfaces. (If we can set up a measurement system we might also publish torque curves for commonly used motors.)

### Why weight on wheels is not the same as robot mass.

The biggest difference between these two is that weight and mass are two different things, separated by a factor of g. (g is Earth's gravity, i.e., 9.8 m/s or 32 ft/s. In a static situation on Earth, weight = g * mass.)

Another difference is that not all supports may be drive wheels. For example, in a rear-wheel-drive car, much of the car's weight is on the front wheels (and therefore not on the drive wheels).

A more subtle difference is that weight_on_wheels may have a dynamic dependency on acceleration. Consider a two-wheeled robot, one wheel on each side, with ball casters front and back. Assume that the robot's center of gravity is (in terms of front-to-back) directly between the two wheels. In the static (robot not accelerating) case on level ground, pretty much all weight will be on the wheels (with only some tiny amount of the robot weight on one caster or the other). However, when the robot is accelerating forward, some of its weight will be shifted from the wheels to the rear ball caster. Likewise, when the robot is decelerating, some of its weight will be shifted to the front ball caster.

The amount of force shifted to the ball caster (and therefore away from the drive wheels) is:

accel * robot_mass * cog_height / caster_distance

where caster_distance is the distance from the caster to the point directly between the wheels.

Notes:

• It should now be apparent that if you are using a two-wheel robot and want to achieve maximum traction for both acceleration and deceleration, then the robot's center of gravity should (in terms of front-to-back) be directly between the wheels.
• If it looks like too much weight will be shifted off of the wheels (e.g., it would cause traction_accel to be the limiting factor for max_accel and subsequently not achieve the desired acceleration), you may want to consider modifying the robot design to lower the center of gravity and/or move the ball casters farther away from the wheels.

## How fast can a robot rotate in place?

This section, like the last, will assume a two-wheel robot.

Fast rotation works much the same as fast movement:

• start at orientation A
• accelerate (at top angular acceleration)
• rotate at top angular velocity (only if times to accelerate/decelerate to/from top angular velocity are short enough)
• decelerate (at top angular deceleration)
• arrive at orientation B (just as angular velocity returns to 0)

Rotation is both simpler and more complicated than translation:

• simpler: There is no weight transfer off of the wheels. (This is assuming that your robot's center of gravity is, in front/back and left/right terms, centered between the wheels. If this is not the case, then there will be weight transfer and you are on your own.)
• more complicated: Need the concept of "moment of inertia", which may be unfamiliar.

Top angular velocity can be derived from top speed:

ωrobot = 2 * speed / wheel_base

Note: Wheels can introduce a lot of resistance to turning, especially with smaller wheel bases and wheels with larger contact patches. Since the above formula does not account for that resistance, the actual ωrobot will be less than indicated above. If trying to maximize angular velocity, consider using wheels that are skinny/firm. A wider wheel base may also be used to reduce that resistance, though reviewing the above formula shows that a wider wheel base might not improve angular velocity, and may reduce it instead.

Primary factors that control top angular acceleration:

• motor torque
• gear ratio
• wheel base
• (static) coefficient of friction (between drive wheels and surface)
• weight on (drive) wheels
• moment of inertia

Just as there is "f = m * a" for linear acceleration, there is "τ = I * α" for angular acceleration. In that formula, τ is torque, I is momement of inertia, and α is angular acceleration.

Angular acceleration is just the rate of change of angular velocity, so if angular velocity is measured in radians/second, angular acceleration is radians/second/second.

Just as mass resists changes to linear velocity, moment of intertia resists change to angular velocity. The definition I find simplest for moment of inertia is that it is the volume integral of r2 * mass_density(). If you want to avoid using calculus (which will just get messy anyways if you try to get an exact value), you can use solid cylinders (and cylindrical holes therein) to approximate the mass distribution of your robot. The moment of inertia of a solid cylinder with radius r and mass m is m/2 * r2.

For example, if your motors have total mass of 50 grams, and they are located between 3 and 5 cm from the center of your robot, then you can approximate their contribution to moment of inertia with a solid cylinder radius .05 minus a hole of radius .03:

motor_I = m/2 * (.052 - .032)

Compute approximations for the other major (significant mass) components and sum them to find the approximate momement of inertia for the entire robot.

Once that is done, top angular acceleration can be computed as follows:

drive_force = motor_torque * gear_ratio / wheel_radius
traction_force = weight_on_wheels * coefficient_of_friction
α = min(drive_force, traction_force) * (wheel_base / 2) / I

Note: Rotating in place is not necessarily the fastest strategy -- it's likely faster to keep moving along the line through the corners. However, stopping, rotating in place and then continuing is the strategy many robots actually use. (And the physics of moving along the line through the corners is beyond the scope of this presentation.)

## How fast can a robot finish a maze?

For any given maze solution, just add up the times of each step of the solution (where each step consists either of moving straight ahead or rotating in place).