Motion Profiling VI

To keep myself awake during class I made a VI that calculates motion profiles given a distance to travel, initial and final velocities, and max allowed velocity and acceleration. You can specify a timestep, or you can let it auto-calculate the timestep for maximum resolution on the graphs. If you want to see the derivation of the math behind it, send me a PM (it’s just a lot of long algebra expressions).

The loop is used to create the graph and tables. If you wanted to use this on a robot, you could get rid of the loop, graphs, tables, and timestep inputs/outputs. Just get the three time value outputs and switch states (accelerating, coasting, decelerating) when that much time has elapsed.

Let me know if you have any questions or find any problems with it.

Motion Profiling.vi (23.3 KB)


Motion Profiling.vi (23.3 KB)

What about initial and final acceleration?

Right now the profiles it produces are acceleration limited, not jerk limited. So (as I understand it) initial and final accelerations are not needed - they are always 0 in this model. My next version will be jerk-limited so it will include max jerk and initial and final accelerations. You have more experience with this stuff than I do, so let me know if I’m mistaken with this.

*Have you ever ridden in a car with a student driver who, when approaching a stop sign, keeps their foot pressed on the brake pedal with constant force all the way until the car jerks to a stop?

That’s what you get if your acceleration (deceleration) is not tapered to zero as you approach the destination.