O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Using Finite State Machines From Concept to Realization

245 visualizações

Publicada em

Using state machines from concept to realization
- OPM - Object Process Methodology
- ARCADIA
- Coding
- Matlab/Simulink
- Arduino

Publicada em: Educação
  • Seja o primeiro a comentar

  • Seja a primeira pessoa a gostar disto

Using Finite State Machines From Concept to Realization

  1. 1. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Missio HICEE Profile: Name: Using Finite State Machines From Concept to Realization Place: INPE Date: 2017-10-31 – 16h00  18h00 and 2017-11-07 – 15h30  18h00 Target Audience: MSc/PhD Students 8:20 1
  2. 2. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Using Finite State Machines From Concept to Realization Christopher Shneider Cerqueira Ana Maria Ambrosio Claudio Kirner
  3. 3. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Motivation •Complex systems are often reactive, i.e., they continuously respond to external and internal stimuli (events) and may have time constraints. •When modelling such systems, the designer should be able to determine the system's behaviour, as well as its flow of control. •System modelling methods must express this action semantics in a way that is both formal and intuitive. 08:20cscerqueira.com.br 3
  4. 4. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Automata theory • A deterministic finite automaton is represented formally by a 5-tuple <Q,Σ,δ,q0,F>, where: • Q is a finite set of states. • Σ is a finite set of symbols, called the alphabet of the automaton. • δ is the transition function, that is, δ: Q × Σ → Q. • q0 is the start state, that is, the state of the automaton before any input has been processed, where q0∈ Q. • F is a set of states of Q (i.e. F⊆Q) called accept states. 08:20cscerqueira.com.br 4https://en.wikipedia.org/wiki/Automata_theory
  5. 5. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Finite-State Machine • A finite-state machine (FSM) or finite-state automaton (FSA, plural: automata), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some external inputs; the change from one state to another is called a transition. An FSM is defined by a list of its states, its initial state, and the conditions for each transition. 08:20cscerqueira.com.br 5 Current State Input Next State Output Locked coin Unlocked Unlocks the turnstile so that the customer can push through. push Locked None Unlocked coin Unlocked None push Locked When the customer has pushed through, locks the turnstile. https://en.wikipedia.org/wiki/Finite-state_machine
  6. 6. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Moore Machine • The FSM uses only entry actions, i.e., output depends only on the state. The advantage of the Moore model is a simplification of the behaviour. Consider an elevator door. The state machine recognizes two commands: "command_open" and "command_close", which trigger state changes. The entry action (E:) in state "Opening" starts a motor opening the door, the entry action in state "Closing" starts a motor in the other direction closing the door. States "Opened" and "Closed" stop the motor when fully opened or closed. They signal to the outside world (e.g., to other state machines) the situation: "door is open" or "door is closed" 08:20cscerqueira.com.br 6
  7. 7. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Mealy Machine • The FSM also uses input actions, i.e., output depends on input and state. The use of a Mealy FSM leads often to a reduction of the number of states. The example in Figure shows a Mealy FSM implementing the same behaviour as in the Moore example. There are two input actions (I:): "start motor to close the door if command_close arrives" and "start motor in the other direction to open the door if command_open arrives". The "opening“ and "closing" intermediate states are not shown. 08:20cscerqueira.com.br 7
  8. 8. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Where can we find FSMs!? 08:20cscerqueira.com.br 8 Idealization / Realization Tests Operations
  9. 9. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Tools 08:20cscerqueira.com.br 9 • OPCat: • http://esml.iem.technion.ac.il • Arcadia: • https://polarsys.org/capella/ • Enterprise Architect: • http://sparxsystems.com/products/ea/ • MatLab: • https://www.mathworks.com/downloads/ • Arduino: • https://www.arduino.cc
  10. 10. Mission Simulation Lab HICEE Mission Simulation Lab HICEE 08:20 10 MBSE – 20min ALFA – 20min OPM – 40min ARCADIA – 50min Code – 10min MATLAB – 30min ARDUINO– 10min WRAP-UP– 10min
  11. 11. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Model Based System Engineering ( MBSE) 08:20cscerqueira.com.br 11https://mediaex- server.larc.nasa.gov/Academy/Play/804f524f16c24fd2927a4eb9f01bdf831d
  12. 12. Mission Simulation Lab HICEE Mission Simulation Lab HICEE System Engineering 8:20 12 “Systems Engineering is an engineering discipline whose responsibility is creating and executing an interdisciplinary process to ensure that the customer and stakeholder's needs are satisfied in a high quality, trustworthy, cost efficient and schedule compliant manner throughout a system's entire life cycle.” http://www.incose.org/AboutSE/WhatIsSE
  13. 13. Mission Simulation Lab HICEE Mission Simulation Lab HICEE How the magic happens? 8:20 13 Talk with Stks
  14. 14. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Engineered System or System Engineering 8:20 14 An engineered system is an open system of technical or sociotechnical elements that exhibits emergent properties not exhibited by its individual elements. It is created by and for people; has a purpose, with multiple views; satisfies key stakeholders’ value propositions; has a life cycle and evolution dynamics; has a boundary and an external environment; and is part of a system-of-interest hierarchy. Systems engineering is “an interdisciplinary approach and means to enable the realization of successful (engineered) systems”. It focuses on holistically and concurrently understanding stakeholder needs; exploring opportunities; documenting requirements; and synthesizing, verifying, validating, and evolving solutions while considering the complete problem, from system concept exploration through system disposal. http://sebokwiki.org/wiki/Use_Case_0:_Systems_Engineering_Novices
  15. 15. Mission Simulation Lab HICEE Mission Simulation Lab HICEE MBSE 8:20 15 “Model-Based Systems Engineering (MBSE) is a systems engineering methodology that focuses on creating and exploiting domain models as the primary means of information exchange between engineers, rather than on document-based information exchange.” http://www.omgwiki.org/MBSE/doku.php “the formalized application of modelling to support system requirements, design, analysis, verification and validation activities beginning in the conceptual design phase and continuing throughout development and later life cycle phases. MBSE is part of a long-term trend toward model-centric approaches adopted by other engineering disciplines, including mechanical, electrical and software. In particular, MBSE is expected to replace the document-centric approach that has been practiced by systems engineers in the past and to influence the future practice of systems engineering by being fully integrated into the definition of systems engineering processes.”
  16. 16. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Model (driven x based x centric x oriented) • Driven: “models should be used to directly generate executable systems” • Based: “uses models rather than documents as the data source for all activities throughout the product life cycle” “models are used to drive all aspects of the product lifecycle and that data is created once and reused by all downstream data consumers.” • Centric: “is a focus entirely on development of information of and about the system – the model” • Oriented: “ is a paradigm that does not differentiate between modelling and coding. This is referred to as model-code duality.” 08:20cscerqueira.com.br 16 http://onlinelibrary.wiley.com/doi/10.1002/spe.1155/abstract#spe1155-note-0001 http://www.3dcadworld.com/why-you-need-to-understand-model-based-engineering/ https://www.youtube.com/watch?v=VjGmNjg5cro http://cruise.eecs.uottawa.ca/umple/
  17. 17. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Model (driven x based x centric x oriented) 08:20cscerqueira.com.br 17 Model Based Model Driven Model Oriented Model Centric Document Based“data-source” “generation” “focus” “language”
  18. 18. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Models... 8:20 18 Engineering? Modelling and auto-build?
  19. 19. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Benefits 8:20 19 http://www.eclipse.org/proposals/eclipse-mddi/
  20. 20. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Same kernel step each activity of the Lifecycle 8:20 20
  21. 21. Mission Simulation Lab HICEE Mission Simulation Lab HICEE V-MODEL 08:20cscerqueira.com.br 21
  22. 22. Mission Simulation Lab HICEE Mission Simulation Lab HICEE 08:20 22 time details V – Waterfall Ys – Prototype Cascade cscerqueira.com.br Equip SubS Sys 0 A B C D E F
  23. 23. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Still alive? 08:20cscerqueira.com.br
  24. 24. Mission Simulation Lab HICEE Mission Simulation Lab HICEE CASE: CUBESAT ALFA 08:20 24
  25. 25. Mission Simulation Lab HICEE Mission Simulation Lab HICEE What is Alfa!? • 1st CubeSat Mission of CTEE Program • CTEE – Capacitação Técnica em Engenharia Espacial • Mission: • Validate Service Bus / Com Networks • Shielding / Error Recovery Experiments • Current Status: • Finishing Documents to MDR • Space Segment • OnBoard Computer • Telecomunications • Power Supply • Attitude (at least determination) • Structure • Experiments • Ground Segment • Receive telemetries (housekeeping / mission) • Send telecommands 08:20cscerqueira.com.br 25 https://gomspace.com
  26. 26. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Simplified Timeline 08:20cscerqueira.com.br 26 Separation 10min start LEOP Housekeeping and Determination TM Manouver & Ex. Release TC Experiment TM EOLPre-Flight Testing Launch Ops
  27. 27. Mission Simulation Lab HICEE Mission Simulation Lab HICEE List all possible CubeSat Events 08:20cscerqueira.com.br 27 Release Pin 10min LEOP timer Charging/Antenna Release Orientation Ok Experiment Released ok Receive Reset TC Failure Occur Failure Solved Press Pin
  28. 28. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Select a few events to model • ON • OFF Pin • OFF • OK • FAILURE Software • NONE • SERVICE • PAYLOAD • MANOUVER • EOL • END_HANDLE Telecommand 08:20cscerqueira.com.br 28 2*3*6 = 36 states All are possibles? All are feasibles? All should exist? All are achievables?
  29. 29. Mission Simulation Lab HICEE Mission Simulation Lab HICEE States 08:20cscerqueira.com.br 29 Failure Pre-Lauch Launch LEOP Handle Serv. TC Handle Manouver TC. Handle Pay. TC Stand-By EOL Pin=off/cb=off Pin=on/cb=start SW=ok/cb=normal SW=Fail/cb=check SW=Fail/cb=check SW=Fail/cb=check SW=Fail/cb=check SW=Fail/cb=check SW=ok/cb=normal Tc=serv/ cb=servHandle Tc=aocs/ cb=manHandle Tc=serv/ cb=servHandle Tc=EOL/ cb=eolHandle Tc=endHandle|| timeout/ cb=norm Tc= endHandle|| timeout / cb=norm
  30. 30. Mission Simulation Lab HICEE Mission Simulation Lab HICEE 08:20 30 Events table: Pre- Flight Testing Launch Ops LEOP Stand-by Handle Service TC Handle Payload TC Handle Manouver TC EOL Failure Pre-Flight Testing x Pin = OFF Launch Ops x Pin = ON LEOP x SW = OK SW = Failure Stand-by x TC = serv TC = pay TC = man TC = eol SW = Failure Handle Service TC TC = endHandle || timeout x SW = Failure Handle Payload TC TC = endHandle || timeout x SW = Failure Handle Manouver TC TC = endHandle || timeout x SW = Failure EOL x Failure SW = OK x
  31. 31. Mission Simulation Lab HICEE Mission Simulation Lab HICEE OPM – Object Process Methodology 08:20 31
  32. 32. Mission Simulation Lab HICEE Mission Simulation Lab HICEE
  33. 33. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Phase 0 – Concepts - OPM • The Start • What is OPM?! • How to MEF?! • Alfa Example 08:20cscerqueira.com.br 33
  34. 34. Mission Simulation Lab HICEE Mission Simulation Lab HICEEThe start: How do we explain ideas to each other? •Grab a pen and piece of paper, or a chalk and blackboard •Scribble shapes with names next to them •While talking, run lines with or without arrows among the shapes •Follow the reaction of the audience to see if idea is understood •Answer questions, continue scribbling… 08:20 34
  35. 35. Mission Simulation Lab HICEE Mission Simulation Lab HICEEThe start: These “first” ideias  Conceptual Modelling •A systematic, formalized process of describing, specifying, designing or explaining ideas, systems, products or processes through a model •Applicable to both: • Science – Studying what is known and what is missing to satisfy human thirst for knowledge, and • Engineering – Designing systems to benefit humans, based on sound scientific principles •Science can be thought of as reverse engineering of nature 08:20 35
  36. 36. Mission Simulation Lab HICEE Mission Simulation Lab HICEE OPM (Object-Process Methodology) 36 Prof. Dov Dori Created in 2002 improving and showing it applicability • A Single Diagram – Maps Behaviour and Structure • 2 Building Blocks and 10 basic relations • Designed to “Systemic View” and “Concept Design” • Simulation Ready • ~130 Pages standard • Published in late 2015 • Intended to “Automation Systems and Integration” • Has the “power” of a ISO seal.
  37. 37. Mission Simulation Lab HICEE Mission Simulation Lab HICEE [Dori] Object-Process Theorem Objects with states, processes and their relations among them constitute a necessary and sufficient universal ontology to describe a system. 08:20cscerqueira.com.br 37 Mission Simulation Lab HICEE Mission Simulation Lab HICEE
  38. 38. Mission Simulation Lab HICEE Mission Simulation Lab HICEEThe start: Theoretical Foundations • Dual Channel Processing (visual and verbal) • Limited Capacity – amount of human processing. • Active Processing – learning occurs during active cognitive processing. (Simulation) • Ontology: set of concepts for describing a domain • Universal Ontology: a domain-independent set of concepts for describing systems. 08:20 38http://esml.iem.technion.ac.il/wp-content/uploads/2015/02/webinar_020915.pdf
  39. 39. Mission Simulation Lab HICEE Mission Simulation Lab HICEE • simple yet expressive, and • intuitive yet formal The Start: 08:20 39 Convert Construct Communic ate Concept Models fragmented knowledge into explicit and integrated knowledge concise models The model to stakeholders
  40. 40. Mission Simulation Lab HICEE Mission Simulation Lab HICEE OPM’s only two building blocks: 08:20 40 Product testing not tested tested 1. Objects with states 2. Processes All the other elements are relations between things, Expressed graphically as links
  41. 41. Mission Simulation Lab HICEE Mission Simulation Lab HICEETwo simultaneous cognitive channels: visual- OPD and textual-OPL Diagram (OPD) Textual (OPL) • Christopher is physical. Christopher knows OPM Theory. Christopher handles presenting. OPM consists of OPM Theory. presenting is physical. presenting consumes OPM Theory. presenting yields Presentation. 08:20cscerqueira.com.br 41 Mission Simulation Lab HICEE Mission Simulation Lab HICEE
  42. 42. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Majors aspects of any system? • Structure – the static aspect. What the system is made of. • Time-independent • Behavior – the dynamic aspect. How the system changes over time. • Time-dependent • Function – The utilitarian, subjective aspect. • Why is the system built? • For whom is the system built? • Who benefits from operating the system? 08:20 42 OnlyoneDiagramType
  43. 43. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Structural Links 08:20 43 StructuralRelational Aggregation Exhibition Specialization Instantiation
  44. 44. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Behaviour (Procedural Links) 08:20 44 Procedural Transforming • Consume • Create • Effect Enabling • Agent • Instrument Control • Events • Conditions • Invocation • Exceptions
  45. 45. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Other Mechanisms Operators • Multiplicity • Logical Complexity • Zoom-In – Zoom- Out • Unfolding - Folding • State expression – suppression Simulation 08:20 45 “Models interrelation”
  46. 46. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Examples: Object-Process Methodology and Its Application to the Visual Semantic Web Mission Simulation Lab HICEE Mission Simulation Lab HICEE 08:20cscerqueira.com.br 46
  47. 47. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Brief comparison: SysML and OPM Feature SysML OPM Theoretical Foundation UML; Object- Oriented Paradigm Minimal Universal Ontology; Object-Process Theorem Standard Documentation number of pages 1670 130 Standardization body OMG (2006) ISO (2015) Number of diagram kinds 9 1 Graphic modality Yes Yes Textual modality No Yes Physical-Informatical Distinction No Yes Systemic-Environmental Distinction No Yes 08:20 47
  48. 48. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Modelling Alfa’s State Behaviour 08:20cscerqueira.com.br 48
  49. 49. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Simpler Example – Logics 08:20cscerqueira.com.br 49 p1 changes a from s1 to s2. p2 changes a from s1 to s2. Following path aa, p3 consumes s1 a. Following path bb, p3 consumes s2 a. p3 yields s3 a. p4 changes a from s1 to s3.
  50. 50. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Simpler Example – states of the water 08:20cscerqueira.com.br 50
  51. 51. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Modelling Alfa’s State Behaviour 08:20cscerqueira.com.br 51
  52. 52. Mission Simulation Lab HICEE Mission Simulation Lab HICEE OPM State Charts 1/6 08:20cscerqueira.com.br 52 https://www.research.ibm.com/haifa/info/ple/present/Dori- States-OPM-Statecharts.pdf
  53. 53. Mission Simulation Lab HICEE Mission Simulation Lab HICEE OPM State Charts 2/6 08:20cscerqueira.com.br 53
  54. 54. Mission Simulation Lab HICEE Mission Simulation Lab HICEE OPM State Charts 3/6 08:20cscerqueira.com.br 54
  55. 55. Mission Simulation Lab HICEE Mission Simulation Lab HICEE OPM State Charts 4/6 08:20cscerqueira.com.br 55
  56. 56. Mission Simulation Lab HICEE Mission Simulation Lab HICEE OPM State Charts 5/6 08:20cscerqueira.com.br 56
  57. 57. Mission Simulation Lab HICEE Mission Simulation Lab HICEE OPM State Charts 6/6 08:20cscerqueira.com.br 57
  58. 58. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Formally 08:20 58 •OPM just turned to be a ISO standard. (15-Dec-2015) •Already being looked by airspace companies ( EMBRAER / BOEING ) •Already being researched to Concurrent Engineering (Cambridge / INPE) • Knowledge Based Systems •Simpler to implement than any UML/SysML specification. • Has direct compatibility with SysML models (back/forth) • Exports to Matlab (AUTOMATLAB) •Dual Channel  textual + visual • Extra third Channel  simulation • Personal touch: • More understandable than any UML-like to non-computer specialists. End of Class 01
  59. 59. Mission Simulation Lab HICEE Mission Simulation Lab HICEE ARCADIA (SysML- Like) 08:20 59
  60. 60. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Phase 0/A – Concepts/Architecture - Arcadia • What is?! • How to MEF?! • Alfa Example 08:20cscerqueira.com.br 60
  61. 61. Mission Simulation Lab HICEE Mission Simulation Lab HICEE History of Object Oriented Modeling languages 08:20cscerqueira.com.br 61 SysML 1.4
  62. 62. Mission Simulation Lab HICEE Mission Simulation Lab HICEE UML – Unified Modelling Language 08:20cscerqueira.com.br 62
  63. 63. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Adaptation to Systemic Domain 08:20cscerqueira.com.br 63
  64. 64. Mission Simulation Lab HICEE Mission Simulation Lab HICEE SysML – System Modelling Language 08:20cscerqueira.com.br 64
  65. 65. Mission Simulation Lab HICEE Mission Simulation Lab HICEE SysML Diagram Branches 08:20cscerqueira.com.br 65
  66. 66. Mission Simulation Lab HICEE Mission Simulation Lab HICEE SysML •Is a visual modelling language that provides •Semantics = meaning •Notation = representation of meaning •Is not •a methodology or a tool •SysML is methodology and tool independent 08:20cscerqueira.com.br 66http://www.omgsysml.org/INCOSE-OMGSysML-Tutorial-Final- 090901.pdf SysML
  67. 67. Mission Simulation Lab HICEE Mission Simulation Lab HICEE PolarSys Proposal for MBSE 08:20cscerqueira.com.br 67
  68. 68. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Arcadia / Capella • Polarsys Group • Thales Alenia • Phases 0 - C • Capella is a layer above the Eclipse IDE, created using the Sirius and the Eclipse Modelling Framework (EMF) • Diagrams: • operational architecture, • use cases, • dataflow, • architecture, • logical, • physical, • tree, • sequence, • state, • and classes 8:20 68https://www.polarsys.org/capella/
  69. 69. Mission Simulation Lab HICEE Mission Simulation Lab HICEESystems Architecture Modeling with the Arcadia Method A Practical Guide to Capella 08:20cscerqueira.com.br 69 ARCADIA - ARChitecture Analysis and Design Integrated Approach
  70. 70. Mission Simulation Lab HICEE Mission Simulation Lab HICEE 08:20cscerqueira.com.br 70
  71. 71. Mission Simulation Lab HICEE Mission Simulation Lab HICEE 08:20cscerqueira.com.br 71
  72. 72. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Diagram Examples 8:20 72 op arc log tree
  73. 73. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Methodological Guidance 08:20cscerqueira.com.br 73 Define Stakeholder Needs and Environment Capture and consolidate operational needs from stakeholders. Define what the users of the system have to accomplish Identify entities, actors, roles, activities, concepts Formalize System Requirements Identify the boundary of the system, consolidate requirements. Define what the system has to accomplish for the users. Model functional dataflows and dynamic behaviour Develop System Logical Architecture See the system as a white box: define how the system will work so as to fulfill expectations Perform a first trade-off analysis Develop System Physical Architecture How the system will be developed and built Software vs. hardware allocation, specification of interfaces, deployment configurations, trade-off analysis Formalize Component Requirements Manage industrial criteria and integration strategy: what is expected from each designer/sub-contractor. Specify requirements and interfaces of all configuration items
  74. 74. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Spiral 08:20cscerqueira.com.br 74 Actors EntitiesNeeds Activities Scenarios MissionsCapabilities Functions ArchitectureFunctions Components S S S S Functions Components Operational Analysis System Analysis Logical Architecture Physical Architecture Modes & States Arc Architecture Architecture (Christopher) Classes
  75. 75. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Spiral 08:20cscerqueira.com.br 75 Operational Analysis System Analysis Logical Architecture Physical Architecture (Christopher) Classes [OEBD][OCB] [OAB] [OAIB] [OAS] [OES] [MB] [MCB] [SDFB] [SAB] [ES] [FS] [LFBD] [LDFB] [LCBD] [LAB] [ES] [FS] [M&S] [PFBD] [PDFB] [PCBD] [PAB] [ES] [FS]
  76. 76. Mission Simulation Lab HICEE Mission Simulation Lab HICEE 08:20cscerqueira.com.br 76 Clock Radio Example Operational OAB - Entities and Activities OEBD - Entities System SABs – Components, Functions and Exchanges SDFBs – Functions and Exchanges SM&S – Modes and States SES – Entities Exchange Scenarios SFC – Functional Chains Logical LABs – Components, Functions and Exchanges LDFB – Data flows (functions and exchanges) LFBD – Function Breakdown LES – Exchange Scenarios LFCD – Functional Chains ...
  77. 77. Mission Simulation Lab HICEE Mission Simulation Lab HICEE 08:20cscerqueira.com.br 77 1 Define Stakeholder Needs and Environment Capture and consolidate operational needs from stakeholders. Define what the users of the system have to accomplish Identify entities, actors, roles, activities, concepts 2 Create Stks e needs Create Activities Create States/Modes Describe Events
  78. 78. Mission Simulation Lab HICEE Mission Simulation Lab HICEE States 08:20cscerqueira.com.br 78 Failure Pre-Lauch Launch LEOP Handle Serv. TC Handle Manouver TC. Handle Pay. TC Stand-By EOL Pin=off/cb=off Pin=on/cb=start SW=ok/cb=normal SW=Fail/cb=check SW=Fail/cb=check SW=Fail/cb=check SW=Fail/cb=check SW=Fail/cb=check SW=ok/cb=normal Tc=serv/ cb=servHandle Tc=aocs/ cb=manHandle Tc=serv/ cb=servHandle Tc=EOL/ cb=eolHandle Tc=endHandle|| timeout/ cb=norm Tc= endHandle|| timeout / cb=norm
  79. 79. Mission Simulation Lab HICEE Mission Simulation Lab HICEE 08:20cscerqueira.com.br 79 1 3 4 Formalize System Requirements Identify the boundary of the system, consolidate requirements. Define what the system has to accomplish for the users. Model functional dataflows and dynamic behaviour Import from Op. Analysis Create the System and Allocate functions Create States/Modes Describe Events
  80. 80. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Capella Ecosystem 08:20cscerqueira.com.br 80
  81. 81. Mission Simulation Lab HICEE Mission Simulation Lab HICEE In Software Code 08:20 81
  82. 82. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Phase C – Code • What is?! • How to MEF?! • Alfa Example • Beyond... 08:20cscerqueira.com.br 82
  83. 83. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Model a Behaviour 08:20cscerqueira.com.br 83 http://gameprogrammingpatterns.com/state.html
  84. 84. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Enum and Switch approach 08:20cscerqueira.com.br 84 enum State { STATE_STANDING, STATE_JUMPING, STATE_DUCKING, STATE_DIVING }; void Heroine::handleInput(Input input) { switch (state_) { case STATE_STANDING: if (input == PRESS_B) { state_ = STATE_JUMPING; yVelocity_ = JUMP_VELOCITY; setGraphics(IMAGE_JUMP); } else if (input == PRESS_DOWN) { state_ = STATE_DUCKING; setGraphics(IMAGE_DUCK); } break; case STATE_JUMPING: if (input == PRESS_DOWN) { state_ = STATE_DIVING; setGraphics(IMAGE_DIVE); } break; case STATE_DUCKING: if (input == RELEASE_DOWN) { state_ = STATE_STANDING; setGraphics(IMAGE_STAND); } break; }}
  85. 85. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Objects 08:20cscerqueira.com.br 85 class Heroine { public: virtual void handleInput(Input input); virtual void update(); // Other methods... private: HeroineState* state_; };
  86. 86. Mission Simulation Lab HICEE Mission Simulation Lab HICEE State Design Pattern 08:20cscerqueira.com.br 86
  87. 87. Mission Simulation Lab HICEE Mission Simulation Lab HICEE State Design Pattern 08:20cscerqueira.com.br 87 class Class Model Heroine + handleInput(Input) :void HeroineState + handleInput(Input) :void + update() :void + handleInput(Heroin&, Input) :HeroineState* Ducking + handleInput(Input) :void + update() :void + handleInput(Heroin&, Input) :HeroineState* Standing + handleInput(Input) :void + update() :void + handleInput(Heroin&, Input) :HeroineState* Jumping + handleInput(Input) :void + update() :void + handleInput(Heroin&, Input) :HeroineState* Diving + handleInput(Input) :void + update() :void + handleInput(Heroin&, Input) :HeroineState*
  88. 88. Mission Simulation Lab HICEE Mission Simulation Lab HICEETo control multiple things... Concurrent StateCharts 08:20cscerqueira.com.br 88http://www.ni.com/tutorial/6194/en/
  89. 89. Mission Simulation Lab HICEE Mission Simulation Lab HICEE States and Concurrent FSMs 08:20cscerqueira.com.br 89 Alfa Abstract SW State Abstract State of something .... Hand Serv Stand By Hand Pay Hand Man Hand EOL Failur e Concurrent FSMs Init
  90. 90. Mission Simulation Lab HICEE Mission Simulation Lab HICEE BioSystems / Nano / Additive / IoT 8:20 90
  91. 91. Mission Simulation Lab HICEE Mission Simulation Lab HICEE New motto 08:20cscerqueira.com.br 91
  92. 92. Mission Simulation Lab HICEE Mission Simulation Lab HICEE CTEE 9208:20
  93. 93. Mission Simulation Lab HICEE Mission Simulation Lab HICEE MATLAB / Simulink 08:20 93
  94. 94. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Phase B/C – Digital Design – Matlab/Simulink • What is?! • What is possible to model?! • How to MEF?! • Alfa Example 08:20cscerqueira.com.br 94
  95. 95. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Simulink • Modeling/designing dynamic systems (including nonlinear dynamics) • Modeling/designing control systems (including nonlinear controllers and plants) • Signal processing design/simulation • Simulink runs under Matlab. First start Matlab, then type “simulink” at the Matlab prompt. 08:20cscerqueira.com.br 95http://emerald.tufts.edu/~rwhite07/PRESENTATIONS_REPORTS/simulink.pdf https://pt.slideshare.net/christophercerqueira/prj32christopher-aula-14-controle
  96. 96. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Example • Ramp with control • Wave with filter • Subsystem all 08:20cscerqueira.com.br 96
  97. 97. Mission Simulation Lab HICEE Mission Simulation Lab HICEE State flow • sf_seqrec 08:20cscerqueira.com.br 97
  98. 98. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Signal Source 08:20cscerqueira.com.br 98
  99. 99. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Moore 08:20cscerqueira.com.br 99 1 12 121 1213
  100. 100. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Mealy 08:20cscerqueira.com.br 100 1 12 121 1213
  101. 101. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Comparing 08:20cscerqueira.com.br 101 1 12 121 1213
  102. 102. Mission Simulation Lab HICEE Mission Simulation Lab HICEE States 08:20cscerqueira.com.br 102 Failure Pre-Lauch Launch LEOP Handle Serv. TC Handle Manouver TC. Handle Pay. TC Stand-By EOL Pin=off/cb=off Pin=on/cb=start SW=ok/cb=normal SW=Fail/cb=check SW=Fail/cb=check SW=Fail/cb=check SW=Fail/cb=check SW=Fail/cb=check SW=ok/cb=normal Tc=serv/ cb=servHandle Tc=aocs/ cb=manHandle Tc=serv/ cb=servHandle Tc=EOL/ cb=eolHandle Tc=endHandle|| timeout/ cb=norm Tc= endHandle|| timeout / cb=norm
  103. 103. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Which is done inside the SUD 08:20cscerqueira.com.br 103 Hand Serv Hand Pay Hand Man Hand EOL Failure InitPin TCs TMs Stand By
  104. 104. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Alfa’s FSM in Matlab 08:20cscerqueira.com.br 104
  105. 105. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Simulating 08:20cscerqueira.com.br 105
  106. 106. Mission Simulation Lab HICEE Mission Simulation Lab HICEE ARDUINO 08:20 106
  107. 107. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Phase C – Automatic Realization • What is?! • What is possible to model?! • How to MEF?! • Alfa Example 08:20cscerqueira.com.br 107
  108. 108. Mission Simulation Lab HICEE Mission Simulation Lab HICEE ARDUINO 08:20cscerqueira.com.br
  109. 109. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Shields 08:20cscerqueira.com.brhttp://www.telecom.uff.br/pet/petws/downloads/tu toriais/arduino/Tut_Arduino.pdf
  110. 110. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Testing • Generate pulse • Stop blinking via INPUT state pin 08:20cscerqueira.com.br 110
  111. 111. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Exposing interfaces (stimuli/response) HW 08:20cscerqueira.com.br 111 Pin TCs TMs D2 – Pin D3 – TC01 D4 – TC02 D5 – TC03 D6 – TC04 D7 – TC05 D8 – TC06 D9 – TC07 Blink pattern pin 13 State -1 – failure : fast State 0 – init : off State 1 – stand : on State 2 – serv : one State 3 – pay : two State 4 – man : three State 5 – eol : four
  112. 112. Mission Simulation Lab HICEE Mission Simulation Lab HICEE Exposing interfaces 08:20cscerqueira.com.br 112
  113. 113. Mission Simulation Lab HICEE Mission Simulation Lab HICEEMicroprocessor x Microcontroller x Application Processor “only process” dedicated task generic “Complete sollution to industry” Complete computational architecture (memory, IOs) Industry and automation “Complete sollution to enduser” Complete computational architecture (memory, IOs) End user apps
  114. 114. Mission Simulation Lab HICEE Mission Simulation Lab HICEE
  115. 115. Mission Simulation Lab HICEE Mission Simulation Lab HICEE WRAP-UP 08:20cscerqueira.com.br 115

×