Andi’s Autopilot A Hard Real-Time Control Application Broderic Gonzales CS 722 May 2, 2005 v.05.

Slides:



Advertisements
Similar presentations
© Alan Burns and Andy Wellings, 2001 Real-Time Systems and Programming Languages n Buy Real-Time Systems: Ada 95, Real-Time Java and Real-Time POSIX by.
Advertisements

A component- and message-based architectural style for GUI software
3-Valued Logic Analyzer (TVP) Tal Lev-Ami and Mooly Sagiv.
Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Resource Containers: A new Facility for Resource Management in Server Systems G. Banga, P. Druschel,
Flight Instrument Systems
1 Copyright 1998 by Dragos Manolescu and Joseph W. Yoder Building Frameworks With Patterns “An Active Object-Model For A Dynamic Web-Based Application”
© 2005 Prentice Hall6-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
1 Beyond Reduction Busy Acquire atomic void busy_acquire() { while (true) { if (CAS(m,0,1)) break; } } if (m == 0) { m = 1; return true; } else.
Steep Turns.
1 EDM Calculations ASM 215 EDM CALCULATIONS. 2 EDM Calculations HORIZONTAL DISTANCE MEASUREMENT n In plane surveying, the distance between two points.
Lecture 6: Hybrid Robot Control Gal A. Kaminka Introduction to Robots and Multi-Robot Systems Agents in Physical and Virtual Environments.
Chapter 13 Embedded Systems
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 6 Functions.
Component-Level Design
Chandelles.
Chapter 13 Embedded Systems
Real-Time Systems and Programming Languages
CS 201 Functions Debzani Deb.
Lesson 16: Aircraft Instrument Systems
OS Organization. OS Requirements Provide resource abstractions –Process abstraction of CPU/memory use Address space Concurrency Thread abstraction of.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
What is it? A mobile robotics system controls a manned or partially manned vehicle-car, submarine, space vehicle | Website for Students.
Cessna 172 Cockpit.
Design Patterns Discussion of pages: xi-11 Sections: Preface, Forward, Chapter
1 Thread Synchronization: Too Much Milk. 2 Implementing Critical Sections in Software Hard The following example will demonstrate the difficulty of providing.
Imperial College Tracker Slow Control & Monitoring.
1 CS 501 Spring 2003 CS 501: Software Engineering Lecture 16 System Architecture and Design II.
Landing a UAV on a Runway Using Image Registration Andrew Miller, Don Harper, Mubarak Shah University of Central Florida ICRA 2008.
Chapter 1 CS 3204: Introduction. CS 3204: Operating Systems2 What is an Operating System (OS) ? Definition 1: An OS is the interface between the hardware.
RUP Design RUP Artifacts and Deliverables
4/2/03I-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Software Architecture and Design Readings: Ambler, Chap. 7 (Sections to start.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 6 Functions.
Use of Coverity & Valgrind in Geant4 Gabriele Cosmo.
FEN Introduction to the database field:  Applications, concepts and terminology Seminar: Introduction to relational databases.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
CPSC 372 John D. McGregor Module 3 Session 1 Architecture.
Object-Oriented Software Engineering using Java, Patterns &UML. Presented by: E.S. Mbokane Department of System Development Faculty of ICT Tshwane University.
Conformance Test Experiments for Distributed Real-Time Systems Rachel Cardell-Oliver Complex Systems Group Department of Computer Science & Software Engineering.
Lecture 3 Abstract Data Type Sandy Ardianto & Erick Pranata © Sekolah Tinggi Teknik Surabaya 1.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
AVAT11001: Course Outline Aircraft and Terminology
CIS 644 Thus. Oct. 28, 1999 W10B … misc. questions … thread, Runable … communication patterns.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 6 Functions.
Starting Out with C++ Early Objects ~~ 7 th Edition by Tony Gaddis, Judy Walters, Godfrey Muganda Modified for CMPS 1044 Midwestern State University 6-1.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Brief Edition Chapter 6 Functions.
Elaboration Iteration 3 – Part 3 - Persistence Framework -
( = “unknown yet”) Our novel symbolic execution framework: - extends model checking to programs that have complex inputs with unbounded (very large) data.
1. Real Time Transaction System As soon as they are booked they are removed from the available list. – No none else can book them An example of a real.
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
Object and Class Structuring Chapter 9 Part of Analysis Modeling Designing Concurrent, Distributed, and Real-Time Applications with UML Hassan Gomaa (2001)
Behavioral Pattern: Mediator C h a p t e r 5 – P a g e 169 When a program is made up of several classes, the logic and computation is divided among these.
Layers Architecture Pattern Source: Pattern-Oriented Software Architecture, Vol. 1, Buschmann, et al.
CS320n –Visual Programming Execution Control with If / Else and Boolean Functions (Slides 6-2-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for.
Air Experience Flying.
Aircraft Auto Pilot Roll Control System
KNU RTLAB A Real-Time Linux System For Autonomous Navigation And Flight Attitude Control Of An Uninhabited Aerial Vehicle Charles E. Hall, Jr. Mechanical.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Chapter 5:Architectural Design l Establishing the overall structure of a software.
6.11 Flight Instruments Refs: FTGU pp
AUTOPILOT The autopilot or automatic pilot is a system of automatic controls that holds the aircraft on any selected magnetic heading & returns the aircraft.
OO Methodology OO Architecture.
Lazy Eights.
 DATAABSTRACTION  INSTANCES& SCHEMAS  DATA MODELS.
Concurring Concurrently
Polymorphism Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2nd edition, by Kernighan.
Operating Systems: A Modern Perspective, Chapter 3
Software Analysis.
Welcome to the Flight Olympics!
Chapter 6: Architectural Design
Software Development Process Using UML Recap
Presentation transcript:

Andi’s Autopilot A Hard Real-Time Control Application Broderic Gonzales CS 722 May 2, 2005 v.05

Purpose “Cruise control” for an airplane. During flight the autopilot must maintain a plane’s: –Altitude: keep the plane level at its current height –Direction: keep the plane traveling in its current heading –Attitude: keep the plane’s orientation stable The autopilot is a hard real-time system.

What makes a system real time? 1 Timeliness Reactiveness Concurrency Device abstractions Distributive State-dependency Dynamic internal structure 1 Coad[230]

Timeliness Timing constraints if not met cause unwanted loss of data. The autopilot uses separate, prioritized threads of control.

Reactiveness Immediately identify, respond and process changes in the system. The autopilot continuously polls instruments and reports deviations to the autopilot to correct the plane’s flight.

Concurrency Multiple activities may be taking place at the same time. The autopilot uses multiple threads of control. Each thread does a single task and is assigned to different subsystems to either monitor an instrument or manipulate a control.

Device Abstractions Abstract representations of both the physical (problem domain) and the logical (program design.) The autopilot abstracts the instruments and controls as objects of the airplane. The autopilot is built on a framework layer that abstracts the implementation details of the operating system.

Distributive Responsibility of controls is spread amongst objects. The autopilot allows the instrumentation to maintain only the information that is relevant to them.

Design Overview

Main Classes

Airplane Class Implementation Details Airplane::Airplane() :_elevators(0), _ailerons(0), _rudders(0) { Controls* controls = Controls::On(); _elevators = controls->GetElevators(); _ailerons = controls->GetAilerons(); _rudders = controls->GetRudders(); } bool Airplane::ActivateAutopilot() { bool elevatorsActivated = _elevators->ActivateAltitudeMaint(); bool aileronsActivated = _ailerons->ActivateHeadingMaint(); bool ruddersActivated = _rudders->ActivateHeadingMaint(); // Was activation of sensor monitors successful? if( elevatorsActivated && aileronsActivated && ruddersActivated ) return true; else return false; }

Elevators Class Details

Elevators Class Details Continued bool Elevators::ActivateAltitudeMaint( ) { Initialize(); bool status = false; // Create thread to monitor for updates. taskId = _task->Start( &CallBack, (void*)this); if( _taskId == Sthread::GOOD_TID ) status = true; // Spawn subthreads. if( status ) status = Activate(); return status; }

Elevators Class Details Continued float Elevators::CalcAdjustments() { float length = 0.0; if( _altChgRate != 0.0 ) length = RATE *(_altDeviation/_altChgRate); float angle = 0.0; if( length != 0.0 ) angle = atan( length/_altDeviation ); return (_pitch + angle); }

Altimeter Class Detail void Altimeter::MonitorAltitudeDeviation( void* pid ) { Altimeter* a = (Altimeter*)pid; for( ;; ){ // Lock. a->_mutex->Acquire(); float current = a->ReadAltitude(); a->_altDeviation = a->CalcDeviation( current ); if( a->IsReportable() ){ a->ReportDeviation(); } // Unlock a->_mutex->Release(); } Thread function example

Vertical Speed Gyro Detail void VerticalSpeedGyro::Register( Elevators* e ) { // May eventually want to store // this into a subscribers list. _elevators = e; } void VerticalSpeedGyro::ReportChangeRate( float changeRate ) { _elevators->Update( VSI, changeRate ); } Register-Update example

Attitude Gyro Detail Perhaps, the composite pattern would’ve helped solve the complexity of this class. bool AttitudeGyro::DeactivatePitchMonitoring() { _pitchMutex->Acquire(); _pitchTask->Cancel(); _pitchMutex->Release(); return true; }

System Interaction Classes Test drivers. They generated data for the instruments.

SI Classes - Details Composite Pattern Not really a gyro

OS Abstraction Layer Although, these classes are concrete, their design is intended to act as a framework for this autopilot to work on different OS.

OS Abstraction Layer Details Relying on POSIX threads

References Coad, Peter. Object Models: Strategies, Patterns, & Applications. 2nd ed. New Jersey:Prentice Hall,1997