© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software ) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.

Slides:



Advertisements
Similar presentations
Robofest 2005 Introduction to Programming RIS 2.0 RCX Code.
Advertisements

Yokogawa Network Solutions Presents:
© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software ) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
IGCSE ICT Control Systems.
DETAILED DESIGN, IMPLEMENTATIONA AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Lab7: Introduction to Arduino
Real-Time Embedded Systems
© S. Ramesh / Kavi Arya / Krithi Ramamritham IT-606 Embedded Systems (Software) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
Slide 1CPU Emulator Tutorial This program is part of the software suite that accompanies the book The Digital Core, by Noam Nisan and Shimon Schocken 2003,
Discrete Control Logic 1. Pneumatic circuits - Low forces - Discrete, fixed travel distances - Rotational or reciprocating motion Main components: compressor,
In this presentation you will:
COMPUTERS AND INPUT SENSORS. cbc MICROCOMPUTER OPERATION HAPPENS IN STAGES Memory.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 2.
Esterel Overview Roberto Passerone ee249 discussion section.
MegaSquirt and MegaSquirt Logo are trademarks of BG Soflex, LLC. MegaShift 4L60E Transmission Controller GPIO Program.
Laboratory 5: Introduction to LabVIEW. Overview Objectives Background Materials Procedure Report / Presentation Closing.
Programmable Logic Controllers Mary Holleboom ENGR 315 Dec. 5, 2001.
Conceptual Model by Aaron Garrett and David Thornton Mindstorms Internet Control Environment.
LEGO Mindstorms Hitachi H8-based RCX brick B.A. Juliano, R.S. Renner, F. Jauregui January 2004 California State University, Chico Intelligent Systems Laboratory.
Chuang-Hue Moh Spring Embodied Intelligence: Final Project.
The NXT is the brain of a MINDSTORMS® robot. It’s an intelligent, computer-controlled LEGO® brick that lets a MINDSTORMS robot come alive and perform.
Black Box for vehicle diagnostics. 2 Abstract This project is an implementation of black box for vehicular safety. Key features: Diagnostic check of vehicle.
1 isr Institute for Sustainable Resources CRICOS No J Automated Greenhouse Gas Measurement System.
Open and Closed Loops Standard Grade Computing Studies.
Computer Organization
S. A. spoločnosť s r.o. Bratislava. Core activities of the S. A. 4 Computer technics 4 Data transfer services 4 Fiscal modules - POS 4 Software 4 Control.
Operator Panel and Programmable Logic Controller.
Experts in Chem-Feed and Water Treatment An Overview of Possibilities Dulcometer Disinfection Controller ( DDC )
Self Guided Tour of TagMate™QC Display Tag DATA Tag Data: PRINT TagMate™QC SETUP Display STATS Tags: START and READ SEND All Data to PC Additional Capabilities.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
RP10 Robotics Platform RP10 Robotics Platform Team Cyberdyne Final Presentation Sahil Verma Adam Nabinger Paul Berens Joseph Wertz Karl Orosz Jeff Kinner.
EasyC Programming Workshop January 30, 2008 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
How to use Touch Screen SeneS Technology. Co, Ltd.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
TECHNICAL TRAINING SMART COMMANDER System Requirements CPU : 800MHz and aboveCPU : 800MHz and above Memory : 256MB RAM or HigherMemory : 256MB.
SLego: A Squeak Implementation of Lego Mindstorms Alexandre Bergel Institut fuer Mathematik und Informatik University Bern
Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks.
© S. Ramesh / Krithi Ramamritham / Kavi Arya 1 IT-606 Embedded Systems (Software) S. Ramesh Krithi Ramamritham Kavi Arya KReSIT/ IIT Bombay.
Castor Bot. Now, we will begin creating a robot Log onto your computer On your screen, click on the website labeled “castor bot” Your building instructions.
© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software ) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay.
1 Software. 2 What is software ► Software is the term that we use for all the programs and data on a computer system. ► Two types of software ► Program.
Laboratory 7: Sensors. Overview Objective Background Materials Procedure Report / Presentation Closing.
OBSTACLE AVOIDANCE ROBOT
Minds and Computers 2.1 The RCX l Hitachi H8/3297 series processor l 3 inputs/sensors (1, 2, 3) l 3 outputs/motors (A, B, C) l 32k RAM/ 16k ROM ä 12 kB.
CUE – Make Any Pump an E-Pump
Service Section Technical Training December 2005.
Mindstorms 1.1 Today’s topics l AI l History of Robotics l Uses of robots l The RCX l ROBOLAB l Upcoming ä Basic control ä Kinematics ä Robot architectures.
Controlling a Robot with a Neural Network n CS/PY 231 Lab Presentation # 9 n March 30, 2005 n Mount Union College.
目录 12 in 1 Sensor Features ● PIR motion sensor ● Ultrasonic sensor ● LUX sensor ● Temperature sensor ● 2 Dry contacts ● 2 external condition inputs ● IR(infrared)
Teaching Digital Logic courses with Altera Technology
EG1003: Introduction to Engineering and Design Laboratory 4: Sensors.
Introduction to LabVIEW
An operating system (OS) is a collection of system programs that together control the operation of a computer system.
How to Recover Deleted Photos from Android Cell Phone? Android is keeping on improving their products and make sure to provide the best software service.
Embedded C- Language Lets Learn fundamentals !!. An Embedded system is combination of computer hardware and software, and perhaps additional mechanical.
Introduction to LEGO Mindstorms EV3 What is in the box?
Voice Controlled Robot by Cell Phone with Android App
Real-time Software Design
Credits: 3 CIE: 50 Marks SEE:100 Marks Lab: Embedded and IOT Lab
Data Logging & Control Systems
Microcontroller Applications
Haiwell PLC Modules Introduce
Esterel By: Sam Weinberg.
Music by Touch Music by Touch Presentation > TeachEngineering.org
Robot Programming Computer Literacy S2.
ACOE347 – Data Acquisition and Automation Systems
LEGO Education - Mindstorms EV3 - Computer/control center – The Brick
LEGO Mindstorms Robot and Java
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

