SlideShare a Scribd company logo
1 of 13
Download to read offline
Vijay Kumar
Professor
Mechanical Engineering
Chitkara University
Controller Design
V. K. Jadon, Prof., Mechanical Engineering, Chitkara University
Simulation
ControllerDesign – 2D
2D Model
The
Flow
…. ControllerDesign – 1D
1D Model
1D Model of Quadcopter
π‘š αˆ·π‘§ 𝑑 = 𝑒 𝑑 βˆ’ π‘šπ‘”
π‘₯1 = 𝑧(𝑑)
π‘₯2 = αˆΆπ‘§ t
changing variables into state variables:
𝑒 𝑑 = 𝑒1
= ሢπ‘₯1
In state-space modelling, we want to see the dynamics
of the each states.
ሢπ‘₯1 = π‘₯2 ሢπ‘₯2 =
1
π‘š
𝑒1 βˆ’ 𝑔
Two initialconditionsare required to solve these first
order differential equationson the state; π‘₯1(0) and π‘₯2(0).
π‘₯1 0 = 𝑧 0 = 0 π‘₯2 0 = αˆΆπ‘§ 0 = 0
π‘šπ‘”
𝑏2
𝑏3
π‘Ž2
π‘Ž3
𝑒1
𝑧 = 𝑧 𝑑𝑒𝑠
scipy.integrate.odeint(func, y0, t, args=(), tfirst=False)
Function model
V K Jadon, Prof., Mechanical Engineering, Chitkara University
def model(z,t,u):
x1=z[0] # Intial Conditionfor First
FODE
x2=z[1] # Initial conditionfor
Second FODE
dx1dt=x2 # First FODE
dx2dt=(u-c*x2-k*x1)/mass-gravity # Second FODE
dxdt = [dx1dt,dx2dt]
return dxdt
time=np.linspace(0,1,10)
sol = odeint(model, [displacement,velocity], time)
#Initial Conditions
displacement=0, velocity=0
#System Parameters
k=0, c=0, g=9.81, mass=0.18
#System Input
u1=10
π‘˜ = 0, 𝑐 = 0, 𝑔 = 9.81, π‘šπ‘Žπ‘ π‘  = 0.18
𝑑 = 0; 𝑣 = 0; 𝑒1 = 0
𝑑 = 1; 𝑣 = 0;
𝑒1 = 0
𝑑 = 0; 𝑣 = 0;
𝑒1 = 1
π‘˜ = 0, 𝑐 = 0, 𝑔 = 9.81, π‘šπ‘Žπ‘ π‘  = 0.18
π‘˜ = 0, 𝑐 = 0, 𝑔 = 9.81, π‘šπ‘Žπ‘ π‘  = 0.18
π‘˜ = 0, 𝑐 = 0, 𝑔 = 9.81, π‘šπ‘Žπ‘ π‘  = 0.18
𝑑 = 0; 𝑣 = 5;
𝑒1 = 0
1D SODE Response
V K Jadon, Prof., Mechanical Engineering, Chitkara University
def model(z,t,u):
x1=z[0]
x2=z[1]
dx1dt=x2
dx2dt=(u-c*x2-k*x1)/mass-gravity
dxdt = [dx1dt,dx2dt]
return dxdt
Control Equation
π‘šπ‘”
𝑦
𝑧
𝑒1
𝑧′′
𝑑 = βˆ’π‘” +
𝑒1
π‘š
𝑑 (1)
𝑒 = 𝑧 𝑑𝑒𝑠 βˆ’ 𝑧
𝑒′ = 𝑧′ 𝑑𝑒𝑠 βˆ’ 𝑧′
The error term 𝑒 and 𝑒′ will decay exponentiallyto zero if error
function satisfies the following second order differential equation:
𝑒′′ + π‘˜ 𝑑 𝑒′ + π‘˜ 𝑝 𝑒 = 0
(𝑧 𝑑𝑒𝑠
β€²β€²
βˆ’π‘§β€²β€²
) + π‘˜ 𝑑 𝑒′
+ π‘˜ 𝑝 𝑒 = 0
Substitutingfrom Eqn (1)
𝑧 𝑑𝑒𝑠
β€²β€²
+ 𝑔 βˆ’
𝑒1 𝑑
π‘š
+ π‘˜ 𝑑 𝑒′ + π‘˜ 𝑝 𝑒 = 0
𝑒1 𝑑 = π‘š(𝑧 𝑑𝑒𝑠
β€²β€²
+ 𝑔 + π‘˜ 𝑑 𝑒′ + π‘˜ 𝑝 𝑒)
The above equationis the controller equation.
𝑒, 𝑒′ 𝑒1
PD Controller
The input to the
controller is the current
and desired positions.
The output is the
control signal.
V K Jadon, Prof., Mechanical Engineering, Chitkara University
V K Jadon, Prof., Mechanical Engineering, Chitkara University
Interactive Mode Plotting
Interactivemode updates a plot each time a new command is issued.
Turn on interactivemode with method: plt.ion()
Turn off interactivemode with method: plt.ioff()
When interactivemode is not on, you enter all pyplot commands and then use the
method plt.show() to see the figure.
plt.clf() clears the entire current figure with all its axes, but leaves the window
opened, such that it may be reused for other plots.
plt.close() closes a window, which will be the current window, if not specified
otherwise.
π‘šπ‘”
𝑏2
𝑏3
π‘Ž2
π‘Ž3
βˆ…
𝑒1 π‘π‘œπ‘ βˆ…
𝑒1 π‘ π‘–π‘›βˆ…
𝑒1
𝑒2
π‘š αˆ·π‘¦ = βˆ’π‘ π‘–π‘›βˆ…π‘’1
π‘š αˆ·π‘§ = π‘π‘œπ‘ βˆ…π‘’1 βˆ’ π‘šπ‘”
𝐼 π‘₯π‘₯
αˆ·βˆ… = 𝑒2
αˆ·π‘¦
αˆ·π‘§
αˆ·βˆ…
=
0
βˆ’π‘”
0
+
βˆ’
1
π‘š
π‘ π‘–π‘›βˆ… 0
1
π‘š
π‘π‘œπ‘ βˆ… 0
0
1
𝐼 π‘₯π‘₯
𝑒1
𝑒2
For every equation,we will have two states
π‘₯1 = 𝑦; π‘₯2 = 𝑧; π‘₯3 = βˆ…; π‘₯4 = αˆΆπ‘¦; π‘₯5 = αˆΆπ‘§; π‘₯6 = αˆΆβˆ…;
First order Differential Equationsare
ሢπ‘₯1 = αˆΆπ‘¦ = π‘₯4 ሢπ‘₯2 = αˆΆπ‘§ = π‘₯5 ሢπ‘₯3 = αˆΆβˆ… = π‘₯6
ሢπ‘₯4 = αˆ·π‘¦ = βˆ’
1
π‘š
π‘ π‘–π‘›βˆ…π‘’1 ሢπ‘₯5 = αˆ·π‘§ =
1
π‘š
π‘π‘œπ‘ βˆ…π‘’1 βˆ’ g ሢπ‘₯6 = αˆ·βˆ… =
𝑒2
𝐼 π‘₯π‘₯
2D Planar Model
ሢπ‘₯1 = αˆΆπ‘¦ + 0𝑒1 + 0𝑒2
ሢπ‘₯2 = αˆΆπ‘§ + 0𝑒1 + 0𝑒2
ሢπ‘₯3 = αˆΆβˆ… + 0𝑒1 + 0𝑒2
ሢπ‘₯4 = 0 βˆ’
1
π‘š
π‘ π‘–π‘›βˆ…π‘’1 + 0𝑒2
ሢπ‘₯5 = βˆ’π‘” +
1
π‘š
π‘π‘œπ‘ βˆ…π‘’1 + 0𝑒2
ሢπ‘₯6 = 0 +
1
𝐼 π‘₯π‘₯
𝑒1 + 0𝑒2
V K Jadon, Prof., Mechanical Engineering, Chitkara University
Expanded general form
ሢπ‘₯1
ሢπ‘₯2
ሢπ‘₯3
ሢπ‘₯4
ሢπ‘₯5
ሢπ‘₯6
=
π‘₯4
π‘₯5
π‘₯6
0
βˆ’g
0
+
0 0
0 0
0 0
βˆ’
1
π‘š
π‘ π‘–π‘›βˆ… 0
1
π‘š
π‘π‘œπ‘ βˆ… 0
0
1
𝐼 π‘₯π‘₯
+
𝑒1
𝑒2
π‘š αˆ·π‘¦ = βˆ’βˆ…π‘’1
π‘š αˆ·π‘§ = 𝑒1 βˆ’ π‘šπ‘”
𝐼 π‘₯π‘₯
αˆ·βˆ… = 𝑒2
2D Planar Model
Linearization
ሢπ‘₯1
ሢπ‘₯2
ሢπ‘₯3
ሢπ‘₯4
ሢπ‘₯5
ሢπ‘₯6
=
π‘₯4
π‘₯5
π‘₯6
0
βˆ’g
0
+
0 0
0 0
0 0
βˆ’
1
π‘š
βˆ… 0
1
π‘š
0
0
1
𝐼 π‘₯π‘₯
+
𝑒1
𝑒2
The model and controller is designed for hover configuration
as it is more close to linear situation
𝑦 𝑑𝑒𝑠 = 𝑦0;
𝑒1 = π‘šπ‘”; 𝑒2 = 0;
𝑧 𝑑𝑒𝑠 = 𝑧0; βˆ… 𝑑𝑒𝑠 = 0
αˆ·π‘¦ = βˆ’π‘”βˆ…
(1)
αˆ·π‘§ = βˆ’π‘” +
𝑒1
π‘š
(2)
αˆ·βˆ… =
𝑒2
𝐼 π‘₯π‘₯
(3)
Linearizationof the model for the hover becomes
V K Jadon, Prof., Mechanical Engineering, Chitkara University
βˆ… β‰ˆ 0
Linearized planer model is given by
𝑦′′
= βˆ’π‘”βˆ…
..(1)
To solve these, transform into first order differential
equationsby defining the state variablesas below
π‘₯1 = 𝑦(𝑑) π‘₯2 = 𝑧(𝑑) π‘₯3 = βˆ…(𝑑)
π‘₯β€²1 = 𝑦′ 𝑑 = π‘₯4 … (4)
π‘₯β€²2 = 𝑧′ 𝑑 = π‘₯5 … (5)
π‘₯β€²3 = βˆ…β€² 𝑑 = π‘₯6 … (6)
SubstitutingEqn (4) into Eqn (1)
π‘₯β€²4 = βˆ’π‘”βˆ… …(7)
SubstitutingEqn (5) into Eqn (2)
π‘₯β€²5 = βˆ’π‘” +
𝑒1
π‘š
… (8)
SubstitutingEqn (6) into Eqn (3)
π‘₯β€²6 =
𝑒2
𝐼 π‘₯π‘₯
… (9)
The solutionof FODE (4) to (9) gives six states variables.
π‘₯1, π‘₯2, π‘₯3, π‘₯4, π‘₯5, π‘₯6
These are positions(𝑦, 𝑧, βˆ…) and their time
derivatives(𝑦′, 𝑧′, αˆΆβˆ…β€² )
Position and Time Derivatives
𝑧′′
= βˆ’π‘” +
𝑒1
π‘š
… (2)
βˆ…β€²β€²
=
𝑒2
𝐼 π‘₯π‘₯
… (3)
V K Jadon, Prof., Mechanical Engineering, Chitkara University
changing dots (.) with
dashes (β€˜) for convenience
We need 𝑒1 and 𝑒2 to solve these set of FODE
𝑒1 and 𝑒2 are output of control equation.
We need to design controllerfor getting
appropriatevaluesof 𝑒1 and 𝑒2
𝑒1, 𝑒2 𝑦, 𝑧, βˆ…
The error (desired value-currentvalue) in roll angle and position
will reach to zero only if the error function satisfies the second
order differential equation.
𝑒′′ + π‘˜ 𝑑 𝑒′ + π‘˜ 𝑝 𝑒 = 0
𝑦 𝑑𝑒𝑠
β€²β€²
βˆ’ 𝑦′′
+ π‘˜ 𝑑𝑦 𝑒 𝑦
β€²
+ π‘˜ 𝑝𝑦 𝑒 𝑦 = 0
Controller
𝑧 𝑑𝑒𝑠
β€²β€²
βˆ’ 𝑧′′
+ π‘˜ 𝑑𝑧 𝑒 𝑧
β€²
+ π‘˜ 𝑝𝑧 𝑒 𝑧 = 0
βˆ… 𝑐
β€²β€² βˆ’ βˆ…β€²β€² + π‘˜ π‘‘βˆ… π‘’βˆ…
β€²
+ π‘˜ π‘βˆ… π‘’βˆ… = 0
𝑦 βˆ’Transllation
Controller
π‘œπ‘’π‘‘π‘π‘’π‘‘π‘¦, 𝑦 𝑑𝑒𝑠
Thrust
Controller
𝑧, 𝑧 𝑑𝑒𝑠
Roll Controller
βˆ…, βˆ… 𝑐
π‘œπ‘’π‘‘π‘π‘’π‘‘
π‘œπ‘’π‘‘π‘π‘’π‘‘
V K Jadon, Prof., Mechanical Engineering, Chitkara University
𝑦 βˆ’Transllation
Controller
βˆ… 𝑐𝑦, 𝑦 𝑑𝑒𝑠
Thrust
Controller
𝑒1𝑧, 𝑧 𝑑𝑒𝑠
Roll Controller
𝑒2βˆ…, βˆ… 𝑐
The linearized planer model
𝑦′′ = βˆ’π‘”βˆ…
..(1)
𝑧′′ = βˆ’π‘” +
𝑒1
π‘š
… (2)
βˆ…β€²β€² =
𝑒2
𝐼 π‘₯π‘₯
… (3)
𝑦 𝑑𝑒𝑠
β€²β€²
βˆ’ 𝑦′′
+ π‘˜ 𝑑𝑦 𝑒 𝑦
β€²
+ π‘˜ 𝑝𝑦 𝑒 𝑦 = 0
Substitutingfrom Eqn (1)
𝑦 𝑑𝑒𝑠
β€²β€²
+ π‘”βˆ… 𝑐 + π‘˜ 𝑑𝑦 𝑒 𝑦
β€²
+ π‘˜ 𝑝𝑦 𝑒 𝑦 = 0
βˆ… 𝑐 = βˆ’
1
𝑔
(𝑦 𝑑𝑒𝑠
β€²β€²
+ π‘˜ 𝑑𝑦 𝑒 𝑦
β€²
+ π‘˜ 𝑝𝑦 𝑒 𝑦) ..(10)
𝑧 𝑑𝑒𝑠
β€²β€²
βˆ’ 𝑧′′
+ π‘˜ 𝑑𝑧 𝑒 𝑧
β€²
+ π‘˜ 𝑝𝑧 𝑒 𝑧 = 0
Substitutingfrom Eqn (2)
𝑧 𝑑𝑒𝑠
β€²β€²
+ 𝑔 βˆ’
𝑒1
π‘š
+ π‘˜ 𝑑𝑧 𝑒 𝑧
β€² + π‘˜ 𝑝𝑧 𝑒 𝑧
𝑒1 = π‘š(𝑧 𝑑𝑒𝑠
β€²β€²
+ 𝑔 + π‘˜ 𝑑𝑧 𝑒 𝑧
β€²
+ π‘˜ 𝑝𝑧 𝑒 𝑧)…(11)
βˆ… 𝑐
β€²β€² βˆ’ βˆ…β€²β€² + π‘˜ π‘‘βˆ… π‘’βˆ…
β€²
+ π‘˜ π‘βˆ… π‘’βˆ… = 0
Substitutingfrom Eqn (3)
βˆ… 𝑐
β€²β€²
βˆ’
𝑒2
𝐼 π‘₯π‘₯
+ π‘˜ π‘‘βˆ… π‘’βˆ…
β€²
+ π‘˜ π‘βˆ… π‘’βˆ… = 0
𝑒2 = 𝐼 π‘₯π‘₯ βˆ… 𝑐
β€²β€²
+ π‘˜ π‘‘βˆ… π‘’βˆ…
β€²
+ π‘˜ π‘βˆ… π‘’βˆ… … (12)
Control Equations
The SODE for error to satisfy
V K Jadon, Prof., Mechanical Engineering, Chitkara University
𝑒 𝑦
β€²
= (𝑦 𝑑𝑒𝑠
β€²
βˆ’ 𝑦′) 𝑒 𝑦 = (𝑦 𝑑𝑒𝑠 βˆ’ 𝑦)
𝑒 𝑧
β€²
= (𝑧 𝑑𝑒𝑠
β€²
βˆ’ 𝑧′) 𝑒 𝑧 = (𝑧 𝑑𝑒𝑠 βˆ’ 𝑧)
π‘’βˆ…
β€²
= (βˆ… 𝑐
β€²
βˆ’ βˆ…β€²) π‘’βˆ… = (βˆ… 𝑐 βˆ’ βˆ…)
βˆ… 𝑐
β€²
V K Jadon, Prof., Mechanical Engineering, Chitkara University
In this problem we have three degrees of freedom (𝑦, 𝑧, βˆ…) and two control
variables(𝑒1, 𝑒2).
So, we need cascaded control system.
To reach the desired position we have to command a roll angle (βˆ… 𝑐) such
that required translation(𝑦 𝑑𝑒π‘₯, 𝑧 𝑑𝑒𝑠) is achieved.
Position
Controller
βˆ… 𝑐
βˆ…β€² 𝑐
𝑦 𝑑𝑒𝑠, 𝑦′ 𝑑𝑒𝑠
𝑧 𝑑𝑒𝑠, 𝑧′ 𝑑𝑒𝑠
Roll
Controller
𝑒2
𝑒1
𝑦, 𝑧, βˆ…
𝑒1
Current states
𝑦′, 𝑧′, βˆ…β€²
βˆ…, βˆ…β€²
Control Block
Thanks
V K Jadon, Prof., Mechanical Engineering, Chitkara University 13

