0% found this document useful (0 votes)
27 views7 pages

A Survey of Identification For Experimental DC Motor by

This paper discusses a method for estimating the parameters of a Permanent Magnet DC Motor (PMDC) using MATLAB's Parameter Estimator tool, validated through simulations and experiments on a Rotary Inverted Pendulum (RIP) with an LQR controller. The authors demonstrate that the identified motor parameters yield a close match between simulation and experimental results, enhancing the reliability of control systems utilizing PMDC motors. The document outlines the mathematical modeling, optimization problem formulation, data collection, and parameter estimation processes in detail.

Uploaded by

tn012257
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views7 pages

A Survey of Identification For Experimental DC Motor by

This paper discusses a method for estimating the parameters of a Permanent Magnet DC Motor (PMDC) using MATLAB's Parameter Estimator tool, validated through simulations and experiments on a Rotary Inverted Pendulum (RIP) with an LQR controller. The authors demonstrate that the identified motor parameters yield a close match between simulation and experimental results, enhancing the reliability of control systems utilizing PMDC motors. The document outlines the mathematical modeling, optimization problem formulation, data collection, and parameter estimation processes in detail.

Uploaded by

tn012257
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Huynh P.H., Mai H.T., Phan P.V., Nguyen T.D., Do D.T., Tran T.Y.N., Nguyen T.T., Nguyen V.D.H.

A SURVEY OF IDENTIFICATION FOR EXPERIMENTAL DC MOTOR BY


MATLAB TOOLBOX
Phuc-Hoang Huynh, Hoai-Tien Mai, Phu-Vinh Phan, Tien-Dat Nguyen, Dang-Thinh Do,
Thi-Yen-Nhi Tran, Tuan-Tung Nguyen, Van-Dong-Hai Nguyen *
Ho Chi Minh City University of Technology and Education (HCMUTE)
Vo Van Ngan Street, No. 01, Ho Chi Minh City, Vietnam
* Corresponding author. E-mail: [email protected]

Abstract: This paper presents a method for estimating the parameters of a Permanent Magnet DC Motor (PMDC) using
the "Parameter Estimator" tool in MATLAB. The authors also conducted simulations and experiments with the
identified motor on a Rotary Inverted Pendulum (RIP) using a Linear Quadratic Regulator (LQR) controller to validate
the results. The findings demonstrate that the system responds well, with a close match between simulation and
experimental results.
Keywords: Parameter Estimator, PMDC Motor, RIP, LQR.

1. Introduction and conduct simulations, and experiments to evaluate


identification results.
DC motors are commonly used in control systems
The article is structured as follows: Part 2
due to their linear mechanical characteristics, wide speed
discusses the mathematical equations of the PMDC
regulation range, and ability to handle large loads at low
motor. Part 3 presents an optimization problem in
speeds [1]. Therefore, PMDC motors are widely applied
MATLAB Simulink. Part 4 explains methods to collect
in control models such as two-wheel balancing vehicles,
experimental data from the motor. Part 5 outlines the
inverted pendulums with inertia wheels, position control,
steps used to estimate and validate the motor's
speed control, etc. However, for most motors available
parameters using a parameter estimator tool. Part 6
on the market today, manufacturers often do not provide
evaluates the results of RIP.
sufficient motor specifications, or wear and tear during
usage leads to inaccurate specifications. This inaccuracy 2. Model of PMDC Motor
results in flawed mathematical modeling of the system,
PMDC Motor belongs to the category of
making simulation, experimentation, and controller
independently excited DC motors. It is divided into two
design challenging and contributing to system instability.
main parts: the field (magnet) and the armature winding.
In practice, there are various methods to estimate
The motor structure is illustrated in Fig. 1
motor parameters, including Genetic Algorithm (GA)
[2], Differential Evolution (DE) with two strategies,
Teaching–Learning-Based Optimization (TLBO), and
Artificial Bee Colony (ABC) [3]. Other methods include
Ordinary Least Squares and Recursive Least Squares
algorithms [4], Error Forecasting Methods, Fuzzy
Modeling, Neural Network Modeling [5], etc.
In error forecasting methods, due to the
mathematical characteristics of the motor equation,
parameter estimation requires collecting current signals. Fig. 1. Independently Excited DC Motor.
However, in reality, the electrical speed is faster than the
mechanical speed, causing the collected current signal to To model this, we need to divide the motor into 2
be incompatible with the motor speed, leading to parts: the 'electrical' and the 'mechanical'. Due to
inaccurate identification. Kirchhoff's law, we have the voltage balance equation in
To ensure the estimated parameters are suitable, the electrical circuit component:
d (ia )
it's necessary to evaluate the results. Unlike the Ra ia (t ) + La + vb (t ) = ea (t ) (1)
evaluation methods proposed by Marko Jesenik [3] and dt
M. Awoda with R. Ali [6], which focus on comparing d
results, the authors not only validate the parameters where: vb (t ) = Kb(t ) - Inductive Reactance;  (t ) = m
dt
using MATLAB but also integrate the motor model into
Applying Newton's law to rotational motion, we
a RIP to model the system, design an LQR controller,
have the equation of torque balance on the motor shaft:

