Calculating max velocity, acceleration, and jerk

I’m using this library for Pathfinding and following: However, I need the robot’s max velocity, max acceleration, and max jerk. How would I go about finding that for our robot?


Peter Chaco

To determine all of these all you need is to record your robot’s position versus time. You can calculate the rest easily.
Using calculus is easiest but you can do it with algebra or graphically

derivative of position vs time = velocity
derivative of velocity vs time = acceleration
derivative of acceleration vs time = jerk

Floor it and record your robot’s position vs time (sample position every X milliseconds where X is a small amount of time).

Max Velocity will be the speed the robot stabilizes to once it is accelerating no more.

Max Acceleration will be observed within the first bit of time when you floor it before steady-state speed is reached.

Max Jerk is getting a little high-in-the-order to be easily observable/physically relevant. For that value, I’d just look at what others have used (see 254 2014 code) and go with that, probably will be fine.

If you use values measured this way you will likely generate a profile that is not actually achievable.

Read the whitepaper linked in my signature; once you understand that, it will be clear both why this is the case and how one should actually calculate values to ensure an achievable profile.

Does anyone have the values for a standard KoP chassis? We’re using the supplied AM14U3 in long configuration this year and didn’t have time to record those values.

Those values are pretty specific to your exact drivetrain and your exact robot. Someone else’s values won’t work for you.

+1 +1 +1 +1 about Oblarg’s characterization paper.

Also, there is some great posts in the “The Great Drive Base Performance Characterization Data Sharing Thread” that Oblarg started.

This post from that thread might help too, it has a link to the code they used to characterize their drivetrain.

what kind and how many motors?

speed reduction from motors to wheels?

wheel type and diameter?

Note that as Oblarg intimated, if you want to use a trapezoidal motion profile for your motors, it isn’t sufficient to find the max velocity OR the max acceleration (max jerk isn’t terrible useful for FRC drivetrain applications). Your trajectory will want to command maximum acceleration all the way up until you hit your maximum velocity.

Consider a transmission with a measured free speed of 15 ft/s at 12V, and a measured 12V acceleration of 15 ft/s^2 from a stall. As you approach 15 ft/s speed, the positive acceleration (via motor torque) you can achieve approaches zero (though the negative acceleration you can achieve approaches -30 ft/s^2, assuming you don’t lose traction first and are okay dumping twice your nominal stall current into your drive motors).

So if you use 15 ft/s and 15 ft/s^2 as your velocity and acceleration constraints on this drivetrain, you will not be capable of tracking a trapezoidal motion profile. But you would be able to track, ex. 7.5 ft/s and 7.5 ft/s^2 (neglecting frictional losses/other nonlinearities), since this is the max power point for your motors. You can trade off for more speed/less acceleration or visa versa, but using a trapezoidal trajectory generator you need to make one tradeoff.

Basically you need to inscribe a rectangle under your torque/speed curve. More advanced techniques let you vary your maximum acceleration as a function of velocity.

Well… within reason I suppose. But if that is taken literally, why bother with trapezoidal accel? Just use rectangular accel.

If you have a top-heavy wobbler, it may be able to tolerate a certain max accel, but only if approached gently (limited jerk).

We’ve been using rectangular accel (infinite jerk) trajectories since 2015. In 2014 we used finite jerk primarily because we had a trajectory generator that supported it, so we figured why not. We noticed no qualitative or quantitative difference when removing it.

I doubt if you guys ever built a top-heavy wobbler :slight_smile:

Thanks for your responses everyone. I know I’m a bit late to this thread, but may I ask…what would you define as “limited jerk?” I really don’t have a good sense for what jerk looks like in real life. I have a good sense for acceleration (maybe accelerate to top speed in 1 second, for starters, then tune from there), but not for jerk. Is 60 ft/s/s really high? Is 5 ft/s/s really low jerk? Is 20 ft/s/s a good “limited” jerk? Etc.

Thanks for you guidance,
Team 6705

A few years ago, Ether and I ran some tests on CIMs using a dynamometer in the Whirlpool motor lab. One of those tests measured initial current surge with the CIM fed directly from a 12V source, so that di/dt was limited only by the motor’s inductance.

We observed that the CIM reached stall current in about 3.8 milliseconds. Multiplying that di/dt by the torque constant (stall torque divided by stall current) gives the maximum rate-of-rise for motor torque dT/dt = 640 N-m/sec.

Maximum jerk for a CIM-powered mechanism can be calculated as the maximum dT/dt divided by the total inertia, including the CIM’s armature and the reflected inertia of the load.

As Jared pointed out earlier in this thread, maximum jerk can often be ignored in FRC mechanism design. That is true because many FRC mechanisms have significantly more inertia, reflected by the inverse of the square of the speed reduction ratio, than the CIM’s armature has. One notable exception is small diameter, lightweight shooter wheels that are directly coupled to the CIM shaft.