Embedded software for many complex cyber-physical systems, for example, trains, planes, and self-driving cars is safety critical. Errors can have disastrous consequences. To ensure the safety of controllers, formal verification with computer-checked, repeatable mathematical proofs presents a particularly trustworthy method for controller design.
Automated train control improves railroad operation by safeguarding the motion of trains while increasing efficiency by enabling motion within a safe envelope. Train controllers decide when to slow trains down to avoid collisions with other trains on the track, stay inside movement authorities, and navigate slopes, curves and tunnels safely. These systems must base their decisions on detailed motion models to guarantee the absence of overshoot of the movement authority (safety) and limit undershoot (efficiency). Train controllers decide when to enforce braking to prevent movement authority violation and collisions. They must account for all the competing influences that govern train motion. Uphill slopes, for example, decrease velocity, which decreases resistance, which permits a more rapid increase in velocity, slope and curve effect, all while the train's brake force builds gradually until saturation as air pressure propagates along brake pipes. These complex interactions make it hard to design a safe and efficient train controller, and even harder to ensure it is always safe.
Train controllers are assessed relative to a (changing) destination stopping point-called end of movement authority. An overshoot of the end of movement authority is a safety violation, because that risks collision with other trains. The efficiency of the train controller is measured in terms of end of movement authority undershoot.
Existing studies of formally verified train motion do not account for at least two effects amongst track grade, track curvature, resistance, and air brake propagation time, rendering their results inapplicable to most real-world scenarios. The kinematics of a train can be described by a kinematics model. For example, the Federal Railroad Administration has developed such a model, referred to here as the FRA model.
Verification against the full dynamics of the FRA model, in which these effects interact subtly with each other is a challenge. Verification of the FRA model would be significant, because these parameters influence the motion of the train in safety-critical and/or performance-critical ways. Neglecting track slope profile and the gradual propagation of air pressure braking, in particular, can render otherwise verifiably safe train controllers unsafe, since their influence may diminish the train's ability to decelerate, causing collisions.
The embodiments described herein use formal verification as a tool to design and verify a train controller, which is a practically important, representative problem with challenges common in other safety-critical embedded systems: complex dynamics with transcendental arithmetic, competing forces with subtle interaction, and effects whose exact magnitude is unknown at proof time.
Before verifying the safety of a controller, the controller must first be designed. Controllers balance efficiency with provable safety. Conservative controllers are mathematically more simplistic, and easier to design and verify, but make railway operations inefficient, but violate performance objectives. A conservative safe controller is first described, and then iteratively made more efficient through the exploitation of characteristics of the physical train dynamics for better but safe control.
The absence of end of movement authority overshoot is proven when using the controller on the FRA model by verification and efficiency is demonstrated by simulation.
To keep the proofs as general and widely applicable as possible, nondeterministic controllers and a paradigm of mathematical abstraction are leveraged. Each controller is intentionally built to be set-valued such that all of its control choices are simultaneously proved safe under all circumstances in the FRA model. The safety of these controllers implies the safety of all their specializations, giving railroads significant freedom in how to adapt the verified controllers for their purposes.
Controller verification follows a two stage process. First, mathematical models of abstract train control motion are proven. Second, proofs of the actual physical models of train control are obtained by uniform substitution to replace the abstract function symbols of the mathematical models with physical terms specific to the FRA model or even specific railroads.
Crucially, the disclosed embodiments use three different types of models: (i) the high-fidelity physics model describing the kinematic motion of trains along the track; (ii) the generalized mathematical abstractions of the physics model disclosed herein; and (iii) simplified but computable approximations of motion models disclosed herein (e.g., Eqs. (4), (5), (12) etc.) and used by the respective train controllers.
The verification provided by the disclosed embodiments proves that the safety of (i) derives from the safety of (ii) and that all control decisions following (iii) are safe in (ii). The proof is written in differential dynamic logic and performed using a hybrid systems theorem prover.
It should be noted that the embodiments are explained in the context of the FRA model, but it is to be understood that the techniques could be applied to any train kinematics model.
The embodiments described herein utilize formal verification using differential dynamic logic (DDL) as a tool to design and verify a train controller. This is a practically important, representative problem with challenges common in other safety-critical embedded systems: complex dynamics with transcendental arithmetic, competing forces with subtle interaction, and effects whose exact magnitude is unknown at proof time.
The disclosed embodiments provide a novel, formal verification of the safety of the Federal Railroad Administration freight train kinematics model with all its relevant forces and parameters, including track slope and curvature, air brake propagation, and
resistive forces as computed by the Davis equation. Due to the significant competing influence of these parameters on train stopping distances, even designing train controllers is a nontrivial control challenge, which is solved using formal verification.
For increased generality at reduced verification effort, symbolic mathematical generalizations of the train control models are verified and efficient uniform substitutions are subsequently applied to obtain verification results for physical train control models.
Differential Dynamic Logic—DDL is a logic with a deductive proof system for hybrid systems. DDL extends first-order logic with the notion of hybrid programs. A hybrid program runs according to a binary relation between states, mapping start states to end states that a program could reach. The program constructs include assignment, for example, x:=e1 which instantaneously assigns expression e1 to variable x. In the special case of nondeterministic assignment, x:=*, the transition relation accounts for any possible real value being assigned to x.
The test operator, as in ?F, aborts the current run if formula F is false. The continuous evolution operator, {x′=f(x)&Q} follows the ordinary differential equation (ODE) x′=f(x) for some nondeterministic amount of time, with evolution domain constraint Q being true throughout the evolution. Sequential composition α; β, runs program α followed by program β, for example, the discrete train controller
followed by the train's ODE β. The nondeterministic choice operator α∪β runs either program α or β, for example, to either accelerate the train with α or brake with β. The loop operator α* runs hybrid program α any non-deterministically chosen n≥0 times. It is important for running a train control loop indefinitely. To express safety properties about hybrid programs, the box modality [α] F is used, which is true in any state from which all runs of hybrid program end in states in which the formula F is true.
For proofs of DDL formulas, DDL inference rules are used. The rules most relevant to the disclosed embodiments are loop (loop), differential invariant (dI), and differential cut (dC).
The loop rule uses an invariant/that holds initially, inductively after each step, and implies the post condition that is to be proven. A differential invariant preserves properties along the flow of a differential equation: if e1≤e2 initially and e1 grows slower than e2, so e′1≤e′2 (where e′1 and e′2 are evaluated after substituting in the assignment x′: =f(x) from the differential equation), then it remains true that e1≤e2. The idea behind a differential cut is that if formula C holds true at the end of every possible run of differential equation x′:=f(x), then C must hold true throughout its evolution. Differential cuts can be used to accumulate knowledge about a differential equation.
FRA Model of Train Kinematics—The FRA model, provides the forces acting on a train and is expressed in Eq. (1). After the net force on the train has been identified, Newton's second law, using train mass, determines the acceleration that the train experiences, which in turn determines change in velocity and change in position for train control design. The forces are
where:
Newton's second law, ΣF=mTa determines train acceleration a. Resistive force FR follows the modified Davis equation:
where AR, BR, CR, DR are experimentally determined positive constants, the numerical value of which, given a choice of units, can be found in other sources. Further, n is the number of axles, and w is the weight of the train.
Grade and curve forces depend on the train position p on the track. Grade force is proportional to train weight w and average track grade grade(p) underneath the train:
Similarly, curve force is a function of average track curvature curve(p) along the train and train weight w:
where AC and AG are positive multiplicative constants.
Braking force can be modeled as the minimum of two linear functions to capture the effect of air pressure brake force buildup and stabilization.
where:
Brake enforcement and train protection algorithms approximate a solution to a differential equation derived from Eq. (1) to estimate the velocity and position of the train at future times.
Mathematical Model Abstraction—To maximize generality of the embedded software design, minimize verification effort, and simplify future proof maintenance, a mathematical abstraction of the FRA model is disclosed. Concrete verified controllers and their safety proofs for the fully expanded model can be obtained automatically from the verified abstract model by uniform substitution.
The abstract train kinematic model in Eq. (2) below is an ODE in time. The rate of change of position is velocity, and the rate of change of velocity is acceleration. The variables and constants involved, along with their signs, when relevant, are (i) train position p; (ii) velocity v; (iii) velocity and position-independent component of acceleration al ranging from immediate braking ability −bmax<0 to maximum train engine acceleration amax>0; (iv) acceleration due to air brakes aa in range abmax<0 to 0; (v) rate of change mb of air brake acceleration, which is mp<0 when the brakes are ramping up and 0 otherwise; (vi) map as from position to acceleration due to grade; (vii) map ac from position to acceleration due to curvature; and (viii) velocity-dependent resistance ar. In the chosen sign convention, resistive acceleration is negative.
with:
The resistance is given by the Davis equation:
which has the shape ar=a1v+a2v2 when a1=−Crg with gravity g summarizes the linear coefficient of velocity, and
summarizes the quadratic coefficient. Grade and curvature are represented by unspecified but bounded functions as and ac that map train positions to a numeric value for acceleration due to slope and average curvature, respectively. The quantity al summarizes locomotive tractive effort (al>0) and train deceleration (al<0) as commanded by the train controller, with adjustment for the velocity-independent resistance.
The proven abstract kinematic train model is then instantiated by uniform substitution of DDL to obtain proofs for specific physical kinematic train models such as the FRA model. Similarly, proofs for specific train configurations result from substituting values for coefficients, or even for a specific train state when additionally substituting speed and position.
A conservative train controller is first developed in DDL based on the abstract train kinematic model given by Eq. (2). The challenge of representing track grade and curve, which are unknown at proof time, are addressed using unspecified maps. To reason about them, the maps are bounded with assumptions quantifying over all arguments. The solution of the disclosed embodiments permits the capture of the full Eq. (2) without conservatively neglecting as(p) and ac(p) when reasoning about it during verification. It generalizes to other embedded software that must reason about unspecified, bounded functions, such as noise or potential fields (e.g., electro-magnetic or gravitational effect).
The conservative controller is then proven to be safe. Relative to Eq. (2), the controller will provably never permit the train's position to exceed the end of movement authority e, although it might be inefficient, braking unnecessarily early. By revising modular components and functions to be more arithmetically sophisticated in provable safety can be retained and the controller made more efficient.
Model Description—The train controller consists of a time control loop. The control has a latency of time T>0. The controller has to wait at most this long before being able to change the throttle position. In practice, reaction time (latency) T is typically on the order of 1 second, but train controllers often keep decisions in effect for a 10 second period without revising them. Every control cycle, the controller computes an over-approximation stopDist(p,v,ab) of the stopping distance, the distance that the train will travel before stopping if it were to accelerate during the current control cycle, but then brake continuously starting at the next control cycle, until it comes to a halt. If the distance left to the end of movement authority e exceeds stopDist(p,v,ab), the controller continues free driving (with any acceleration or deceleration choice within the physical limits of the train), otherwise it brakes. This control cycle, α(stopDist), is parametric in stopping distance stopDist, and expressed as a hybrid program in Model 1, shown in
Train Dynamics-Model 2, shown in
Stopping Distance—To decide between free driving and braking, the controller computes the upper bound stopDist(p,v,ab) on the distance covered over one time period of acceleration and subsequently braking to a stop. Thus, the models provide two distinct specifications of the distance that the train will take to stop. The first, indirect specification is through the differential equation in Model 2 that implicitly describes the physical motion of the train. The second, approximate specification is stopDist in Line 2 of Model 1, an explicit arithmetic expression that the controller can evaluate efficiently to make decisions at runtime. Efficiency concerns demand that stopDist(p,v,ab) be as tight as possible. If the bound is too large, the controller enforces braking unnecessarily. But verifiable safety requires stopDist(p,v,ab) to provably be an upper bound on the distance that the train covers (as determined by the dynamic model). The tightest possible bound is the exact solution of the differential equation. However, even ignoring the effect of air brakes, the differential equation requires trigonometric solutions. Transcendental function arithmetic is undecidable. To ensure mathematical provability, polynomial approximations are developed, which is a delicate design task because automated decision procedures for polynomial real arithmetic validity are computationally expensive. This constrains the complexity of the polynomial approximations that can be used as upper bounds. A balance can be struck between conflicting concerns: striving for efficiency while satisfying mathematical provability.
To illustrate this approach, start with a simple conservative expression for stopDist. This expression is proved safe for the full model including slope, curve friction, air brake propagation, and aerodynamic drag. The approximation is then improved, focusing on one contributing factor at a time.
Conservative Stopping Distance-A conservative controller will now be constructed by instantiating control loop with an expression for stopDist and proving it safe. Referring back to the train dynamics in Eq. (2), an upper bound for v is first needed. Integrating this bound via p′=v computes a stopping distance upper bound.
The first impediment to obtaining a provable upper bound for v is that grade and curvature maps as and ac are arbitrary functions, constrained only by upper and lower bounds, and bounded gradients. At runtime, the train knows their exact values as the controller is instantiated with maps for the railroad it runs on. However, these maps are unknown at proof time. And yet, the proof has to show safety of the train control ahead of time for all possible track maps in order to justify safety of the train controller. To obtain a provable upper bound on stopping distance, the proof is therefore based on the limited information that we do have about the maps: upper bounds on the potential values of as and ac.
A naive upper bound on as is the value of acceleration that the train experiences when it is on the steepest permissible downward slope, ms. The proof shows that the distance required to stop for any permissible grade map cannot exceed the distance computed with the steepest downward slope. It first shows that the true acceleration is bounded above by an acceleration that uses the highest permissible value of grade acceleration, then that actual velocity cannot exceed the velocity computed using the worst-case acceleration, and consequently, that traveled distance cannot exceed the stopping distance computed using the worst-case estimate of velocity.
Accounting for grade force is important. On a downward hill, for example, a train with a controller that ignores grade would roll forward even at the end of its movement authority which may cause accidents. In contrast, curve resistance can be safely ignored when approximating stopDist, because resistances shorten stopping distance (upper bound 0). These simplifications result in differential equation v′2=al+ms+ar(v) because max(ab,abmax)=0 while the train is accelerating, where v2 is the upper bound on v that is integrated to compute stopDist. However, the solution v2(t) is still transcendental:
The culprits are the linear and quadratic terms in velocity from the Davis equation. With another simplification of 0 as an upper bound for ar (resistance always works against the train's motion), a polynomial expression is derived for stopDist:
where:
The solutions provide a conservative stopping distance bound.
Where the first and second terms represent the distance while accelerating and the third term represents the stopping distance from increased speed.
The conservative stopping distance stopDist; ignores its arguments p and ab, but later refinements of stopDist functions also depend on p and ab, which is why they are passed in.
The first two terms are the distance covered by the train in one control cycle of acceleration, while the third term is the distance that the train needs to stop should it start braking right after, assuming the worst-case value of 0 for da. This conservative distance is adjusted to account for grade force with its worst-case accelerating or decelerating effects. Substituting Eq. (4) into control cycle a results in the DDL hybrid program of the conservative controller: α(stopDistb).
A physically important quantity is braking distance, the distance that the train will travel before coming to a stop should it start braking right now. an upper bound, brake Distb(v,ab) is derived, which will be crucial to the proofs and the initial assumptions and is improved upon later.
The last term of Eq. (4) is brakeDistb(v3(T),0) with v3 according to Eq. (3) when
Initial assumptions init(brakeDist) parametrized by brakeDist, and initAirbrake (assumptions on air brakes) are required to prove the conservative controller safe. Assumptions about unspecified functions are represented by universal quantification over their input. This representation permits derivation of a formula about the unspecified function at any point of the train's evolution by substituting the quantified input with current values.
Theorem 1 is the DDL formula representing the safety of the conservative controller:
Theorem 1: The conservative braking controller guarantees that the train always remains within the end of the movement authority. The DDL formula below is provable, where a is the control loop from Model 1 parameterized with Eq. (4) for stopDist.
The proof has been done in the theorem prover KeYmaera X, but the central ideas are disclosed here. Loop invariant e−p≥brakeDistb(v, 0)∧ab≤0∧v≥0 is used and split into cases for free driving and braking corresponding to the nondeterministic choice in Lines 2-5 of Model 1. On braking, the invariant is maintained because the derivative of the distance that the train will take to come to a stop does not exceed the derivative of the distance to the end of movement authority (i.e., (stopDistb)′≤(e−p)′). On free driving for a control period T, the train maintains a distance to the end of movement authority of at least stopDist adjusted for time t since the last control decision:
by dC and dI. The required inequality relation between the derivatives:
holds because v′−(amax+ms)≤0.
To make our controller more efficient, the over-approximation for stopping distance must be improved. The FRA model presents two challenges common in embedded controllers: it uses functions whose exact values are unknown at proof time (slope and curve maps) and has many interacting forces. The disclosed techniques address these problems with two general principles: using quantified worst case bounds on unknown functions, and separation of dependencies. The first technique relies on the observation that the track changes are gradual and predictable (the rate of change of unknown functions is bounded). It drastically improves bounds on the effect of grade and curve over one time period of acceleration, after resolving circular dependencies between the variables of motion. The second technique improves the estimate brakeDist by accounting for air brake dynamics. It demonstrates a handling of triple integration, using mode-splitting to deal with the non-analytical change of behavior when brakes saturate. The third technique uses Taylor polynomials to capture the effect of resistance, which would otherwise lead to transcendental arithmetic.
Bound on Gradient—The train controller knows the current slope as(p) and vertical curves of the track, which determine transitions from one track grade to another. This knowledge results in a bound hmax on the difference in grade per unit length:
The second inequality follows from the first using the chain rule and p′=v. After time T, as could have increased by no more than uhmaxT, where u is some upper bound on v over the course of T time
Bound on Curve Resistance-Similar to bounding the gradient change, an upper bound on the rate of change of curve resistance can be computed as a function of velocity using track geometry. Curve resistance depends on average curve curve(p). Assume that the tightest permissible curvature for the railroad corresponds to radius r. The greatest change in average curvature occurs when a train goes from a track with the greatest permissible curvature to a straight track (or vice versa). Over a small period of time dt, the portion of the train transitioning from greatest curvature to 0 curvature is dv, where v is velocity. So the rate of change of curve (p) (taken in radians) with respect to time is
where l is the length of the train. For a given train, ac relates to curve with some constant multiplicative factor q. In this case, use
with the constant factor
With this bound on the maximum rate of change of ac, we now estimate the upper bound on curve resistance over time T, where p0 is initial train position, to be:
As before, u is an upper bound on velocity for duration T.
Tight Stopping Distance Approximation—The upper bounds ās on gradient and āc on curve resistance are summarized as:
This enables improvement of the estimation of stopping distance:
Upper bound v4 is tighter than v3 of Eq. (3) and thus integrates to an improved stopping distance estimate. It depends (transitively through ās and āc) on the unknown upper bound u on velocity, which is still needed to estimate provably correctly.
Circular Dependencies—The upper bound on velocity, u, is undefined in Eq, (7) above. The bound v4 cannot be used for u, since v4 itself is phrased in terms of u. The problem is a circular dependency between as and v: the bound on slope acceleration as depends on speed v, while the upper bound on speed v, in turn, depends on slope acceleration as and likewise for ac. Physically, this is because if the train is moving faster, less is known about the nature of the track (e.g., its curve and slope) after the passage of some time, as the train is farther from its previous position on the track. However, information about the grade curve is needed to better estimate the velocity at which the train is traveling. To cut through these circular dependencies, the conservative estimations of these quantities are used as a base case to bootstrap incrementally finer computations, as presented below.
The initial upper bounds ms for as and 0 for ac are used to get a conservative bound v(t)≥v0+(amax+ms)t, so that u=v0+(amax+ms)T. Because (amax+ms) is a positive upper bound on the train's acceleration, velocity could have increased no more than (amax+ms)T. Hence, u is indeed an upper bound on v through the T time interval. Substituting this u refines the gradient and curve resistance bounds.
These expressions give the chosen definitions of ās and āc by replacing placeholder velocity bound u.
In principle, this upper bound could be further improved on speed by using v4 to obtain an even better bound on as and ac, which could in turn yield an improved bound on v. However, extra levels of extrapolation increase proof cost and computation time when the controller is run. Each extra intermediate bound requires a constant number of extra steps in the proof, but provides diminishing efficiency gains in return. Intuitively, proof length is asymptotically linear in number of iterations because under optimal proof rule application ordering, each iteration induces one extra application of rule dC to introduce the intermediate bound into the proof tree, and rule dI to justify this intermediate bound.
The stopDist expression below uses 14 with u=v0+ (amax+ms)T to estimate stopping distance, which is sufficiently tight to make useful control decisions.
Further initial assumptions are needed to prove the improved slope-exploiting controller α(stopDists) safe. These assumptions represent the result of the track environment discussion used for the computer-checked proof.
This technique applies to time-triggered controllers (where a control loop runs with some known maximum latency and sensors measure current state every cycle) for physical systems with functions affecting the environment that are unknown except for bounds on their rate of change. The future value of the functions can be bounded in terms of their worst-case rate of change. Furthermore, these bounds can be used to compute bounds on other variables in the system, just as here a bound on velocity was used to bound slope and curve effect, which was again used to obtain a better bound on velocity. The situation arises frequently in practice: examples of unknown functions are a potential field, or a noise or error effect, which may have circular dependence with position.
Theorem 2: The slope-estimating controller guarantees that the train stays within its movement authority. The DDL formula below is provable, where a is the control loop from Model 1 parameterized with Eq. (8) for stopDist.
The proof (by proof in KeYmaera X) builds on the ideas from Theorem 1. The loop rule is applied with the same loop invariant as Theorem 1. If the train brakes, differential invariant rule dI again shows that the loop invariant holds throughout differential equation evolution.
If the train chooses to accelerate, then as before, the train maintains at least a distance of stopDists adjusted for time t since the last control decision. Unlike before, ās instead of ms accounts for worst-case as, and āc instead of 0 accounts for worst-case ac. Again, dI proves that this adjusted inequality remains true. To prove the required inequality on the derivatives, differential cut rule dC is used to show ās(p0)≥as(p) throughout the control cycle, and āc(p0)≥ac(p). There are two branches for each cut corresponding to how the min in ās and c resolve. For example, using initial position and velocity v0 and p0, for ās, it is necessary to show that as(p)≤ms, and as(p)≤as(p0)+uhmaxT. While the former follows from the quantified assumption on as(p), to prove the latter, elapsed time is adjusted for t, to argue that as(p)≤as(p0)+(v0+uhmax(T−t)), proved using dI. The required derivative inequality follows from instantiating the quantified assumption bounding the rate of change of (as(p))′≤uhmax with the current position and showing that u is an upper bound on v in the control loop. The argument for ac is analogous.
Effect of Air Pressure Brakes—The term brakeDist; conservatively neglects the significant effects of air brakes to avoid reasoning about their time dependence. A tighter brakeDista that accounts completely for air brakes will now be derived. It specifies a controller that simultaneously benefits from the slope and curve estimation previously discussed, and from air brake dynamics. The central insight required to prove the improved controller safe is how to compose reasoning about time-dependent air brake propagation and velocity-dependent slope and curve estimations. The component of stopDist affected by air brakes, brakeDista is first shown to be the desired upper bound on distance to brake throughout the control loop. Then, holding brakeDista constant, the differential reasoning on slope and curve estimation previously described is performed. The two results together permit an overall proof of safety of the air brake-exploiting controller.
To derive the improved brakeDista, some intermediate functions from air brake dynamics are first computed. In Eq. (2), during brake ramp-up, with slope relaxed pessimistically to ms, and curve and resistance to 0, max(ab,abmax) evaluates to ab, and mp to mp. The solution for v in the resulting differential equation v′=bmax−ms+ab,a′b=mp is quadratic in t:
Function tb in Eq. (11) computes the time the train takes to achieve full braking by subtracting current brake buildup ab from maximal air braking abmax, and dividing by the rate of increase in air brake force mp. If the train comes to a stop before air brake saturation, it instead evaluates to the time until the train stops, as computed by solving Eq. (10) for v=0.
The distance that the train travels before either stopping or reaching maximum air brake effect is:
The velocity of the train after this period of buildup, by Eq. (10), is:
So, after the brakes finished ramping up, the distance traveled until the train comes to a halt is:
using Newton's third equation of motion. If the train stops before finishing brake ramp-up, vf evaluates to 0, as required. Adding the upper bounds on distance traveled before and after brake ramp-up results in brakeDista(v,ab) in Eq. (12) below, an upper bound on braking distance that accounts for the effect of air brakes. While this derivation for controller design is manual, its result will be verified by computer-checked proof in Theorem 3 below.
To prove the invariant that after a control cycle of braking, e−p>brakeDista(v,aa), three dynamically distinct cases must be considered: (i) when max(ab,abmax) is abmax; (ii) when it is ab, and tb(v,ab) evaluates to (abmax−ab)/mp; and (iii) when it is ab but tb(v,ab) evaluates to
The model dynamics are split into these three evolution domains, branching between the three possibilities in a loop to transition between modes freely (Model 3, shown in
Theorem 3: The air-brake-exploiting controller guarantees that the train stays within its movement authority. The DDL formula below is provable, where α is the control loop from Model 1 parameterized with Eq. (12) for stopDist.
inits(brakeDista)∧initAirBrake→[(α(stopDista);Model 3)*]e−p>0
The high level idea of the proof (in KeYmaera X) is to use an outer loop invariant e−p≥brakeDist(v,aa)∧ab≤0∧v≥0 and again split into free driving and braking cases. On braking, the outer loop invariant is maintained in each of the three dynamics modes using an inner loop invariant consisting of 4 formulas, the most important of which is e−p>brakeDist(v, max(ab,abmax)).
On free driving:
is truly an upper bound on all reachable brake Dist (v, max(ab,abmax)) values in the control cycle. Then, holding brakeDista0 constant, a proof similar to that for Theorem 2 is followed to show that, in every mode, the increase in p does not exceed the decrease in distance buffer
The free driving inner loop invariant consists of 14 formulas, most of which state that various upper bound expressions (such as on velocity, grade and curve) remain upper bounds over the course of the loop. By monotonicity, then, e−p>distance buffer+brakeDista0>brakeDist(v,max(ab,abmax)).
Exploiting Resistance-Exactly accounting for the quadratic dependence of resistance on velocity, as discussed above, leads to an undecidable, transcendental exact solution for stopping distance. The controller must instead use an approximation. Because polynomial arithmetic is decidable, Taylor polynomials are a natural way to obtain decidable approximations. The disclosed embodiments apply Taylor approximations to the FRA model, identifying techniques generalizable to verified control for other embedded systems with transcendental dynamics.
The Davis equation implies
The first-order Taylor polynomial of this expression for velocity is
Using this approximation at time T, with al=amax, as an upper bound for velocity after a time period of acceleration, Eq. (13) is computed for stopping distance that leverages resistance. While this derivation is manual, its result will be verified by computer-checked proof in Theorem 4 below.
Unlike previous stopping distance estimates, this expression is not always an upper bound. It uses resistance for the original velocity v0, which is only a conservative bound when resistance is low enough to permit acceleration. This condition is captured by predicate vbound in Eq. (14):
For the Taylor approximation controller (Model 4), the stopDisttp predicate is defined in Eq. (15), which, unlike previous expressions for stopping distance, returns a truth value. It uses previous definitions stopDist, from Eq. (13), vbound. From Eq. (14) to determine when stopDist, is applicable, and stopDistb from Eq. (8) is used as a fallback.
Higher order Taylor polynomials permit analogous reasoning. Theorem 4 expresses that the Taylor polynomial controller in Model 4, shown in
Theorem 4: The Taylor polynomial controller guarantees that the train stays within its movement authority. The DDL formula below is provable:
The proof (in KeYmaera X) starts by showing that the loop invariant from Theorem 3 is maintained (using DDL rule loop). The case where the train is braking proceeds similar to Theorem 3. When the train is accelerating, a showing that the controller has insisted on a sufficient distance margin (stopping distance), so that even after a time period, the train has enough space to stop, is necessary. As the Taylor polynomial computes the stopping distance, it must be proven that it actually is an upper bound. A monotonicity argument is used by introducing an auxiliary variable that represents a “ghost” train, perpetually traveling down worst possible slope ās and curve āc. This isolates slope and curve from the effect of resistance, breaking interdependence. The Taylor polynomial result, derived on the ghost train, shows that it goes no slower than the real train, and that consequently the Taylor polynomial result must hold for the real train. Other elements of the proof remain similar to Theorem 1.
A proof for the FRA model derives from the proof for the abstract mathematical models (e.g., Theorem 4), by uniform substitution, which replaces abstract function symbols with specific terms using the correspondence previously discussed. Model 5, shown in
A corollary posits that the kinematic train model is safe. That is, the train controller for the FRA model never overshoots the end of movement authority. The following formula is provable with
Here is the proof. By uniform substitution from Theorem 4, using the substitutions σ below:
For validation, ModelPlex can be used to derive a controller monitor from Model 5 that measures the safety margin in decisions of previous brake enforcement controllers and the verified control presented herein. That way, measurements of if, and how well, the verified train controllers and existing controllers agree can be used to assess the safety of those existing systems and the efficiency of the model. Existing brake enforcement controllers brake to a full stop once engaged.
The ModelPlex monitor computes a robustness measure indicating how close a decision is to losing the safety proof. When the robustness measure is positive, the decision is guaranteed to remain provably safe so that the system enjoys the safety proof of the verified model. When it is negative, emergency brakes should be applied for safety reasons. The ModelPlex controller monitor follows the structure of the verified model when it computes robustness. For example, a monitor for Lines 2-3 of Model 5 describes their effect with the formula stopDisttp(p,v,0)∧−bmax≤ai<amax which translates to the robustness measure.
The most important elements of the full Model 5 monitor are: (1) in free driving (when stopDisttp is satisfied) it combines remaining position margin, that is, the larger of Taylor margin e−p−stopDistt when vbound (v), or fallback margin e−p−stopDista with acceleration choice robustness min (al+bmax,amax−al) from control decision a:=*;?−bmax≤1<amax. and speed robustness. That is, v from evolution domain . . . &v≥0; and (2) during braking, which is always allowed, it measures speed robustness, that is, v per evolution domain constraint.
Because the robustness measure of ModelPlex combines multiple quantities of incompatible units, there is no direct interpretation of its magnitude, but only of its sign. For validation, the train model of Eq. (2) was implemented in Python by numerical integration, instantiating the model parameters per the FRA model. These parameter values are estimated from train test runs and standards and require careful consideration of their units.
The evaluation compares start braking and stopping points of trains, highlighting braking performance in terms of overshoot (safety risk) and undershoot (performance objective of a maximum undershoot of 1000 ft) of the end of movement authority. The baseline controllers were implemented using numeric forward Euler integration to simulate the model to determine the stopping distance. The verified controllers neither use numeric integration nor include the dynamic model, but instead decide based on the stopping distance over-approximation stopDisttp from Eq. (15).
The most interesting train behavior arises from the subtle interplay between air pressure propagation, aerodynamic/roll resistance, and acceleration/deceleration due to slope. It peaks on crests that change gradient from uphill to downhill and in troughs that change gradient from downhill to uphill. When calculating stopping distance, numerical integration in the baseline enforcement algorithms discretizes train speed and position to calculate forces, which overestimates resistance while simultaneously underestimating available brake force. Acceleration/deceleration due to slope is even more subtle as it depends on the position of the train along the slope (e.g., on a crest changing from uphill to downhill, deceleration on the uphill segment is overestimated until the train passes the top, afterwards acceleration is underestimated). These effects do not balance out and thus make numerical integration errors unreliable and hard to predict. Moreover, changing the integration step size shifts how distance estimates are biased towards undershoot or overshoot (e.g., in typical configurations, brake ramp-up is the dominating influence on stopping distance, and so larger integration step sizes bias towards undershoot). As a result, for any given configuration of numerical integration in enforcement algorithms, scenarios can be constructed where the numerical integration underestimates stopping distance and train enforcement exhibits unsafe behavior. The formal models and proofs presented herein design provably correct stopping distance over-approximations instead of using numerical integration and are, therefore, not subject to these intricate safety tradeoffs.
Stopping Behavior in Troughs—The first validation in
The base enforcement algorithm in
Stopping Behavior on Crests—An assumption in the brake enforcement algorithms and thus an initial condition in the proof is that train locomotives are not underpowered: their tractive effort is enough to overcome maximum uphill slope and stay stopped on the maximum downhill slope.
Underpowered locomotives are especially challenging on a crest where (full) tractive effort is needed to limit the speed loss on the uphill slope and regain desired speed on the downhill segment, but air brakes are needed to stay stopped.
Numeric integration underestimates stopping distance in several configurations, whereas our verified controller correctly identifies the need to engage air brakes in time while simultaneously avoiding the inefficiencies of fudge factors.
Verified train controllers that account for the FRA model were formally verified with all its competing influences of track grade, curve resistance, air brakes and Davis resistance. Techniques that generalize to resolve challenges in safety critical embedded software design improved controller efficiency. Validation in simulation shows significant improvement in undershoot over conservative controllers that use safety offsets, and improved safety compared to controllers without safety offsets.
The invention has been described in the context of specific embodiments, which are intended only as exemplars of the invention. As would be realized, many variations of the described embodiments are possible. For example, variations in the design, shape, size, location, function and operation of various components, including both software and hardware components, would still be considered to be within the scope of the invention, which is defined by the following claims.
This application is a national stage application under 35 USC 371 of PCT Application PCT/US2022/048651 filed Nov. 2, 2022 which claims the benefit of U.S. Provisional Patent Applications Nos. 63/276,225, filed Nov. 5, 2021 and 63/290,860, filed Dec. 17, 2021, the contents of which are incorporated herein in their entireties.
This invention was made with United States Government support under contract 693JJ620C000025 awarded by the Federal Railroad Administration Office of Research, Development and Technology. The U.S. Government has certain rights in the invention.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/US2022/048651 | 11/2/2022 | WO |
Number | Date | Country | |
---|---|---|---|
63290860 | Dec 2021 | US | |
63276225 | Nov 2021 | US |