More Related Content

What's hot

Ecuaciones dispositivos electronicos
Ecuaciones dispositivos electronicosEcuaciones dispositivos electronicos
Ecuaciones dispositivos electronicosfsdewr
Β 
Movimiento rectilΓ­neo uniforme
Movimiento rectilΓ­neo uniformeMovimiento rectilΓ­neo uniforme
Movimiento rectilΓ­neo uniformeFranklin Jesper
Β 
Article 1
Article 1Article 1
Article 1badreisai
Β 
Concurrent force system
Concurrent force systemConcurrent force system
Concurrent force systemVinod Shikhare
Β 
Introduction to Mathematical Probability
Introduction to Mathematical ProbabilityIntroduction to Mathematical Probability
Introduction to Mathematical ProbabilitySolo Hermelin
Β 
Control assignment#4
Control assignment#4Control assignment#4
Control assignment#4cairo university
Β 
12b applications
12b applications12b applications
12b applicationslaiba javed
Β 
Lu decomposition
Lu decompositionLu decomposition
Lu decompositiongilandio
Β 
7. pid controller designing for active suspension system of bike
7. pid controller designing for active suspension system of bike7. pid controller designing for active suspension system of bike
7. pid controller designing for active suspension system of bikeMubashar Sharif
Β 
Numerical method-Picards,Taylor and Curve Fitting.
Numerical method-Picards,Taylor and Curve Fitting.Numerical method-Picards,Taylor and Curve Fitting.
Numerical method-Picards,Taylor and Curve Fitting.Keshav Sahu
Β 
Optimal PID Controller Design for Speed Control of a Separately Excited DC Mo...
Optimal PID Controller Design for Speed Control of a Separately Excited DC Mo...Optimal PID Controller Design for Speed Control of a Separately Excited DC Mo...
Optimal PID Controller Design for Speed Control of a Separately Excited DC Mo...ijscmcj
Β 
Mechanics of Quadcopter
Mechanics of QuadcopterMechanics of Quadcopter
Mechanics of QuadcopterVijay Kumar Jadon
Β 
Identification of the Mathematical Models of Complex Relaxation Processes in ...
Identification of the Mathematical Models of Complex Relaxation Processes in ...Identification of the Mathematical Models of Complex Relaxation Processes in ...
Identification of the Mathematical Models of Complex Relaxation Processes in ...Vladimir Bakhrushin
Β 

