# Development of a Small CNC Machining Center for Physical Implementation and a Digital Twin
## 4 Materials and Methods  
### Modeling the Feed Drive Systems  
The feed systems on the three axes of motion (X, Y, and Z) were modeled as closed-loop motion control systems, using the DC servo motor as the actuation device and the incremental encoder as the feedback device. A ball screw\(-\)nut mechanism was used as the transmission element. A block diagram of the system is shown in Figure 2.  
It should be noted that although all three feed axes (X, Y, and Z) were numerically controlled, at this stage, the machine was a 2.5D machine. This meant that while the X- and Y-axes could perform simultaneous movements (in contouring mode), the Z-axis could only operate in single-axis mode. (It could not operate simultaneously with either the X- or Y-axis.) This was because the Z-axis drive system, including the servo motor and ball screw, was different from the X- and Y-axes systems. Normally, the mathematical modeling of such a system is based on the transfer function in the relation below, considering the voltage applied on the armature as the input signal and the angular velocity of the motor as the output signal, which can be expressed as:  
\[\frac{\Omega_{m}(s)}{U(s)}=\frac{K_{t}}{(J_{real}s+B_{real})\left(Ls+R\right)+ K_{t}K_{v}}. \tag{1}\]  
The notations employed in the aforementioned relation were defined as follows:  
* Voltage applied to the armature) u [V] (the term _U(s)_ represents the Laplace transform of the voltage input); \begin{table}
\begin{tabular}{c c c c} \hline
**Open-Architecture** & & **Literature References** & **Present Approach** \\
**CNC Systems** & & & - & MATLAB and Simulink and \\  & & & - & Simscape (v. 2016–v. 2024) \\ Simulation approach & - & MATLAB and Simulink (v. 2016–v. 2024) or & & (CAE approach) \\  & & other software packages based on numerical & - & CAM approach \\  & & integration (CAE approach) [4; 6; 12] & - & integrated CAE + CAM approach (digital twin) \\  & - & Arduino + Raspberry PI (medium & \\  & - & cost) [11; 12; 13; 14] & \\  & - & Yaskawa servo driver (medium to high & \\  & - & cost) [4; 6] & - & Arduino + low cost Pololu \\  & - & GALIL motion control card (medium to & DC motor drivers \\  & & high cost) [5; 6] & \\ \hline \end{tabular}
\end{table} 
Table 1: _Cont._  
Figure 2: Block diagram of the feed system. * Angular speed of the motor shaft \(\upmu\)m [rad/s] (the term \(\Omega\)m (s) represents the Laplace transform of the angular speed output;
* Armature moment of inertia \(J_{m}\) [kgm\({}^{2}\)];
* Coefficient of viscous friction B\({}_{m}\) [Nms/rad];
* Back electromotive force (emf) voltage constant K\({}_{v}\) [V/rad/s];
* Electromagnetic torque constant K\({}_{t}\) [Nm/A];
* Armature resistance R [\(\Omega\)];
* Armature inductance L [H]. In order to take into account all components of the motion control system, not just the motor, it was necessary to modify the above transfer function by relating the inertia and friction of moving parts other than the motor to the motor shaft. This was achieved by substituting \(J_{m}\) and B\({}_{m}\) with \(J_{red}\) and B\({}_{red}\), respectively. This substitution signified reductions in the moment of inertia and viscous friction constant at the motor shaft. It is important to note that the ball screw was the sole rotating moving element considered in this system, with the coupling between the motor and the ball screw being negligible. The values for \(J_{red}\) and B\({}_{red}\) were calculated using the following relations:  
\[J_{red}=J_{m}+\frac{J_{s}}{i^{2}}. \tag{2}\]  
\[B_{red}=B_{m}+\frac{B_{s}}{i^{2}}. \tag{3}\]  
The notations employed in Equations (2) and (3) are defined as follows:  
* Reduced moment of inertia at the motor shaft \(J_{m}\) [kgm\({}^{2}\)];
* Coefficient of viscous friction reduced at the motor shaft \(B_{red}\) [Nms/rad];
* Transfer ratio of the transmission between motor and screw i.