# A Study on the Errors of 2D Circular Trajectories Generated on a 3D Printer
## 3 Experimental Results and Discussion  
There are many important exploitable resources of \(x\) and \(y\)-motions description already partially revealed in Figures 4 and 5. As a first interesting approach, we propose the signals fitting, each one with a single harmonic function (fitting with a sine model). The Curve Fitting Tool from Matlab provides the best analytical approximation \(x_{a}\) and \(y_{a}\) of \(x\) and \(y\)-motion, as follows:  
\[x_{a}(t)=8.987\cdot\sin(0.6991\cdot t+1.398)y_{a}(t)=8.987\cdot\sin(0.6991 \cdot t-0.1883) \tag{1}\]  
The fitting quality is confirmed for both motions by the same amplitude (8.987 mm, this being the radius of the circular trajectory) and angular frequency \(\omega\) = 0.6991 rad/s (for a period \(T\) = 2\(\pi\)/\(\omega\) = 8.987 s). These values found by curve fitting were already used in circular trajectory programming. However, there is a shift of phase by 1.5863 radians between motions (1.5863 \(>\)\(\pi\)/2 = 1.5707). This means that the \(x\) and \(y\)-axes are not rigorously perpendicular (there is an axes misalignment), as a first indicator for the lack of P&A. The printer works in a non-orthogonal \(x\)by system (with an angle of 90.893 degrees between axes). As a result, a programmed circular trajectory will be executed as an elliptical one. Nevertheless, this non-perpendicularity of \(x\) and \(y\)-axes revealed here can be compensated by programming. In a short definition, this compensation should solve this question: what kind of elliptical trajectory should be programmed in order to achieve a desired circular trajectory? The evolution of residuals \(x_{r}(t)=x(t)-x_{a}(t)\) and \(y_{r}(t)=y(t)-y_{a}(t)\) from curve fitting of \(x\) and \(y\)-motions using a sine model are described in Figures 6 and 7 (with the same scale). The shape and the magnitude of residuals proves that \(x\) and \(y\)-motions are not perfectly harmonic (as expected), as a new indicator for the lack of P&A of circular trajectories. The evolution of residuals from Figures 6 and 7 indicates that the negative effect on P&A of \(x\)-motion errors is smaller than of \(y\)-motion errors. It is interesting to find out if there is a recurrent (or repeating)periodical pattern of the residual evolutions (\(x_{r}\), \(y_{r}\)) on a complete period \(T\) of each motion (\(x\), \(y\)). A simple way  
Figure 6: The evolution of residual \(x_{r}\) from the harmonic fitting model for \(x\)-motion. to check if there is a recurrent periodical pattern on \(x_{r}\), and \(y_{r}\) evolutions is to build an average evolution of the residual \((x_{Ar},y_{Ar})\) on a single period \(T\) with these definitions:  
\[x_{Ar}(t)=\frac{1}{k}\sum_{i=0}^{k-1}x_{r}(t+i\cdot T)y_{Ar}(t)=\frac{1}{k}\sum _{i=0}^{k-1}y_{r}(t+i\cdot T) \tag{2}\]  
Figure 8 presents the evolution of \(x_{Ar}(t=0\div T\), with 179,740 samples) with \(k=5\) (for five completely circular trajectories), each sample of \(x_{Ar}\) being an average of \(k\) correlated samples of \(x_{r}\). It is obvious that the \(x\)-motion has a well-defined repetitive periodical pattern, with systematic errors. In other words, \(x_{r}\) (and \(x\)-motion as well) is well correlated with itself. The curve fitting of \(x_{Ar}\) evolution using a sum of sine model delivers the analytical evolution \(x_{Ar}\) of \(x_{Ar}\) as Figure 9 indicates. In Equation (3) is depicted the analytical model for \(x_{Ar}\) as it follows:  
\[x_{Ar}(t)=\sum_{j=1}^{n}a_{xj}\cdot\sin(b_{xj}\cdot t+c_{xj}) \tag{3}\]  
Figure 8: The average evolution \(x_{Ar}\) of the residual \(x_{r}\) for \(x\)-motion. Figure 7: The evolution of residual \(y_{r}\) from the harmonic fitting model for \(y\)-motion. A better model \(x_{aAr}\) for \(x_{Ar}\) is available by increasing the value of \(n\). There is not a total fit between \(x_{aAr}\) and \(x_{Ar}\), mainly because the model is not able to describe the phenomena characterized by temporary variations of amplitudes.