public class CubicSCurve extends Object implements MotionProfile
In motion controller parlance an S-curve motion profile is one that ramps acceleration using a constant "jerk" (da/dt). The alternative is a so-called "trapezoidal" profile in which acceleration changes discontinuously (infinite jerk). S-curve motion is smoother, with no sharp bends in the velocity curve.
The S-curve is generated by scaling the following basic profile starting at distance = 0 dUnit, velocity = 0 dUnit/tUnit and acceleration = 0 dUnit/tUnit*2:
The basic profile d(t), v(t), a(t) represents of motion of +1/8 dUnit in 1 tUnit. A motion of D distance units in T time units is represented by 8D*d(t/T), (8D/T)*v(t/T), (8D/T**2)*a(t/T). D is positive for an extension and negative for a retraction.
Instances of this class are immutable.
Distance traveled, velocity and acceleration all refer to the leading edge of the blade set though for brevity we just say "the blade set".
This motion profile was first used with the one-bladed shutter prototype.
| Constructor and Description |
|---|
CubicSCurve(double totalDistance,
double totalTime)
Sets the scale factors for distance moved and total elapsed time.
|
| Modifier and Type | Method and Description |
|---|---|
double |
acceleration(double t)
Gives the acceleration of the blade set at time t.
|
double |
distance(double t)
Gives the distance traveled by the blade set at time t.
|
double |
inverseDistance(double dtarget)
Provides the time t at which the
distance had a given value d.
|
double |
velocity(double t)
Gives the velocity of the blade set at time t.
|
public CubicSCurve(double totalDistance,
double totalTime)
totalDistance - The total distance D to move. Negative for a retraction.totalTime - The elapsed time T allowed for the move.IllegalArgumentException - if totalTime is zero or negative.public double distance(double t)
MotionProfiledistance in interface MotionProfilet - a time between 0.0 and the amount of time allowed for the motion, inclusivepublic double velocity(double t)
MotionProfilevelocity in interface MotionProfilet - a time between 0.0 and the amount of time allowed for the motion, inclusivepublic double acceleration(double t)
MotionProfileacceleration in interface MotionProfilet - a time between 0.0 and the amount of time allowed for the motion, inclusive.public double inverseDistance(double dtarget)
MotionProfileinverseDistance in interface MotionProfiledtarget - the distance, between 0.0 and the total distance traveled, inclusive.
Negative for a retraction.Copyright © 2022 LSST. All rights reserved.