© S. Ramesh / Kavi Arya / Krithi Ramamritham 1 IT-606 Embedded Systems (Software ) S. Ramesh Kavi Arya Krithi Ramamritham KReSIT/ IIT Bombay

© S. Ramesh / Kavi Arya / Krithi Ramamritham 2 Esterel Tools & Illustrative Examples S. Ramesh

© S. Ramesh / Kavi Arya / Krithi Ramamritham 3 Esterel Tools Compiler –C-code for simulation –C-code for target implementation in SW –bliff code for implementation in HW and verification Simulator - Xes Verifer –Xeve –fctools –atg

© S. Ramesh / Kavi Arya / Krithi Ramamritham 4 Make file - An example all: blif genc obj es blif: esterel –Lblif :-soft -causal -main simple auto.strl genc: esterel -simul -main simple auto.strl obj: gcc -w -c auto.c es: xes auto.o

© S. Ramesh / Kavi Arya / Krithi Ramamritham 5 The simulation tool - Xes

© S. Ramesh / Kavi Arya / Krithi Ramamritham 6 Verification Tools Xeve –converts bliff code into fc2 format –hiding of signals FcTools –Automata minimization –Automata abstractions Atg –display of automaton –Manual inspection

© S. Ramesh / Kavi Arya / Krithi Ramamritham 7 Code generator Compiler (without special options) produces – reactive engine that implements the automaton – one function for each input signal the reactive engine is just a procedure user has to write a main program that calls the engine user has to write a function for each output signal and sensor when to call the engine, which input signals are simultaneous decided by the user the engine calls the output functions

© S. Ramesh / Kavi Arya / Krithi Ramamritham 8 Example Main:: every milli second for every input that has occurred call f_input(par); call f_kernel; end Assume interface functions run concurrently with the main program Input parameter gets the value from specific registers or memory f_kernel calls output functions corresponding to emitted outputs

© S. Ramesh / Kavi Arya / Krithi Ramamritham 9 A Simple Example An Auto Controller: initially waits for the engine to be on when car is running, acceleration/deceleration controls the throttle valve car stops when the ignition is off

© S. Ramesh / Kavi Arya / Krithi Ramamritham 10 The code module simple: input ignition_on,ignition_off,accel; output control_throttle; loop abort await ignition_on; every accel do emit control_throttle end every when ignition_off end end module

© S. Ramesh / Kavi Arya / Krithi Ramamritham 11 Use of Esterel Tools compile the program to simulate (-simul option) compile the program to generate bliff code use xeve to generate automaton use atg for visual display

© S. Ramesh / Kavi Arya / Krithi Ramamritham 12 Automaton for Simple controller

© S. Ramesh / Kavi Arya / Krithi Ramamritham 13 A Complex Controller Additional safety feature: monitors status of the door (closed or open) while in motion sends out alarm when door opens ensures that doors are closed while starting