What's hot (19)

Ecuaciones dispositivos electronicos
Ecuaciones dispositivos electronicosEcuaciones dispositivos electronicos
Ecuaciones dispositivos electronicos
Β 
INTERPOLATION
INTERPOLATIONINTERPOLATION
INTERPOLATION
Β 
Cap 12
Cap 12Cap 12
Cap 12
Β 
Kalman
KalmanKalman
Kalman
Β 
Movimiento rectilΓ­neo uniforme
Movimiento rectilΓ­neo uniformeMovimiento rectilΓ­neo uniforme
Movimiento rectilΓ­neo uniforme
Β 
Article 1
Article 1Article 1
Article 1
Β 
Concurrent force system
Concurrent force systemConcurrent force system
Concurrent force system
Β 
Introduction to Mathematical Probability
Introduction to Mathematical ProbabilityIntroduction to Mathematical Probability
Introduction to Mathematical Probability
Β 
Control assignment#4
Control assignment#4Control assignment#4
Control assignment#4
Β 
Assignment2 control
Assignment2 controlAssignment2 control
Assignment2 control
Β 
12b applications
12b applications12b applications
12b applications
Β 
Lect24 hmm
Lect24 hmmLect24 hmm
Lect24 hmm
Β 
Lu decomposition
Lu decompositionLu decomposition
Lu decomposition
Β 
7. pid controller designing for active suspension system of bike
7. pid controller designing for active suspension system of bike7. pid controller designing for active suspension system of bike
7. pid controller designing for active suspension system of bike
Β 
Numerical method-Picards,Taylor and Curve Fitting.
Numerical method-Picards,Taylor and Curve Fitting.Numerical method-Picards,Taylor and Curve Fitting.
Numerical method-Picards,Taylor and Curve Fitting.
Β 
Optimal PID Controller Design for Speed Control of a Separately Excited DC Mo...
Optimal PID Controller Design for Speed Control of a Separately Excited DC Mo...Optimal PID Controller Design for Speed Control of a Separately Excited DC Mo...
Optimal PID Controller Design for Speed Control of a Separately Excited DC Mo...
Β 
Mechanics of Quadcopter
Mechanics of QuadcopterMechanics of Quadcopter
Mechanics of Quadcopter
Β 
Periodic Solutions for Nonlinear Systems of Integro-Differential Equations of...
Periodic Solutions for Nonlinear Systems of Integro-Differential Equations of...Periodic Solutions for Nonlinear Systems of Integro-Differential Equations of...
Periodic Solutions for Nonlinear Systems of Integro-Differential Equations of...
Β 
Identification of the Mathematical Models of Complex Relaxation Processes in ...
Identification of the Mathematical Models of Complex Relaxation Processes in ...Identification of the Mathematical Models of Complex Relaxation Processes in ...
Identification of the Mathematical Models of Complex Relaxation Processes in ...
Β 

