Robotics & control

Differential Drive Robot Lab

Drives a two-wheeled robot on a 4 m course: an autopilot steers it to up to six waypoints with proportional heading control, a speed taper, a capture radius and wheel-speed saturation, or a program of up to six constant-speed segments drives it; every step is an exact circular arc, up to three obstacles stop the run at the first contact, a forward-Euler ghost track shows the naive update drifting, and a closed-form single arc reaches a target; reports the finish time, waypoints reached, final pose, track length, collision and clearance, and the frames for the film; refuses inputs out of range plainly, and scores five challenges. For learning robot kinematics and simple path control.

Last updated

Calculator overview

Inputs and outputs

This summary comes from the calculator's published input and output contract.

Inputs

Start heading (required)
About this input

The start heading in degrees from +x, counterclockwise positive, from -180 to 180.

Unit deg Default 0 Range -180 to 180
Start x (required)
About this input

The start x on the course, in m, from 0 to 4 (origin at the bottom-left corner).

Unit m Default 0.5 Range 0 to 4
Obstacles (row k is obstacle k; leave a row blank when it is not used)
When omitted Blank
About this input

Up to three round obstacles (centre x and y in m from 0 to 4, radius from 0.05 to 1 m); a blank row is no obstacle, and the whole table may be blank. The first frame at which the robot overlaps one stops the run.

Default 1 row
ColumnRange or allowed values
x (m) 0 to 4
y (m) 0 to 4
Radius (m) 0.05 to 1
Program (row k is segment k; leave a row blank when it is not used)
When omitted Blank
About this input

Up to six program segments: left and right wheel speeds (rad/s, each from -20 to 20) held for a duration (s, from 0.1 to 20); a blank row adds nothing. Used in Program mode; speeds above the limit are scaled down together.

Default 2 rows
ColumnRange or allowed values
Left wheel (rad/s) -20 to 20
Right wheel (rad/s) -20 to 20
Duration (s) 0.1 to 20
Start y (required)
About this input

The start y on the course, in m, from 0 to 4.

Unit m Default 0.5 Range 0 to 4
Wheel radius (required)
About this input

r, the radius of each driven wheel, in m, from 0.02 to 0.1.

Unit m Default 0.05 Range 0.02 to 0.1
Wheel-speed limit (required)
About this input

The largest speed either wheel can turn, in rad/s, from 1 to 20. Faster commands are scaled down together, which keeps the turn.

Unit rad/s Default 12 Range 1 to 20
Track width (required)
About this input

b, the distance between the two wheels, in m, from 0.1 to 0.6. The robot body is a disc of radius b/2 + 0.03 m.

Unit m Default 0.3 Range 0.1 to 0.6
Waypoints (row k is waypoint k; leave a row blank when it is not used) (required)
About this input

Up to six waypoints (x and y in m, each from 0 to 4), visited in row order; a blank row is skipped. At least one waypoint is needed. Program mode does not use them.

Default 3 rows
ColumnRange or allowed values
x (m) 0 to 4
y (m) 0 to 4
Arc time (required)
About this input

The time the single arc must take, in s, from 0.5 to 20.

Unit s Default 5 Range 0.5 to 20
Capture radius (required)
About this input

A waypoint counts as reached once the robot is within this distance, in m, from 0.05 to 0.5.

Unit m Default 0.15 Range 0.05 to 0.5
Arc target x (required)
About this input

The single-arc target x, in m, from 0 to 4.

Unit m Default 2.5 Range 0 to 4
Arc target y (required)
About this input

The single-arc target y, in m, from 0 to 4.

Unit m Default 2 Range 0 to 4
Challenge number (required)
About this input

0 for none, or 1 to 5 to load a challenge. A challenge fixes the robot, the start, the mode and the course it is about and leaves only its free inputs to you.

Default 0 Range 0 to 5
Time step (required)
About this input

dt, the time step, in s, from 0.02 to 0.2; the run is always 200 steps.

Unit s Default 0.1 Range 0.02 to 0.2
Where does it end? (challenge 1) (required)
About this input

Your prediction in challenge 1: Not yet predicted, or one of the four marked spots Spot A to Spot D, chosen from the list. The path stays hidden until you choose.

Default Not yet predicted Allowed Not yet predicted, Spot A, Spot B, Spot C, Spot D
Controller gain (required)
About this input

Kp, the autopilot's turn rate per radian of heading error, per second, from 0 to 10.

Unit 1/s Default 3 Range 0 to 10
Drive mode (required)
About this input

