chrono::ChFunction_DoubleS Class Reference

Description

Double-S ramp function composed by seven tracts with constant jerk (aka.

'seven segments', 'constant jerk', 'trapezoidal acceleration').

#include <ChFunction_DoubleS.h>

Inheritance diagram for chrono::ChFunction_DoubleS:
Collaboration diagram for chrono::ChFunction_DoubleS:

Public Member Functions

 ChFunction_DoubleS ()
 Default constructor.
 
 ChFunction_DoubleS (double q0, double q1, double v0, double v1, double T, double Ta, double Tj)
 Simplified case Double-S, with imposed boundary conditions and times. More...
 
 ChFunction_DoubleS (double q0, double q1, double vmax, double amax, double jmax)
 Simplified case Double-S: under. More...
 
 ChFunction_DoubleS (bool &feasible, double q0, double q1, double v0, double v1, double vmax, double amax, double jmax)
 General case Double-S: under. More...
 
 ChFunction_DoubleS (const ChFunction_DoubleS &other)
 
virtual ChFunction_DoubleSClone () const override
 "Virtual" copy constructor (covariant return type).
 
virtual FunctionType Get_Type () const override
 Get type of ChFunction.
 
void Setup_Data (double q0, double q1, double v0, double v1, double T, double Ta, double Tj)
 Setup internal data of Double-S, imposed times case.
 
void Setup_Data (double q0, double q1, double vmax, double amax, double jmax)
 Setup internal data of Double-S, simplified case for minimization of motion time with v0 = v1 = 0.
 
void Setup_Data (bool &feasible, double q0, double q1, double v0, double v1, double vmax, double amax, double jmax)
 Setup internal data of Double-S, general case for minimization of motion time.
 
virtual double Get_y (double x) const override
 Position: return the y value of the function, at position x.
 
virtual double Get_y_dx (double x) const override
 Velocity: return the dy/dx derivative of the function, at position x.
 
virtual double Get_y_dxdx (double x) const override
 Acceleration: return the ddy/dxdx double derivative of the function, at position x.
 
virtual double Get_y_dxdxdx (double x) const override
 Jerk: return the dddy/dxdxdx triple derivative of the function, at position x.
 
double Get_h () const
 Get total displacement.
 
double Get_end () const
 Get total motion time.
 
void Get_Bounds (double &q0, double &q1, double &v0, double &v1)
 Get boundary conditions.
 
void Get_Constraints (double &vmax, double &amax, double &jmax)
 Get kinematic constraints.
 
void Get_Times (double &T, double &Ta, double &Tv, double &Td, double &Tj1, double &Tj2)
 Get internal motion times.
 
void Get_Limits (double &vlim, double &alim_a, double &alim_d)
 Get maximum velocity/acceleration/deceleration effectively reached during motion law.
 
virtual void ArchiveOut (ChArchiveOut &marchive) override
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIn (ChArchiveIn &marchive) override
 Method to allow de-serialization of transient data from archives.
 
- Public Member Functions inherited from chrono::ChFunction
 ChFunction (const ChFunction &other)
 
virtual double Get_weight (double x) const
 Return the weight of the function (useful for applications where you need to mix different weighted ChFunctions)
 
virtual void Estimate_x_range (double &xmin, double &xmax) const
 Return an estimate of the range of the function argument. More...
 
virtual void Estimate_y_range (double xmin, double xmax, double &ymin, double &ymax, int derivate) const
 Return an estimate of the range of the function value. More...
 
virtual double Get_y_dN (double x, int derivate) const
 Return the function derivative of specified order at the given point. More...
 
virtual void Update (double x)
 Update could be implemented by children classes, ex. to launch callbacks.
 
virtual double Compute_max (double xmin, double xmax, double sampling_step, int derivate) const
 Compute the maximum of y(x) in a range xmin-xmax, using a sampling method.
 
virtual double Compute_min (double xmin, double xmax, double sampling_step, int derivate) const
 Compute the minimum of y(x) in a range xmin-xmax, using a sampling method.
 
virtual double Compute_mean (double xmin, double xmax, double sampling_step, int derivate) const
 Compute the mean value of y(x) in a range xmin-xmax, using a sampling method.
 
virtual double Compute_sqrmean (double xmin, double xmax, double sampling_step, int derivate) const
 Compute the square mean val. of y(x) in a range xmin-xmax, using sampling.
 
virtual double Compute_int (double xmin, double xmax, double sampling_step, int derivate) const
 Compute the integral of y(x) in a range xmin-xmax, using a sampling method.
 
virtual double Get_Ca_pos () const
 Computes the positive acceleration coefficient (inherited classes should customize this).
 
virtual double Get_Ca_neg () const
 Compute the positive acceleration coefficient (inherited classes should customize this).
 
virtual double Get_Cv () const
 Compute the speed coefficient (inherited classes must customize this).
 
virtual int HandleNumber () const
 Return the number of handles of the function.
 
virtual bool HandleAccess (int handle_id, double mx, double my, bool set_mode)
 Get the x and y position of handle, given identifier. More...
 