Robotica  Management, 29-2 / 2024


4 A Survey of Identification for Experimental DC Motor by Matlab Toolbox

d Optimization solver tunes the values of designed


Jm + Dm = Tm − Td (2) variables to satisfy specified objectives and constraints.
dt
Optimization solver applied to the PMDC Motor here is
where: Tm = Kt ia (t ) - Motor torque
Nonlinear Least Squares (NLS). This choice is made
Tab. 1. Parameters of motor because the cost function is not scalar and number of
error residuals does not change from one iteration to
Symbol Descriptions Unit another.
ea Objective of NLS method is finding a vector x
Armature voltage V
inimizing cost function F ( x ) :
La Armature inductance H
(
min F ( x ) 2 = min f1 ( x ) + f 2 ( x ) + ... + f n ( x )
x
2 2 2 2
) (5)
ia Armature current A
where: f1 ( x ) , f 2 ( x ) ,..., f n ( x ) scalar-valued nonlinear
vb Back emr V function of residual of data point i = 1, 2,..., n in which n
is the number of samples, x is vector of variables
m Angular position of rotor rad representing the motor parameters to be estimated.
Various algorithms are used in the MATLAB Toolbox to
Tm Motor torque N/m solve equations(5), including:
• Levenberg-Marquardt algorithm [8]. This algorithm
Jm Rotor inertia kgm2 combines the Gauss-Newton method with Gradient
Descent to search for the optimal point x .
Dm Viscous friction constant Nm/rad
• Trust-Region-Reflective algorithm[9]. This method
Kt Torque constant Nm/A restricts the search range within a confidence region
x to ensure algorithm stability.
Kb Back emf constant Vs/rad In this parameter identification problem for the
PMDC motor, the authors use the Levenberg-Marquardt
 Payload torque Nm method to solve the numerical equations (5)
Optimization stopping criterion is decided by
Ra Armature resistance  several factors: if two successive parameters change by
less than the selected parameter tolerance
3. Parameter Estimation as an Optimization ( xi +1 − xi  1 ) , or if cost function values change by less
Problem in Matlab/Simulink
than selected function tolerance ( Fi +1 − F 1   2 ) , or if
When performing parameter estimation of a
PMDC motor, software formulates an optimization maximum number of iterations is reached. By adjusting
problem [7]. The solution to this problem is set of these parameters, optimization can continue searching
estimated parameter values of the PMDC motor. This for a more accurate solution [6].
problem includes: 4. Input-Output Motor Data Estimation
• x - Design variables: The parameters of the PMDC
motor model and the initial state to be estimated. The process of collecting supply voltage and
• xmin  x  xmax Bounds: Limits on the estimated angular velocity data through communication between a
computer and a microcontroller is demonstrated in Fig. 2
parameter values. For PMDC motor parameter
estimation must be 0  x  xmax .
• F ( x ) - Objective function: A function calculating the Speed of motor
Microcontroller
PWM Motor PMDC
Encoder
Voltage signal Drive Motor
measure of difference between simulated (sim ( t ) )
Voltage signal
and experimental (ref ( t ) ) motor speed responses. It
Fig. 2. Block diagram of experimental voltage and speed
is also known as the cost function or estimation error. data.
The cost function is Sum squared error:
nt We collect two datasets. The first dataset is used to
F ( x ) =  e(t ) 2 (3) estimate parameters of PMDC motor with voltage
t =0
signals represented as a Fourier series:
V = 3 ( sin ( 0.4 t ) + sin ( 0.6 t ) + sin ( 2 t ) + sin (1.2 t ) ) (V ) (6)
where n is the number of samples
e ( t ) = ref ( t ) − sim ( t ) (4)

