Lecture 2C Supplemental_1
Supplementary Material - State-Space Form Presented by Lucy Tang, PhD student. In the lecture, we saw the dynamical equations with a quadrotor written as matrix equations, which we call state-space form. In this segment, well demonstrate how to transform the ordinary differential equations representing a dynamical system into state-space form. !ecall that a dynamical system is a system where the effects of actions do not occur immediately. "e ha#e seen that the e#olution of the states of these systems is go#erned by a set of ordinary differential equations. Its often helpful in control problems to rearrange these ordinary differential equations into state-space form . This means that we represent the differential equations in the form$ x f & x, u % "here x is a matrix of states and u is a matrix of inputs. "e can do this in a #ery systematic manner. 'uppose we ha#e an ordinary differential equation go#erning a one-dimensional system whose position is represented by y. (. )irst identify identify the the order of of the system system n. !ecall !ecall that the the order is the the highest highest deri#ati#e that appears in the differential equation. *. "e the then n def defin inee the the stat states es x(
y &t %, x *
&t %,...., x n y
y
& n (%
&t % where
y & n(% &t % is the &n-(% st deri#ati#e of y +. ext, ext, we create create the the state-# state-#ecto ector r x x( x *
T
... x n y &t % y &t % ... y & n (% &t % which is a #ector T
containing the pre#iously defined states. . These states states are go#erned go#erned by the followin following g set of coupled coupled first-order first-order differential equations$ d
d x( y y x * dt dt d
d x+ x * y y dt dt d
d xn y & n (% g & y, y ,..., y & n (% , u % g & x( , x*, ..., xn , u % dt dt /ecause of the way we defined the states, the first equation simply states that the deri#ati#e of x( is x*. The second equation states that the deri#ati#e of x * is x+. The only non-tri#ial differential equation is the deri#ati#e of x n which could be a function of all the other states plus the input u.
"e get this function by rearranging the go#erning ordinary differential equation. )inally, we stac0 these first-order differential equations into a matrix$ x* x( x x+ * ... ... xn g & x( , x* ,..., xn , u % 1n the left hand side we ha#e the matrix x . 1n the right hand side we ha#e a matrix whose components are functions of the states x and the input u. 2onsider the 3ass'pring system we loo0ed at earlier, and go#erned by the ordinary differential equation shown$
&t % ky&t % u &t % m y The highest deri#ati#e that appears in this equation is the second deri#ati#e, ma0ing this a second order system. "e need to define the states x (4y and x*4 y . ext, we create the state #ector x. In this case, x contains only two components, y and and y dot which we ha#e designated as x ( and x *$ x x( x * y y T
T
"e can now define the system of first-order differential equations. The first equation is tri#ial and simply states that the deri#ati#e of x( is x*. d
d x( y y x * dt dt
using the go#erning ordinary differential "e get the second equation by sol#ing for y equation. d u &t % ky&t % u &t % kx( x* y y dt dt m m d
"e see that the deri#ati#e of x* is a function of x ( and u. "e can write these two differential equations as a matrix$
x( x* x u &t % kx( * m "e see that because 0 and m are constants, the system is actually linear in the states and input. 5s a result, we can write the equations in the following manner$
x( 6 ( x( 6 x k 6 x ( u &t % * m * m This equation is in the form x 4 5x 7 /u, which is the general form for a linear statespace equation. 5gain the matrix equation is linear in the states, x, and the inputs, u. "e can demonstrate how to extend this procedure to higher-order systems by using the Planar 8uadrotor 3odel. )rom the lecture we 0now the Planar 8uadrotor is
go#erned by the following set of ordinary differential equations which are written in the terms of the #ariables y, 9 and $
sin& %u( m y cos& m z cos& %u( mg u I xx * :ere, the highest deri#ati#e appearing in any differential equation is the second deri#ati#e, so this is still a second order system. ext, we essentially must carry out the required steps for each #ariable. /ecause n4*, we to need define states for the position and #elocity of y, 9, and . This gi#es us a system with six states$
, x; x( y , x* z , x+ , x- y , x< z "e place these six states into one state #ector$
x x( x* x+ x- x< x; y z y z T
T
"e can now define the system of first-order differential equations. 5gain, the first three equations simply relate states to each other$ d
d x( y y xdt dt d
d x< x* z z dt dt d
d x+ x; dt dt The last three equations come from rearranging the three go#erning ordinary differential equations$ d
d sin& %u( sin& x+ %u( x- y y dt dt m m d
d z cos& x< z cos& %u( mg cos& x+ %u( mg dt dt d
d u* x; dt dt I xx "e can now place these equations into a single matrix equation$
x x( x< x * x x+ sin& x; %u + ( m x- x< cos& x+ %u( mg u* x; I xx These equations are non-linear because of the functions sine and cosine of the state x +.