## 3 Neural Network Model  
The nonlinear control-affine model with stepper motor joint angles and velocities as inputs makes the control design relatively straightforward and is given in the following. \[\bar{\mathbf{x}}=\mathbf{f}(\mathbf{x},\hat{\mathbf{x}})+\mathbf{g}(\mathbf{x},\hat{\mathbf{x}})\mathbf{u} \tag{4}\]  
where \(\mathbf{x}=[p_{x},p_{y},p_{z}]^{T}\), \(\mathbf{u}=[\theta_{1},\theta_{2},\theta_{3},\dot{\theta}_{1},\dot{\theta}_{2}, \dot{\theta}_{3}]^{T}\), \(\mathbf{f}(\cdot)\in\mathbb{R}^{3\times 1}\), and \(\mathbf{g}(\cdot)\in\mathbb{R}^{3\times 6}\) are nonlinear functions of their arguments, and \(p_{x}\), \(p_{y}\), and \(p_{z}\) represent the position of the end effector at the centroid along the \(x\), \(y\), and \(z\) axes. As pointed out before, the control-affine form of the model is not directly derivable from [PERSON]'s law, Lagrangian dynamics, or inverse kinematics. Although various dynamic models for the Delta robot that use the computed-torque approach are available in the literature, they cannot be applied to this study, since the inputs of the Delta robot are only the joint angles and velocities. Here, the neural networks are adopted to approximate the nonlinear functions of the dynamic model for the Delta robot. Specifically, two neural networks are constructed to approximate the nonlinear functions \(\mathbf{f}(\cdot)\) and \(\mathbf{g}(\cdot)\). Notably, with an extra hidden layer and an additional input, a single neural network can be customized to approximate the two nonlinear functions. The structure of the proposed neural network model for the Delta robot is shown in Figure 3.  
Figure 3: A flowchart illustrating the neural network model of the Delta robot. The inputs for neural networks are \(\mathbf{x}\), \(\hat{\mathbf{x}}\), and \(\mathbf{u}\). The output for the neural networks is \(\tilde{\mathbf{k}}\), which can be expressed in terms of the two neural networks \(\hat{\mathbf{f}}(\mathbf{x},\hat{\mathbf{x}})\) and \(\hat{\mathbf{g}}(\mathbf{x},\hat{\mathbf{x}})\):  
\[\tilde{\mathbf{x}}(n)=\hat{\mathbf{f}}(\mathbf{x}(n),\hat{\mathbf{x}}(n))+ \hat{\mathbf{g}}(\mathbf{x}(n),\hat{\mathbf{x}}(n))\mathbf{u} \tag{5}\]  
where \(n\) is the sample time. The loss function is defined as  
\[\mathbf{J}=\frac{1}{2}\sum_{n=1}^{n_{s}}(\tilde{\mathbf{x}}(n)-\tilde{\mathbf{ x}}(n))^{2} \tag{6}\]  
where \(\tilde{\mathbf{x}}(n)\) is the prediction from neural networks and \(\tilde{\mathbf{x}}(n)\) is the system response. Data can be collected from simulations or experiments, and \(n_{s}\) is the total number of sampled points. Detailed information of the number of hidden layers, type of activation function, and number of neurons are shown in Table 2. Here, the sigmoid neuron is chosen as the activation function. Other activation functions such as tanh or ReLU can also be considered based on the universal approximation theorem of neural networks. The number of training epochs is set as 20,000. The chosen optimization algorithm is stochastic gradient descent (SGD). Dropout with a frequency of 0.5 is adopted to prevent overfitting. The SGD algorithm is one of the most popular stochastic optimization methods in the machine learning community [21]. In this study, it has been adopted as the optimization algorithm to train the neural networks. The stochastic gradient descent maintains a single learning rate to update all weights compared to Adam [22]. The loss value reached 0.000281 after training for 20,000 epochs. A remark on the choices of various hyper-parameters for the neural networks is in order. We have to say that the parameters we used are not guaranteed to be optimal. Since there is no established general rule for selecting the hyper-parameters of neural networks, some level of trial and error is involved with specific data set of different applications. With the help of the dynamic model built in Section 2, a SimScape model of the Delta robot is developed and used to generate the data of time series \(\mathbf{x},\hat{\mathbf{x}},\tilde{\mathbf{x}}\) and \(\hat{\theta}_{i}\).