0

I have the following simplyfied problem and have to develop an algorithm to optimize it.

Let's imagine n number of trains with zero mass.

  • Each train is placed on their own railway.
  • Each train has it's owm maximum acceleration constraint.
  • Each train has it's own maximum velocity constraint.
  • Each train has m number of fix points that describe the m positions of the train on it's railway. These points can be regarded as synchronized. E.g. At time t = 3 each train is at it's own fix point[3].

The time is rastered in a fixed grid. E.g.: 0.1seconds First we assume, that each fixed point is 0.1seconds apart from the next. E.g.: fixed point1 has time 0sec ; fixed point2 has time 0.1sec ; .... For some points it will not be possible to reach the next point in 0.1sec given the velocity and acceleration constraints. In that case another intermediate point should be inserted between them on the 0.1sec time grid. E.g.: fixed point1 has time 0sec ; intermediate point has time 0.1sec ; fixed point2 has time 0.2sec.

Now for a start i would like to optimize the route of a single train: Again, the train has m fix points P, a maximum acceleration a_max & a maximum velocity v_max constraint. How can I "interpolate" those fixed points, so that the velocity (gradient) doesn't exceed v_max & the acceleration (curvature) doesn't exceed a_max? The fixed points have to be on a fixed grid. E.g:0.1sec. Intermediate points may be inserted on that grid that lie on the "interpolation" curve.

An example:

"Input" example for one of many segments.

"Output" example for one of many segments.

Here we see P1 at t = 0 and P2 at t = 1 and the travel path when accelerating at max acceleration in green. (The green curve will cap out at a the maximum gradient v_max. But for simplicity is disregarded in this ecxample) As you can see, the Point P2 can't be reached in time. P2 has to be moved to the next timestep t = 2 and an intermediate Point P1.5 has to be inserted along the curve at t = 1. The green curve is the function s = 0.5 a t^2 for constant acceleration with a starting velocity v0 = 0.

Notes: As you can see we have some degree of freedom after moving P2 to the next timestep as it does not lie directly on top of the green curve. There may be different starting velocities. So optimizing in regards to brake-distance has to be considered.

I thought of interpolating backwards through each segment. Giving eat point a maximum velocity allowed in case the starting velocity v0 is too high to "brake" to reach the next point. Then iterate forwards and try to accelerate as much as possible. But not to much to exceed the maximum allowed velocity. But i feel like this approach will lead to nowhere and there might be more ellegant solutions. This problem is especially important in robotics so there must be an elegant solution.

Evil_skunk
  • 3,040
  • 4
  • 30
  • 42
MuFFiiN
  • 3
  • 2
  • Your "iterate backwards to determine max. velocity; then iterate forwards to accelerate as much as possible" sounds like the right solution to me. – Brendan Dec 05 '22 at 14:22

0 Answers0