virtual int FilePostscriptPlot (ChFile_ps *m_file, int plotY, int plotDY, int plotDDY)
 Plot function in graph space of the ChFile_ps postscript file where zoom factor, centering, color, thickness etc. More...
 
virtual int FileAsciiPairsSave (ChStreamOutAscii &m_file, double xmin=0, double xmax=1, int msamples=200)
 Save function as X-Y pairs separated by space, with CR at each pair, into an ASCII file. More...
 
virtual void EvaluateIntervaldN (ChMatrixDynamic<> &data, double xmin, double xmax, double step, int der=0)
 Sample function on entire interval, up to Nth derivative (der = 0: y, 1: y_dx, 2: y_dxdx, 3: y_dxdxdx). More...
 

Additional Inherited Members

- Public Types inherited from chrono::ChFunction
enum  FunctionType {
  FUNCT_CUSTOM, FUNCT_CONST, FUNCT_CONSTACC, FUNCT_DERIVE,
  FUNCT_FILLET3, FUNCT_INTEGRATE, FUNCT_MATLAB, FUNCT_MIRROR,
  FUNCT_MOCAP, FUNCT_NOISE, FUNCT_OPERATION, FUNCT_OSCILLOSCOPE,
  FUNCT_POLY, FUNCT_POLY345, FUNCT_RAMP, FUNCT_RECORDER,
  FUNCT_REPEAT, FUNCT_SEQUENCE, FUNCT_SIGMA, FUNCT_SINE,
  FUNCT_LAMBDA, FUNCT_CYCLOIDAL, FUNCT_BSPLINE, FUNCT_DOUBLES
}
 Enumeration of function types.
 

Constructor & Destructor Documentation

◆ ChFunction_DoubleS() [1/3]

chrono::ChFunction_DoubleS::ChFunction_DoubleS ( double  q0,
double  q1,
double  v0,
double  v1,
double  T,
double  Ta,
double  Tj 
)

Simplified case Double-S, with imposed boundary conditions and times.

Eg. for q1 > q0, it produces a motion profile characterized by

  • time: [0, Tj, Ta-Tj, Ta, Ta+Tv, Ta+Tv+Tj, T-Tj, T]
  • jerk: [+jmax, 0, -jmax, 0, -jmax, 0, +jmax]
  • acceleration: [+lin, const, -lin, zero, -lin, const, +lin]

NB: Ta = (0..1/2) * T; Tj = (0..1/2) * Ta

Parameters
q0start position
q1end position
v0start velocity
v1end velocity
Ttotal motion time
Taacceleration time (corresponds to first accel trapezoid) -> NB: Ta = (0..1/2) * T
Tjjerk time (corresponds to first jerk square wave) -> NB: Tj = (0..1/2) * Ta

◆ ChFunction_DoubleS() [2/3]

chrono::ChFunction_DoubleS::ChFunction_DoubleS ( double  q0,
double  q1,
double  vmax,
double  amax,
double  jmax 
)

Simplified case Double-S: under.

  • imposed boundary positions
  • (assumed) zero boundary velocities
  • (assumed) zero boundary accelerations
  • symmetric kinematic constraints on max |velocity|, |acceleration|, |jerk| minimizes total motion time.
  • imposed boundary positions
  • (assumed) zero boundary velocities
  • (assumed) zero boundary accelerations
  • symmetric kinematic constraints on max |velocity|, |acceleration|, |jerk| minimize total motion time.
Parameters
q0start position
q1end position
vmaxkinematic constraint: (abs) max allowed velocity
amaxkinematic constraint: (abs) max allowed acceleration
jmaxkinematic constraint: (abs) max allowed jerk

◆ ChFunction_DoubleS() [3/3]

chrono::ChFunction_DoubleS::ChFunction_DoubleS ( bool &  feasible,
double  q0,
double  q1,
double  v0,
double  v1,
double  vmax,
double  amax,
double  jmax 
)

General case Double-S: under.

  • imposed boundary positions
  • imposed boundary velocities
  • (assumed) zero boundary accelerations
  • symmetric kinematic constraints on max |velocity|, |acceleration|, |jerk| attempts to minimize total motion time.

NB: if desired motion law is not feasible, everything is set to zero (try to relax constraints).

  • imposed boundary positions
  • imposed boundary velocities
  • (assumed) zero boundary accelerations
  • symmetric kinematic constraints on max |velocity|, |acceleration|, |jerk| attempt to minimize total motion time.

NB: if desired motion law is not feasible, everything is set to zero (try to relax constraints).

Parameters
feasibleoutput: will be set to true if desired motlaw is feasible, false otherwise
q0start position
q1end position
v0start velocity
v1end velocity
vmaxkinematic constraint: (abs) max allowed velocity
amaxkinematic constraint: (abs) max allowed acceleration
jmaxkinematic constraint: (abs) max allowed jerk

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/motion_functions/ChFunction_DoubleS.h
  • /builds/uwsbel/chrono/src/chrono/motion_functions/ChFunction_DoubleS.cpp