1 Introduction

As is known, the presence of mechanical backlash generates vibrations, shock, abnormal stress, low positioning precision and dynamic problems of various nature. The consequences of such effects are: machining inaccuracy, wear, unsatisfactory dynamic behavior, failure of mechanical components and reduction in the life cycle of machinery. The approaches to overcome the problem can be summarized in the following items:

  • construction of machines with limited backlash, thanks to particular design solutions;

  • use of materials and lubrication techniques that produce low wear, thus avoiding the creation and growth of the backlash during the life cycle of the machine;

  • adoption of mechanical systems for backlash compensation;

  • use of actuation commands without discontinuity in the acceleration and jerk diagrams;

  • adoption of particular control strategies to be activated when the transducers detect the loss of contact between adjacent elements of the mechanical transmission.

For a long time, the dynamic effects of the backlash are studied by many research groups; particular attention is devoted to the study of techniques to compensate for the negative effects resulting from the backlash.

In [1], the authors analyze the effect of dither on the nonlinear element of a SISO (single-input single-output) feedback system; backlash and hysteresis are considered in the feedforward loop; the stability of two systems (the original dithered system and an approximate equivalent system) are compared. The effects of backlash and friction are studied in [2], and a method to compensate for errors caused by these phenomena is developed. In [3], the position control of a high-backlash servomotor gear train apparatus is presented and discussed. A fuzzy controller is proposed in [4] to carry out high accuracy and fast positioning of an experimental testbed; through computer simulation and experimental activity, the fuzzy controller is found to be capable of obtaining good accuracy and robustness against backlash and Coulomb friction. Reference [5] deals with the problems related to the mechanical gears when elasticity and backlash affect their connection; a proportional-derivative controller is applied to the three different mathematical models of the mechanical system, and the properties of the numerical solutions obtained by computer simulation are studied and discussed. In [6], the compensation of backlash is treated as a rendezvous problem in optimal control, and a linear controller is designed; the computer simulation demonstrates that significant improvements in system tracking performance can be obtained when backlash compensation is active. A numerical solution is developed in [7] for controlling a multi-body, MIMO (multi-input multi-output) nonlinear systems with joint backlash; the backlash compensation is obtained using the optimal control theory. Finally, a robust nonlinear speed controller is proposed in [8] for systems with backlash and elasticity; two linear controllers are designed, one globally stable with reduced performance and one with high performance exhibiting limit cycles around the backlash; both controllers are combined into one high-performance controller with soft switching.

In many cases of practical interest, the reduction in the backlash requires mechanical changes difficult to implement and expensive. It is therefore easier to work on the control system, but also in this case, the operations are not particularly simple . Usually, the user modifies the parameters of the motion controller (for example the proportional, integral and derivative gains of a PID controller) in order to reduce the negative effects of the backlash. More complex is surely the reprogramming of the position controller to implement a more efficient algorithm for backlash compensation.

Sometimes the user works on the motion command of the actuator, generating diagrams in the time domain having a high smoothness of operation and following in this way the classic approach suggested by the designers of cam mechanisms [9, 10]. As already mentioned, the concept of smoothness of operation should be understood from the mathematical point of view, as use of motion commands with higher order of continuity in the temporal derivatives. So not only the acceleration profile must be continuous, but also its derivatives (jerk, etc). As is well known, it is also necessary to limit the maximum accelerations, in order to limit the values of the inertial forces and torques.

From the above considerations, it is clear that the dynamic behavior of a servomechanism must be studied as a whole without distinction between its parts, in order to assess correctly the overall performance of the system. For this reason, in many cases of practical interest, it may be useful to analyze the dynamics of a mechatronic device using a mathematical model and a computer simulation software, in order to verify the consequences arising from the modification of a particular parameter of the system.

Following this methodological approach, this paper proposes a model for the dynamic analysis of a typical industrial servomechanism characterized by elasticity and backlash in the transmission. The model, schematically represented in Fig. 1, has been implemented into a software application and it can be used to test, from a theoretical point of view, the dynamic behavior of the device under user-defined operating conditions.

