Polynomial-Fit FB


The data at the output-connector from Polynomial-Fit FB is a series of concatenated (joined end-to-end) polynomials that are a 'best-fit' to motion-values at its input-connector.

You can output the 'best-fit' as:

'motion-values' at its output-connector
to a .CSV file, or
the format required for a Schneider-Electric® servo-controller.

See: Add Polynomial Fit Function-Block

STEP 1: Connect a wire from the output-connector of a different FB to the input-connector of the Polynomial-Fit FB.
STEP 2: Open the Polynomial-Fit FB dialog-box: (See 'How to open a dialog-box')

Polynomial-Fit dialog-box


The Polynomial-Fit dialog-box:

1r   Toolbar to 'get '1-cycle', 'run', 'stop', 'save' and 'auto-run'

2r Three(3) dialog separators:

Polynomial Parameters
Motion Function-Blocks
Solve Values

3r Graph-Area

4r Toolbar to save, print and control how to view the:

data at the input-connector

and the


Polynomial-Fit toolbar


Polynomial Fit toolbar

After you edit the 'Polynomial Parameters', then you can press the different buttons in the toolbar.

The toolbar has these buttons:

1r Acquire ('Capture', 'Get One Cycle') button : Click each time you edit 'Polynomial Parameters' or change the data at the input connector.

2r Fit Polynomials to Data button: Click each time you want to fit the polynomials to the input-data.

3r Stop the 'Polynomial Fit algorithms'. Click if the algorithms cannot find a good solution quickly.

4r Save Coefficients : Click to save the results to a CSV file, or a EPAS4 file THAT IS suitable for a Schneider Electric servo-controller.

5r Auto-Run: Immediately allow the algorithms to run until the polynomials fit the data to the accuracy as specified, and with less or equal to the maximum number of Polynomials in the 'best-fit'.

Polynomial Parameters 


Parameters to enter before you click Polynomial Fit (button Red-14-2 above)

Number-of-Points :

... you want in the output motion, should you want to save the fit as a series of data points.

Pts. in Tol Sample :

... that the algorithm will use to calculate the error between the 'output motion' and the input motion'.

Maximum Number of Polynomial :

... to 'best-fit' to the 'input data'.

Position Tolerance %; Velocity Tolerance %; Acceleration Tolerance %

... the difference (error) between the 'best-polynomial-fit' and the 'input-data' within the number of samples in the 'Sample Count'. These are scaled to the range of the input to the Poly-Fit FB.

Polynomial-Fit algorithm:

1.Does the algorithm to fit the Polynomial, using number of points as specified in the 'Tolerance Sample Count', and then...
2.Shifts the data point by one data point, and then...
3.Repeats the calculation, and then...
4.Repeats 1 to 3 again and again by the total 'number of points':
until the errors are less than the 'Tolerances' specified below


the number of Polynomials exceed the 'Maximum Polynomial Count' value


you use the 'Stop the Polynomial Fit algorithm' button - see toolbar above.

Motion Function-Blocks 


The Motion name, associated with the Motion FB, helps the algorithms to calculate the Polynomial-Fit.

The X-axis values of the Blend-Points in the motion should have the same timing as the input to the Polynomial-Fit FB.

This is especially useful when the motion-values at the input to the Poly-Fit FB and the Motion name both have dwells with the same X-axis timing.

To add a Motion FB:

1.Unlock the data-box
2.Click a Motion FB in the Assembly-Tree or the graphic-area.


When the Polynomial Fit FB must find Polynomials that are equal to a servo's motion that controls a Tool-Part, but via a kinematic-chain:

Connect (in parallel) to its input-connector the Motion FB (with associated FBs) that controls the motion of the Tool-Part.

Solve Values 


RMS Position Error, RMS Velocity Error, RMS Acceleration Error (Read-Only).

They give the RMS (Root, Mean Square) error values of the Position, Velocity and Acceleration between the 'best-polynomial-fit' and the 'input-motion-data', as percentage of the maximum range of each motion-derivative.

# of Polynomials in Fit

The number of Polynomials in the solution.

See also: 'Maximum Polynomial Count'. in the  Polynomial Parameters  separator.

Tutorials and Reference Help Files for MechDesigner and MotionDesigner 14.2 + © Machine, Cam, Mechanism, and Motion Design Software by PSMotion Ltd