Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

As widely analyzed, the approximations made in the simple inverse kinematics solution are not accurate enough to meet the requirements for the SCU (Superconducting Undulator).

...

Feedforward neural network

The previously employed error function approach used an optimization algorithm to find the coefficients of a predefined polynomial equation that minimized the prediction error. While effective and compatible with requirements, this method struggled to model all small nonlinearities present in the system, particularly in real-world applications.

To address the limitations of the polynomial approach, the idea is to use a feedforward neural network to learn both the direct and inverse kinematics of the system. This method leverages a large dataset of random actuator positions and corresponding quadrupole positions/orientations to train the neural network.

Procedure

  1. Data Generation:

    • Randomly generate a large set of actuator positions within their stroke limits.
    • Explore the entire configuration space using a Monte Carlo method to sample the whole reachable space.
  2. Data Collection:

    • Position all actuators at each specific configuration.
    • Measure the position and orientation of the quadrupole, either in simulation or using an interferometer for the real system.
    • Repeat this process for all N configurations to build a comprehensive dataset.
  3. Neural Network Training:

    • Use the collected dataset to train a feedforward neural network.
    • Train two models: one for direct kinematics (actuator positions to quadrupole position/orientation) and one for inverse kinematics (quadrupole position/orientation to actuator positions).
  4. Runtime Application:

    • Load the trained neural network models.
    • Use the models at runtime based on the specific necessity: direct kinematics for determining the quadrupole position/orientation from actuator positions, and inverse kinematics for determining actuator positions from the desired quadrupole position/orientation.

Benefits

  • Nonlinearity Handling: Neural networks excel at modeling complex, nonlinear relationships, improving accuracy over polynomial methods.
  • Adaptability: The model can be retrained with new data to adapt to changes in the system or environment.
  • Efficiency: Once trained, neural networks can provide real-time predictions, crucial for dynamic applications.

By employing feedforward neural networks, the system can achieve higher accuracy in modeling both direct and inverse kinematics, effectively handling the nonlinearities present in real-world scenarios. This approach not only meets the requirements but also offers flexibility and adaptability for future system modifications.

Sequence

The sequence of the scripts to execute is:

  • NN data generator: This script generates the dataset used in during the training phase
  • NN training: This scripts trains both networks (direct and inverse kin) for the selected datasets
  • Space explorer NN: This script explore the space and computes the inverse kinematics error as for the previous approach

Comparison

Both approaches solve the problem of computing an accurate inverse kinematic function. However, there is a winner in terms of simplicity, flexibility and generality. But first let's have a look at the results 

image-2024-6-21_10-10-6.pngImage AddedError function correctionImage AddedImage Added

The first plot represents the error for the quadrupole position (X and Y) computed with the analytical solution of the inverse kinematics, the second represents the same error but with inverse kinematics based on the optimized error function and, finally, the third one is the one based on the feedforward neural network

image-2024-6-21_10-10-55.pngImage Addedimage-2024-6-21_15-14-4.pngImage AddedImage Added

These plots are the same as before except for the fact that these represent the orientation errors.

Both the error function optimization and the feedforward NN show almost the same performances for the position while, on the orientation side, the feedforward nn outperforms if compared with the other.

For this reason and for the fact is capable of modeling uncaught behavior defined in the function error, the Feedforward NN is the favourite approach to solve this problem.