Sunteți pe pagina 1din 23

Switching & Hybrid Systems

Harry G. Kwatny
Department of Mechanical Engineering & Mechanics Drexel University

Outline

Hybrid System composed of a continuous dynamical system interfaced with a discrete event system May be viewed as a switching system with a general switching structure Simple Examples of Hybrid Systems Bouncing ball Heating system Gearbox/cruise control Simulating Hybrid Systems Simulink with Stateflow Stateflow/Simulink Bouncing ball Power conditioning system Inverted pendulum

Simple Examples

Bouncing Ball
y

Free fall: Collision:


g

y = g y (t + ) = y (t ) = 0 y ( t + ) = cy ( t ) , c [0,1]

x1 = x2 x2 = g

+ x1 = 0 x2 < 0 x2 := cx2

Bouncing Ball
v = v0 gt 1 2v x = v0 t gt 2 = 0 t = 0 g 2 2v 2v 2v t1 = 0 , t2 = 0 c,, ti = 0 c i 1 g g g 2v0 i 1 2v0 N i 1 2v0 1 c N TN = i =1 ti = i =1 c = c = i =1 g g g 1 c 2v 1 For 0 c < 1, lim TN = 0 N g 1 c
N N

Time for N transitions

Zeno phenomenon transitions in finite time

Heater
x

x 73

x = x + 50
x 77
t

x = x + 100

continuous state: x R, x + 50 q = off x = f ( x, q ) , f ( x, q ) = x + 100 q = on discrete state: q {on, off }, on off q ( k + 1) = ( x, q ( k ) ) , ( x, q ) = off on q = off , x 73 q = off , x > 73 q = on, x 77 q = on, x < 77

Automobile Gearbox Control


Problem 1: Automated gearbox - coordinate automatic gearshift with throttle command Problem 2: Cruise control automate throttle and gearbox to maintain speed Background

R. W. Brockett, "Hybrid Models for Motion Control," in Perspectives in Control, H. L. Trentelman and J. C. Willems, Ed. Boston: Birkhauser, 1993, pp. 29-54. S. Hedlund and A. Rantzer, "Optimal Control of Hybrid Systems," presented at Conference on Decision and Control, Phoenix, AZ, pp. 3972-3977, 1999. F. D. Torrisi and A. Bemporad, "HYSDEL-A Tool for Generating Computational Hybrid Models for Analysis and Synthesis Problems," IEEE Transactions on Control Systems Technology, vol. 12, pp. 235-249, 2004.

Transmission
M qi v = u [ 0,1] Rqi R fin rwheel f eng ( ) u Fb cv 2 M veh g sin ( ) throttle position engine speed engine torque-speed characteristic corresponding gear ratios rear gear ratio wheel radius brake force

f eng ( ) u

q {q1 , q2 , q3 , q4 , q5 } transmission state Rqi ,i = 1,,5 R fin rwheel Fb

Continuous control - throttle u and brake Fb are chosen so that Rqi R fin rwheel f eng ( ) u Fb = cv 2 + M veh g sin ( ) + M qi k P ( v v ) + k I ( v v ) dt
f eng ( )

Cruise Control

- a standard feedback linearized design with PI controller. - notice that control depends on the discrete state. Discrete control - ad hoc gear shift strategy.

u
q0 , neutral

u
q1 , gear1 q2 , gear2 v + kP v + kI v = kI v

u
q3 , gear3 v + kP v + kI v = kI v

u
q4 , gear4 v + kP v + kI v = kI v

u
q5 , gear5 v + kP v + kI v = kI v

v + kP v + kI v = kI v

=
< stall

Rq1 R fin rwheel

=
< l

Rq2 R fin rwheel

=
< l

Rq3 R fin rwheel

Rq4 R fin rwheel

Rq5 R fin rwheel

< l

< l

Cruise Control Issues


Choice of shift thresholds


Wide spread implies large speed deviation before shift Narrow spread opens possibility of excessive shifting, even chattering

Does not explicitly consider throttle and brake limits It must be verified that the engine does not stall or exceed red line