Robotica  Management, 29-2 / 2024


Huynh P.H., Mai H.T., Phan P.V., Nguyen T.D., Do D.T., Tran T.Y.N., Nguyen T.T., Nguyen V.D.H. 5

Fig. 3. Fourier input signal.


Second dataset is used to evaluate estimation results with voltage signals represented as a sinusoidal waveform:
V = 12sin ( 2 0.15t ) (V ) (7)

Fig. 4. Sinusoidal input signal.


With such input voltage signals to the motor, the authors use an encoder mounted on the motor shaft to read the
rotor angle with a sampling period Ts = 0.01( s ) . The signal is sent back to the microcontroller to calculate the rotor
angular velocity and transmit it to the computer.
The rotor angular velocity when the Fourier input signal is represented is shown in Fig. 5.

Fig. 5. Rotor speed with fourier input signal.


The rotor angular velocity when the sinusoidal input signal is represented is shown in Fig. 6.

Fig. 6. Rotor speed with Sinusoidal input signal.


Collected data is stored as a structure with time in
5. The Identification Process
MATLAB to store the experimental data for estimation
and validation. After collecting data, we proceed to simulate
motor system in MATLAB Simulink. The motor is

Robotica  Management, 29-2 / 2024


6 A Survey of Identification for Experimental DC Motor by Matlab Toolbox

described by mathematical equations (1) and (2) with six parameters of motor model: Dm , J m , Kt , Kb , Ra , La .
initial parameters of PMDC motor. These parameters are By knowing from our physical insight that these
obtained from another motor with known specifications parameters cannot be negative, we set their lower limits
and loaded into workspace. to zero.
c. Load estimation data by adding a new experiment.
Select inputs as the voltage signal with a Fourier series
and the corresponding output as the rotor speed.
d. Add progress plots by clicking Add Plot on the
Fig. 7. Simulating the motor system in Matlab Simulink. Parameter Estimation tab, in Experiment Plots select
Exp. In Cost Function select Sum Squared Error.
5.1. Estimate Parameter PMDC Motor. Select More Option > Optimization, in tag Estimation
To estimate the parameters of the PMDC motor, Options select method Nonlinear least squares, Trust-
we use Parameter Estimator toolbox for Matlab. Here, Region-Reflective algorithm, click ok, and run the
we use Matlab 2023a. All steps follow the guidelines estimation.
provided by MathWorks as (from [10]): Fig. 8 shows experimental data overlaid with
a. In the Simulink, we select Apps > Parameter simulated data. Simulated data comes from the model
estimator. with six estimated parameters. Results of estimation
b. Selecting Parameters for Estimation. Estimation show that output matches.
parameters are chosen by clicking Select Parameters in
Parameter Estimator tab. For PMDC Motor, we obtain

