Professional Documents
Culture Documents
19mv32-Report With External Signature
19mv32-Report With External Signature
PRITHIV L
(19MV32)
MASTER OF ENGINEERING
June 2021
PRITHIV L
(19MV32)
MASTER OF ENGINEERING
of Anna University
June 2021
------------------ -------------
Mr.K.R.RADHAKRISHNAN Dr. V. KRISHNAVENI
Faculty Guide Head of the Department
Certified that the candidate was examined in the viva-voice examination held on……21.06.2021….
……………………. ..……………………
(Internal Examiner) (External Examiner)
ACKNOWLEDGEMENT
ACKNOWLEDGEMENT
I would like to extend my sincere thanks to Dr.K.PRAKASAN, Principal In-Charge, PSG
College of Technology, for his kind patronage.
I extend my thanks to all the teaching and non-teaching staff members of Department
of Electronics and Communication Engineering and my student colleagues for their continuous
support at every stage for the completion of this project.
Last but not the least I thank the Almighty and my family members who have been a
great moral support to me.
i
Synopsis
SYNOPSIS
PID (Proportional Integral Derivative) in arial drone control used to read the real-
time values of gyro sensor the rotational speed of the motor is varied to retain the altitude
and angular displacement based on the control inputs. It basically reduces the error rate
of the closed loop system. The PID has three variables that can be tuned. P is Proportional
which reduces the present error rate, I is Integral reduces past error rate and D is derivative
predicts the future errors and reduces it.
In current scenario Based on the occurrence of errors in the operational
environment of the drone the PID should be tuned manually which takes time to implement
it. To make the PID auto tunable based on the operational environment the PID is designed
with inbuilt adaptive control unit for controlling the variables of the PID. And there are
adaptive filters used for same purpose. But the step response of the filter is too low. To
implement this design MATLAB Simulink is used to design and compare its response to
other available models. C code is generated from the MATLAB Simulink and it was used
in the Vits HLS to generate RTL Code. Furthermore, Vivado HLx is used to find the power
consumption, critical operating frequency and total number of resources used when
implemented in the FPGA.
The observation from the analysis is that the proposed PID provided better step
response and lower peak over shoot than the adaptive filters and existing PID controllers
respectively. The Proposed PID provides sensitivity up to 38.1 V/ms whereas the existing
PID and adaptive filter provides up to 9.6 V/ms and 6.4 V/ms respectively for reference
voltage of 24V. the proposed system consumes 143 mW and the power consumption of
the adaptive filter and existing PID is 164mW and 165mW respectively. The operating
frequency of proposed system is 28.571 MHz, 41.667 for adaptive filter and 28.571 MHz
for existing PID. From this comparison of results, it is concluded that the proposed system
has higher sensitivity with 13% lower power consumption.
ii
Contents
CONTENTS
Acknowledgement ……………………………………………..….…………………...(i)
Synopsis………………….………………………………………………..…………….(ii)
List of Figures ………………………………………………...………………………..(v)
List of Tables ……………………………………………………………………………(vii)
1. INTRODUCTION…………………………………………………………..............1
1.1. PID of quadcopter/drone 1
1.2. Loop time 2
1.3. PID parameters 2
1.3.1. P Gain 2
1.3.2. I Gain 3
1.3.3. D Gain 3
1.4. Tuning effect of each parameter in UAV 3
1.4.1. P on Roll, Pitch and Yaw 3
1.4.2. D on Roll and Pitch 3
1.4.3. I on Roll, Pitch and Yaw 3
1.5. Yaw performance other than PID parameters 4
2. LITERATURE SURVEY…………………..………………………………………..5
3. DESIGN OF DRONE FLIGHT CONTROLLER………………………………….10
3.1. PID 10
3.1.1. Advantages 11
3.1.2. Disadvantages 11
3.2. Adaptive Filter 11
3.2.1. Advantages 12
3.2.2. Disadvantages 12
3.3. Proposed Design 12
4. IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE.……...14
4.1. Simulation Results 14
4.1.1. Adaptive filter 14
4.1.2. PID 15
Contents
BIBLIOGRAPHY ..…………………………………………………………….………… 35
List of Figures
LIST OF FIGURES
v
List of Figures
vi
List of Figures
vii
List of Figures
LIST OF TABLES
vii
INTRODUCTION Chapter 1
CHAPTER 1
INTRODUCTION
PID (Proportional Integral Derivative) in arial drone control used to read the real-time
values of gyro sensor the rotational speed of the motor is varied to retain the altitude and
angular displacement based on the control inputs. It basically reduces the error rate of the
closed loop system. The PID has three variables that can be tuned. P is Proportional which
reduces the present error rate, I is Integral reduces past error rate and D is derivative predicts
the future errors and reduces it. Based on the occurrence of errors in the operational
environment of the drone the PID should be tuned manually which takes time to implement it.
1
INTRODUCTION Chapter 1
2
INTRODUCTION Chapter 1
• If the P gain is too low then the UAV becomes sloppy and does not respond
quick enough.
1.3.2 I gain
• This is determined for the drone to hot the altitude against the external forces
such as wind and off centred motors.
• This can be concluded as the stiffness of the UAV.
• I gain improves throttle dips.
1.3.3 D gain
• Used as a damper and reduces the over correction and overshoot.
• Counteracts P gain and counteracts the oscillations provided by P gain.
1.4 TUNING EFFECT OF EACH PARAMETERS IN UAV
Tuning of the drone’s PID cannot be done randomly. Because each of the parameters
of the PID effect different response provided by the drone. The response of the drone is based
on the three variables controlled by parameters of PID. They are P, I and D gain. There is an
order to tune the response variables of a PID. Initially roll then pitch and finally Yaw. This
tuning of a quadcopter may take few minutes or hours or days to get it perfectly.
1.4.1 P on Roll, pitch and Yaw
• If P is low the drone starts to wobble. And when high there will be fast
oscillations.
• Too high of P gain can result in high vibration in the frame.
• Yaw is the response time for a drone to stop. Yaw P gain won’t provide much
vibration as on roll P gain and pitch P gain.
1.4.2 D on Roll and Pitch
• Rising of D gain helps in reduction of oscillation while descending of the drone.
• Excessive D gain provides oscillations to the drone in the opposite direction
and makes the motors to get hotter.
1.4.3 I on Roll, pitch and Yaw
• If there is a noise while maintaining the altitude then increase I on pitch gain.
and this also helps at keeping the same angle when moved front or back.
• If the drone does not hold the angle during the left or right movement then
change I on Roll gain. The I gain should be high enough, if excessively done
then the it may result in stiff and there may even provide oscillations.
3
INTRODUCTION Chapter 1
4
LITERATURE SURVEY CHAPTER 2
CHAPTER 2
LITERATURE SURVEY
Literature survey consists of various Drone controller architectures to reduce the area,
time and power consumption of the design.
5
LITERATURE SURVEY CHAPTER 2
6
LITERATURE SURVEY CHAPTER 2
auto C code for the DSP processor. The output results are analyzed using Digital Storage
Oscilloscope (DSO) in terms of filtered signal. The results have also been compared with the
LMS algorithm to prove the superiority of NLMS algorithm.
7
LITERATURE SURVEY CHAPTER 2
to know the dynamic behaviour of the process which can be established by a representative
mathematical model.
Table 2.1 Parameters of the Parrot
Parameter Meaning
Mass (including the support)
Distance between rotor and
center of mass
Max angular speed of the rotor –
in runner -14.5 V
Ratio of angular speed propeller
to rotor
Diameter x stroke of propeller
8
LITERATURE SURVEY CHAPTER 2
the desired speech embedded with noise from a variety of noisy backgrounds. The VAD
(Voice Activity Detection) algorithm is an effective speech detecting method that performs to
an average of 80% success rate. However, the VAD does not work well if an unwanted speech
(noise) is incoming at the same time as desired speech. For a real-time environment in an in-
vehicle environment, noise sources are non-stationary because they come from all directions.
The previous works are conventionally implemented by using industrial control software such
as LabVIEW which can verify our design rapidly due to its powerful mathematical libraries and
the capability of real-time simulation.
However, the exact computational efficiency cannot be explored. It is also unable to
evaluate the performance and throughput of the designs. On the other hand, noise reduction
is a very challenging and complex problem due to its highly complexity and heavily
dependence of specific context and applications. Hence, this paper presents a real-time
adaptive Wiener filter for non-Stationary noise cancellation. It can efficiently evaluate the
performance and cost of the individual components of noise reduction
2.5 ANALYSIS AND COMPARISON OF RLS ADAPTIVE FILTER IN
SIGNAL DE-NOISING [6]
In the field of digital signal processing only adaptive filter can deal with some random
signal noise or the time-varying signal. The adaptive filter can track the changes of the signal
and noise so as to realize optimal filtering. This paper introduces the structure and principle
of adaptive filters. Recursive Least Square (RLS) Algorithm, presents the implementation of
simulation in the software simulator of a 32-order adaptive filter which is designed in MATLAB
environment. The emulation result shows that the 32-order adaptive filter can remove the
noise very well.
Traditional filter works well only when the signal and noise overlap in the given
frequency band, once the signal and noise overlap in the whole frequency band, and its
features cannot be predicted, Recursive Least Square (RLS) adaptive algorithm filter has
incomparable superiority of traditional methods. RLS adaptive filter uses the time average and
solves linear adaptive filtering by means of batch method. In this work, we studied RLS
adaptive algorithm filter and found that RLS algorithm converge very fast on the model, solve
the problem of slow delay, big error caused by slow convergence of Least Mean Square
(LMS), and it was widely used in practice.
9
DESIGN OF POLAR ENCODER/DECODER CHAPTER 3
CHAPTER 3
10
DESIGN OF POLAR ENCODER/DECODER CHAPTER 3
Fig 3.2 – Table For Response Variation Based On The Parameter Increase.
3.1.1 Advantages
• Easy to stabilize
• Faster response than just P controller.
• No steady state errors.
3.1.2 Disadvantages
• Can amplify high frequency noises.
• Narrower range stability.
3.2 ADAPTIVE FILTER
The schematic of Adaptive filter is shown in fig 5. It is a filter that can automatically
adjust the its coefficients based on the environmental changes. But the only problem in the
adaptive filter’s usage in a drone is that its rise and settling time are lower when compared to
PID controller.
𝑟
𝑋[𝑛] = [𝑥[𝑛], 𝑥[𝑛 − 1, … , 𝑥[𝑛 + 1]] ……(3)
11
DESIGN OF POLAR ENCODER/DECODER CHAPTER 3
X[n] in eq (3) is the input reference signal. And w[n] and d[n] in eq (4) are filter
coefficient and noisy signal. Α and µ in eq (5) are error coefficients parameters which varies
from 0 to 1.
3.2.1 Advantages
• Many well documented implementations (LMS, RLS, Kalman filters)
• Are optimal in that they minimize the mean squared estimation error
• Often can be computed in real-time
3.2.2 Disadvantages
• Provide point estimates
• Mean-squared error isn’t always relevant
To improve the problems that is discussed in the above system the follow design is
proposed.
3.3 PROPOSED DESIGN
In this fig 6 shows the proposed schematic of the PID controller. To reduce the peak
overshoot and improve or speedup the response time of the controller system, both PID and
adaptive filter is introduced in a single system. In the proposed system the PID is provides the
response for the reference provided by the user. The adaptive controller takeover when there
is a change in the control environment unless the PID is tuned again by the tuning module
provided inside the PID. Once the PID is tuned the control is reverted back to the PID
controller.
12
DESIGN OF POLAR ENCODER/DECODER CHAPTER 3
The above eq (6) shows the integrated equation of both PID and adaptive filter. This
equation shows the complexity of the design is higher than the existing systems.
The above discussed system are designed using Simulink which is used do generate
the c/c++ code. Which are ran in Vits HLS to generate the RTL design. And then the RTL
design is implemented using Vivado HLx for the analysis of power consumption, Resource
utilization and critical path frequency.
13
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
CHAPTER 4
IMPLEMENTATION OF DRONE CONTROLLER
ARCHITECHTURE
The controller structures discussed in the previous chapter are implemented using
Verilog language in Vivado platform and the procedure of implementation are explained in
detail in this chapter.
The following fig 4.1 shows the simulation output waveform of Adaptive filter. From the
waveform it can be analyzed and resulted as the adaptive provides a smooth transition for the
provided reference and also it also takes time to get settled to its optimal point.
14
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
The Fig 4.2 shows the response of an Adaptive filter for a variable reference. From
this it is proven that even before the response wave gets settle the reference value is changed.
So, this design has steady rise time with smooth transition rate. But slow settling time.
4.1.2 PID
The fig 4.3 shows the step response of PID simulated in the Simulink software. From
the waveform it can me concluded that the PID have a very good rise time and its settling time
is faster than the adaptive filters. But there is a glitch at the rising edge of the wave. This make
the drone moves will be wavey.
15
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
The fig 4.4 shows the response of a PID for a varying reference. It is concluded that
PID has good rise time and better settling time than adaptive filter but due to the glitch at the
rising edge of the wave. This unwanted glitch does not allow the PID response to settle for
short time responses.
The fig 4.5 shows the step response of the Proposed PID where the waveform looks
almost ideal to the reference given to the design and settling time is also faster than the
adaptive filter and existing PID.
16
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
The below show fig 4.6 show the response of the proposed PID for a varying reference
voltage.
17
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
The adaptive filter design has been designed using Simulink which is used do generate
the c/c++ code. Which are ran in Vits HLS to generate the RTL design. And then the RTL
design is implemented using Vivado HLx. It consumes 164 mW with utilization of 499 LUTs,
90 and 18 DSPs. Its operating frequency is 41.667MHz. In fig 4.7 shows the synthesised
design of adaptive filter.
4.2.2 PID
The PID controller design has been designed using Simulink which is used do
generate the c/c++ code. Which are ran in Vits HLS to generate the RTL design. And then the
RTL design is implemented using Vivado HLx. It consumes 165 mW with utilization of 1013
LUTs, 128 and 27 DSPs. Its operating frequency is 28.571 MHz. In fig 4.8 shows the
synthesised design of adaptive filter.
18
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
The proposed PID controller design has been designed using Structural RTL language
in Vivado HLx platform. Its blocks were designed using above discussed design codes as
reference and has sub blocks like 64-bit floating-point adder, subtractor and multiplier. It
consumes 143 mW with utilization of 1526 LUTs, 64 and 27 DSPs. Its operating frequency is
28.571 MHz. In fig 4.9 shows the synthesised design of adaptive filter.
19
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
The fig 4.10 shows the clock summary of the adaptive filter. It was derivative from
implementation of constraint file added to the vivado design project.
The fig 4.11 shows the power summary of the adaptive filter after finalizing the
operational frequency of design using the STA analysis. That is after getting the near zero
positive slack.
The Fig 4.12 shows the design runs of the adaptive filter which has the information of
number of LUTs, FFs and DSP block are used to implement the design.
4.3.2 PID
The fig 4.13 shows the clock summary of the PID. It was derivative from
implementation of constraint file added to the vivado design project.
20
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
The fig 4.14 shows the power summary of the PID after finalizing the operational
frequency of design using the STA analysis. That is after getting the near zero positive slack.
The Fig 4.15 shows the design runs of the PID which has the information of number
of LUTs, FFs and DSP block are used to implement the design.
The fig 4.16 shows the clock summary of the Proposed PID. It was derivative from
implementation of constraint file added to the vivado design project.
21
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
The fig 4.17 shows the power summary of the Proposed PID after finalizing the
operational frequency of design using the STA analysis. That is after getting the near zero
positive slack.
The Fig 4.18 shows the design runs of the Proposed PID which has the information of
number of LUTs, FFs and DSP block are used to implement the design.
22
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
• Open MATLAB and type “Simulink” in the command window or click on the
Simulink icon on the task bar. The Fig 4.19 shows the Simulink Window after
doing the above process.
• To get the component to be connected for the design open the library. And the
Library used for our implementation is HLD Coder. The Fig 4.20 shows the
screenshot of Simulink Library.
23
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
• Place all the components by selecting and right clicking the needed component
and select place in the project
• Connect the components in the required design and provide the parameter for
the project components.
• Then Click on Run to get the waveform or the response of the design in the
scope.
• Open Simulink coder app and configure as shown in the fig 4.21
• Then click on OK to generate the C code. The summary report will be opened
in a new window as shown in the Fig 4.22.
24
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
• Open HLS and create project and add all the C code files generated by
Simulink Code generator.
• Run the following command in the command prompt of the Vits HLS as shown
in Fig 4.22 to generate the RTL file.
25
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
26
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
• Now click on the + on the top of the sources window which is highlighted in the
above figure
• Select the add or create design source and click next
• Click on create file to create the .v file to write the program
• Give the name for the .v file
27
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
28
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
• The .v file will be added in the design source and double click on the name to open
the coding window
29
IMPLEMENTATION OF DRONE CONTROLLER ARCHITECHTURE CHAPTER 4
• Now next step is run synthesis to get the number of FF, LUTs and other utilities
• Then run the implementation to get the power and timing analysis
• Click on the open implementation to see the results
30
RESULTS AND ANALYSIS CHAPTER 5
CHAPTER 5
Implementation results of each Drone flight controller structure are given and compared
with each other in this chapter. All the implementation are done in Xilinx vivado software on
Artix 7 board as the base platform
31
RESULTS AND ANALYSIS CHAPTER 5
Sensitivity (mV/s)
50
40
30
20
10
0
PID NLMS Proposed
Sensitivity (mV/s) 9.6 6.4 38.1
Resource Utilization
1500
150
15
LUTs FFs DSPs
32
RESULTS AND ANALYSIS CHAPTER 5
5.2.3 Frequency
Even though proposed design is larger and consumes higher resource than the other
the frequency of operation remains the same as the existing PID filter. This is because the
proposed design has a PID block. So the critical path remains the same in both systems. Fig
5.3 represents the critical path frequency for different designs.
FREQUENCY (MHZ)
41.667
28.571
28.571
ADAPTIVE PID PROPOSED
FILTER DESIGN
Power (W)
0.164 0.165
0.143
33
CONCLUSION Chapter 6
CHAPTER 6
CONCLUSION
To deal with the peak overshoot in PID and low response time in adaptive contollers
this designed system is proposed. In comparison of the proposed system with the PID and
LLMS adaptive system, the proposed system has better response time and good settling time
than the other designs compared. Even though the proposed system has higher resource
utilization than the other systems, the power consumption is 13% lower than the other designs
and operating frequency remains same as the existing PID filter. From this comparison it can
be concluded that the proposed system has better performance than the existing designed
systems. And so it can be concluded that the system is better replacement of the existing
controller designs.
The observation from the analysis is that the proposed PID provided better step
response and lower peak over shoot than the adaptive filters and existing PID controllers
respectively. The Proposed PID provides sensitivity up to 38.1 V/ms whereas the existing PID
and adaptive filter provides up to 9.6 V/ms and 6.4 V/ms respectively for reference voltage of
24V. the proposed system consumes 143 mW and the power consumption of the adaptive
filter and existing PID is 164mW and 165mW respectively. The operating frequency of
proposed system is 28.571 MHz, 41.667 for adaptive filter and 28.571 MHz for existing PID.
From this comparison of results, it is concluded that the proposed system has higher
sensitivity with 13% lower power consumption.
34
BIBLIOGRAPHY
BIBLIOGRAPHY
1. Ashis C K, Rahul Sharma K “Dynamic Modelling and Altitude Control of Parrot Rolling
Spider using LQR”, 2019 2nd International Conference on Intelligent Computing,
Instrumentation and Control Technologies (ICICICT).
2. Seema Chaudhary and Awadhesh Kumar “Control of Twin Rotor MIMO System Using
1- Degree-of-Freedom (DOF) PID, 2-Degree-of-Freedom (2DOF) PID and Fractional
order PID Controller (FOPID)”, Proceedings of the Third International Conference on
Electronics Communication and Aerospace Technology [ICECA 2019] IEEE
Conference Record # 45616; IEEE Xplore ISBN: 978-1-7281-0167-5
35
BIBLIOGRAPHY
12. Douglas, S.C., “Fast exact filtered-X LMS and LMS algorithms for multichannel active
noise control, “Proceedings of IEEE International Conference on Acoustics, Speech,
and Signal Processing, 1997. ICASSP-97., Vol. 1, pp. 399-402, 1997.
13. Jing Dai; Yanmei Wang, “NLMS Adaptive Algorithm Implement Based on FPGA,”
Proceedings of the 3rd International Conference on Intelligent Networks and Intelligent
Systems (ICINIS), pp. 422- 425, 2010.
36
PUBLICATION
PUBLICATION
1. Prithiv L, Radhakrishnan K R, “Design of Adaptive PID controller for quadcopter UAV”, One
day Online Workshop on Micro Nano Electronics and Communication Systems
(MECS’21),PSG College of Technology,Coimbatore.
37
Department of Electronics & Communication Engineering
PSG College of Technology, Coimbatore – 641004