Simulating Hybrid Systems with Stateflow/SIMULINK

Stateflow

Stateflow is a Simulink toolbox Provides a graphical means to incorporate discrete event process into Simulink Based on the concept of statecharts

Harel, D., Statecharts: A Visual Formalism for Complex Systems. Science of Computer Programming, 1987. 8: p. 231-274. Has evolved to represent an implementation of UML

Simulating Hybrid Systems in Stateflow/SIMULINK

Stateflow: Action Language Categories


State creator tool Stateflow coder Default state Event trigger

Transition action

Merge tool

State entry action

State exit action

State on event_name action

State during action

Event trigger

Condition

Condition action

Bouncing Ball
y

Free fall: Collision:


g

y = g y (t + ) = y (t ) = 0 y ( t + ) = cy ( t ) , c [0,1]

x1 = x2 x2 = g

+ x1 = 0 x2 < 0 x2 := cx2

[ x1 = 0 & & x2 < 0]{x2+ := cx2 }


StateFlow action language

Power Conditioning System


Ro

iL
R pre
vo

Rbleed

High power drives in vehicle applications


Startup (precharge) Normal (current regulation) Shutdown (bleed)


M. Senesky, G. Eirea, and T. J. Koo, "Hybrid Modeling and Control of Power Electronics," in Hybrid Systems: Computation and Control, vol. 2623, Lecture Notes in Computer Science. New York: Springer-Verlag, 2003, pp. 450-465. P. Gupta and A. Patra, "Hybrid Sliding Mode Control of DC-DC Power Converters," presented at IEEE Tencon 2003, Bangalore, 2003.

Background (Boost converters)


Power Conditioning System


0 Clock Power Display Off 1 On -1

MainBreaker Voltage

MainBreaker {OFF=-1, ON=1} MainBreaker {OFF=-1, ON=1} PreBreaker {OFF=-1, ON=1} PreBreaker {OFF=-1, ON=1}

Synch

Memory
I_av ge

PreBreaker Bleed I_av ge_reset Time Time_reset

Memory1

Bleed Breaker {OFF=-1, ON=1} Bleed Breaker {OFF=-1, ON=1} Av ge Current Reset Av ge Current Reset Time Reset

Modes1 Memory2

Total Load Current

Bank Voltage

Bank Voltage

Step
Main Breaker Mains Voltage Mains Voltage

Step1

Precharge

Mains Current

Mains Current

Bleed

Bank Current

Bank Current

Scope

Power System Gain 10 1 s

I_av ge

Avge Current Constant1 1 1 s Time

Time

Power Conditioning System

Power Conditioning System

Inverted Pendulum ~ 1
x=v
z

2v + cos = F + 2 sin cos v + = sin Suppose we choose F to regulate v, so that the pendulum equations are

= = sin u cos
where u is treated as a control.

Inverted Pendulum ~ 2
Suppose we wish to design a global feedback controller that will steer any initial state to the upright position with the constraint u [ 1,1]. Feedback linearization will not work in general, choose u so that

sin + u cos = 0 + 2 + = 0
2 sin u = within constraints only near = 0. cos

Inverted Pendulum Swing-up Strategy


= , = sin u cos
2 E pend = 1 + ( cos 1) 2

E pend = 0 when = 0, = 0 1) pump/remove energy into system until E pend 0, E pend [ , ] E = ( sin u cos ) sin = u cos 2) wait until pendulum is close to upright 3) apply feedback linearizing control

Inverted Pendulum: Control Strategy


E pend >

E pend <

remove energy u = sgn ( cos )


E pend >

E pend [ , ]

wait u=0

add energy u = sgn ( cos )


E pend [ , ]

stabilize 2 sin u= cos

+ <
E pend <
0.4

E pend = 0.02

E pend = 0.02

Constant energy trajectories, u = 0, in 'wait' state. Switch to 'stabilize' in blue box.

0.2

-0.2

-0.4

-0.4

-0.2

0.2

0.4

S-ar putea să vă placă și