CSCI 1600 Embedded and Real Time Software Lecture
CSCI 1600: Embedded and Real Time Software Lecture 9: Modeling III: Hybrid Systems Steven Reiss, Fall 2016
Time and Finite State Automata We’ve added timing to our automata in an ad-hoc fashion Assuming a fixed period Added timer events Indicated length of time in a state (min/max) No notion of absolute time, clocks, etc. These are easy to implement In order to prove properties of the system With respect to time We need a cleaner, more formal representation Assuming time is continuous 2 Lecture 9: Modeling Hybrid Systems 9/6/2021
Timed Automata Basic idea Extended finite state machine Add the notion of timer variables Timer variables can be set explicitly All timer variables are periodically incremented Can think of this as every k milliseconds Can think of this as continuous as well Timer variables can be used in conditions No ad-hoc time constraints 3 Lecture 9: Modeling Hybrid Systems 9/6/2021
Timed Automata 4 Lecture 9: Modeling Hybrid Systems 9/6/2021
Another example 5 Lecture 9: Modeling Hybrid Systems 9/6/2021
Extended timed automata 6 Lecture 9: Modeling Hybrid Systems 9/6/2021
Timed Automata Are these still finite state? Timer variables can be unbounded Timer variables are continuous Determine the state ranges for times These form time-states Can create an equivalent FSA 7 Lecture 9: Modeling Hybrid Systems 9/6/2021
Modeling and the Real World Often we want to model both the system and the world The system is a finite automata The real world is continuous & not just clocks Problems How to combine the two What can we do with the combination Understanding Proving properties 8 Lecture 9: Modeling Hybrid Systems 9/6/2021
Modeling in the Real World 9 Lecture 9: Modeling Hybrid Systems 9/6/2021
Hybrid Automata State variables reflect the real world Updates done over time automatically Updates can use continuous modeling Can specify velocity, acceleration rather than position Can specify rules for doing the update 10 Lecture 9: Modeling Hybrid Systems 9/6/2021
Bouncing Ball Example 11 Lecture 9: Modeling Hybrid Systems 9/6/2021
RC Car 12 Lecture 9: Modeling Hybrid Systems 9/6/2021
Hybrid Timed Automata The external (timed) portion is set outside the automata Rules for continuous update Model the physics of the real world 13 Lecture 9: Modeling Hybrid Systems 9/6/2021
Why Model the World? Does the code need to know the state of the real world Either precisely or approximately Does it need to compute that state Or retrieve it via sensors How accurate can you model the world? Consider speed control on a car Proving properties of the program wrt the model Does this prove the system correct 14 Lecture 9: Modeling Hybrid Systems 9/6/2021
Implementation Approach Get information from the real world What the actual speed is, change of speed Actual temperature (and change rate) Compute the difference between actual and desired This is called the error Use this to determine the action This is considered feedback 15 Lecture 9: Modeling Hybrid Systems 9/6/2021
Control Theory Why are computers called “digital computers” What is the alternative What is an analog computer It turns out that analog computers are easy to build Either mechanically or electronically Predate digital computers 16 Lecture 9: Modeling Hybrid Systems 9/6/2021
Analog Computers 17 Lecture 9: Modeling Hybrid Systems 9/6/2021
Analog Computer Can do simple math operations Some complex math operations are easy Integration, differentiation 18 Lecture 9: Modeling Hybrid Systems 9/6/2021
Controlling Physical Systems Analog computers are designed for this If you want a car to go in a straight line Use feedback from left/right to update steering Use intergrator to determine error to control system Analog control is all about feedback We can do the same in digital systems Covered a week from Friday First we need to cover details for the assignment And some additional modeling concepts 19 Lecture 9: Modeling Hybrid Systems 9/6/2021
Homework Read Chapter 7. 1 20 Lecture 9: Modeling Hybrid Systems 9/6/2021
- Slides: 20