Fig. 8. Relationship between Simulated and experimental outputs with the Fourier input signal.
The estimated parameters are shown as
a. Load the validation data by selecting Validation >
La =0.007703 ( H ) ; J m =0.0069575 (Kgm2); New Experiment. Select the inputs as the sinusoidal
Dm =0.037751 (Nm/rad); K t =0.54897 (Nm/A); (8) voltage signal and the corresponding output as the rotor
K b =0.024502 (Vs/rad); Ra =0.47345 ( ) speed.
b. Right-click on the added dataset, select Use
5.2. Validation Parameter PMDC Motor. Experiment for Validation, then choose Validate.
Successful estimation will not only match The results after validation are presented on Fig.
experimental data that was used for estimation but also 9. Validation demonstrates that the model effectively
other data sets experimentally collected [10]. Therefore, handles sinusoidal input signal from the validation data,
we added an evaluation step with a sinusoidal input indicating that model parameters were successfully
signal. The validation in the Parameter Estimator follows estimated.
the following steps:

Robotica  Management, 29-2 / 2024


Huynh P.H., Mai H.T., Phan P.V., Nguyen T.D., Do D.T., Tran T.Y.N., Nguyen T.T., Nguyen V.D.H. 7

Fig. 9. The relationship between the simulated and experimental outputs with the Sinusoidal input signal.
6. Evaluate the PMDC Motor Parameter using K tV −K K
LQR Controller on RIP = + ( t b − Dm ) − J m (10)
Rm Rm
Because the objective of parameter estimation for Tab. 2. The parameters and variables of the system.
the motor is to model and design a controller for the
Values Description Value Unit
system. Therefore, to evaluate the estimated parameters
for the motor, the authors will design an LQR controller m1 Mass of pendulum 0.05322 Kg
on the represented RIP in Fig. 10. l1 Length of pendulum stick 0.33 m
m1 L0 Length of pendulum arm 0.22 m

J0 Inertia moment of arm 0.00817 kgm2
Inertia moment of
J1 0.00912 kgm2
Z pendulum
l1 g Gravitational acceleration
9.81 m/s2
constant
X  Pendulum arm angle rad

 Y
Pendulum angle rad
L0 V Armature voltage V
 Torque applied to the arm
Nm
Fig. 10. RIP model. axis
Kt Torque constant 0.54897 Nm A
According to [5], we have mathematical
equations describing RIP system as follows: Kb Back emf constant 0.024502 Vs rad
 J 0 + m1 L20 + m1l12 sin 2  −m1 L0l1 cos     Ra Armature resistance 0.47345 
   +
 −m1 L0l1 cos  J1 + m1l12     Jm Moment of inertia of rotor 0.0069575 kgm2

 1 2 1 2  Dm Viscous friction constant 0.037751 Nms/rad


C0 + 2 m1l1  sin 2 m1 L0l1 sin  + 2 m1l1  sin 2    From (9), (10). we obtain the linear state
+  +
  
equations of RIP at the operating point:
 − 1 m l 2 sin 2 C1
 2 1 1   x = Ax + Bu
 (11)
 0     y = Cx
+ =  (9)
 −m1 gl1 sin   0    ; u = V ; y =  
T
where: x =   
T

The control signal here is torque of motor (  ). It With system parameters from Tab. 2, the matrices
needs to be converted into voltage to fit the real system. A, B, C at the x = 0 operating point are as follows:
Torque produced by DC motor is defined by:

Robotica  Management, 29-2 / 2024


8 A Survey of Identification for Experimental DC Motor by Matlab Toolbox

0 0 0 0  (12) K = −5.47 −4.93 97.51 13.3 (14)


0 −4.537 4.78 −0.004 
With the mathematical equations (9), (10) and the
A= ;
0 0 0 1  system parameters from Tab. 2, the authors simulated
  RIP on Matlab Simulink Fig. 11.
0 −2.013 21.908 −0.02 
1 0 0 0 
B =  0 72.49 0 32.17  ; C = 
T

0 0 1 0
Because we use a microcontroller to control the
system with a sampling time Ts=10ms, discrete-time
matrices A, B and the weighting matrices for the LQR
controller have the following values:
1 0.0098 0.0002 0  (13)
0 0.9556 0.0467 0.0002 
Ad =  ;
0 −0.0001 1.0011 0.01 
 