Similar to quadcopter modelling and controller design

Trabajo matemΓ‘ticas 7
Trabajo matemΓ‘ticas 7Trabajo matemΓ‘ticas 7
Trabajo matemΓ‘ticas 7SamanthaAlcivar1
Β 
A05330107
A05330107A05330107
A05330107IOSR-JEN
Β 
assignemts.pdf
assignemts.pdfassignemts.pdf
assignemts.pdframish32
Β 
Btech_II_ engineering mathematics_unit5
Btech_II_ engineering mathematics_unit5Btech_II_ engineering mathematics_unit5
Btech_II_ engineering mathematics_unit5Rai University
Β 
State space design
State space designState space design
State space designAndrew Wilhelm
Β 
Engineering Analysis -Third Class.ppsx
Engineering Analysis -Third Class.ppsxEngineering Analysis -Third Class.ppsx
Engineering Analysis -Third Class.ppsxHebaEng
Β 
B.tech ii unit-5 material vector integration
B.tech ii unit-5 material vector integrationB.tech ii unit-5 material vector integration
B.tech ii unit-5 material vector integrationRai University
Β 
Lecture 11 state observer-2020-typed
Lecture 11 state observer-2020-typedLecture 11 state observer-2020-typed
Lecture 11 state observer-2020-typedcairo university
Β 
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's Classes
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's ClassesIIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's Classes
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's ClassesSOURAV DAS
Β 
Deep learning and neural networks (using simple mathematics)
Deep learning and neural networks (using simple mathematics)Deep learning and neural networks (using simple mathematics)
Deep learning and neural networks (using simple mathematics)Amine Bendahmane
Β 
BSC_COMPUTER _SCIENCE_UNIT-2_DISCRETE MATHEMATICS
BSC_COMPUTER _SCIENCE_UNIT-2_DISCRETE MATHEMATICSBSC_COMPUTER _SCIENCE_UNIT-2_DISCRETE MATHEMATICS
BSC_COMPUTER _SCIENCE_UNIT-2_DISCRETE MATHEMATICSRai University
Β 
lecture 5 courseII (6).pptx
lecture 5 courseII (6).pptxlecture 5 courseII (6).pptx
lecture 5 courseII (6).pptxAYMENGOODKid
Β 
Ejercicios resueltos de analisis matematico 1
Ejercicios resueltos de analisis matematico 1Ejercicios resueltos de analisis matematico 1
Ejercicios resueltos de analisis matematico 1tinardo
Β 
A brief introduction to finite difference method
A brief introduction to finite difference methodA brief introduction to finite difference method
A brief introduction to finite difference methodPrateek Jha
Β 
Dcs lec02 - z-transform
Dcs   lec02 - z-transformDcs   lec02 - z-transform
Dcs lec02 - z-transformAmr E. Mohamed
Β 
Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Rai University
Β 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)IJERD Editor
Β 

