Microcontrollerbased Data AcquisitionControl Applications and Synchronization of Sampleddata

Microcontroller-based Data Acquisition/Control Applications and Synchronization of Sampled-data Chaotic Systems Sang-Hoon Lee Department of Mechanical and Aerospace Engineering Polytechnic University, Brooklyn, NY 11201

Outline Lee • Motivation • Chaos and Synchronization • Goals • Motivation and goals • Prior research • Master-slave synchronization • Hardware components • Problem formulation • Software components • Control design objective • Coupled two-tank system • Chua’s system • System model & ID • Experimental setup • Proposed research—II 1

Motivation PC-based data acquisition and control (DAC) boards • High-end DAC boards (e. g. , Quanser and National Instruments) – Advanced hardware capabilities and sophisticated software environment – Drawback: cost! (hundreds to few thousand dollars) • DAC boards supported by MATLAB – Costly and usually include additional hardware features that may not be fully used (e. g. , high sampling rates and high resolution analog to digital converter) • Low-end DAC boards – Relatively low cost – Drawback: use proprietary software • Graphical User Interface (GUI) capabilities are nonexistent for microcontrollers – Microcontrollers are not designed to directly interact with human beings – Microcontrollers are directly embedded into automated products/processes Lee 2

Goals • Develop a low-cost MATLAB-based DAC systems by exploiting – Microcontrollers – MATLAB – Simulink (Dials and Gauges Blockset) – Serial communication capabilities of MATLAB and microcontrollers • The GUIs which will be designed using our framework allow the user to – Vary control commands – Acquire sensory data – Perform data processing – Visualize and control data using realistic looking virtual instruments • Use the MATLAB DAC toolbox to facilitate – Automatic generation of proper program codes for a variety of sensors and actuators – Automatic programming of the microcontrollers – Data communication between the microcontrollers and MATLAB Lee 3

Prior Research • BASIC Stamp 2 (BS 2) microcontroller to Lab. VIEW interface by Radcliffe, 2001 • An approach to endow BS 2 microcontroller with GUI capabilities by interfacing it with MATLAB by Li, Harari, Wong, and Kapila, 2004 Lee 4

Hardware Components–PIC • Microcontrollers are designed to interface to and interact with electrical/electronic devices, sensors and actuators, and high-tech gadgets to automate systems – Directly embedded into the product or process for automated decision making – Do not have GUI capabilities that are common in many PC applications Peripheral Interface Controllers (PICs) • Inexpensive microcontroller units (few dollars) that include – Central processing unit – Peripherals: memory, timers, and I/O functions • PIC Assembly language • 35 single-word instruction set Lee • Various selection 5

Hardware Components–BS 2 • • • Lee BS 2 Microcontroller is a 24 -pin DIP IC based on Microchip Inc. ’s PIC 16 C 57 microcontroller – 32 bytes of RAM and 2 kilobytes of EEPROM of memory – 16 general-purpose digital input/output (I/O) pins that are user defined – BS 2 processing speed is approximately 4000 instructions/sec Board of Education (BOE) is a carrier board interfacing BS 2 to additional hardware – Provides DB 9 connector for BS 2 – Provides connectivity to BS 2’s general purpose I/O pins BS 2 installed on BOE transmits/receives data to/from the PC via serial communication BS 2 Board of Education 6

Hardware Components–Serial Communication • BS 2 and PC communicate through a RS-232 serial communication link – Allows user program to be sent to the BS 2 – Allows data exchange between BS 2 and PC – BS 2 maximum data exchange rate (Baud rate): 9600 kilobytes per second – PC identifies serial ports as COM ports • A DB-9 serial cable facilitates communication between BS 2 and PC Male DB-9 Connector Lee Pin assignments for a DB-9 serial cable data Pin # Label Signal Name Signal Type 1 CD Carrier detect Control 2 RD Received data Data 3 TD Transmitted data Data 4 DTR Data terminal ready Control 5 GND Signal ground Ground 6 DSR Data set ready Control 7 RTS Request to send Control 8 CTS Clear to send Control 9 RI Ring indicator Control 7

Software Components–PIC Assembly and PBASIC • PIC assembly language is a primitive programming language consisting of a 35 singleword instruction set • Parallax Beginner's all-purpose symbolic instruction code (PBASIC) is a high level programming language similar to BASIC • PBasic includes many of the same functions found in BASIC, plus microcontroller specific functions (e. g. , serial communication, PWM, I/O pin monitoring/ control, etc. ) • Key benefits of utilizing PBASIC as a microcontroller programming language: – Simple, high-level programming language to implement and debug microcontroller programs – Intuitive commands used for interacting with BS 2 hardware Lee 8

Software Components–MATLAB • MATLAB is an interactive technical computing software – MATLAB versions 6. 1 and higher support serial communication – Custom designed m-file functions provide serial communication functionality Lee 9

