Lab Activity - Friction and Inertia Estimation
In questa pagina 3
1. Activity goal
Estimate the friction and inertia parameters of the DC servomotor available in the laboratory from data obtained with simple experimental tests. The parameters will be used in the next laboratory activity to improve the performance of the PI speed controller, in particular with a feedforward compensation scheme. The model of the servomotor is the one of Modeling a DC ServomotorA permanent-magnet DC motor is modeled by an electrical equation with a back-EMF term and a mechanical equation with inertia and viscous friction, a gearbox just adds the load inertia and friction divided by N squared on the motor side, and for the laboratory servomotor (voltage driver plus gearmotor plus disc) this gives a transfer function from input voltage to load angle that reduces to a first-order lag times an integrator.Modeling a DC Servomotor → and Lab Activity - DC Servomotor Simulink ModelingLaboratory activity to build a Simulink model of the laboratory DC servomotor that includes voltage saturation, DAC and encoder quantization, Coulomb friction and three alternative speed filters, with nominal parameters, step-by-step tasks S1 to S7 and a Matlab parameter script.Lab Activity - DC Servomotor Simulink Modeling →.
2. Estimation of model parameters
In principle, the control design can be carried out on a nominal model of the plant, provided that a sufficiently large phase margin is chosen to tolerate parameter uncertainties that could destabilise the control system. However, better performance can usually be achieved when the actual parameter values are estimated from experimental data. Here a simple procedure estimates the main mechanical parameters (static and viscous friction, total rotor inertia). They can be used either to redesign the feedback controller with the updated plant model, or to implement a feedforward compensator for better tracking.
2.1 Friction estimation
Start from the overall mechanical dynamics at motor side (see Lab Activity - DC Servomotor Simulink ModelingLaboratory activity to build a Simulink model of the laboratory DC servomotor that includes voltage saturation, DAC and encoder quantization, Coulomb friction and three alternative speed filters, with nominal parameters, step-by-step tasks S1 to S7 and a Matlab parameter script.Lab Activity - DC Servomotor Simulink Modeling →):
Rearranging, the torque balance equation is
At any instant a fraction of the motor torque, the inertial torque
accelerates the equivalent rotor inertia, and the remaining part overcomes the total friction torque
(at load side the total friction torque is ). It has two terms: the viscous friction and the static (Coulomb) friction , seen at motor side.
Constant speed. At steady state with , (4) gives
The motor torque must exactly balance the friction torque to keep the speed constant. The torque cannot be measured directly, but the law of motors
gives an indirect measurement through the armature current (sensed as voltage drop across the shunt resistor ), provided that is known. If the torque is measured at different constant speed levels, and in the affine function (7) can be estimated by linear least squares (LS) fitting of the torque versus speed data.
Linear regression form.
are the vector of regressors and the vector of unknown parameters. Let
be the torque/speed pairs measured at different constant speed levels. The parameters minimise the quadratic cost (quadratic error)
With the notation
the cost becomes
minimised by the LS solution
The LS estimate of the total friction torque is
In Matlab, with the matrices stored in variables Phi and Y, the solution (16) is computed with the left matrix division operator: thLS = Phi\Y (see mldivide in the online help).
2.2 Inertia estimation
Impose a constant acceleration or deceleration to the total gearmotor inertia (increase or decrease the speed at a constant rate). From (4)-(6), an estimate of the inertial torque used to accelerate the equivalent inertia is obtained by subtracting from the measured motor torque the friction torque estimated in section 2.1:
Let be the average inertial torque estimated with a constant acceleration , and the average inertial torque with a constant deceleration . The total rotor inertia is estimated as
If several acceleration/deceleration phases are repeated, the estimate is the average of the single estimates:
with the total number of phases and the estimate for the -th phase.
2.3 Combined friction and inertia estimation
A single experimental test can replace both previous tests. Rewrite the torque balance (4) in regression form:
With the measurements
minimise the quadratic cost
With
the cost is rewritten as in (15) and minimised by the LS solution (27), computed with (16). For the identifiability of the parameters the data (24) must be collected under sufficient excitation conditions of the plant dynamics: it is sufficient to impose constant acceleration/deceleration phases during the data collection.
3. Laboratory assignments: post-processing of experimental data
3.1 Estimation of friction parameters
S1. Consider the experimental data collected in laboratory activity 2 with a staircase speed reference
The measured motor current is very noisy because of the commutation of the brushes contacts while the motor rotates. To reduce it, filter the current with a low-pass filter before the estimation: a second-order Butterworth low-pass filter with Hz cut-off,
is sufficient. All data are collected with a fixed sampling time ms, so the filtering is done in discrete time: define the continuous-time filter (29) in Matlab, discretise it with the Control System Toolbox routine c2d with a suitable method (e.g. 'tustin'), then apply the Matlab routine filter:
% low-pass filtering of armature current measurement
wci = 2*pi*20;
di = 1/sqrt(2);
sysHi = tf(wci^2, [1, 2*di*wci, wci^2]);
sysHi = c2d(sysHi, sim.Ts, 'tustin');
[numHi, denHi] = tfdata(sysHi, 'v');
ia = filter(numHi, denHi, ia);Notes: line 4 defines the LTI object sysHi for the continuous-time filter (29); line 5 obtains a discrete equivalent with Tustin's method; line 7 filters the current signal ia with filter. An alternative to lines 2-6 is the routine butter of the Signal Processing Toolbox, which gives numerator/denominator of a discrete-time low-pass Butterworth filter of given order and cut-off frequency.
S2. For each time interval
in which the motor speed is constant, compute the average values and of the motor speed and torque. In each interval avoid the initial speed and torque transients: use only the portion of data where a constant steady-state value is reached (shaded areas in Fig. 1a). Two tests were performed, one with a positive and one with a negative staircase reference; compute the averages for both. Denote with the data set with positive reference speed and with that with negative reference.
S3. With the data set obtain the friction parameters and with the procedure of section 2.1. Use the correct units: torque in N m and speed in rad/s, so that is in N m/(rad/s) and in N m. Repeat for to get and . The overall estimates are
Fig. 1 (data of the activity): (a) a staircase of motor speed up to about krpm (steps of roughly krpm) and the motor current, with spikes at each speed change and a slowly growing level; (b) the friction torque (motor side) against motor speed in krpm: experimental points of the order of N m lie on two straight lines, one for positive and one for negative speed, with a jump at zero speed (the Coulomb term) and the slope given by the viscous coefficient.
3.2 Estimation of inertia parameters
S4. Consider the data of laboratory activity 2 with a triangular-wave speed reference (speed reference with constant acceleration/deceleration phases):
As in S1 of section 3.1, use the filter (29) to remove the brushes commutation noise from the current.
S5. The estimation (19) needs the motor acceleration, obtained by differentiating the speed with a suitable high-pass filter; cut-off frequency and roll-off must be chosen to avoid excessive amplification of the encoder quantization noise. A second-order high-pass filter
is sufficient. As for the current, the speed filtering is done in discrete time (the speed measurement is a discrete-time signal) after discretising (34). The Matlab excerpt computing the motor acceleration from the load-side speed measurement is:
% high-pass filtering of speed measurement (to get the acceleration)
wca = 2*pi*20;
da = 1/sqrt(2);
sysFa = tf([0, wca^2, 0], [1, 2*da*wca, wca^2]);
sysFa = c2d(sysFa, sim.Ts, 'tustin');
[numFa, denFa] = tfdata(sysFa, 'v');
al = filter(numFa, denFa, wl);S6. Use the friction parameters (31) to compute the friction torque signal
where is the motor speed measured at the sampling instant and is the number of samples. Then use (18) to compute the inertial torque signal
the fraction of motor torque used to accelerate the total inertia (bottom plot of Fig. 2b); is the motor torque measured at .
S7. For each interval
in which the motor acceleration is constant, compute the averages and of the motor acceleration and of the inertial torque, avoiding the initial transients (shaded areas of Fig. 2b). is positive when is even and negative otherwise.
S8. Estimate the equivalent inertia with the procedure of section 2.2. Applying (20):
with (assuming even), using the fact that, given the acceleration reference (33), is positive for even and negative for odd.
Fig. 2 (data of the activity): (a) the speed of the triangular profile (peaks of about krpm every s) and the current; (b) the acceleration (alternating about and krpm/s, as read from the plot) and the inertial torque (of the order of N m in absolute value), with shaded intervals used for the averages.
Versione ripasso
Goal. Estimate , , for the feedforward and PI redesign; see Modeling a DC ServomotorA permanent-magnet DC motor is modeled by an electrical equation with a back-EMF term and a mechanical equation with inertia and viscous friction, a gearbox just adds the load inertia and friction divided by N squared on the motor side, and for the laboratory servomotor (voltage driver plus gearmotor plus disc) this gives a transfer function from input voltage to load angle that reduces to a first-order lag times an integrator.Modeling a DC Servomotor →.
Torque balance (motor side, ):
inertial torque , total friction .
Friction (constant speed, ). , , ; LS:
computed in Matlab with the left division operator on Phi and Y.
Inertia (constant acceleration). ;
Combined. , , same LS; the data need acceleration/deceleration phases (excitation).
Post-processing.
- S1: staircase reference ; filter the current with a Hz second-order Butterworth low-pass (),
c2d(...,'tustin'),filter. - S2-S3: averages , over steady portions, LS for the positive and the negative data set (torque in N m, speed in rad/s), then , .
- S4-S5: triangular reference, acceleration from the speed with the discretised high-pass , .
- S6: , .
- S7-S8: averages and per interval, then
Typical error: using rpm or N m inconsistently in the regression, or averaging over the initial transients of each interval.
Regressione a velocità costante (LS):
- e con righe .
- Costo: , minimo per .
- Stima dell'attrito: .
Stima dell'inerzia con accelerazioni costanti: con e per l'accelerazione, e per la decelerazione.
Stima combinata (un solo test): con e . Serve un'eccitazione sufficiente: vanno inserite fasi di accelerazione e decelerazione.
Filtro di corrente (S1): Butterworth del secondo ordine, , , discretizzato con Tustin ( ms) e applicato con filter:
sysHi = tf(wci^2, [1, 2*di*wci, wci^2]);
sysHi = c2d(sysHi, sim.Ts, 'tustin');
ia = filter(numHi, denHi, ia);Filtro passa-alto per l'accelerazione (S5): , con e . Dal segnale di velocità del carico si ottiene con filter, dopo la discretizzazione.
Ordine dei passi S1-S8:
- Filtrare la corrente (S1 e S4).
- Media di e su ogni gradino stazionario, senza i transitori (S2).
- LS per i dati positivi e negativi, poi media di e di (S3).
- Accelerazione dal passa-alto, poi (S4-S6).
- Media di e per ogni intervallo, con per pari (S7).
- con la formula (38) (S8).
Errori tipici:
- Mescolare rpm e rad/s o N m e kN m nella regressione: le unità devono essere coerenti.
- Usare il termine senza dividere per .
- Mediare includendo i transitori iniziali di ogni intervallo.
- Mediare con segno invece che con il valore assoluto dei due test.
- Stimare con un test senza accelerazione: l'inerzia non è identificabile.