Similar to quadcopter modelling and controller design (20)

Trabajo matemΓ‘ticas 7
Trabajo matemΓ‘ticas 7Trabajo matemΓ‘ticas 7
Trabajo matemΓ‘ticas 7
Β 
A05330107
A05330107A05330107
A05330107
Β 
lec33.ppt
lec33.pptlec33.ppt
lec33.ppt
Β 
assignemts.pdf
assignemts.pdfassignemts.pdf
assignemts.pdf
Β 
Btech_II_ engineering mathematics_unit5
Btech_II_ engineering mathematics_unit5Btech_II_ engineering mathematics_unit5
Btech_II_ engineering mathematics_unit5
Β 
doc
docdoc
doc
Β 
State space design
State space designState space design
State space design
Β 
Engineering Analysis -Third Class.ppsx
Engineering Analysis -Third Class.ppsxEngineering Analysis -Third Class.ppsx
Engineering Analysis -Third Class.ppsx
Β 
B.tech ii unit-5 material vector integration
B.tech ii unit-5 material vector integrationB.tech ii unit-5 material vector integration
B.tech ii unit-5 material vector integration
Β 
Lecture 11 state observer-2020-typed
Lecture 11 state observer-2020-typedLecture 11 state observer-2020-typed
Lecture 11 state observer-2020-typed
Β 
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's Classes
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's ClassesIIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's Classes
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's Classes
Β 
Deep learning and neural networks (using simple mathematics)
Deep learning and neural networks (using simple mathematics)Deep learning and neural networks (using simple mathematics)
Deep learning and neural networks (using simple mathematics)
Β 
BSC_COMPUTER _SCIENCE_UNIT-2_DISCRETE MATHEMATICS
BSC_COMPUTER _SCIENCE_UNIT-2_DISCRETE MATHEMATICSBSC_COMPUTER _SCIENCE_UNIT-2_DISCRETE MATHEMATICS
BSC_COMPUTER _SCIENCE_UNIT-2_DISCRETE MATHEMATICS
Β 
lecture 5 courseII (6).pptx
lecture 5 courseII (6).pptxlecture 5 courseII (6).pptx
lecture 5 courseII (6).pptx
Β 
Ejercicios resueltos de analisis matematico 1
Ejercicios resueltos de analisis matematico 1Ejercicios resueltos de analisis matematico 1
Ejercicios resueltos de analisis matematico 1
Β 
A brief introduction to finite difference method
A brief introduction to finite difference methodA brief introduction to finite difference method
A brief introduction to finite difference method
Β 
Dcs lec02 - z-transform
Dcs   lec02 - z-transformDcs   lec02 - z-transform
Dcs lec02 - z-transform
Β 
Servo systems
Servo systemsServo systems
Servo systems
Β 
Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3
Β 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
Β 

More from Vijay Kumar Jadon

Outcome Based Education and Assessment
Outcome Based Education and AssessmentOutcome Based Education and Assessment
Outcome Based Education and AssessmentVijay Kumar Jadon
Β 
Analysis and design eccentric loading
Analysis and design eccentric loadingAnalysis and design eccentric loading
Analysis and design eccentric loadingVijay Kumar Jadon
Β 
Program outcome maping
Program outcome mapingProgram outcome maping
Program outcome mapingVijay Kumar Jadon
Β 
Concept of state of stress and strain
Concept of state of stress and strainConcept of state of stress and strain
Concept of state of stress and strainVijay Kumar Jadon
Β 
Free Body Diagram - FBD
Free Body Diagram - FBDFree Body Diagram - FBD
Free Body Diagram - FBDVijay Kumar Jadon
Β 
tensile test - stress strain curve
tensile test - stress strain curvetensile test - stress strain curve
tensile test - stress strain curveVijay Kumar Jadon
Β 
Design equation for static load
Design equation for static loadDesign equation for static load
Design equation for static loadVijay Kumar Jadon
Β 
Introduction to Aerial Robotics
Introduction to Aerial RoboticsIntroduction to Aerial Robotics
Introduction to Aerial RoboticsVijay Kumar Jadon
Β 
Design equation for static load
Design equation for static loadDesign equation for static load
Design equation for static loadVijay Kumar Jadon
Β 
Machine design philosophy
Machine design philosophyMachine design philosophy
Machine design philosophyVijay Kumar Jadon
Β 
Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050
Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050
Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050Vijay Kumar Jadon
Β 

More from Vijay Kumar Jadon (15)

Co jan22
Co jan22Co jan22
Co jan22
Β 
Session 2 jan17
Session 2 jan17Session 2 jan17
Session 2 jan17
Β 
Outcome Based Education and Assessment
Outcome Based Education and AssessmentOutcome Based Education and Assessment
Outcome Based Education and Assessment
Β 
Analysis and design eccentric loading
Analysis and design eccentric loadingAnalysis and design eccentric loading
Analysis and design eccentric loading
Β 
Program outcome maping
Program outcome mapingProgram outcome maping
Program outcome maping
Β 
Concept of state of stress and strain
Concept of state of stress and strainConcept of state of stress and strain
Concept of state of stress and strain
Β 
Free Body Diagram - FBD
Free Body Diagram - FBDFree Body Diagram - FBD
Free Body Diagram - FBD
Β 
tensile test - stress strain curve
tensile test - stress strain curvetensile test - stress strain curve
tensile test - stress strain curve
Β 
Design equation for static load
Design equation for static loadDesign equation for static load
Design equation for static load
Β 
Introduction to Aerial Robotics
Introduction to Aerial RoboticsIntroduction to Aerial Robotics
Introduction to Aerial Robotics
Β 
Aerial Robotics
Aerial RoboticsAerial Robotics
Aerial Robotics
Β 
Tensile test
Tensile testTensile test
Tensile test
Β 
Design equation for static load
Design equation for static loadDesign equation for static load
Design equation for static load
Β 
Machine design philosophy
Machine design philosophyMachine design philosophy
Machine design philosophy
Β 
Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050
Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050
Inertial Measurement Unit-Accelerometer and Gyroscope MPU6050
Β 