© S. Ramesh / Kavi Arya / Krithi Ramamritham 14 The code module complex: input ignition_on,ignition_off,accel; input door_opened, door_locked; output alarm,control_throttle,door_lock; loop abort await ignition_on; emit door_lock; loop await door_locked; abort every accel do emit control_throttle end every when door_opened; emit alarm; emit door_lock; end; when ignition_off end end module

© S. Ramesh / Kavi Arya / Krithi Ramamritham 15 Automaton for Complex controller

© S. Ramesh / Kavi Arya / Krithi Ramamritham 16 Lego Mindstorm Robot

© S. Ramesh / Kavi Arya / Krithi Ramamritham 17 Mindstorms robots Smart toys assembled using certain Lego bricks called, Robotics Invention System –RCX brick (microcomputer), inspired by MIT media lab. Programmable Brick –touch sensors –light sensor –Motors –IR Transceiver –Serial cable

© S. Ramesh / Kavi Arya / Krithi Ramamritham 18 RCX Lego Micro computer –8 bit 16 MHz Hitachi controller –8K ROM, 19K RAM –Supports three touch sensors, three motors and one light sensor –Programmed using PC –Loaded using IR transmitter connected through serial cable Programmed using RCS programming language Program receives sensor inputs and controls motor movements

© S. Ramesh / Kavi Arya / Krithi Ramamritham 19 Synchronous Programming Mindstorms can be programmed using synchronous languages, like Esterel. Thanks to an effort by some french groups – Makes use of LegOS, its tools and APIs

© S. Ramesh / Kavi Arya / Krithi Ramamritham 20 LegOS An open source OS for lego Mindstorms initiated by Markus L. Noga –Web page: Supports (version 0.2.0) –Dynamic loading of programs and modules –Full IR packet networking –Preemptive multitasking –Dynamic memory management –Drivers for all RCX subsystems

© S. Ramesh / Kavi Arya / Krithi Ramamritham 21 Cross Compilation The OS cross - compiled on a PC and downloaded onto the RCX via IR transceiver Runs in both Linux and windows Provides many APIs for application programs –Inputting from Sensors –Actuating motors Application programs (in C) use these APIs to control cross-compiled and loaded onto the RCX

© S. Ramesh / Kavi Arya / Krithi Ramamritham 22 Esterel Programming Applications can be written in Esterel An extension of Esterel compiler is available Need to use specific names for inputs and outputs –touch_1, touch_3, motor_a_speed, motor_b_speed, cputs etc. Here is an example

© S. Ramesh / Kavi Arya / Krithi Ramamritham 23 A simple program module lego1 : input TOUCH_1, TOUCH_3; output MOTOR_A_SPEED(integer), MOTOR_C_SPEED(integer), MOTOR_A_DIR(integer), MOTOR_C_DIR(integer), CPUTS(string); relation TOUCH_1 # TOUCH_3; constant MOTOR_FWD, MOTOR_REV, MAX_SPEED : integer;

© S. Ramesh / Kavi Arya / Krithi Ramamritham 24 var t : integer in emit MOTOR_A_SPEED(MAX_SPEED/2); emit MOTOR_C_SPEED(MAX_SPEED/2); loop emit MOTOR_A_DIR(MOTOR_FWD); emit MOTOR_C_DIR(MOTOR_FWD); emit CPUTS("fwd"); await [TOUCH_1 or TOUCH_3]; present TOUCH_1 then t:=1; else t:=3; end present;

© S. Ramesh / Kavi Arya / Krithi Ramamritham 25 emit MOTOR_A_DIR(MOTOR_REV); emit MOTOR_C_DIR(MOTOR_REV); emit CPUTS("rev"); await 100 tick; % 1 tick = 1 ms if t=1 then emit MOTOR_A_DIR(MOTOR_FWD); emit CPUTS("right"); else emit MOTOR_C_DIR(MOTOR_FWD); emit CPUTS("left"); end if; await 100 tick; % 1 tick = 1 ms end loop end var.

© S. Ramesh / Kavi Arya / Krithi Ramamritham 26 Compiling This program can be simulated Compiled using the extended compiler to generate C code Use legOS cross compiler to generate code and download onto the RCX Look at the web-site for more examples

© S. Ramesh / Kavi Arya / Krithi Ramamritham 27 A Simple Case-study Plastic Injection Controller a simple controller controls a plastic injection unit. The unit injects plastic material from a tank into a molding chamber When chamber is empty, a motor started in the forward direction motor moves a piston until it reaches position B

© S. Ramesh / Kavi Arya / Krithi Ramamritham 28 Illustration (contd.) motion is reversed until position A reached in the opposite direction plastic material in the tank heated by a coil temperature of the tank controlled between T min and T max