0 −0.0197 0.2187 1.0009 
Bd =  0.0036 0.7087 0.0016 0.3146 ; Fig. 11. Simulation of the RIP system.
T

50 0 0 0  x =      =  0.18 0 −0.02 0


 0 0.01 0 0  System response is shown in Fig. 12
Q= ; R = 0.7
0 0 10000 0 
 
0 0 0 0.001
From (13), matrix K is obtained as

Fig. 12. The output response of the system in the simulation.


Output experimental response is shown in Fig. 13 and system response is shown in Tab.3
Tab. 3. System response
Pendulum angle (rad) Arm angle (rad) Control voltage (V)
Error [0.017;0.17] [-0.01; 0.003] [-0.623;1.3]
Average error 0.05 0.003 0.2
With initial state angles during simulation:

Fig. 13. The output experimental response of the system.

Robotica  Management, 29-2 / 2024


Huynh P.H., Mai H.T., Phan P.V., Nguyen T.D., Do D.T., Tran T.Y.N., Nguyen T.T., Nguyen V.D.H. 9

7. Conclusion Drive Systems (IJPEDS), vol. 11, no. 2, 2020.


[3] Jesenik M. et al: "The Use of Evolutionary
To solve parameter estimation problem for motor
Methods for the Determination of a DC Motor
as an optimization task in Matlab Simulink, we utilized
and Drive Parameters Based on the Current and
Nonlinear Least Squares method Trust-Region-
Angular Speed Response", Mathematics, vol. 8,
Reflective algorithm. We built a Simulink model with
no. 8, 2020.
dynamic equations of the PMDC motor and used
[4] Arshad S. et al: "Parameter estimation of a DC
parameters from another motor to simulate the initial
motor using ordinary least squares and recursive
motor system. Estimation was performed using a Fourier
least squares algorithms", in Proceedings of the
input signal, followed by validation with a sinusoidal
8th International Conference on Frontiers of
input signal. Simulation results of the motor system with
Information Technology, pp. 1-5, 2010.
estimated parameters closely matched experimental
[5] Huynh T.H.: "Intelligent Control Systems”, Ho
results, demonstrating suitability of PMDC motor
Chi Minh City National University, 2006.
parameters. Since parameter estimation aims to design a
[6] Awoda M., Ali R.: "Parameter estimation of a
controller for improved system stability, we applied
permanent magnetic DC motor", Iraqi J. Electr.
estimated motor to a RIP by using LQR controller for
Electron. Eng, vol. 15, no. 1, pp. 28-36, 2019.
further validation. The consistency between simulation
[7] MathWorks. "How the Software Formulates
and experimental results confirms that estimated
Parameter Estimation as an Optimization
parameters are appropriate for the system.
Problem". Link:
Acknowledgement https://www.mathworks.com/help/sldo/ug/optimiz
ation-problem-formulation-for-parameter-
This paper belongs to project for student in 2025
estimation.html (accessed 4/3, 2024).
of HCMUTE. We appreciate the support of HCMUTE
[8] Ranganathan A.: "The levenberg-marquardt
for funding for this project. We also want to give thanks
algorithm", Tutoral on LM algorithm, vol. 11, no.
to Ms. Eng. Phong-Luu Nguyen (email: 1, pp. 101-110, 2004.
[email protected]) for supporting in operating in [9] Conn A.R., Gould N.I., Toint P.L.: „Trust region
Matlab environment.
methods”, SIAM, 2000.
8. References [10] MathWorks. "Inverted Pendulum Parameter
Estimation". Link:
[1] Huynh T.H., Nguyen T.P.H.: "Automatic https://www.mathworks.com/help/sldo/ug/inverte
Control", Ho Chi Minh City National University, d-pendulum-parameter-estimation.html (accessed
2011. 4/5, 2024).
[2] Amiri M.S. et al: "Optimal parameter estimation
for a DC motor using genetic algorithm",
International Journal of Power Electronics and

Robotica  Management, 29-2 / 2024

You might also like