Fig. 1
figure 1

Electromechanical system

The following subsections describe the details of the mathematical modeling: in particular, Sects. 2 and 3 present, respectively, the model of the mechanical transmission and the model of the control system; Sect. 4 shows how the equations of the various parts of the system are assembled for obtaining a system of differential equations which can be solved with a numerical procedure. Finally, Sect. 5 presents the results of some simulations carried out with the aid of the calculation model here presented.

2 Mechanical system modeling

Figure  schematically represents a linear positioning system, which consists of the following components:

  • a permanent magnet DC servomotor;

  • a gear transmission;

  • a viscoelastic joint with backlash;

  • a ball screw drive; and

  • a carriage moving along a linear guide.

In this section, we will analyze first the case with deformable joint and subsequently the ideal case, in which the joint is considered perfectly rigid and without backlash.

2.1 Case with deformable joint and backlash

Assuming for simplicity that the gear transmission has an ideal kinematic behavior and that the only cause of mechanical backlash is concentrated in the coupling joint, the system has two degrees of freedom; furthermore, we suppose that the joint has a viscoelastic behavior when its rotating parts are in contact (that is outside the backlash zone). To derive the equations of motion, we use here the Lagrangian approach, considering as free coordinates the rotation \(\beta \) of the output shaft of the gear transmission and the rotation \(\gamma \) of the screw: In our case, these equations take the following form:

$$\begin{aligned} \left\{ \begin{array}{l} \displaystyle \frac{\mathrm{d}}{\mathrm{d}t} \left( \displaystyle \frac{\partial T}{\partial \dot{\beta }} \right) - \displaystyle \frac{\partial T}{\partial \beta } + \displaystyle \frac{\partial D}{\partial \dot{\beta }} + \displaystyle \frac{\partial U}{\partial \beta } = \displaystyle \frac{\delta W}{\delta \beta } \\ \displaystyle \frac{\mathrm{d}}{\mathrm{d}t} \left( \displaystyle \frac{\partial T}{\partial \dot{\gamma }} \right) - \displaystyle \frac{\partial T}{\partial \gamma } + \displaystyle \frac{\partial D}{\partial \dot{\gamma }} + \displaystyle \frac{\partial U}{\partial \gamma } = \displaystyle \frac{\delta W}{\delta \gamma } \end{array} \right. \end{aligned}$$
(1)

where T indicates the kinetic energy, U the elastic potential energy due to the torsion of the joint, D the Rayleigh dissipation function and W the work made by external actions (motor torque and resistant force applied to the carriage).

The kinetic energy of the system is given by the following expression (for the meaning of symbols see “List of symbols”):

$$\begin{aligned} T=\frac{1}{2} (J_\mathrm{m} \dot{\alpha }^2 + J_\mathrm{v} \dot{\gamma }^2 + M \dot{x}^2) \end{aligned}$$
(2)

Looking at the drawing in Fig. 2, the kinematic relations valid for the system under consideration are the following:

$$\begin{aligned} \dot{\beta }=z \dot{\alpha } \qquad \dot{x} = p \dot{\gamma } \end{aligned}$$
(3)

where z and p indicate, respectively, the gear ratio and the pitch of the screw. Taking into account these relationships, the kinetic energy can be rewritten in the form:

$$\begin{aligned} T=\frac{1}{2} \left[ \frac{J_\mathrm{m}}{z^2} \dot{\beta }^2 + (J_\mathrm{v} + M p^2)\dot{\gamma }^2 \right] \end{aligned}$$
(4)

Assuming a viscoelastic model for the coupling joint, the potential energy due to torsional deformation and the Rayleigh dissipation function can be expressed in the form:

$$\begin{aligned} U=\frac{1}{2} k (\beta - \gamma )^2 \qquad D=\frac{1}{2} c (\dot{\beta } - \dot{\gamma })^2 \end{aligned}$$
(5)

Finally, the virtual work made by external actions (motor torque \(\tau _\mathrm{m}\) and resistant force \(F_\mathrm{r}\)) is given by:

$$\begin{aligned} \delta W = \tau _\mathrm{m} \delta \alpha - F_\mathrm{r} \delta x = \tau _\mathrm{m} \frac{\delta \beta }{z} - F_\mathrm{r} p\, \delta \gamma \end{aligned}$$
(6)

Replacing (4), (5) and (6) into the Lagrange equations and calculating the derivatives, we obtain the following system of differential equations that mathematically describes the dynamic behavior of the mechanical part of the servomechanism:

$$\begin{aligned} \left\{ \begin{array}{l} \displaystyle \frac{J_\mathrm{m}}{z^2} \ddot{\beta } + c (\dot{\beta } - \dot{\gamma }) + k (\beta - \gamma ) = \displaystyle \frac{\tau _\mathrm{m}}{z} \\ (J_\mathrm{v} + M p^2) \ddot{\gamma } - c (\dot{\beta } - \dot{\gamma }) - k (\beta - \gamma ) = -F_\mathrm{r} p \end{array} \right. \end{aligned}$$
(7)

Equations (7) have been obtained assuming that the coupling joint is deformable but without backlash; when the backlash is present, the torque transmitted by the joint is zero if the relative rotation \(\varepsilon = \beta - \gamma \) between the two coupling parts is less than the half amplitude b of the backlash.

Fig. 2
figure 2

Model of the mechanical transmission

By adopting a dead zone model (see Fig. 3), we can write the following equation:

$$\begin{aligned} \varPsi _e(\varepsilon ) = \left\{ \begin{array}{ll} k (\varepsilon - b) &{}\quad \mathrm{if}\quad \varepsilon > b \\ 0 &{}\quad \mathrm{if}\quad |\varepsilon | \le b \\ k (\varepsilon + b) &{}\quad \mathrm{if}\quad \varepsilon < -b \\ \end{array} \right. \end{aligned}$$
(8)

where \(\varPsi _e\) is the elastic component of the torque transmitted by the coupling joint. In a similar manner, the viscous component \(\varPsi _\mathrm{v}\) of the torque transmitted by the coupling is zero if \(|\varepsilon | \le b\), while it is proportional to the difference \(\dot{\varepsilon } = \dot{\beta } - \dot{\gamma }\) between the angular velocities when the two coupling parts are in contact with each other; in mathematical terms, we can then write:

$$\begin{aligned} \varPsi _\mathrm{v}(\varepsilon , \dot{\varepsilon }) = \left\{ \begin{array}{ll} 0 &{}\quad \mathrm{if}\quad |\varepsilon | \le b \\ c (\dot{\varepsilon }) &{}\quad \mathrm{if}\quad |\varepsilon | > b \\ \end{array} \right. \end{aligned}$$
(9)

Now we define the total torque \(\varPsi \) transmitted by the joint as:

$$\begin{aligned} \varPsi _(\varepsilon , \dot{\varepsilon })= \varPsi _e(\varepsilon ) + \varPsi _\mathrm{v}(\varepsilon , \dot{\varepsilon }) \end{aligned}$$
(10)

and rewrite motion equations (7) in the generalized form:

$$\begin{aligned} \left\{ \begin{array}{l} \displaystyle \frac{J_\mathrm{m}}{z^2} \ddot{\beta } + \varPsi (\beta -\gamma , \dot{\beta }-\dot{\gamma }) = \displaystyle \frac{\tau _\mathrm{m}}{z} \\ (J_\mathrm{v} + M p^2) \ddot{\gamma } -\varPsi (\beta -\gamma , \dot{\beta }-\dot{\gamma }) = -F_\mathrm{r} p \end{array} \right. \end{aligned}$$
(11)

which are valid both in the presence of backlash (\(b \ne 0\)) and both in the absence of it (\(b = 0\)).

Fig. 3
figure 3

Diagram of the elastic torque \(\varPsi _e\) versus the relative rotation \(\varepsilon \)

Regarding the motor torque \(\tau _\mathrm{m}\), it should be recalled that, for a DC motor, it results proportional to the current I which flows in the armature circuit, according to the relation:

$$\begin{aligned} \tau _\mathrm{m} = k_\mathrm{m} I \end{aligned}$$
(12)

where \(k_\mathrm{m}\) indicates the torque/back e.m.f. constant of the motor. The resistant force applied to the carriage \(F_\mathrm{r}\) usually varies as a function of its velocity \(\dot{x}\), which is proportional to the angular velocity of the screw \(\dot{\gamma }\). In the most common cases, it is sufficient to calculate this force as the sum of three contributions: a constant term, a linearly variable term and a quadratic term; we can then write:

$$\begin{aligned} F_\mathrm{r} (\dot{\gamma }) = a_0 + a_1 \dot{\gamma } + a_2 \dot{\gamma }^2 \end{aligned}$$
(13)

where the three coefficients \(a_0\), \(a_1\) and \(a_2\) can be estimated by experimental tests.

Making explicit equations (11) with respect to the angular accelerations we obtain:

$$\begin{aligned} \left\{ \begin{array}{l} \ddot{\beta } = \mathcal {G}_1 (\beta , \dot{\beta }, \gamma , \dot{\gamma }, I) \\ \ddot{\gamma } = \mathcal {G}_2 (\beta , \dot{\beta }, \gamma , \dot{\gamma }) \end{array} \right. \end{aligned}$$
(14)

where

$$\begin{aligned} \begin{array}{l} \mathcal {G}_1 (\beta , \dot{\beta }, \gamma , \dot{\gamma }, I) = \displaystyle \frac{z^2}{J_\mathrm{m}} \left[ \displaystyle \frac{k_\mathrm{m} I}{z} - \varPsi (\beta -\gamma , \dot{\beta }-\dot{\gamma })\right] \\ \mathcal {G}_2 (\beta , \dot{\beta }, \gamma , \dot{\gamma }) = \displaystyle \frac{1}{J_\mathrm{v} + M p^2} \left[ \varPsi (\beta -\gamma , \dot{\beta }-\dot{\gamma }) - p F_\mathrm{r}(\dot{\gamma })\right] \end{array} \end{aligned}$$
(15)

2.2 Case with rigid joint without backlash

To conclude the present discussion, it is appropriate to consider also the case with ideal joint (perfectly rigid and without backlash) that can be used as a reference against which to evaluate the previous case; in this situation, the angles \(\beta \) and \(\gamma \) are equal, and then, the system has only degree of freedom; using as a free coordinate angle \(\beta \), the Lagrange equation for this system is:

$$\begin{aligned} \displaystyle \frac{\mathrm{d}}{\mathrm{d}t} \left( \displaystyle \frac{\partial T}{\partial \dot{\beta }} \right) - \displaystyle \frac{\partial T}{\partial \beta } = \displaystyle \frac{\delta W}{\delta \beta } \end{aligned}$$
(16)

where

$$\begin{aligned} T= & {} \frac{1}{2} \left( J_\mathrm{v} + \frac{J_\mathrm{m}}{z^2} + M p^2 \right) \dot{\beta }^2 \end{aligned}$$
(17)
$$\begin{aligned} \delta W= & {} \left( \frac{\tau _\mathrm{m}}{z} - F_\mathrm{r} p \right) \delta \beta \end{aligned}$$
(18)

Note that the resistant force can still be defined by (13), putting \(\dot{\gamma } = \dot{\beta }\) as the joint is perfectly rigid; therefore, \(F_\mathrm{r}=F_\mathrm{r}(\dot{\beta })\).

Substituting (17) and (18) in (16), and taking into account (12) we obtain with simple steps the motion equation of the system, which takes the following form:

$$\begin{aligned} \ddot{\beta } = \mathcal {G}(\dot{\beta }, I) = \frac{1}{J_{eq}} \left( \frac{k_\mathrm{m} I}{z} - p F_\mathrm{r}(\dot{\beta }) \right) \end{aligned}$$
(19)

where \(J_{eq} = J_\mathrm{v} + J_\mathrm{m}/z^2 + M p^2\) is the equivalent moment of inertia.

3 The motion control system

This section describes in detail the architecture of the position control system of the servomechanism under consideration.

As is evident from the block diagram shown in Fig. 4, the motion control is obtained by means of a feedback loop based on the direct measurement of the rotation of the motor axis. At each time instant t, the desired position \(\alpha _{\mathrm{ref}}(t)\) (stored in the RAM memory of the digital controller) is compared with the effective position \(\alpha (t) \) detected by a transducer installed on the motor axis and the angular position error e(t) (in radians) is calculated using the relation:

$$\begin{aligned} e(t)=\alpha _{\mathrm{ref}}(t) - \alpha (t) \end{aligned}$$
(20)

If the transducer is a two-channel quadrature encoder with N pulses/revolution, the proportionality constant \(K_ {enc}\), necessary for converting the position error e(t) (in radians) in the corresponding error \(e_\mathrm{s}(t) \) (in encoder steps), is given by:

$$\begin{aligned} K_{\mathrm{enc}} = \frac{4N}{2 \pi } \end{aligned}$$
(21)

The position error expressed in encoder steps is then:

$$\begin{aligned} e_\mathrm{s}(t)= K_{\mathrm{enc}} [ \alpha _{\mathrm{ref}}(t) - \alpha (t) ] \end{aligned}$$
(22)

A digital controller receives as input the signal \(e_\mathrm{s}\) and processes it appropriately, generating as output a signal y, which will be subsequently used for the motor command.

Many algorithms can be implemented in the motion controller. One of the most popular employs a proportional-integral-derivative algorithm (PID), which calculates the output signal y using the following formula:

$$\begin{aligned} y(t)=K_\mathrm{p} e_\mathrm{s}(t) + K_\mathrm{i} \int _0^t e_\mathrm{s}(t) \hbox {d}t + K_\mathrm{d} \frac{\mathrm{d}e_\mathrm{s}(t)}{\mathrm{d}t} \end{aligned}$$
(23)

where the symbols \(K_\mathrm{p}\), \(K_\mathrm{i}\) and \(K_\mathrm{d}\) indicate, respectively, the proportional, integral and derivative gains. The numerical values of these gains can be selected by the user in order to optimize the dynamic performances of the whole system.

Fig. 4
figure 4

Block diagram of the control system with position feedback and PID regulator

Usually good performance is achieved using a simple proportional control; the integral term, as is known, is introduced to compensate for the static error or to eliminate the position error (usually due to the presence of friction) that sometimes occurs at the end of the movement.

The derivative contribution is introduced to increase the bandwidth of the control system and therefore to provide an adequate speed of response to command signals quickly varying in the time domain; this contribution, in fact, reinforces the effect of the proportional action, generating a stronger control action when the position error is growing over time (\(d e_\mathrm{s}/\hbox {d}t > 0\)) and reducing it in the opposite case (\(d e_\mathrm{s}/\hbox {d}t < 0\)). The use of the derivative action has to be carefully considered, since in some cases makes the system too reactive and therefore very sensitive to high frequency noise that may be present in the system. The signal y generated by the position controller is digital, and therefore, it must be converted into an analog signal \(V_ {\mathrm{out}}\) by a D/A converter; using a n bit converter with voltage output range \(\varDelta V\), the resolution \( K_ {dac} \) is:

$$\begin{aligned} K_{\mathrm{dac}} = \frac{V_{\mathrm{out}}}{y} = \frac{\varDelta V}{2^n} \end{aligned}$$
(24)

The voltage \(V_ {\mathrm{out}}\) is amplified by a power amplifier with gain \(K_\mathrm{a}\); the output of the amplifier is limited to the value \(\pm V_{\mathrm{max}}\) by the saturation block shown in Fig. 4, which allows to consider, during the numerical simulation, the physical limitation of the output voltage. The voltage \(V_\mathrm{m} \) generated by the amplifier is applied to the armature circuit of the permanent magnet DC motor.

Figure 5 shows the armature circuit of the motor; R and L indicate, respectively, the circuit resistance and inductance, \(k_\mathrm{m}\) is the torque/back e.m.f. constant and \(E=k_\mathrm{m} \dot{\alpha }\) is the back electromotive voltage.

Fig. 5
figure 5

Armature circuit of a DC motor

Hence, the Kirchhoff’s voltage law applied to the armature circuit is:

$$\begin{aligned} V_\mathrm{m}=R I + L \dot{I} + k_\mathrm{m} \dot{\alpha } \end{aligned}$$
(25)

Recalling that \(\dot{\alpha }=\dot{\beta }/z\) and making explicit (25) with respect to the derivative of the current I, we obtain:

$$\begin{aligned} \dot{I} = \frac{1}{L} \left[ V_\mathrm{m} - RI - k_\mathrm{m} \frac{\dot{\beta }}{z} \right] \end{aligned}$$
(26)

In order to correctly simulate the dynamic behavior of the system in the presence of the control loop, it is necessary to know the initial conditions and resolve, at each time instant, the differential equations that define the dynamic response of the various parts of the servomechanism, i.e., the mechanical transmission, the electric circuit of the motor and the position controller with position feedback. Due to their complexity, these equations must be numerically solved: this is not a problem, because, at present, many mathematical software packages offer calculation routines, which allows the user to solve simultaneous ordinary differential equations (ODE) by means of well-known numerical methods with fixed or variable time step. However, the implementation of the algorithm requires that the equations are written in an appropriate form, as described in the following paragraph.

4 The complete model: dynamic equations and their solution

According to the diagram in Fig. 4, the voltage \(V_\mathrm{m}\) can be rewritten in the form:

$$\begin{aligned} V_\mathrm{m} = K_0 \left[ K_\mathrm{p} e(t) + K_\mathrm{i} \int _0^t e(t) \hbox {d}t + K_\mathrm{d} \frac{\mathrm{d}e(t)}{\mathrm{d}t} \right] \end{aligned}$$
(27)

where \(K_0 = K_\mathrm{a} K_{\mathrm{enc}} K_{\mathrm{dac}}\) and e(t) is defined by (20).

If we calculate separately the three contributions (the position error, its time derivative and its integral) taking into account the gear ratio z, we obtain the following relationships:

$$\begin{aligned} e = \alpha _{\mathrm{ref}}- \displaystyle \frac{\beta }{z} \quad \displaystyle \frac{de}{\hbox {d}t} = \dot{\alpha }_{\mathrm{ref}}- \displaystyle \frac{\dot{\beta }}{z} \quad \int _0^t e \; \hbox {d}t = \hat{\alpha }_{\mathrm{ref}}- \displaystyle \frac{\hat{\beta }}{z} \end{aligned}$$
(28)

where the symbol \(\,\hat{} \,\) indicates the time integral of the function to which it is applied, i.e.,

$$\begin{aligned} \hat{\alpha }_{\mathrm{ref}} = \int _0^t \alpha _{\mathrm{ref}}(t) \; \hbox {d}t \qquad \hat{\beta } = \int _0^t \beta (t) \; \hbox {d}t \end{aligned}$$
(29)

The function \(\alpha _{\mathrm{ref}}(t)\) is assigned directly as function of the time, and thus, its time derivative \(\dot{\alpha }_{\mathrm{ref}}(t)\) and its integral \(\hat{\alpha }_{\mathrm{ref}}(t)\) are immediately calculable analytically or numerically; on the contrary, the function \(\beta \), its integral \(\hat{\beta } \) and its derivative \(\dot{\beta } \) are unknown, and therefore, their variation in the time domain will be known only after solving the differential equations describing the dynamics of the servosystem. On the basis of the previous considerations, if we assign the values of the three constants \(K_\mathrm{p}\), \(K_\mathrm{i}\) and \(K_\mathrm{d}\), the voltage \(V_\mathrm{m}\) can be considered a known function of the state variables \(\hat{\beta }\), \(\beta \), \(\dot{\beta }\) and the time t, that is:

$$\begin{aligned} V_\mathrm{m} = V_\mathrm{m}(\hat{\beta }, \beta , \dot{\beta }, t) \end{aligned}$$
(30)

By inserting now the relationship (30) in (26) we note that the time derivative of the current is a function (denoted by the symbol \(\mathcal {H}\)) of the three state variables \(\hat{\beta }\), \(\beta \), \(\dot{\beta }\) and the current I; we can then write:

$$\begin{aligned} \dot{I} = \mathcal {H}(\hat{\beta }, \beta , \dot{\beta }, I, t) \end{aligned}$$
(31)

At this point, the differential equations of the global system can be written without particular difficulties. If we use the model with two degrees of freedom described in Sect. 2A, two equations (11) must be joined to (31) in order to generate the following system of differential equations:

$$\begin{aligned} \left\{ \begin{array}{l} \ddot{\beta } = \mathcal {G}_1 (\beta , \dot{\beta }, \gamma , \dot{\gamma }, I) \\ \ddot{\gamma } = \mathcal {G}_2 (\beta , \dot{\beta }, \gamma , \dot{\gamma }) \\ \dot{I} = \mathcal {H}(\hat{\beta }, \beta , \dot{\beta }, I, t) \\ \end{array} \right. \end{aligned}$$
(32)

Usually the numerical solvers require that each second-order differential equation be converted to a set of two first-order ODE’s for solution; to achieve this result it is sufficient to introduce the following auxiliary functions:

$$\begin{aligned} \left\{ \begin{array}{l} u_0=\hat{\beta } \\ u_1=\beta \end{array} \right. \quad \left\{ \begin{array}{l} u_2=\dot{\beta } \\ u_3=\gamma \end{array} \right. \quad \left\{ \begin{array}{l} u_4=\dot{\gamma } \\ u_5=I \end{array} \right. \end{aligned}$$
(33)

Therefore, differential equations (32) can be rewritten as:

$$\begin{aligned} \left\{ \begin{array}{l} \dot{u}_0 = \beta = {u}_1\\ \dot{u}_1 = \dot{\beta } = {u}_2\\ \dot{u}_2 = \ddot{\beta } = \mathcal {G}_1 (u_1, u_2, u_3, u_4, u_5)\\ \dot{u}_3 = \dot{\gamma } = {u}_4\\ \dot{u}_4 = \ddot{\gamma } = \mathcal {G}_2 (u_1, u_2, u_3, u_4)\\ \dot{u}_5 = \dot{I} = \mathcal {H} (u_0, u_1, u_2, u_5, t)\\ \end{array} \right. \end{aligned}$$
(34)

These five simultaneous ODE’s are written in state space form and can be integrated by a numerical solver, using a fixed or an adaptive step size.

For the case with ideal joint (perfectly rigid and without backlash) described in Sect. 2B, the process is similar; the system of differential equations that describes the dynamic behavior of the servomechanism is obtained by combining (19) with equation (31):

$$\begin{aligned} \left\{ \begin{array}{l} \ddot{\beta } = \mathcal {G} (\dot{\beta }, I) \\ \dot{I} = \mathcal {H}(\hat{\beta }, \beta , \dot{\beta }, I, t) \\ \end{array} \right. \end{aligned}$$
(35)

Introducing now the following auxiliary functions:

$$\begin{aligned} \left\{ \begin{array}{l} u_0=\hat{\beta } \\ u_1=\beta \end{array} \right. \quad \left\{ \begin{array}{l} u_2=\dot{\beta } \\ u_3=I \end{array} \right. \end{aligned}$$
(36)

the system is rewritten in the form:

$$\begin{aligned} \left\{ \begin{array}{l} \dot{u}_0 = \beta = {u}_1\\ \dot{u}_1 = \dot{\beta } = {u}_2\\ \dot{u}_2 = \ddot{\beta } = \mathcal {G} (u_2, u_3)\\ \dot{u}_3 = \dot{I} = \mathcal {H} (u_0, u_1, u_2, u_3, t)\\ \end{array} \right. \end{aligned}$$
(37)

and it can be solved without difficulties by numerical integration.

5 Simulation examples

This section shows some examples of simulations carried out on the complete model of the servomechanism described in this paper. The simulations were obtained by means of a calculation software specially developed to check in a simple and immediate way the dynamic effects resulting from the following factors:

  • the shape of the function used as motion command for the servomechanism (displacement, velocity, acceleration diagrams);

  • the gains \(K_\mathrm{p}\), \(K_\mathrm{i}\) and \(K_\mathrm{d}\) of the PID regulator;

  • the electric parameters of the motor; and

  • the parameters of the mechanical system (masses and moments of inertia, gear ratio, screw pitch, stiffness, damping and backlash of the joint).

As regards the choice of the motion command, the simulation software is designed so that the user can define the acceleration profiles in parametric form. After assigning the value h of the displacement of the carriage and the total motion time \(T_0\), the user can define in detail the acceleration profile by assigning the durations of the seven time intervals \(t_1, t_2, \ldots , t_7\), visible in Fig. 6. Looking at the graph, we note that the acceleration diagram is constituted by arcs of sinusoid alternating with sections having constant value: Each interval can be eliminated by assigning to it a duration equal to zero.

Fig. 6
figure 6

Motion command: parametric acceleration diagram with seven time intervals (user selectable)

Proceeding with a double integration, the software calculates the speed and displacement diagrams; the displacement values, suitably scaled on the basis of the transmission ratio z and the pitch of the screw p, are sent to the control system simulator. At each instant of time \(\varDelta t\) (user selectable), the reference position \(\alpha _{\mathrm{ref}}\) is compared with the actual position \(\alpha \) and the position error, properly processed by the PID controller, is used to generate the voltage command for the electric motor. The simulation in the time domain is obtained by using the Runge–Kutta algorithm.

Figure 7 shows some examples of simulations which may be executed by means of this calculation software the data used for the calculation are given in Tables 1 and 2.

Table 1 System parameters
Table 2 Backlash amplitude and duration of the time intervals \(t_\mathrm{i}\) used in the numerical simulations
Fig. 7
figure 7

Simulation examples: acceleration command (plots in the left column) and carriage acceleration (plots in the right column). The simulations are performed with different acceleration diagrams and with different backlash values (see Table 2)

6 Conclusions

The article presented an operational methodology to define a computational model capable of simulating the dynamic behavior of a servomechanism. This model has been implemented in a simulation software that allows the user to predict the performance of a linear drive and to evaluate the effects related to specific design choices.

Considerable attention has been paid to the characteristics of the mechanical transmission, in particular as regards the deformability and the presence of backlash. However, to make more reliable the simulation, it was decided to integrate in the calculation model also the effects due to the control algorithm.

Therefore, it has been defined a typical control scheme, based on the position feedback and a PID regulator. This scheme, very common in the industrial field, is not particularly complex to implement and, at the same time, it allows to obtain satisfactory performance in most cases. The function chosen to command the system can greatly affect the global dynamic behavior of the servomechanism. For this reason, the software contains a calculation module that allows the user to define motion commands with various acceleration diagrams; in this way it is possible to verify the effects related to different motion strategies. The numerical simulations, which can be performed in a short time, may help the designer to optimize the dynamic performance of the servomechanism without performing experimental activities. On the basis of the simulation results he can then evaluate, for example, whether the presence of the backlash still allows to obtain acceptable acceleration values. The software also allows to verify the effects resulting from different settings of the position regulator, and therefore, it can be helpful to assist the designer during the calibration procedures. Finally, if we have at our disposal an actual servomechanism equipped with some type of transducers (transducers speed, acceleration, current, etc.), the software allows the identification of the characteristic parameters of the mathematical model, through the comparison between the experimental data, acquired in the time domain, and the corresponding values obtained by numerical simulations.