CIS 4930/6930: Principles of Cyber-Physical Systems Chapter 2: Continuous Dynamics Hao Zheng Department of Computer Science and Engineering University of South Florida H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 1 / 29
Modeling Techniques • Models are abstractions of system dynamics (i.e., how things change over time): • Examples: • Continuous dynamics - ordinary differential equations (ODEs) • Discrete dynamics - finite-state machines (FSMs) • Hybrid systems - a variety of hybrid system models H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 2 / 29
Modeling Continuous Dynamics • Classical mechanics is the study of mechanical parts that move. • Motion of mechanical parts can often be modeled using ordinary differential equations (ODEs). • ODEs can also be applied to numerous other domains including circuits, chemical processes, and biological processes. • ODEs used in tools such as LabVIEW (from National Instruments) and Simulink (from The MathWorks, Inc.). • ODEs only work for “smooth” motion where linearity , time invariance , and continuity properties hold. • Non-smooth motion, such as collisions, require hybrid (mixture of continuous and discrete) models (see next lecture). • Feedback control can stabilize unstable systems. H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 3 / 29
2.1 Model of Helicopter Dynamics x Roll y Yaw z Pitch H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 4 / 29
Position • Position is represented by six functions: : R → R x : R → R y : R → R z : R → R roll θ x : R → R yaw θ y : R → R pitch θ z where the domain represents time and the co-domain (range) represents position or orientation along the axis. • Collecting into two vectors: R → R 3 : x R → R 3 : θ where x represents position and θ represents orientation. H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 5 / 29
Newton’s Second Law F ( t ) = M ¨ x ( t ) where F is the force vector, M is the mass, and ¨ x is second derivative of x (i.e., the acceleration ). • Velocity can be determined as follows: � t ∀ t > 0 , x ( t ) ˙ = x ( 0 )+ ˙ ¨ x ( τ ) d τ 0 � t x ( 0 )+ 1 ˙ = F ( τ ) d τ M 0 • Position can be determined as follows: � t ∀ t > 0 , x ( t ) = x ( 0 )+ x ( τ ) d τ ˙ 0 � t � τ x ( 0 )+ 1 x ( 0 )+ t ˙ = F ( α ) d α d τ M 0 0 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 6 / 29
Rotational Version of Newton’s Second Law • The rotational version of force is torque : d dt ( I ( t )˙ T ( t ) = θ ( t )) ˙ T x ( t ) I xx ( t ) I xy ( t ) I xz ( t ) θ x ( t ) d ˙ T y ( t ) = I yx ( t ) I yy ( t ) I yz ( t ) θ y ( t ) dt ˙ T z ( t ) I zx ( t ) I zy ( t ) I zz ( t ) θ z ( t ) where T is the torque vector and I ( t ) is the moment of inertia tensor that represents reluctance of an object to spin. • When I ( t ) is a constant I , this reduces to: I ¨ T ( t ) = θ ( t ) H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 7 / 29
Rotational Version of Newton’s Second Law (cont) • Rotational acceleration : T ( t ) ¨ θ ( t ) = I • Rotational velocity : � t θ ( 0 )+ 1 ˙ ˙ θ ( t ) = T ( τ ) d τ I 0 • Orientation: � t ˙ θ ( t ) = θ ( 0 )+ θ ( τ ) d τ 0 � t � τ θ ( 0 )+ 1 θ ( 0 )+ t ˙ = T ( α ) d α d τ I 0 0 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 8 / 29
Feedback Control Problem • A helicopter without a tail rotor will spin uncontrollably due to the torque induced by friction in the rotor shaft. • Control system problem: apply torque using the tail rotor to counter the torque of the main rotor. H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 9 / 29
Model-Order Reduction: Simplified Helicopter Model main rotor shaft tail body M ¨ θ y ( t ) = T y ( t ) / I yy � t θ y ( 0 )+ 1 ˙ θ y ( t ) = T y ( τ ) d τ I yy 0 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 10 / 29
2.2 Actor Model of Systems • A system is a function that relates an input x to an output y : x : R → R , y : R → R • The domain and range of the system function are sets of signals, which are functions: : X → Y S where X = Y = ( R → R ) . • Parameters may affect the definition of the function S . H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 11 / 29
Actor Model of the Helicopter • Input is the net torque of the tail rotor. • Output is the angular velocity around the y axis. • Parameters are I yy and ˙ θ y ( 0 ) . • The system function is: � t θ y ( 0 )+ 1 ˙ ˙ θ y ( t ) = T y ( τ ) d τ I yy 0 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 12 / 29
Composition of Actor Models ∀ t ∈ R , y ( t ) = ax ( t ) = y ax = 1 / I yy a � t y ′ ( t ) x ′ ( τ ) d τ ∀ t ∈ R , = i + 0 ˙ = θ y ( 0 ) i H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 13 / 29
Actor Models with Multiple Inputs S : ( R → R ) 2 → ( R → R ) ∀ t ∈ R , y ( t ) = x 1 ( t )+ x 2 ( t ) y ( t ) = x 1 ( t ) − x 2 ( t ) H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 14 / 29
2.3 Properties of Systems • Causal systems • Memoryless systems • Linearity and time invariance • Stability H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 15 / 29
Causal Systems • A system is causal if its output depends only on current and past inputs. • Formally, a system is causal if for all x 1 , x 2 ∈ X and τ ∈ R : x 1 | t ≤ τ = x 2 | t ≤ τ ⇒ S ( x 1 ) | t ≤ τ = S ( x 2 ) | t ≤ τ where x | t ≤ τ is the restriction in time to current and past inputs. • A system is causal if for two inputs x 1 and x 2 that are identical up to (and including) time τ , the outputs are identical up to (and including) time τ . • A system is strictly causal if for all x 1 , x 2 ∈ X and τ ∈ R : x 1 | t < τ = x 2 | t < τ ⇒ S ( x 1 ) | t ≤ τ = S ( x 2 ) | t ≤ τ • y ( t ) = x ( t − 1 ) is strictly causal, y ( t ) = cx ( t ) is causal. • Strictly causal actors are useful for constructing feedback systems. H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 16 / 29
Causal Systems � Causal System Non-Causal System Input Input t t Output Output t t Most systems in nature are causal But… we need to understand non-causal systems because theory shows H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 17 / 29
Memoryless Systems • A system has memory if the output depends not only on the current inputs, but also on past inputs (or future inputs, if not causal). • In a memoryless system, the output at time t depends only on the input at time t . • Formally, a system is memoryless if there exists a function f : A → B such that for all x ∈ X and for all t ∈ R : ( S ( X ))( t ) = f ( x ( t )) • The Integrator is not memoryless, but the adder is. • A strictly causal, memoryless system has a constant output for all inputs. H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 18 / 29
Linearity and Time Invariance • A system is linear if it satisfies the superposition property: ∀ x 1 , x 2 ∈ X and ∀ a , b ∈ R , S ( ax 1 + bx 2 ) = aS ( x 1 )+ bS ( x 2 ) • The helicopter example is linear if and only if ˙ θ y ( 0 ) = 0. • Integrator is linear when i = 0, and scale factor/adder are always linear. x 1 ( t ) y 1 ( t ) Linear System x 2 ( t ) y 2 ( t ) Linear System x ( t ) = a 1 x 1 ( t )+ a 2 x 2 ( t ) y ( t ) = a 1 y 1 ( t )+ a 2 y 2 ( t ) Linear System H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 19 / 29 �
Linearity and Time Invariance • A system is time invariant if: ∀ x ∈ X and τ ∈ R , S ( D τ ( x )) = D τ ( S ( x )) where D τ : X → Y is a delay such that ( D τ ( x ))( t ) = x ( t − τ ) . • Helicopter example is not time invariant unless no initial angular rotation, and the integral starts at − ∞ . x ( t ) y ( t ) system x ( t-t 0 ) y ( t-t 0 ) x ( t ) y ( t ) t t x ( t-t 0 ) y ( t-t 0 ) t t t 0 t 0 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 20 / 29
Stability • A system is bounded-input bounded-output (BIBO) stable if the output signal is bounded for all input signals that are bounded. • Consider a continuous-time system with input w and output v . • The input is bounded if there is a real number A < ∞ such that | w ( t ) | ≤ A for all t ∈ R . • The output is bounded if there is a real number B < ∞ such that | v ( t ) | ≤ B for all t ∈ R . • The system is stable if for any input bounded by some A, there is some bound B on the output. H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 21 / 29
Open-Loop Helicopter • Helicopter example is not stable. • Consider input T y = u where u is a unit step input: � 0 , t < 0 ∀ t ∈ R , u ( t ) = 1 , t ≥ 0 • The system function is: � t θ y ( 0 )+ 1 ˙ ˙ θ y ( t ) = T y ( τ ) d τ I yy 0 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 22 / 29
ψ 2.4 Feedback Control • Feedback control is used to achieve stability. • These systems measure the error (difference between actual and desired behavior) and use this information to correct the behavior. e K H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 23 / 29
Recommend
More recommend