Autopilot (the robot steers itself to the waypoints in row order) or Program (it follows the program table's segments), chosen from the list.

Default Autopilot Allowed Autopilot, Program

Outputs

Program segments in use
About this output

The number of program rows in use.

No unit declared
Track length
About this output

The length of the drawn track, the sum of the frame-to-frame distances, in m.

Unit m
Obstacles: the obstacles used and the closest the robot came to each
About this output

One row per obstacle row in use: its label, x, y, radius and the closest clearance over the run, in m.

No unit declared
Robot frames: 201 rows (frame k = 0 to 200 at t = k dt): the displayed pose, the wheel speeds of the step that follows, the stage and the flag
About this output

The film: one row per frame (201, frame k at t = k dt) with the time, the displayed x, y and heading (frozen after a collision), the left and right wheel speeds of the step that follows (0 once stopped, blank on the last frame), the stage (the waypoint row or program segment being driven) and the flag (Drive, Saturated, Collision, Done, Stopped or End). Frames 1 to 200 are withheld while challenge 1 awaits a prediction.

No unit declared
Program length
About this output

The program's total duration, in s.

Unit s
Program: the segments applied (after saturation), their start times and end poses (Program mode)
About this output

Program mode only: one row per program row in use with the applied (saturated) wheel speeds, the duration, the start time and the exact end pose.

No unit declared
Formula module versions
About this output

The formula modules embedded in the workbook and their versions.

No unit declared
Largest travel per step
About this output

The farthest the robot can move in one time step (top speed times dt), in m; above 0.1 m the status warns that a collision between frames can be missed.

Unit m
Finish time
About this output

When the course or program finished, in s: the done frame times dt in Autopilot, the program's exact end time in Program; blank when it did not finish, after a collision, and while challenge 1 awaits a prediction.

Unit s
Final y
About this output

The robot's y on the last frame, in m.

Unit m
Model version
About this output

The workbook version.

No unit declared
Model Status
About this output

OK, CHECK (a prediction is awaited, the program is empty, the robot hit an obstacle, a collision could be missed between frames, a waypoint was not reached, or the program runs past the run) or NOT VALID with the reason. When NOT VALID every model result and grid cell is blank; the challenge result, goal and feedback still show.

No unit declared
Closest clearance
About this output

The smallest gap between the robot's body and any obstacle over the run, in m; negative after a collision; blank with no obstacle.

Unit m
Waypoints reached
About this output

The number of waypoints reached by the end of the run (Autopilot); blank in Program mode.

No unit declared
Waypoints in use
About this output

The number of waypoints in use.

No unit declared
Fastest spin
About this output

The fastest spin in place (both wheels at the limit, opposite ways), in degrees per second.

Unit deg/s
Wheel-speed limit used
About this output

The wheel-speed limit used, rad/s (the challenge's when a challenge fixes it).

Unit rad/s
Wheel radius used
About this output

The wheel radius used, m (the challenge's when a challenge fixes it).

Unit m
Waypoints: the waypoints used and when each was reached
About this output

One row per waypoint row in use: its label, its x and y used, and in Autopilot the time it was reached (blank if not reached).

No unit declared
Track width used
About this output

The track width used, m (the challenge's when a challenge fixes it).

Unit m
Start heading used
About this output

The start heading used, degrees (the challenge's when a challenge fixes it).

Unit deg
Driving steps at the wheel limit
About this output

The share of the driving steps in which a wheel command passed the limit and both were scaled down, percent.

Unit %
Run length
About this output

The length of the run, 200 time steps, in s.

Unit s
Top speed
About this output

The robot's top forward speed, r times the wheel limit, in m/s.

Unit m/s
Start y used
About this output

The start y used, m (the challenge's when a challenge fixes it).

Unit m
Start x used
About this output

The start x used, m (the challenge's when a challenge fixes it).

Unit m
Capture radius used
About this output

The capture radius used, m (the challenge's when a challenge fixes it).

Unit m
Body radius
About this output

The radius of the robot's body disc, b/2 + 0.03 m, used for drawing and for the collision test.

Unit m
Arc time used
About this output

The arc time used, s (the challenge's when a challenge fixes it).

Unit s
Challenge markers: the marked spots of the selected challenge
About this output

The marked spots of the selected challenge: Spot A to Spot D in challenge 1, the parking spot in challenge 2; blank otherwise.

No unit declared
Challenge goal
About this output

The goal of the selected challenge; blank with no challenge.

No unit declared
Challenge feedback
About this output

A prompt while challenge 1 awaits a prediction, else the met or not-met feedback of the selected challenge; blank with no challenge.

No unit declared
Arc target y used
About this output

The arc target y used, m (the challenge's when a challenge fixes it).

Unit m
Single arc: length
About this output

The length of the single arc, in m.

Unit m
Single arc: left wheel
About this output

The left wheel speed of the single arc to the target, in rad/s; blank when the target is more than 150 degrees off the heading or while challenge 5 is not met.

Unit rad/s
Single arc: heading change
About this output

The heading change along the single arc (twice the target's bearing), in degrees.

Unit deg
Arc target x used
About this output

The arc target x used, m (the challenge's when a challenge fixes it).

Unit m
Single arc: right wheel
About this output

The right wheel speed of the single arc, in rad/s; blank as the left one.

Unit rad/s
Single arc
About this output

Whether one forward arc reaches the target within the wheel limit, needs speeds above it, cannot reach it well (more than 150 degrees off the heading), or the target is at the start; while challenge 5 is not met, a prompt to solve it first.

No unit declared
Euler drift at the end
About this output

The gap between the Euler comparison track and the exact track on the last frame, in m.

Unit m
Time step used
About this output

The time step used, s (the challenge's when a challenge fixes it).

Unit s
Drive mode used
About this output

The drive mode used (the challenge's when a challenge fixes it).

No unit declared
Final x
About this output

The robot's x on the last frame, in m.

Unit m
Final heading
About this output

The robot's heading on the last frame, in degrees.

Unit deg
Euler track: every 5th frame of the forward-Euler comparison and its gap to the exact track
About this output

Every 5th frame of the forward-Euler comparison track (41 rows): the time, the Euler x and y, and the gap to the exact track, in m.

No unit declared
Controller gain used
About this output

The controller gain used, per second (the challenge's when a challenge fixes it).

Unit 1/s
Challenge result
About this output

No challenge selected, MET or NOT MET.

No unit declared
Challenge score
About this output

100 when the selected challenge is met, else 0.

No unit declared
Challenge: the value scored
About this output

The value the selected challenge scores: the distance from the chosen spot to the end (challenge 1, m), from the end to the parking spot (2, m), the finish time (3, s), the waypoints reached (4), or the distance from the end to the arc target (5, m); blank with no challenge, while withheld, or when the measure is blank.

No unit declared
Collision time
About this output

The time of the collision frame, in s; blank with no collision.

Unit s
Obstacle hit
About this output

The row number of the obstacle hit; blank with no collision.

No unit declared
Collision frame
About this output

The frame at which the robot first overlaps an obstacle; blank with no collision.

No unit declared
This page is provided by LogicCommons for informational purposes only. Results are analysis outputs computed from the inputs you supply and are not professional advice. Verify all inputs and results independently.

LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.

Methodology

Purpose and model boundary

This lab drives a two-wheeled robot on a flat square course 4 m across, seen from above. The robot has two driven wheels of radius r a track width b apart, and its body is a disc of radius b/2 + 0.03 m. The model runs 200 time steps of length dt, frames 0 to 200, in one of two modes. In Autopilot a proportional heading controller steers the robot to up to six waypoints in row order, slowing near each one and counting it as reached inside a capture radius. In Program the robot follows up to six segments of constant left and right wheel speeds, each held for a set duration. A wheel-speed limit scales both wheels down together when a command passes it. Up to three round obstacles are checked at every frame, and the first frame that overlaps one stops the run there. From the frames the model reports the waypoints reached, the finish time, the final pose, the length of the track, the collision and the closest clearance. At Advanced it also returns a forward-Euler comparison track that replays the same wheel speeds, and a closed-form single arc that drives from the start to a target point in a given time. Five scored challenges turn the lab into exercises.

Every step is a direct calculation: there is no iteration and no solver. With constant wheel speeds the robot moves along an exact circular arc, so each autopilot step is an exact arc and each program frame is composed exactly from the segment-end poses. The autopilot is a fixed recursion of 200 rows.

It is a kinematics lab for learning how a differential-drive robot moves and how a simple controller steers it, not a tool for navigating or controlling a real robot. The robot is rigid, its wheels roll without slipping, and the wheel speeds change instantly at each step. There are no masses, motor torques, acceleration limits, wheel slip, sensors or noise.

The model is the calculation authority. The page sends the values you set to the model and draws only what the model returns: every pose, wheel speed, stage, flag, Euler point, clearance and arc value comes from the model's results; the page computes no motion itself.

Inputs and units

Input Meaning and unit
Drive mode Autopilot or Program: which of the two modes is driven, shown and scored. Both are always computed.
Wheel radius r, the radius of each driven wheel, from 0.02 to 0.1 m.
Track width b, the distance between the two wheels, from 0.1 to 0.6 m. It also sets the body radius, b/2 + 0.03 m.
Wheel-speed limit lim, the largest angular speed either wheel can turn, from 1 to 20 rad/s.
Start x and start y x0 and y0, where the robot starts on the course, each from 0 to 4 m (origin at the bottom-left corner).
Start heading θ0, the direction the robot faces at the start, from −180 to 180 degrees.
Waypoints Up to 6 rows of x and y, each from 0 to 4 m. At least one row must be in use; blank rows are skipped. Autopilot only.
Obstacles Up to 3 rows of x and y (each from 0 to 4 m) and a radius (from 0.05 to 1 m). The whole table may be blank.
Program Up to 6 segments of a left and a right wheel speed (each from −20 to 20 rad/s) and a duration (from 0.1 to 20 s). Program mode only; the whole table may be blank.
Controller gain Kp, the turn rate per radian of heading error, from 0 to 10 per second. Autopilot only.
Capture radius Rc, the distance at which a waypoint counts as reached, from 0.05 to 0.5 m. Autopilot only.
Time step (Advanced) dt, from 0.02 to 0.2 s. The run lasts 200·dt.
Arc target x and y (Advanced) The point the single arc must reach, each from 0 to 4 m.
Arc time (Advanced) Ta, the time the single arc must take, from 0.5 to 20 s.
Challenge number 0 for free exploration; 1 to 5 loads one of the five challenges.
Your end-point prediction (challenge 1) Not yet predicted, or Spot A, B, C or D. Only challenge 1 uses it.

A row of a table is in use when any of its entries is filled. A waypoint row in use needs both coordinates, an obstacle row all three values and a program row all three values. A program row not in use acts as a segment of zero duration: it adds no time and no motion. Program wheel speeds above the wheel-speed limit are allowed; they are scaled down by the same rule as the autopilot's commands.

Sign conventions: x runs to the right and y up the course. Headings are measured from +x, counterclockwise positive, and every heading the model returns is from −180 (exclusive) to 180 degrees. A wheel speed is the wheel's angular speed in rad/s, positive when it drives the robot forward. The turn rate is positive counterclockwise, so a right wheel faster than the left turns the robot left.

Every scalar input is required and is checked on its entered value, whether or not the selected mode uses it. In a challenge, the inputs the challenge fixes cannot be changed.

Governing relationships

Wheel speeds to motion. With the left and right wheel speeds L and R (rad/s):

  • the forward speed is v = r·(R + L)/2 (m/s);
  • the turn rate is ω = r·(R − L)/b (rad/s).

Equal wheel speeds give ω = 0 exactly and the robot drives straight; opposite wheel speeds give v = 0 exactly and it spins in place. Anything else is a circular arc of radius (b/2)·(R + L)/(R − L), for example 0.45 m for L = 4 and R = 8 rad/s on the default robot.

The exact arc. Holding L and R for a time τ from the pose (x, y, θ), the model moves the robot along the exact arc, written so that no radius is ever formed:

  • the half turn is h = ω·τ/2 (radians), and S = sin(h)/h, taken as exactly 1 when h is 0;
  • the chord, the straight distance from the start of the arc to its end, is v·τ·S (negative when reversing);
  • the turn is Δθ = ω·τ in degrees, and the chord points along the mid-arc heading θ + Δθ/2;
  • the new pose is x + chord·cos(θ + Δθ/2), y + chord·sin(θ + Δθ/2) and θ + Δθ, wrapped to the heading range.

This is exact for constant wheel speeds: the chord of a circular arc that turns through 2h and is v·τ long is v·τ·sin(h)/h long and lies along the mid-arc heading. Straight motion and spin in place are exact by construction. At whole multiples of 90 degrees the sine and cosine are taken as exactly 0, 1 or −1, so a robot heading straight up keeps its x unchanged to the last digit, and a heading already in range is returned unchanged.

Saturation. A pair of commanded wheel speeds (cL, cR) is saturated when the larger of |cL| and |cR| is above the limit (by more than one part in a billion). Then both are multiplied by lim divided by that larger value. Scaling both wheels by the same factor keeps their ratio, so it keeps the turning radius and only slows the robot. A command exactly at the limit is not saturated. The same rule applies to the autopilot's commands and to every program segment.

The autopilot. Row k (k = 0 to 199) holds the pose and the waypoint being sought, starting at the start pose and the first waypoint in use:

  • Capture. The waypoint sought is reached when the robot's centre is within Rc of it (plus 1×10⁻⁹ m). The robot then heads for the next waypoint in use. At most one waypoint is reached per frame. The course is complete at the first frame where the last waypoint is reached: the done frame, possibly frame 0.
  • Heading error. With the offset (dx, dy) from the robot to the waypoint it now heads for, at distance ρ, the bearing is atan2(dy, dx) and the heading error e is the bearing minus the heading, wrapped to the heading range. When the robot stands exactly on that waypoint, e is 0.
  • Speed. The speed factor is f = min(1, ρ/0.5 m)·max(0, cos e): full speed beyond 0.5 m, slowing in proportion closer in, and no forward motion while the waypoint is abeam or behind, so the robot turns in place toward it and cannot orbit it. The forward command is u = 0.8·lim·f, which leaves 20% of the limit for steering.
  • Steering. The steering command is δ = Kp·e·b/(2r), with e in radians, and the commanded wheel speeds are (u − δ, u + δ), saturated as above.
  • Step. The robot moves along the exact arc of those wheel speeds for dt. Once the course is complete both wheels are 0 exactly, so the pose stays the same.

Frame 200 only tests for a capture; no step follows it.

The program. For segment j (j = 1 to 6) the applied wheel speeds are the entered pair, saturated as above, and its duration is d_j (0 for a row not in use). The segment end times are T_j = T_(j−1) + d_j from T_0 = 0, and the segment-end poses P_j follow from P_(j−1) by the exact arc of segment j for d_j. Frame k is at time t_k = k·dt:

  • the segment in effect is the one whose end time is the first above t_k, where a frame within 1×10⁻⁹ s of a segment end belongs to the next segment;
  • its pose is the exact arc from that segment's start pose for the time since the segment began;
  • after the last segment the pose is P_6 exactly.

Every program frame is therefore exact, whatever the time step: a segment that ends inside a step is followed to its end and the next one begins there. The program's done frame is the first frame at or after its end (within 1×10⁻⁹ s). The program fits the run when T_6 is at most 200·dt (plus 1×10⁻⁹ s).

Collision. For each obstacle in use and each frame k from 0 to 200, the clearance is the distance from the robot's centre to the obstacle's centre, minus the obstacle's radius and the body radius (m; negative means overlap). A frame collides when some obstacle's clearance is below −1×10⁻⁹ m; touching is not a collision. The collision frame is the first colliding frame, and the obstacle hit is the lowest-numbered obstacle that overlaps there. The run stops at the collision: every later frame shows the pose of the collision frame.

Collisions are checked at the frames only. When the robot can move at most 0.1 m in one step, an overlap missed between two frames is at most about 0.01 m deep; above 0.1 m a warning applies (see Errors and warnings).

The frame flags. Each frame of the film carries the first of these that applies:

  1. Collision at the collision frame;
  2. Stopped after the collision frame or after the done frame, and at every frame of an empty program;
  3. Done at the done frame;
  4. End at frame 200;
  5. Saturated when the step that follows was saturated;
  6. Drive otherwise.

A frame flagged Collision, Stopped or Done shows wheel speeds of 0; frame 200 has none, since no step follows it. The stage is the waypoint row the autopilot is heading for, or the program segment in effect, and it is blank on a frame flagged Collision, Stopped, Done or End.

The Euler comparison track (Advanced). From the start pose, with the wheel speeds the film shows for frame k (so the Euler robot stops when the robot stops), forward Euler takes one straight step per frame:

  • x + v·dt·cos θ, y + v·dt·sin θ and θ + ω·dt, the heading wrapped to the heading range.

The gap is the distance between the exact and the Euler position at each frame. Euler moves along the current heading for the whole step instead of along the arc, so for constant wheel speeds it keeps an offset of about v·dt that swings around the exact circle rather than growing; halving the time step roughly halves it. Euler also samples the wheel speeds only at the start of each step, so a program segment that ends inside a step is seen late.

The single arc (Advanced). From the start pose to the arc target in the arc time Ta, with (dx, dy) the offset to the target and d its distance:

  • At the start (d at most 1×10⁻⁹ m): both wheel speeds, the heading change and the length are 0.
  • Otherwise the target in the robot's own frame is fwd = cos θ0·dx + sin θ0·dy ahead and lat = cos θ0·dy − sin θ0·dx to the left, at the bearing α = atan2(lat, fwd).
  • Behind: when |α| is more than 150 degrees (plus 1×10⁻⁹), no forward arc reaches the target well, and the four numbers are blank.
  • Otherwise the arc that leaves the start along the heading and passes through the target turns through 2α and is s = d/S(α) long, with S(α) = sin α/α (1 when α is 0). Then:
    • the heading change is 2α, in degrees, and the arc length is s;
    • the right wheel speed is (s + α·b)/(r·Ta) and the left wheel speed (s − α·b)/(r·Ta).

Driving these two wheel speeds for Ta turns the robot through 2α and moves it a chord of length d along θ0 + α, which is the target. A target dead ahead gives α = 0, equal wheel speeds and a straight line. The note says whether both wheel speeds are within the wheel-speed limit; the arc is never applied to the robot.

Run figures.

  • The run length is 200·dt; the top speed is r·lim; the fastest spin, both wheels at the limit in opposite directions, is 2r·lim/b in degrees per second; the farthest the robot can move in one step is r·lim·dt.
  • The track length is the sum of the straight distances between successive frames as shown, so it reads slightly shorter than the arc length.
  • The closest clearance is the smallest clearance to any obstacle in use over frames 0 to the last frame of the run (the collision frame, or 200).
  • The saturation share is the percentage of driving steps (flagged Saturated or Drive) that were saturated, 0 when there are none.
  • The finish time is the done frame times dt in Autopilot, and the program's exact end time T_6 in Program. It is blank when the course or program is not finished within the run, or after a collision.

Calculation sequence

The model works through the relationships above in this order:

  1. It checks the entered inputs, items 1 to 10 of the status list under Errors and warnings.
  2. It fixes the values used: your inputs, or in a challenge the challenge's own values with only its free inputs left to you. A table is fixed or left free one entry at a time.
  3. It finds the waypoints and obstacles in use, the applied program segments, their end times and their end poses.
  4. It runs the 200 autopilot rows and composes the 201 program frames, and takes the track of the selected mode.
  5. It computes the clearance to every obstacle at every frame, finds the collision frame and stops the run there.
  6. It sets each frame's flag, wheel speeds and stage, and runs the Euler comparison track.
  7. It computes the run figures and the single arc.
  8. It sets the status and, in a challenge, scores the challenge.

Outputs and interpretation

  • Status: OK, CHECK with a reason, or NOT VALID with the first problem to fix (see Validation and status logic and Errors and warnings).
  • Course results: the waypoints reached (Autopilot; blank in Program), the finish time (s), the final x and y (m) and heading (degrees) on the last frame, and the body radius (m).
  • Collision: the collision frame and, at Experiment, its time (s) and the obstacle row hit; blank with no collision.
  • Robot and run (Experiment): the run length (s), the top speed (m/s), the fastest spin (degrees per second), the number of waypoints in use, the track length (m), the closest clearance to any obstacle (m; blank with no obstacle, negative after a collision), the saturation share (%), the number of program segments in use and the program's total duration (s).
  • Method and arc (Advanced): the farthest move in one step (m) and the gap between the Euler and the exact track on the last frame (m); the single arc's left and right wheel speeds (rad/s), heading change (degrees) and length (m), and its note.
  • Values used (Advanced): the drive mode, wheel radius, track width, wheel-speed limit, start x, y and heading, controller gain, capture radius, time step, arc target and arc time actually used. In a challenge these are the challenge's own.
  • Versions (Advanced): the model version and the formula module versions.
  • Grids:
    • Robot frames: 201 rows, one per frame, of the time (s), x and y (m), heading (degrees), the left and right wheel speeds of the step that follows (rad/s), the stage and the flag.
    • Waypoints: one row per waypoint row in use: its label, x and y (m) and, in Autopilot, when it was reached (s), blank if it was not reached during the run.
    • Obstacles: one row per obstacle row in use: its label, x, y and radius (m), and its closest clearance over the run (m).
    • Program (Experiment): in Program mode only, one row per segment in use: its label, the applied (saturated) left and right wheel speeds (rad/s), the duration and start time (s), and the end x and y (m) and heading (degrees).
    • Marked spots (Experiment): Spot A to Spot D in challenge 1, the parking spot in challenge 2; blank otherwise.
    • Euler track (Advanced): every 5th frame, 41 rows of the time (s), the Euler x and y (m) and the gap to the exact track (m).
    • The rows of the waypoint, obstacle and program tables keep the row numbers you entered; a blank row is blank.

Reading the results:

  • At the default, the robot reaches its three waypoints at frames 35, 82 and 131, finishing at 13.1 s, and about 7.6% of its driving steps are saturated.
  • The robot cuts each corner by about the capture radius: a larger capture radius heads for the next waypoint sooner.
  • A saturated step keeps the turning radius and only slows the robot, so the path of a saturated program segment is the same circle traced more slowly.
  • The program frames do not depend on the time step; the autopilot does, because its commands are held for one step.
  • The Euler gap shows the error of the naive update, not an error of the exact track.

Challenges

Choose a challenge number from 1 to 5. The model loads that challenge's robot, mode, start, course, program and time step, and the inputs it fixes replace yours (the "used" outputs show the values in effect). Only the inputs the challenge leaves free stay yours. The challenge result reads MET or NOT MET, the score is 100 when met and 0 otherwise, and a goal and a feedback line say what is asked and what to try next. The measured value is the quantity the challenge scores. The status checks still apply inside a challenge.

  1. Where does it end? Predict which of four marked spots a fixed two-segment program ends at, before you see the path. Until you choose, frames 1 to 200 of the film, the Euler track after its first row, the finish time, final pose, track length, collision, clearance, saturation share and Euler gap, the program's end poses and the obstacles' clearances are blank. The challenge is met when the chosen spot is within 0.1 m of the end.
  2. Park on the spot. Write a program of at most 3 segments that parks the robot within 0.1 m of the parking spot, around an obstacle and without touching it.
  3. Fastest clean course. Tune the controller gain so the robot visits both waypoints without a collision and finishes in 11.4 s or less (done by frame 114).
  4. Slower wheels. With the wheel-speed limit cut to 7.2 rad/s, adjust the gain and the capture radius so the robot still visits all three waypoints within the run, without a collision.
  5. One arc in 5 s. Find the constant wheel speeds of a single 5 s program segment that drive the robot along one arc to the arc target, ending within 0.05 m. Until the challenge is met, the model's own single arc is blank and its note asks you to solve it first.

Validation and status logic

The status reads the first message in the list under Errors and warnings that applies. Items 1 to 10 check the values you entered; items 11 to 16 check the values used, which are a challenge's own when one is selected. A CHECK still returns every result it can; it marks something that deserves a second look. Saturation is not a CHECK: it is a normal result, counted by the saturation share and flagged on each frame. A large Euler gap is not a CHECK either.

Assumptions and limitations

  • Kinematics only: a rigid robot with two driven wheels that roll without slipping, on a flat course. No masses, motor torques, acceleration limits, wheel slip, sensors or noise; the wheel speeds change instantly at each step. The robot may leave the course area; only the inputs are bounded to it.
  • 200 steps; the run lasts 200·dt, from 4 to 40 s. Each autopilot step holds its wheel speeds for the whole step, and each step is integrated exactly; the program is composed exactly.
  • The autopilot is proportional heading control at 80% of the wheel-speed limit with a 0.5 m speed taper, no forward motion while a waypoint is abeam or behind, and one capture per frame. Waypoints are visited in row order.
  • Collisions are checked at the frames only, on a disc of radius b/2 + 0.03 m.
  • The single arc is one forward arc tangent to the start heading, for targets within 150 degrees of the heading. It may need wheel speeds above the limit; the note says so, and the arc is not applied anywhere.
  • The Euler track is forward Euler with the wheel speeds sampled at the start of each step; it is first order in the time step.
  • A value within about 1×10⁻⁹ of a threshold may fall either side of it. This applies to the capture, collision and at-start tests, the saturation test, the segment boundaries, the program fit, the one-step travel warning, the 150-degree arc limit and each challenge band.

Restrictions and non-computing states

Every scalar input is required; a blank or out-of-range value reads NOT VALID. A table row in use must be complete and in range. The drive mode and the end-point prediction must be exactly one of their listed choices.

Under NOT VALID every result and every grid entry is blank. The model and module versions still show, the challenge score reads 0, and a selected challenge reads NOT MET with its goal and its not-met text. A challenge number that is not a whole number from 0 to 5 counts as no challenge selected.

The waypoints reached are blank in Program mode, and the program table is blank in Autopilot. The finish time is blank when the course or program does not finish within the run, and after a collision. The single arc's four numbers are blank when the target is more than 150 degrees off the heading, and while challenge 5 is selected and not met.

Errors and warnings

The status messages, in the order they are checked (k is a row number, the lowest one that fails):

  1. NOT VALID: choose the drive mode from the list: Autopilot or Program
  2. NOT VALID: the wheel radius must be from 0.02 to 0.1 m, the track width from 0.1 to 0.6 m and the wheel-speed limit from 1 to 20 rad/s
  3. NOT VALID: the start must lie on the 4 m course (x and y from 0 to 4 m), with a heading from -180 to 180 degrees
  4. NOT VALID: waypoint k needs both x and y from 0 to 4 m, or leave the row blank
  5. NOT VALID: place at least one waypoint on the course
  6. NOT VALID: obstacle k needs x and y from 0 to 4 m and a radius from 0.05 to 1 m, or leave the row blank
  7. NOT VALID: program segment k needs wheel speeds from -20 to 20 rad/s and a duration from 0.1 to 20 s, or leave the row blank
  8. NOT VALID: the controller gain must be from 0 to 10 per second, the capture radius from 0.05 to 0.5 m and the time step from 0.02 to 0.2 s
  9. NOT VALID: the arc target must lie on the course (x and y from 0 to 4 m), with an arc time from 0.5 to 20 s
  10. NOT VALID: the challenge number must be a whole number from 0 to 5, and the end-point prediction one of the listed choices
  11. CHECK: make your prediction first: the robot's path appears once you choose a spot: challenge 1 is selected and no spot is chosen yet.
  12. CHECK: the program has no segment yet, so the robot stays at the start; enter at least one segment: Program mode with no segment in use.
  13. CHECK: the robot hit obstacle k, so the run stopped at the collision: k is the obstacle row hit.
  14. CHECK: the robot can move more than 0.1 m in one time step, so a collision between frames can be missed; shorten the time step or lower the wheel-speed limit: an obstacle is in use and r·lim·dt is above 0.1 m.
  15. CHECK: waypoint k was not reached by the end of the run (200 steps); raise the gain or the capture radius, or move the waypoints closer: Autopilot, and the course is not complete; k is the first waypoint row not reached.
  16. CHECK: the program runs longer than the simulation (200 steps), so its end is cut off: Program mode, and the program's total duration is longer than the run.
  17. OK

The single arc's note reads one of:

  • One forward arc reaches the target within the wheel-speed limit
  • One forward arc reaches the target, but it needs wheel speeds above the limit
  • The target is more than 150 degrees off the heading: one forward arc cannot reach it well
  • The target is at the start: both wheels stay still
  • Solve it yourself first: the model's arc appears once the challenge is met: challenge 5 is selected and not met.

References

This laboratory is an educational model of a differential-drive robot with rigid wheels that roll without slipping. The forward speed and the turn rate follow from the two wheel speeds, and with constant wheel speeds the robot moves along an exact circular arc about its instantaneous centre of curvature, written here in a form that needs no turning radius. An autopilot steers with proportional control of the heading error, and a program composes segments of constant wheel speeds exactly. A forward-Euler track shows the error of the first-order update, and a single arc tangent to the start heading through a target point is the circular arc that pure-pursuit path tracking steers along.

Sources and further reading

  • Differential-drive kinematics, the instantaneous centre of curvature and the pose update for constant wheel speeds: G. Dudek and M. Jenkin, Computational Principles of Mobile Robotics, 2nd edition, Cambridge University Press, 2010.
  • Wheeled mobile robot kinematics and odometry: R. Siegwart, I. R. Nourbakhsh and D. Scaramuzza, Introduction to Autonomous Mobile Robots, 2nd edition, MIT Press, 2011.
  • Wheeled mobile robots, the unicycle model, the kinematics of a differential-drive robot and odometry: K. M. Lynch and F. C. Park, Modern Robotics: Mechanics, Planning, and Control, Cambridge University Press, 2017, chapter 13, Wheeled Mobile Robots. The authors' free preprint edition: Modern Robotics, Northwestern University
  • The arc through a goal point and its curvature: R. C. Coulter, Implementation of the Pure Pursuit Path Tracking Algorithm, technical report CMU-RI-TR-92-01, Robotics Institute, Carnegie Mellon University, 1992.
  • The forward Euler method and its first-order error: E. Hairer, S. P. Nørsett and G. Wanner, Solving Ordinary Differential Equations I: Nonstiff Problems, 2nd revised edition, Springer, 1993.

No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.

This laboratory is for learning. Its results hold only within its stated ranges; it is not a tool for navigating or controlling real robots.

Results are informational and not professional advice. See our Terms of Use. Powered by SpreadsheetWeb · About · Privacy · Terms