Recently uploaded

main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
Β 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
Β 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
Β 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
Β 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
Β 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
Β 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
Β 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
Β 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
Β 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
Β 
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube ExchangerAnamika Sarkar
Β 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
Β 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
Β 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
Β 
πŸ”9953056974πŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
πŸ”9953056974πŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...πŸ”9953056974πŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
πŸ”9953056974πŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...9953056974 Low Rate Call Girls In Saket, Delhi NCR
Β 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
Β 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
Β 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
Β 

Recently uploaded (20)

main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
Β 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
Β 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
Β 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
Β 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
Β 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
Β 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
Β 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
Β 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
Β 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Β 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
Β 
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned ο»ΏTube Exchanger
Β 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
Β 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Β 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
Β 
πŸ”9953056974πŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
πŸ”9953056974πŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...πŸ”9953056974πŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
πŸ”9953056974πŸ”!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
Β 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
Β 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
Β 
young call girls in Rajiv ChowkπŸ” 9953056974 πŸ” Delhi escort Service
young call girls in Rajiv ChowkπŸ” 9953056974 πŸ” Delhi escort Serviceyoung call girls in Rajiv ChowkπŸ” 9953056974 πŸ” Delhi escort Service
young call girls in Rajiv ChowkπŸ” 9953056974 πŸ” Delhi escort Service
Β 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
Β 