Software Components–Simulink • Simulink is a model-based, system-level, visual programming environment – Used to simulate and analyze dynamic systems using icon-based tools – User can design Simulink diagrams by: • Dragging and dropping Simulink blocks into a Simulink diagram • Connecting I/O ports of Simulink blocks • Changing Simulink block parameters Lee 10

Software Components–Dials and Gauges Blockset • Dials and Gauges Blockset provides a library of Simulink blocks that are in the form of visual, realistic-looking, virtual instruments – Transforms Simulink block diagrams into virtual control panels Small subset of Dials and Gauges blocks Lee 11

Coupled Two-Tank System • Two-tank system consists of: – Two liquid level tanks with orifices – Liquid level sensors at the bottom of each tank – Voltage controlled pump – Liquid basin • Pump provides the liquid infeed into Tank 1 • Outflow of Tank 1 becomes the liquid infeed to Tank 2 • Outflow of Tank 2 is emptied into the liquid basin • Two tanks have the same diameters and can be fitted with differing diameter outflow orifices Lee 12

Coupled Two-Tank System Model Lee 13

System Identification • Provide a fixed pump voltage to allow for steady state conditions to occur – Obtain system parameter ratios A/B and C/D • Fill Tank 1 with a fixed amount of water and let it drain out to Tank 2 – Compute the system parameters A and B using the transient response data • Fill Tank 2 with a fixed amount of water and let it drain out to the basin – Compute the system parameters C and D using the transient response data Lee 14

Proposed Research—I • Develop MATLAB and Simulink-based DAC toolbox by – Using BS 2 and PIC microcontrollers – Utilizing MATLAB, Simulink, and Dials/Gauges Blockset – Exploiting the serial communication functionality of MATLAB and the microcontrollers • Develop user-defined microcontroller libraries that allow – The generation of proper microcontroller codes for a variety of sensors and actuators – Programming of the microcontroller – Data communication between the microcontroller and MATLAB • Develop an experimental setup to show the effectiveness of our MATLAB-based GUI environment by performing liquid-level control of a coupled, two-tank system and – Design a classical PI controller for the system – Determine the system parameters by an experimental system identification study Lee 15

Chaos • Mostly described as a deterministic system that exhibits aperiodic behavior depending on the initial conditions Lee 16

Synchronization may give rise to chaos “Two oscillators” but for a proper parameter choice with a coupling they may synchronize School of fish Lee Flock of birds Team of robots 17

Motivation • Synchronization of chaotic oscillators: Secure communication systems – Use chaos to mask a transmitted signal – Recover the signal securely in reception using chaos synchronization • Sampled-data: improve robustness of secure communication – Noise corruption in analog signal transmission is a severe drawback • Pulse synchronization: particularly more realistic for real communication systems – Reduce power load – Reduce time delay • Sampled-data: design of robust and effective cooperative control algorithms for spatially distributed robots Lee 18

Goals • Design a periodic state feedback control law for global pulse synchronization of sampled-data chaotic system • Perform experimental validation of a sampled-data representation of Chua's oscillators implemented using microcontrollers and RF communication Lee 19

Master-Slave Synchronization—C. T. Case Master Synchronization + - Slave Vast literature! • Assumption: nonlinear vector function g(·) satisfies where Lee 20

Master-Slave Synchronization—Sampled-data Case • Euler approximation of continuous-time master and slave systems – Let u(t)=0, no loss of generality, and let h be the step-size for Euler approximation – Master system – Slave system using unidirectional coupling where • , Pulse synchronization … – Pulse control: K(k) is a periodic gain matrix 0 1 Lee 2 p-1 p p+1 21

Problem Formulation • Design control gains • Error system formulation • Error system for pulse synchronization so that where we have used , Lee 22

Control Design Objective • Sampled-data master-slave system need to be asymptotically synchronized for arbitrary initial conditions • Error system dynamics need to asymptotically converge to zero for arbitrary initial conditions Lee 23

Illustrative Example: Chua’s Circuit State-space model: Lee 24

Chua’s System—Sampled Data Representation Lee • Parameters of sample-data master Chua’s circuit and nonlinear function • Plots of double scroll attractors of the sample-data master Chua’s circuit 25

Experimental Setup Propeller demoboard 32 -bit processor 912 MHz RF transciever Lee 26

Proposed Research—II • Develop a state feedback controller for the pulse synchronization of a master-slave chaotic system in the sampled-data setting – Use the Euler approximation technique to discretize the system – Formulate the problem of global asymptotic synchronization of the system as equivalent to the states of a corresponding error system asymptotically converging to zero for arbitrary initial conditions – Use a discrete-time Lyapunov stability theory – Use a linear matrix inequality • Develop an experimental setup to validate our research by performing Synchronization of a sampled-data master-slave chaotic system based on Chua's circuit – Using Propeller microcontroller – RF wireless communication Lee 27
- Slides: 28