\section{Machine Tool Drive System}
We develop a model of a single axis machine tool drive in which a motor drives a lead screw through a gear. Figure~\ref{fig_mach_dr} illustartes such a system.
\begin{figure}
\vspace{4.5in}
\special{bmp:c:/mybook/mach_dr.bmp x=6in y=4.5in}
\caption{A diagram of a machine tool drive system.}
\label{fig_mach_dr}
\end{figure}
This model is adapted from Driels~\cite[pages 613--619]{driels96}. The system operates as follows. The lead screw moves the table with a workpiece on it under the cutter to perform desired operation. The table is positioned by a control system. We wish to place the table in a desirable position as rapidly and accurately as possible. This means, that while modeling the machine tool drive system we should, in particular, take into account the flexibility of the lead screw. The length of the lead screw implies that its rotation at the gear box will not be the same as its rotation at the table. Thus, the angular twist along the length of the lead screw cannot be neglected. We model the lead screw flexibility using a torsional spring as illustarted in Figure~\ref{fig_ma_dr_s}. 
\begin{figure}
\vspace{4.5in}
\special{bmp:c:/mybook/ma_dr_s.bmp x=6in y=4.5in}
\caption{A graphical model of the machine tool drive system.}
\label{fig_ma_dr_s}
\end{figure}
The system input is the motor torque $\tau_m$, and the system output is the rotation of the end of the lead screw labeled by $\theta_l$. We assume that the damping torque, due to viscous friction, acting on the motor is proportional to its angular velocity $\dot{\theta}_m=\omega_m$ with the coefficient of viscous friction denoted by $c_m$. We denote the motor moment of inertia by $J_m$, and by $\tau_1$ the load torque on the motor gear due to the rest of the gear train. Then, the equation modeling the dynamics of the motor shaft has the form
\[
J_m \ddot{\theta}_m+c_m \dot{\theta}_m+\tau_1=\tau_m.
\]
Let $\tau_2$ be the torque transmitted to the load shaft, and let $N=N_1/N_2$ be the gear ratio, where $N_1$ denotes the number of teeth of the first gear, and respectively $N_2$ is the number of teeth of the second gear. The work done by the first gear is equal to that of the second, hence
\[
\tau_2=\tau_1/N.
\]
As mentioned above, we model the load shaft flexibility with a torsional spring. The torsional spring coefficient is denoted by $k$. We assume that the moment of inertia of the lead screw is negligible compared to that of the load. Hence,
\[
\tau_2=\tau_1/N=k\left( theta_m N-\theta_l\right).
\]
We denote the moment of inertia of the load by $J_l$. The torque due to viscous friction of the load is $c_l\omega_l$, where $c_l$ is the coefficient of the viscous friction of the load. Let $\omega_l=\dot{\theta}_l$ be the angular displacement of the end of the lead screw. Taking the above into account we obtain the following equation modeling the dynamics of the load:
\[
J_l\ddot{\theta}_l+c_l\dot{\theta}_l=\tau_2.
\]
We define the state variables
\[
x_1=\theta_m,\quad x_2=\dot{\theta},\quad x_3=\theta_l,\quad x_4=\dot{\theta}_l.
\]
Then, we can represent the above modeling equations in state space format as
\begin{eqnarray*}
\dot{x}_1 &=& x_2\\
\dot{x}_2 &=& -\frac{kN^2}{J_l}x_1-\frac{c_m}{J_m}x_2+\frac{kN}{J_m}x_3+\frac{1}{J_m}u\\
\dot{x}_3 &=& x_4\\
\dot{x}_4 &=& \frac{kN}{J_l}x_1 - \frac{k}{J_l}x_3-\frac{c_l}{J_l}x_4\\
y &=& x_3.
\end{eqnarray*}
We represent the above equations in matrix form to get
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{x}_1\\
\dot{x}_2\\
\dot{x}_3\\
\dot{x}_4
\end{array}\right]&=&\left[\begin{array}{cccc}
0 & 1 & 0 & 0\\
-\frac{kN^2}{J_l}&-\frac{c_m}{J_m}&\frac{kN}{J_m}&0\\
0 & 0 & 0 & 1\\
\frac{kN}{J_l}&0&-\frac{k}{J_l}&-\frac{c_l}{J_l}x_4
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2\\
{x}_3\\
{x}_4
\end{array}\right]+\left[\begin{array}{c}
0\\
\frac{1}{J_m}\\
0\\
0
\end{array}\right]u\\
y&=&\left[\begin{array}{cccc}
0&0&1&0
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2\\
{x}_3\\
{x}_4
\end{array}\right].
\end{eqnarray*}
In our simulation experiments we use numerical data shown in Table~\ref{table_mach_dr}.
\begin{table}[h]
\caption{Numerical data for the machine tool drive system model.}
\label{table_mach_dr}
\begin{center}
\begin{tabular}{ll}
$J_m$ & 0.0001 Nms$^2$/rad\\
$J_l$ & 0.001 Nms$^2$/rad\\
$c_m=c_l$ & 0.01 Nms/rad\\
$k$ & 1 Nm/rad\\
$N$ & 1/5\\ \hline
\end{tabular}
\end{center}
\end{table}


 