quadcopter modelling and controller design

  • 2. V. K. Jadon, Prof., Mechanical Engineering, Chitkara University Simulation ControllerDesign – 2D 2D Model The Flow …. ControllerDesign – 1D 1D Model
  • 3. 1D Model of Quadcopter π‘š αˆ·π‘§ 𝑑 = 𝑒 𝑑 βˆ’ π‘šπ‘” π‘₯1 = 𝑧(𝑑) π‘₯2 = αˆΆπ‘§ t changing variables into state variables: 𝑒 𝑑 = 𝑒1 = ሢπ‘₯1 In state-space modelling, we want to see the dynamics of the each states. ሢπ‘₯1 = π‘₯2 ሢπ‘₯2 = 1 π‘š 𝑒1 βˆ’ 𝑔 Two initialconditionsare required to solve these first order differential equationson the state; π‘₯1(0) and π‘₯2(0). π‘₯1 0 = 𝑧 0 = 0 π‘₯2 0 = αˆΆπ‘§ 0 = 0 π‘šπ‘” 𝑏2 𝑏3 π‘Ž2 π‘Ž3 𝑒1 𝑧 = 𝑧 𝑑𝑒𝑠 scipy.integrate.odeint(func, y0, t, args=(), tfirst=False) Function model V K Jadon, Prof., Mechanical Engineering, Chitkara University def model(z,t,u): x1=z[0] # Intial Conditionfor First FODE x2=z[1] # Initial conditionfor Second FODE dx1dt=x2 # First FODE dx2dt=(u-c*x2-k*x1)/mass-gravity # Second FODE dxdt = [dx1dt,dx2dt] return dxdt
  • 4. time=np.linspace(0,1,10) sol = odeint(model, [displacement,velocity], time) #Initial Conditions displacement=0, velocity=0 #System Parameters k=0, c=0, g=9.81, mass=0.18 #System Input u1=10 π‘˜ = 0, 𝑐 = 0, 𝑔 = 9.81, π‘šπ‘Žπ‘ π‘  = 0.18 𝑑 = 0; 𝑣 = 0; 𝑒1 = 0 𝑑 = 1; 𝑣 = 0; 𝑒1 = 0 𝑑 = 0; 𝑣 = 0; 𝑒1 = 1 π‘˜ = 0, 𝑐 = 0, 𝑔 = 9.81, π‘šπ‘Žπ‘ π‘  = 0.18 π‘˜ = 0, 𝑐 = 0, 𝑔 = 9.81, π‘šπ‘Žπ‘ π‘  = 0.18 π‘˜ = 0, 𝑐 = 0, 𝑔 = 9.81, π‘šπ‘Žπ‘ π‘  = 0.18 𝑑 = 0; 𝑣 = 5; 𝑒1 = 0 1D SODE Response V K Jadon, Prof., Mechanical Engineering, Chitkara University def model(z,t,u): x1=z[0] x2=z[1] dx1dt=x2 dx2dt=(u-c*x2-k*x1)/mass-gravity dxdt = [dx1dt,dx2dt] return dxdt
  • 5. Control Equation π‘šπ‘” 𝑦 𝑧 𝑒1 𝑧′′ 𝑑 = βˆ’π‘” + 𝑒1 π‘š 𝑑 (1) 𝑒 = 𝑧 𝑑𝑒𝑠 βˆ’ 𝑧 𝑒′ = 𝑧′ 𝑑𝑒𝑠 βˆ’ 𝑧′ The error term 𝑒 and 𝑒′ will decay exponentiallyto zero if error function satisfies the following second order differential equation: 𝑒′′ + π‘˜ 𝑑 𝑒′ + π‘˜ 𝑝 𝑒 = 0 (𝑧 𝑑𝑒𝑠 β€²β€² βˆ’π‘§β€²β€² ) + π‘˜ 𝑑 𝑒′ + π‘˜ 𝑝 𝑒 = 0 Substitutingfrom Eqn (1) 𝑧 𝑑𝑒𝑠 β€²β€² + 𝑔 βˆ’ 𝑒1 𝑑 π‘š + π‘˜ 𝑑 𝑒′ + π‘˜ 𝑝 𝑒 = 0 𝑒1 𝑑 = π‘š(𝑧 𝑑𝑒𝑠 β€²β€² + 𝑔 + π‘˜ 𝑑 𝑒′ + π‘˜ 𝑝 𝑒) The above equationis the controller equation. 𝑒, 𝑒′ 𝑒1 PD Controller The input to the controller is the current and desired positions. The output is the control signal. V K Jadon, Prof., Mechanical Engineering, Chitkara University
  • 6. V K Jadon, Prof., Mechanical Engineering, Chitkara University Interactive Mode Plotting Interactivemode updates a plot each time a new command is issued. Turn on interactivemode with method: plt.ion() Turn off interactivemode with method: plt.ioff() When interactivemode is not on, you enter all pyplot commands and then use the method plt.show() to see the figure. plt.clf() clears the entire current figure with all its axes, but leaves the window opened, such that it may be reused for other plots. plt.close() closes a window, which will be the current window, if not specified otherwise.
  • 7. π‘šπ‘” 𝑏2 𝑏3 π‘Ž2 π‘Ž3 βˆ… 𝑒1 π‘π‘œπ‘ βˆ… 𝑒1 π‘ π‘–π‘›βˆ… 𝑒1 𝑒2 π‘š αˆ·π‘¦ = βˆ’π‘ π‘–π‘›βˆ…π‘’1 π‘š αˆ·π‘§ = π‘π‘œπ‘ βˆ…π‘’1 βˆ’ π‘šπ‘” 𝐼 π‘₯π‘₯ αˆ·βˆ… = 𝑒2 αˆ·π‘¦ αˆ·π‘§ αˆ·βˆ… = 0 βˆ’π‘” 0 + βˆ’ 1 π‘š π‘ π‘–π‘›βˆ… 0 1 π‘š π‘π‘œπ‘ βˆ… 0 0 1 𝐼 π‘₯π‘₯ 𝑒1 𝑒2 For every equation,we will have two states π‘₯1 = 𝑦; π‘₯2 = 𝑧; π‘₯3 = βˆ…; π‘₯4 = αˆΆπ‘¦; π‘₯5 = αˆΆπ‘§; π‘₯6 = αˆΆβˆ…; First order Differential Equationsare ሢπ‘₯1 = αˆΆπ‘¦ = π‘₯4 ሢπ‘₯2 = αˆΆπ‘§ = π‘₯5 ሢπ‘₯3 = αˆΆβˆ… = π‘₯6 ሢπ‘₯4 = αˆ·π‘¦ = βˆ’ 1 π‘š π‘ π‘–π‘›βˆ…π‘’1 ሢπ‘₯5 = αˆ·π‘§ = 1 π‘š π‘π‘œπ‘ βˆ…π‘’1 βˆ’ g ሢπ‘₯6 = αˆ·βˆ… = 𝑒2 𝐼 π‘₯π‘₯ 2D Planar Model ሢπ‘₯1 = αˆΆπ‘¦ + 0𝑒1 + 0𝑒2 ሢπ‘₯2 = αˆΆπ‘§ + 0𝑒1 + 0𝑒2 ሢπ‘₯3 = αˆΆβˆ… + 0𝑒1 + 0𝑒2 ሢπ‘₯4 = 0 βˆ’ 1 π‘š π‘ π‘–π‘›βˆ…π‘’1 + 0𝑒2 ሢπ‘₯5 = βˆ’π‘” + 1 π‘š π‘π‘œπ‘ βˆ…π‘’1 + 0𝑒2 ሢπ‘₯6 = 0 + 1 𝐼 π‘₯π‘₯ 𝑒1 + 0𝑒2 V K Jadon, Prof., Mechanical Engineering, Chitkara University Expanded general form
  • 8. ሢπ‘₯1 ሢπ‘₯2 ሢπ‘₯3 ሢπ‘₯4 ሢπ‘₯5 ሢπ‘₯6 = π‘₯4 π‘₯5 π‘₯6 0 βˆ’g 0 + 0 0 0 0 0 0 βˆ’ 1 π‘š π‘ π‘–π‘›βˆ… 0 1 π‘š π‘π‘œπ‘ βˆ… 0 0 1 𝐼 π‘₯π‘₯ + 𝑒1 𝑒2 π‘š αˆ·π‘¦ = βˆ’βˆ…π‘’1 π‘š αˆ·π‘§ = 𝑒1 βˆ’ π‘šπ‘” 𝐼 π‘₯π‘₯ αˆ·βˆ… = 𝑒2 2D Planar Model Linearization ሢπ‘₯1 ሢπ‘₯2 ሢπ‘₯3 ሢπ‘₯4 ሢπ‘₯5 ሢπ‘₯6 = π‘₯4 π‘₯5 π‘₯6 0 βˆ’g 0 + 0 0 0 0 0 0 βˆ’ 1 π‘š βˆ… 0 1 π‘š 0 0 1 𝐼 π‘₯π‘₯ + 𝑒1 𝑒2 The model and controller is designed for hover configuration as it is more close to linear situation 𝑦 𝑑𝑒𝑠 = 𝑦0; 𝑒1 = π‘šπ‘”; 𝑒2 = 0; 𝑧 𝑑𝑒𝑠 = 𝑧0; βˆ… 𝑑𝑒𝑠 = 0 αˆ·π‘¦ = βˆ’π‘”βˆ… (1) αˆ·π‘§ = βˆ’π‘” + 𝑒1 π‘š (2) αˆ·βˆ… = 𝑒2 𝐼 π‘₯π‘₯ (3) Linearizationof the model for the hover becomes V K Jadon, Prof., Mechanical Engineering, Chitkara University βˆ… β‰ˆ 0
  • 9. Linearized planer model is given by 𝑦′′ = βˆ’π‘”βˆ… ..(1) To solve these, transform into first order differential equationsby defining the state variablesas below π‘₯1 = 𝑦(𝑑) π‘₯2 = 𝑧(𝑑) π‘₯3 = βˆ…(𝑑) π‘₯β€²1 = 𝑦′ 𝑑 = π‘₯4 … (4) π‘₯β€²2 = 𝑧′ 𝑑 = π‘₯5 … (5) π‘₯β€²3 = βˆ…β€² 𝑑 = π‘₯6 … (6) SubstitutingEqn (4) into Eqn (1) π‘₯β€²4 = βˆ’π‘”βˆ… …(7) SubstitutingEqn (5) into Eqn (2) π‘₯β€²5 = βˆ’π‘” + 𝑒1 π‘š … (8) SubstitutingEqn (6) into Eqn (3) π‘₯β€²6 = 𝑒2 𝐼 π‘₯π‘₯ … (9) The solutionof FODE (4) to (9) gives six states variables. π‘₯1, π‘₯2, π‘₯3, π‘₯4, π‘₯5, π‘₯6 These are positions(𝑦, 𝑧, βˆ…) and their time derivatives(𝑦′, 𝑧′, αˆΆβˆ…β€² ) Position and Time Derivatives 𝑧′′ = βˆ’π‘” + 𝑒1 π‘š … (2) βˆ…β€²β€² = 𝑒2 𝐼 π‘₯π‘₯ … (3) V K Jadon, Prof., Mechanical Engineering, Chitkara University changing dots (.) with dashes (β€˜) for convenience We need 𝑒1 and 𝑒2 to solve these set of FODE 𝑒1 and 𝑒2 are output of control equation. We need to design controllerfor getting appropriatevaluesof 𝑒1 and 𝑒2
  • 10. 𝑒1, 𝑒2 𝑦, 𝑧, βˆ… The error (desired value-currentvalue) in roll angle and position will reach to zero only if the error function satisfies the second order differential equation. 𝑒′′ + π‘˜ 𝑑 𝑒′ + π‘˜ 𝑝 𝑒 = 0 𝑦 𝑑𝑒𝑠 β€²β€² βˆ’ 𝑦′′ + π‘˜ 𝑑𝑦 𝑒 𝑦 β€² + π‘˜ 𝑝𝑦 𝑒 𝑦 = 0 Controller 𝑧 𝑑𝑒𝑠 β€²β€² βˆ’ 𝑧′′ + π‘˜ 𝑑𝑧 𝑒 𝑧 β€² + π‘˜ 𝑝𝑧 𝑒 𝑧 = 0 βˆ… 𝑐 β€²β€² βˆ’ βˆ…β€²β€² + π‘˜ π‘‘βˆ… π‘’βˆ… β€² + π‘˜ π‘βˆ… π‘’βˆ… = 0 𝑦 βˆ’Transllation Controller π‘œπ‘’π‘‘π‘π‘’π‘‘π‘¦, 𝑦 𝑑𝑒𝑠 Thrust Controller 𝑧, 𝑧 𝑑𝑒𝑠 Roll Controller βˆ…, βˆ… 𝑐 π‘œπ‘’π‘‘π‘π‘’π‘‘ π‘œπ‘’π‘‘π‘π‘’π‘‘ V K Jadon, Prof., Mechanical Engineering, Chitkara University
  • 11. 𝑦 βˆ’Transllation Controller βˆ… 𝑐𝑦, 𝑦 𝑑𝑒𝑠 Thrust Controller 𝑒1𝑧, 𝑧 𝑑𝑒𝑠 Roll Controller 𝑒2βˆ…, βˆ… 𝑐 The linearized planer model 𝑦′′ = βˆ’π‘”βˆ… ..(1) 𝑧′′ = βˆ’π‘” + 𝑒1 π‘š … (2) βˆ…β€²β€² = 𝑒2 𝐼 π‘₯π‘₯ … (3) 𝑦 𝑑𝑒𝑠 β€²β€² βˆ’ 𝑦′′ + π‘˜ 𝑑𝑦 𝑒 𝑦 β€² + π‘˜ 𝑝𝑦 𝑒 𝑦 = 0 Substitutingfrom Eqn (1) 𝑦 𝑑𝑒𝑠 β€²β€² + π‘”βˆ… 𝑐 + π‘˜ 𝑑𝑦 𝑒 𝑦 β€² + π‘˜ 𝑝𝑦 𝑒 𝑦 = 0 βˆ… 𝑐 = βˆ’ 1 𝑔 (𝑦 𝑑𝑒𝑠 β€²β€² + π‘˜ 𝑑𝑦 𝑒 𝑦 β€² + π‘˜ 𝑝𝑦 𝑒 𝑦) ..(10) 𝑧 𝑑𝑒𝑠 β€²β€² βˆ’ 𝑧′′ + π‘˜ 𝑑𝑧 𝑒 𝑧 β€² + π‘˜ 𝑝𝑧 𝑒 𝑧 = 0 Substitutingfrom Eqn (2) 𝑧 𝑑𝑒𝑠 β€²β€² + 𝑔 βˆ’ 𝑒1 π‘š + π‘˜ 𝑑𝑧 𝑒 𝑧 β€² + π‘˜ 𝑝𝑧 𝑒 𝑧 𝑒1 = π‘š(𝑧 𝑑𝑒𝑠 β€²β€² + 𝑔 + π‘˜ 𝑑𝑧 𝑒 𝑧 β€² + π‘˜ 𝑝𝑧 𝑒 𝑧)…(11) βˆ… 𝑐 β€²β€² βˆ’ βˆ…β€²β€² + π‘˜ π‘‘βˆ… π‘’βˆ… β€² + π‘˜ π‘βˆ… π‘’βˆ… = 0 Substitutingfrom Eqn (3) βˆ… 𝑐 β€²β€² βˆ’ 𝑒2 𝐼 π‘₯π‘₯ + π‘˜ π‘‘βˆ… π‘’βˆ… β€² + π‘˜ π‘βˆ… π‘’βˆ… = 0 𝑒2 = 𝐼 π‘₯π‘₯ βˆ… 𝑐 β€²β€² + π‘˜ π‘‘βˆ… π‘’βˆ… β€² + π‘˜ π‘βˆ… π‘’βˆ… … (12) Control Equations The SODE for error to satisfy V K Jadon, Prof., Mechanical Engineering, Chitkara University 𝑒 𝑦 β€² = (𝑦 𝑑𝑒𝑠 β€² βˆ’ 𝑦′) 𝑒 𝑦 = (𝑦 𝑑𝑒𝑠 βˆ’ 𝑦) 𝑒 𝑧 β€² = (𝑧 𝑑𝑒𝑠 β€² βˆ’ 𝑧′) 𝑒 𝑧 = (𝑧 𝑑𝑒𝑠 βˆ’ 𝑧) π‘’βˆ… β€² = (βˆ… 𝑐 β€² βˆ’ βˆ…β€²) π‘’βˆ… = (βˆ… 𝑐 βˆ’ βˆ…) βˆ… 𝑐 β€²
  • 12. V K Jadon, Prof., Mechanical Engineering, Chitkara University In this problem we have three degrees of freedom (𝑦, 𝑧, βˆ…) and two control variables(𝑒1, 𝑒2). So, we need cascaded control system. To reach the desired position we have to command a roll angle (βˆ… 𝑐) such that required translation(𝑦 𝑑𝑒π‘₯, 𝑧 𝑑𝑒𝑠) is achieved. Position Controller βˆ… 𝑐 βˆ…β€² 𝑐 𝑦 𝑑𝑒𝑠, 𝑦′ 𝑑𝑒𝑠 𝑧 𝑑𝑒𝑠, 𝑧′ 𝑑𝑒𝑠 Roll Controller 𝑒2 𝑒1 𝑦, 𝑧, βˆ… 𝑒1 Current states 𝑦′, 𝑧′, βˆ…β€² βˆ…, βˆ…β€² Control Block
  • 13. Thanks V K Jadon, Prof., Mechanical Engineering, Chitkara University 13