physics.robotics.stopping
physics.robotics.stopping
Stopping envelopes, S-curve trajectories, and velocity bounds for Physical AI.
Functions
| Name | Description |
|---|---|
| calc_blend_reserve_use | Largest growth, over a smoothstep blend’s ticks, of travel plus the resident stop. |
| calc_braking_time | Time to brake from velocity to rest at constant deceleration. |
| calc_c2_stop_suffix | Calculate the duration and distance of a C2-continuous stop from cruise. |
| calc_latch_contact_stopping_profile | Calculate force rise and required braking after latch contact. |
| calc_max_permitted_velocity | Calculate the forward-velocity ceiling in the delayed stopping model. |
| calc_safe_stopping_distance | Calculate dynamic stopping distance under non-zero control latency. |
| calc_scurve_max_permitted_velocity | Highest cruise speed whose delayed S-curve stop fits the clearance. |
| calc_scurve_rest_to_rest_time | Calculate the duration of a jerk-limited rest-to-rest move with no cruise phase. |
| calc_scurve_stop_distance | Distance of a jerk-limited S-curve stop entered from zero-acceleration cruise. |
| calc_scurve_stop_time | Duration of the jerk-limited S-curve stop of calc_scurve_stop_distance. |
| calc_smoothstep_braking_blend | Exit speed and travel of a fixed-endpoint smoothstep blend from cruise into braking. |
| calc_stopping_crossover_speed | Speed at which travel during the pre-brake delay equals braking travel. |
| calc_travel_between_speeds | Distance covered while speed changes uniformly between two recorded values. |
calc_blend_reserve_use
physics.robotics.stopping.calc_blend_reserve_use(
entry_velocity,
deceleration,
max_jerk,
window,
tick,
)Largest growth, over a smoothstep blend’s ticks, of travel plus the resident stop.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| entry_velocity | Quantity | Nonnegative speed at onset in m/s. | required |
| deceleration | Quantity | Positive braking deceleration in m/s^2. | required |
| max_jerk | Quantity | Positive jerk bound in m/s^3. | required |
| window | Quantity | Positive blend duration in s. | required |
| tick | Quantity | Positive permission sampling interval in s. | required |
Returns
| Name | Type | Description |
|---|---|---|
| Quantity | Reserve use in millimeters. |
Notes
Equation:
At each permission tick i of a blend of length T from cruise into braking, u = min(i * tick / T, 1); the blended speed and travel follow from the once- and twice-integrated smoothstep:
A1(u) = u^6 - 3 u^5 + 2.5 u^4, A2(u) = u^7 / 7 - u^6 / 2 + u^5 / 2
v(u) = v0 - a T A1(u), x(u) = v0 T u - a T^2 A2(u)
use = max_i [ x(u_i) + d_S(v(u_i)) ] - d_S(v0)
where d_S is the resident jerk-limited stop (calc_scurve_stop_distance). The resident stop from each blended speed is charged from zero acceleration, which overstates it while the blend is already decelerating, so the bound is conservative (added 2026-10-20).
Assumptions: Positive window and tick define a finite permission grid; positive deceleration and jerk define the resident stop, and blended speed stays nonnegative.
Excludes: Between-tick maxima, acceleration-aware resident stopping, tracking error, and safety certification.
References
Derivation: At each sampled permission time, integrate the blend and add the resident zero- acceleration stop; subtract the original stop distance and take the largest sampled growth.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_blend_reserve_use
>>> from mlsysim.core.units import ureg
>>> calc_blend_reserve_use(ureg('1 m/s'), ureg('1 m/s**2'), ureg('1 m/s**3'), ureg('0.1 s'), ureg('0.01 s')).check('[length]')
Truecalc_braking_time
physics.robotics.stopping.calc_braking_time(velocity, max_deceleration)Time to brake from velocity to rest at constant deceleration.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| velocity | Quantity | Nonnegative forward speed in m/s. | required |
| max_deceleration | Quantity | Positive braking deceleration bound in m/s^2. | required |
Returns
| Name | Type | Description |
|---|---|---|
| Quantity | Braking time in seconds. |
Notes
Equation: t_brake = v / a
Assumptions: Speed is nonnegative and the positive braking deceleration is constant.
Excludes: Reaction time, jerk ramps, and speed-dependent braking.
References
The constant-acceleration relation v = v0 + a * t is evaluated at rest (OpenStax, University Physics Volume 1, Sec. 3.4, Eq. 3.12).
Derivation: Integrate dv/dt = -a to rest to get elapsed time v/a.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_braking_time
>>> from mlsysim.core.units import ureg
>>> calc_braking_time(ureg('1 m/s'), ureg('1 m/s**2')) == ureg('1 s')
Truecalc_c2_stop_suffix
physics.robotics.stopping.calc_c2_stop_suffix(entry_velocity, peak_deceleration)Calculate the duration and distance of a C2-continuous stop from cruise.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| entry_velocity | Quantity | Cruise velocity at the start of the stop (e.g. m/s). | required |
| peak_deceleration | Quantity | Credible peak deceleration the stop may reach (e.g. m/s^2). | required |
Returns
| Name | Type | Description |
|---|---|---|
| dict | Duration (ms), distance (m), and peak_jerk (m/s^3). |
Notes
Equation:
A stop that begins and ends at zero acceleration, entered from constant velocity v_c, follows the minimum-order polynomial
q(u) = q_c + v_c * T * (u - u^3 + u^4 / 2), u = t / T in [0, 1],
whose peak deceleration is 1.5 * v_c / T and whose distance is v_c * T / 2. Setting the peak equal to the credible deceleration a gives
T = 1.5 * v / a, d = 0.75 * v^2 / a,
which is 1.5 times the constant-deceleration distance v^2 / (2 * a). The factor belongs to this polynomial, not to smooth stopping in general: its jerk q’’’ = -(6 v_c / T^2)(1 - 2u) peaks in magnitude at the ends,
j_peak = 6 * v / T^2 = (8 / 3) * a^2 / v,
and a jerk-limited S-curve with the same a and j_peak stops shorter (calc_scurve_stop_distance).
Assumptions: Positive entry speed begins at zero acceleration; the specified quartic position polynomial stops with zero final acceleration.
Excludes: An independent jerk bound, actuator tracking, and an optimality claim across other smooth profiles.
References
This polynomial construction satisfies q’ = v_c, q’’ = 0 at u = 0 and q’ = 0, q’’ = 0 at u = 1; peak |q’‘| occurs at u = 1/2 (minimum of q’‘(u) = v_c / T * (-6u + 6u^2)); peak |q’’’| occurs at u = 0 and u = 1.
Derivation: Differentiate the displayed quartic to locate its peak deceleration at normalized time one-half, then solve for duration.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_c2_stop_suffix
>>> from mlsysim.core.units import ureg
>>> calc_c2_stop_suffix(ureg('1 m/s'), ureg('1 m/s**2'))['distance'].check('[length]')
Truecalc_latch_contact_stopping_profile
physics.robotics.stopping.calc_latch_contact_stopping_profile(
approach_velocity=None,
tripwire_force=None,
latch_stiffness=None,
response_time=None,
force_limit=None,
*,
scenario=None,
)Calculate force rise and required braking after latch contact.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| approach_velocity | Quantity | Arm approach speed (e.g. m/s). If omitted and scenario is given, defaults to scenario.v_latch_approach. | None |
| tripwire_force | Quantity | Tripwire threshold force (e.g. N). Defaults to scenario.f_latch_tripwire if scenario is given. | None |
| latch_stiffness | Quantity | Spring stiffness of the latch mechanism (e.g. N/m). Defaults to scenario.k_latch. | None |
| response_time | Quantity | Contact-loop response latency from tripwire detection to brake onset (e.g. ms). Defaults to scenario.t_contact_response. | None |
| force_limit | Quantity | Maximum permissible contact force limit (e.g. N). Defaults to scenario.f_latch_limit. | None |
| scenario | EmbodiedSiteScenario | Site scenario supplying default latch physical parameters. | None |
Returns
| Name | Type | Description |
|---|---|---|
| dict | - “f_at_brake_onset”: Force at brake command onset (Quantity in N). - “x_remaining”: Remaining allowable displacement (Quantity in mm). - “a_arm_needed”: Required arm deceleration to honor force limit (Quantity in m/s^2). - “t_arm_stop”: Arm stopping duration (Quantity in ms). - “df_dt”: Force rate of rise during contact (Quantity in N/s). |
Notes
Equation:
When a robot manipulator contacts a compliant latch or strike plate: 1. Force accumulation rate: df/dt = k_latch * v_approach 2. Force at brake command onset (tripwire force + accumulation during response time): f_cmd = f_tripwire + k_latch * v_approach * t_response 3. Remaining allowable deflection before exceeding contact limit f_limit: x_remaining = (f_limit - f_cmd) / k_latch 4. Required constant arm deceleration to halt within x_remaining: a_arm_needed = v_approach^2 / (2 * x_remaining) 5. Duration of the arm stopping phase: t_arm_stop = v_approach / a_arm_needed
Assumptions: Positive approach speed remains constant until brake onset; a positive linear stiffness sets force and braking deceleration is constant afterward. Brake-onset force must remain below the limit.
Excludes: Jerk ramps, damping, actuator limits, and contact safety certification.
References
Derivation: Use Hooke’s law for the remaining compression and solve v squared/(2 a) = remaining compression for required deceleration.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_latch_contact_stopping_profile
>>> from mlsysim.core.units import ureg
>>> calc_latch_contact_stopping_profile(ureg('1 m/s'), ureg('1 N'), ureg('1 N/m'), ureg('1 s'), ureg('10 N'))['a_arm_needed'].check('[length]/[time]**2')
Truecalc_max_permitted_velocity
physics.robotics.stopping.calc_max_permitted_velocity(
d_clear,
total_latency,
max_deceleration,
loc_margin=None,
physical_margin=None,
)Calculate the forward-velocity ceiling in the delayed stopping model.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| d_clear | Quantity | Detected clearance distance to obstacle along travel vector (e.g. m). | required |
| total_latency | Quantity | End-to-end sense-to-actuation latency tau_delay (e.g. s or ms). | required |
| max_deceleration | Quantity | Maximum braking deceleration capacity a_brake (e.g. m/s^2). | required |
| loc_margin | Quantity | Localization uncertainty bound (e.g. cm or m). | None |
| physical_margin | Quantity | Physical clearance safety buffer (e.g. cm or m). | None |
Returns
| Name | Type | Description |
|---|---|---|
| Quantity | Modeled forward-velocity ceiling in meters/second. |
Notes
Equation:
Solves the quadratic inequality: v * tau + v^2 / (2 * a) <= D_clear - delta_loc - delta_margin for the maximum non-negative velocity root: v_max = -a * tau + sqrt((a * tau)^2 + 2 * a * D_eff) where D_eff = D_clear - delta_loc - delta_margin. If D_eff <= 0, v_max = 0.
Assumptions: Clearance is nonnegative; the delay and constant braking deceleration are positive. Margins consume clearance before solving.
Excludes: Jerk ramps, approaching obstacles, changing traction, and certified safe-speed determination.
References
The speed ceiling follows from the positive root of the calc_safe_stopping_distance quadratic, so it rests on the same kinematics (OpenStax, University Physics Volume 1, Sec. 3.4, Eq. 3.14) and the same additive-margin modeling assumption.
Derivation: Take the nonnegative root of v tau + v squared/(2 a) = effective clearance, clamping to zero when no clearance remains.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_max_permitted_velocity
>>> from mlsysim.core.units import ureg
>>> calc_max_permitted_velocity(ureg('0 m'), ureg('1 s'), ureg('1 m/s**2')) == ureg('0 m/s')
Truecalc_safe_stopping_distance
physics.robotics.stopping.calc_safe_stopping_distance(
velocity,
total_latency,
max_deceleration,
loc_margin=None,
physical_margin=None,
)Calculate dynamic stopping distance under non-zero control latency.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| velocity | Quantity | Current operational velocity (e.g. m/s). | required |
| total_latency | Quantity | End-to-end perception-to-brake latency (e.g. ms or s). | required |
| max_deceleration | Quantity | Maximum braking deceleration available (e.g. m/s^2). | required |
| loc_margin | Quantity | Localization uncertainty bound (e.g. cm or m). | None |
| physical_margin | Quantity | Physical obstacle clearance safety margin (e.g. cm or m). | None |
Returns
| Name | Type | Description |
|---|---|---|
| Quantity | Total stopping distance in meters. |
Notes
Equation: d_stop = v * tau_latency + (v^2) / (2 * a_max) + delta_loc + delta_margin
Assumptions: Forward speed is nonnegative, delay and available constant deceleration are positive, and optional nonnegative margins add linearly.
Excludes: Jerk ramps, changing traction, moving obstacles, and safety certification.
References
Reaction distance v * tau adds to constant-deceleration braking distance v^2 / (2 * a), from v^2 = v0^2 + 2 * a * (x - x0) (OpenStax, University Physics Volume 1, Sec. 3.4, Eq. 3.14; Example 3.10 adds reaction-time travel to braking distance the same way). The additive localization and clearance margins are a modeling assumption.
Derivation: Integrate constant speed during the delay and constant deceleration during braking, then add clearance margins.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_safe_stopping_distance
>>> from mlsysim.core.units import ureg
>>> calc_safe_stopping_distance(ureg('0 m/s'), ureg('1 s'), ureg('1 m/s**2')) == ureg('0 m')
Truecalc_scurve_max_permitted_velocity
physics.robotics.stopping.calc_scurve_max_permitted_velocity(
d_clear,
total_latency,
max_deceleration,
max_jerk,
loc_margin=None,
physical_margin=None,
approach_velocity=None,
)Highest cruise speed whose delayed S-curve stop fits the clearance.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| d_clear | Quantity | Clear distance to the obstacle (e.g. m). | required |
| total_latency | Quantity | Pre-brake delay tau (e.g. ms). | required |
| max_deceleration | Quantity | Stop limits a_max (m/s^2) and j_max (m/s^3). | required |
| max_jerk | Quantity | Stop limits a_max (m/s^2) and j_max (m/s^3). | required |
| loc_margin | Quantity | Localization bound and protective clearance subtracted from d_clear. | None |
| physical_margin | Quantity | Localization bound and protective clearance subtracted from d_clear. | None |
| approach_velocity | Quantity | Speed at which the obstacle closes during delay and stop (e.g. m/s). | None |
Returns
| Name | Type | Description |
|---|---|---|
| Quantity | Speed ceiling in m/s (zero if the margins consume the clearance). |
Notes
Equation:
Solves for the largest v with
v * tau + d_S(v) + v_h * (tau + T_S(v)) <= D_clear - delta_loc - delta_margin,
where d_S and T_S are the S-curve stop distance and time (calc_scurve_stop_distance, calc_scurve_stop_time) and v_h is an optional obstacle approach speed (zero for a static obstacle). The left side is continuous and strictly increasing in v, so bisection finds the root. Because d_S is not a single quadratic in v, no one closed form covers both stop regimes; for v_h = 0 in the trapezoidal regime the result equals calc_max_permitted_velocity with delay tau + a / (2 j).
Assumptions: Clearance, delay, margins, and obstacle approach speed are nonnegative; deceleration and jerk limits are positive and the obstacle approaches at constant speed.
Excludes: Obstacle acceleration, curved motion, tracking error, and safety certification.
References
This inverse uses calc_scurve_stop_distance (Biagiotti and Melchiorri 2008, ch. 3) and the additive delay-plus-braking budget of calc_safe_stopping_distance.
Derivation: Find the largest root of delay travel plus S-curve travel plus obstacle closure minus available clearance by bisection.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_scurve_max_permitted_velocity
>>> from mlsysim.core.units import ureg
>>> calc_scurve_max_permitted_velocity(ureg('0 m'), ureg('0 s'), ureg('1 m/s**2'), ureg('1 m/s**3')) == ureg('0 m/s')
Truecalc_scurve_rest_to_rest_time
physics.robotics.stopping.calc_scurve_rest_to_rest_time(
distance,
max_acceleration,
max_jerk,
)Calculate the duration of a jerk-limited rest-to-rest move with no cruise phase.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| distance | Quantity | Positive linear distance in m or angular distance in rad. | required |
| max_acceleration | Quantity | Positive acceleration limit in distance-units per second squared. | required |
| max_jerk | Quantity | Positive jerk bound in m/s^3. | required |
Returns
| Name | Type | Description |
|---|---|---|
| dict | Duration in s, peak_velocity in distance-units/s, and Boolean reaches_max_acceleration. |
Notes
Equation:
A symmetric double-S profile that accelerates, then immediately decelerates. With t_j = a/j and x the time from the start of the jerk ramp to the end of the constant-acceleration plateau minus t_j (peak speed a*x):
plateau reached (x >= t_j): D = a * x * (x + t_j), T = 2 (x + t_j)
no plateau (D < 2 a^3 / j^2): D = 2 j tau^3, T = 4 tau
Returns a dict with duration, peak_velocity, and reaches_max_acceleration. Works for linear or angular moves (distance in m or rad, rates to match).
Assumptions: Distance and both limits are positive; the symmetric profile has no speed limit or cruise phase, with matching linear or angular units.
Excludes: Velocity ceilings, tracking error, and asymmetric acceleration limits.
References
Biagiotti and Melchiorri, Trajectory Planning for Automatic Machines and Robots (Springer, 2008), ch. 3, double-S velocity profile.
Derivation: Integrate the symmetric double-S profile; solve a quadratic when the acceleration plateau exists and a cubic otherwise.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_scurve_rest_to_rest_time
>>> from mlsysim.core.units import ureg
>>> calc_scurve_rest_to_rest_time(ureg('1 m'), ureg('1 m/s**2'), ureg('1 m/s**3'))['duration'].check('[time]')
Truecalc_scurve_stop_distance
physics.robotics.stopping.calc_scurve_stop_distance(
entry_velocity,
max_deceleration,
max_jerk,
)Distance of a jerk-limited S-curve stop entered from zero-acceleration cruise.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| entry_velocity | Quantity | Cruise velocity at stop onset (e.g. m/s); zero gives zero distance. | required |
| max_deceleration | Quantity | Deceleration bound a_max (e.g. m/s^2). | required |
| max_jerk | Quantity | Jerk bound j_max (e.g. m/s^3). | required |
Returns
| Name | Type | Description |
|---|---|---|
| Quantity | Stopping distance in meters. |
Notes
Equation:
The stop drives acceleration from zero to -a at the jerk limit j, holds -a, and returns acceleration to zero at the jerk limit as velocity reaches zero (trapezoidal acceleration, the “double S” velocity profile). The profile is C2: position, velocity, and acceleration are continuous and jerk is piecewise constant.
if v >= a^2 / j: d = (v / 2) * (v / a + a / j)
= v^2 / (2 a) + v * a / (2 j)
else: d = v * sqrt(v / j) (a is never reached)
In the first case the stop equals constant-deceleration braking at a plus cruise over half of one jerk ramp, a / (2 j). Under the bounds |a| <= a_max and |j| <= j_max this is the time-optimal stop, and for a stop that does not reverse it is also the shortest.
Assumptions: Entry speed is nonnegative, acceleration and jerk limits are positive, and both boundary accelerations are zero.
Excludes: Reaction delay, traction variation, tracking error, and safety certification.
References
Biagiotti, L. and Melchiorri, C., Trajectory Planning for Automatic Machines and Robots, Springer (2008; DOI 10.1007/978-3-540-85629-0), ch. 3, trajectory with double S velocity profile, specialized here to a stop from v to rest with zero boundary accelerations. Formula re-derived and checked against a discretized minimum-distance linear program.
Derivation: Integrate symmetric jerk ramps with an optional constant-deceleration plateau; symmetry makes distance v T/2.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_scurve_stop_distance
>>> from mlsysim.core.units import ureg
>>> calc_scurve_stop_distance(ureg('0 m/s'), ureg('1 m/s**2'), ureg('1 m/s**3')) == ureg('0 m')
Truecalc_scurve_stop_time
physics.robotics.stopping.calc_scurve_stop_time(
entry_velocity,
max_deceleration,
max_jerk,
)Duration of the jerk-limited S-curve stop of calc_scurve_stop_distance.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| entry_velocity | Quantity | Nonnegative speed at onset in m/s. | required |
| max_deceleration | Quantity | Positive braking deceleration bound in m/s^2. | required |
| max_jerk | Quantity | Positive jerk bound in m/s^3. | required |
Returns
| Name | Type | Description |
|---|---|---|
| Quantity | Stopping time in milliseconds. |
Notes
Equation:
if v >= a^2 / j: T = v / a + a / j else: T = 2 * sqrt(v / j)
Assumptions: The stop has the same nonnegative entry speed, positive limits, and zero boundary accelerations as calc_scurve_stop_distance.
Excludes: Pre-brake delay, tracking error, and dynamics beyond the acceleration and jerk bounds.
References
Biagiotti and Melchiorri (2008), ch. 3, double S velocity profile; see calc_scurve_stop_distance.
Derivation: Sum the two jerk-ramp durations and the plateau, when present; otherwise solve the triangular acceleration area for duration.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_scurve_stop_time
>>> from mlsysim.core.units import ureg
>>> calc_scurve_stop_time(ureg('0 m/s'), ureg('1 m/s**2'), ureg('1 m/s**3')) == ureg('0 ms')
Truecalc_smoothstep_braking_blend
physics.robotics.stopping.calc_smoothstep_braking_blend(
entry_velocity,
deceleration,
window,
)Exit speed and travel of a fixed-endpoint smoothstep blend from cruise into braking.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| entry_velocity | Quantity | Nonnegative speed at onset in m/s. | required |
| deceleration | Quantity | Positive braking deceleration in m/s^2. | required |
| window | Quantity | Positive blend duration in s. | required |
Returns
| Name | Type | Description |
|---|---|---|
| dict | exit_speed (m/s) and travel (m). |
Notes
Equation: a(t) = -a_b alpha(t / T), alpha(s) = 10 s^3 - 15 s^4 + 6 s^5 v_exit = v0 - a_b T / 2 (the integral of alpha over [0, 1] is 1/2) d_blend = v0 T - a_b T^2 / 7 (the integral of (1 - s) alpha over [0, 1] is 1/7)
The quintic smoothstep has zero first and second derivatives at both ends, so the commanded deceleration rises from zero to a_b with continuous jerk (added 2026-10-20).
Assumptions: Entry speed is nonnegative; positive deceleration rises through a quintic smoothstep over a positive window. The intended regime avoids reversing before the window ends.
Excludes: A zero-speed clamp and subsequent stop. An overlong window can return a negative exit speed.
References
Derivation: Integrate the quintic once for velocity and twice for displacement; the full- window integrals are one-half and one-seventh.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_smoothstep_braking_blend
>>> from mlsysim.core.units import ureg
>>> calc_smoothstep_braking_blend(ureg('1 m/s'), ureg('1 m/s**2'), ureg('1 s'))['exit_speed'].check('[length]/[time]')
Truecalc_stopping_crossover_speed
physics.robotics.stopping.calc_stopping_crossover_speed(
total_latency,
max_deceleration,
)Speed at which travel during the pre-brake delay equals braking travel.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| total_latency | Quantity | Pre-brake delay tau (e.g. ms or s); zero gives v* = 0. | required |
| max_deceleration | Quantity | Braking deceleration a (e.g. m/s^2). | required |
Returns
| Name | Type | Description |
|---|---|---|
| Quantity | Crossover speed in m/s. |
Notes
Equation: v * tau = v^2 / (2 * a) => v* = 2 * a * tau
Below v*, delay travel is the larger term of the elementary stopping budget; above it, braking travel is.
Assumptions: Delay is nonnegative and braking deceleration is positive and constant.
Excludes: Margins, jerk ramps, and moving obstacles.
References
The crossover equates the two terms of calc_safe_stopping_distance (OpenStax, University Physics Volume 1, Sec. 3.4, Eq. 3.14 and Example 3.10).
Derivation: Equate v tau to v squared/(2 a) and select the nonzero crossover branch v = 2 a tau.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_stopping_crossover_speed
>>> from mlsysim.core.units import ureg
>>> calc_stopping_crossover_speed(ureg('0 s'), ureg('1 m/s**2')) == ureg('0 m/s')
Truecalc_travel_between_speeds
physics.robotics.stopping.calc_travel_between_speeds(
start_velocity,
end_velocity,
duration,
)Distance covered while speed changes uniformly between two recorded values.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| start_velocity | Quantity | Nonnegative initial speed in m/s. | required |
| end_velocity | Quantity | Nonnegative final speed in m/s. | required |
| duration | Quantity | Nonnegative elapsed time in s. | required |
Returns
| Name | Type | Description |
|---|---|---|
| Quantity | Distance in meters. |
Notes
Equation: x = (v_start + v_end) / 2 * t
With equal speeds this is the delay travel v * tau of the stopping budget; with two recorded speeds it is the trapezoid estimate of the distance covered between them.
Assumptions: Both endpoint speeds and duration are nonnegative; speed varies linearly between endpoints.
Excludes: Unobserved nonlinear speed changes and reverse travel.
References
Constant-acceleration travel is x = (v0 + v) / 2 * t (OpenStax, University Physics Volume 1, Sec. 3.4, Eq. 3.11 with Eq. 3.12).
Derivation: Integrate the linear velocity interpolation: mean endpoint speed times elapsed duration.
Examples
>>> from mlsysim.physics.robotics.stopping import calc_travel_between_speeds
>>> from mlsysim.core.units import ureg
>>> calc_travel_between_speeds(ureg('1 m/s'), ureg('1 m/s'), ureg('1 s')) == ureg('1 m')
True