Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
0 views

Project Update System Identification & PID Tuning

This document discusses the system identification and PID tuning of DC motors for a self-balancing robot, emphasizing the importance of modeling in motor control. It details two modeling approaches: white-box (physics-based) and black-box (data-driven), and explains the process of tuning a PID controller to achieve stable motor speed control. The project highlights the integration of theory and experimentation to enhance the robot's performance and balance.

Uploaded by

med akachar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Project Update System Identification & PID Tuning

This document discusses the system identification and PID tuning of DC motors for a self-balancing robot, emphasizing the importance of modeling in motor control. It details two modeling approaches: white-box (physics-based) and black-box (data-driven), and explains the process of tuning a PID controller to achieve stable motor speed control. The project highlights the integration of theory and experimentation to enhance the robot's performance and balance.

Uploaded by

med akachar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

System Identification

& PID Tuning of dc motor

Realised by :
-Rachdi Issam
-Akachar Mohammed
Table of Contents
Introduction .

Overview of the DC Motor .

Importance of Modeling in Motor Control .

White-Box Modeling (Physics-Based Approach) .


Electrical and Mechanical Equations .
Transfer Function Model .
Black-Box Modeling (Data-Driven Identification) .
Data Collection and Preprocessing

System Identification Using MATLAB Toolbox


Comparison Between White-Box and Black-Box
Modeling .

PID Tuning

Conclusion
Introduction :
DC motors are widely used in robotics due to their reliability, ease of
control, and fast response. To control these motors accurately, it is
important to understand and model their dynamic behavior.
In this project, we focus on identifying the mathematical model of two DC
motors used in a self-balancing robot. By modeling the motors, we are
able to design and tune PID controllers to maintain the robot's balance.

Two different modeling


r methods are used:

White-box modeling, based on physical equations of the motor

Black-box modeling, using experimental data and MATLAB's


System Identification Toolbox

There is no information
input about the system; only the
input is converted to the output
output.

This project combines theory and experimentation to


create a stable and responsive control system for real-time
balancing.
Overview of the DC Motor .
DC motor:
A Direct Current (DC) motor is an
electrical device that transforms
electrical energy into mechanical
energy through the generation of a
magnetic field, powered by direct
current. When you energize a DC
motor, it creates a magnetic field
within its stator. This field interacts
with magnets situated on the rotor,
prompting it to spin. To maintain the
rotor's continuous rotation, the
commutator delivers current to the
motor’s windings via brushes linked
to the power source.

gearbox
A gearbox is a mechanical system
used to transmit power from the DC
motor to an output shaft, typically to
reduce speed and increase torque. It
consists of a set of gears that change
the speed and direction of rotation.
In the case of the gearbox used in
this project, it has a 10:1 reduction
ratio, meaning that for every 10
rotations of the DC motor, the output
shaft completes only 1 rotation. This
setup increases the torque at the
output while reducing the rotational
speed.
Importance of Modeling in
Motor Control .
Modeling is essential in motor control because
it provides a mathematical representation of
the motor's behavior, which is crucial for
designing effective controllers. Accurate models
allow engineers to predict how a motor will
respond to various inputs, optimize control
strategies, and improve system performance.
Without a proper model, controlling the motor
becomes a trial-and-error process, potentially
leading to instability, inefficiency, and poor
performance.
By creating reliable models, whether through
white-box (physical equations) or black-box
(data-driven) methods, it's possible to fine-tune
controllers, such as PID, for precise control,
ensuring stability, responsiveness, and
efficiency in motor-driven systems, such as
robots, industrial machinery, and automotive
applications.
White-Box Modeling
White-box modeling of a system involves deriving a mathematical
model using first principles—i.e., physics-based laws and known
parameters. For a Permanent Magnet DC (PMDC) Motor, we can
derive its transfer function and state-space model from the
electrical and mechanical dynamics. .

1. System Overview:

This motor system includes:


Electrical subsystem: an LR circuit with back electromotive
force (emf).
Mechanical subsystem: a rotating mass with inertia and
friction.

2. Electrical Model (Armature Circuit)

Using Kirchhoff’s Voltage Law (KVL):

v(t): applied armature voltage


i(t): armature current
L: armature inductance
R: armature resistance
vb(t): back emf
And since back emf is proportional to angular velocity:

And since back emf is proportional to angular velocity:

3. Mechanical Model:
Using Newton's Second Law for rotation:

τ(t): torque generated by the motor.


J: moment of inertia.
B: damping/friction coefficient.
θ(t): rotor angle.

And torque is proportional to current:


3. Mechanical Model:

Transfer Function
Laplace transform (eq. 1), (eq. 2), (eq. 3), (eq. 4):

Solve for output/input:

Block Diagram
Black-Box Modeling
Data Collection and Preprocessing

In our system, the input is the PWM


signal, and the output is the RPM of
the motor. The process involves the
Arduino randomly selecting a
number within the range of -255 to
255 for the PWM signal, which is then
applied to the motor. The Arduino
uses two-channel encoders to
measure the RPM and applies a filter
to remove high-frequency noise.
The Arduino sends the following data
over serial during the experiment:
Time of the record
PWM value (input)
RPM value (output)
This data collection process occurs
for 10 seconds, with the PWM being
chosen randomly 10 times during
each iteration.
In MATLAB, there is a script called
collect_data_from_arduino that
captures this streamed data and
saves it into a CSV file. The CSV file
contains three columns: Time, PWM
(input), and RPM (output).
System Identification Using MATLAB Toolbox

In this step, we use MATLAB's System Identification


Toolbox to create a transfer function model of the DC
motor. The collected data, consisting of PWM input and
RPM output, is first processed by interpolating the data to
a uniform time vector. We then create an iddata object to
represent the system’s input-output relationship and fit a
continuous-time transfer function model using the tfest
function. The identified model is validated by comparing
the simulated output with the actual data. Finally, the
transfer function model is saved for future use in control
design.

The Response of the System to a Single PWM Pulse (PWM = 180)


The Response of the System to a 10 PWM Pulse

cost function
PID Tuning :
PID Tuning
After identifying the transfer function of the DC
motor, we proceed with tuning a PID controller to
achieve stable and accurate motor speed control. The
goal is to minimize the error between the desired and
actual RPM. The tuning process involves adjusting the
proportional (P), integral (I), and derivative (D) gains to
ensure a fast response, minimal overshoot, and
reduced steady-state error. The tuned PID controller is
then tested on the system to evaluate its performance
and stability.

PID parameters
Conclusion :

This project demonstrated the importance of system


identification and PID control in achieving stable
performance for a self-balancing robot using two DC
motors. By modeling the motor using both white-box
and black-box approaches, we were able to
understand the system dynamics and develop an
accurate transfer function. The identified model
allowed us to design and tune a PID controller that
effectively regulates motor speed. This approach
enhances the robot's ability to maintain balance and
respond accurately to control inputs, highlighting the
value of combining theory with practical
experimentation in control systems engineering.

You might also like