© S. Ramesh / Kavi Arya / Krithi Ramamritham 29 Time Constraints motor must stop within  in time units after signals A and B are emitted as otherwise, the piston might get stuck contact switch made on/off within  temp after temperature limits T min and T max reached to avoid boiling and keep it flowing

© S. Ramesh / Kavi Arya / Krithi Ramamritham 30 The code: module simple: constant T_min=30:integer, T_max=100:integer; input A,B,form_empty; sensor Temp: integer; output motor_on(boolean), motor_off; output contact_on,contact_off; relation A#B;

© S. Ramesh / Kavi Arya / Krithi Ramamritham 31 [ loop if ?Temp T_max then emit contact_off end; await tick; end || loop await form_empty; emit motor_on(true); await B; emit motor_on(false); await A; emit motor_off; end ] end module

© S. Ramesh / Kavi Arya / Krithi Ramamritham 32 Use of Esterel Tools

© S. Ramesh / Kavi Arya / Krithi Ramamritham 33 A Cruise Controller A more complex auto controller: includes the feature of cruise mode of driving illustrates the features like modules, valued signals and procedure calls

© S. Ramesh / Kavi Arya / Krithi Ramamritham 34 module cruise: input cruise; input accel,brake_pressed; input engine_off; input accel_released,ignition_on; input belt_fastened,belt_unfastened; output chk_belts,start_engine; output control_throttle:double; output alarm; input current_speed:integer; output cruising; procedure increase_speed(double)(integer); procedure compute_throttle(double) (integer,integer);

© S. Ramesh / Kavi Arya / Krithi Ramamritham 35 loop await ignition_on; emit chk_belts; await belt_fastened; emit start_engine;

© S. Ramesh / Kavi Arya / Krithi Ramamritham 36 abort [ loop abort run manual_mode; when cruise; abort run cruise_mode; when brake_pressed; end loop when engine_off end loop end module || every belt_unfastened do emit alarm end ]

© S. Ramesh / Kavi Arya / Krithi Ramamritham 37 module manual_mode: input accel_released,accel; output control_throttle:double; var th$_value:=5.0:double,val:=0:integer in loop abort every accel do emit control_throttle(th_value + 2.0); end every when accel_released; end end var end module

© S. Ramesh / Kavi Arya / Krithi Ramamritham 38 module cruise_mode: input current_speed:integer; output control_throttle:double, cruising; procedure compute_throttle(double) (integer,integer); var cruise_speed:=?current_speed:integer, th_value:double in cruise_speed:=?current_speed; every tick do call compute_throttle(th_value) (?current_speed,cruise_speed); emit control_throttle(th_value); emit cruising end end var end module

© S. Ramesh / Kavi Arya / Krithi Ramamritham 39 A Train Controller controls the movement of an automatic train train moves back and forth between a set of stations no request means the train is idle at one of the stations request are serviced eventually door is closed when the train is in motion buttons are provided inside the train and in the stations

© S. Ramesh / Kavi Arya / Krithi Ramamritham 40 module Train: input d_closed, d_opened, stn_arrived(integer); input request(integer); output d_close,d_open, t_run, t_stop; loop var X: integer in emit d_open; await d_opened; await request; X:=?request; emit d_close; await d_closed; trap Stop in

© S. Ramesh / Kavi Arya / Krithi Ramamritham 41 loop abort sustain t_run when stn_arrived; if X=?stn_arrived then emit t_stop; exit Stop; end end %loop end %trap end %var end %outer loop end module

© S. Ramesh / Kavi Arya / Krithi Ramamritham 42 A mine pump controller controls a pump that drains excess water in the mines pump should start draining when water level is high pump has to stop when water is too low mine has methane which is combustible when the pump is on high dose of CO is lethal warnings are to be issued auto and manual mode for pump pump is started and stopped under operator control default is auto

© S. Ramesh / Kavi Arya / Krithi Ramamritham 43 module pump_controller: input start,stop,methane,co,hw_level; input lw_level,manual; input auto; output p_run,p_stop,m_alarm,c_alarm; [ loop abort loop await hw_level; await immediate [ not methane ]; abort sustain p_run

© S. Ramesh / Kavi Arya / Krithi Ramamritham 44 when [ methane or lw_level ]; emit p_stop end when manual; abort loop await start; await immediate [ not methane ]; abort sustain p_run when [methane or stop]; emit p_stop; end

© S. Ramesh / Kavi Arya / Krithi Ramamritham 45 when auto; end loop || every methane do emit m_alarm; end every || every co do emit c_alarm end every ] end module