1 In this lecture, you will learn the following. 1. Basics of real-time control engineering 2. Effects of fixed and unfixed (also probably unknown) sampling.

Slides:



Advertisements
Similar presentations
Simulation of Feedback Scheduling Dan Henriksson, Anton Cervin and Karl-Erik Årzén Department of Automatic Control.
Advertisements

ECE 495: Integrated System Design I
1 1 Mechanical Design and Production Dept, Faculty of Engineering, Zagazig University, Egypt. Mechanical Design and Production Dept, Faculty of Engineering,
Lab7: Introduction to Arduino
Analog-to-Digital Converter (ADC) And
1 ECE 495 – Integrated System Design I ECE INTEGRATED SYSTEMS I Engineering Project Planning Timothy Burg.
ECE 893 Industrial Applications of Nonlinear Control Dr
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
Seismic Octave Programming for Analog/Digital Converters Michael W. Siekman Electrical and Computer Engineering Senior Capstone Design Project 2007 Advisor:
Data Acquisition Concepts Data Translation, Inc. Basics of Data Acquisition.
Using an FPGA to Control the Protection of National Security and Sailor Lives at Sea Brenda G. Martinez, Undergraduate Student K.L. Butler-Purry, Ph.D.,
Motor Control Lab Using Altera Nano FPGA
MotoHawk Training Model-Based Design of Embedded Systems.
Multidisciplinary Engineering Senior Design Project 6508 Controls Lab Interface Improvement Preliminary Design Review 11/11/05 Team Members: Michael Abbott,
Operating System - Overview Lecture 2. OPERATING SYSTEM STRUCTURES Main componants of an O/S Process Management Main Memory Management File Management.
Controls Lab Interface Improvement Project #06508Faculty Advisors: Dr. A. Mathew and Dr. D. Phillips Project Objectives This work focused on the improvement.
Design of a Control Workstation for Controller Algorithm Testing Aaron Mahaffey Dave Tastsides Dr. Dempsey.
Simulink ® From Simulink® 7 Getting Started Guide.
Wireless Data Acquisition for SAE Car Project by: J.P. Haberkorn & Jon Trainor Advised by: Mr. Steven Gutschlag.
Multidisciplinary Engineering Senior Design Project 6508 Controls Lab Interface Improvement Critical Design Review 2/24/05 Project Sponsor: EE Department.
Cambodia-India Entrepreneurship Development Centre - : :.... :-:-
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Capacitance Sensor Project
Distributed Control Systems Emad Ali Chemical Engineering Department King SAUD University.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
In this PPT, all the materials covered up for the PIC microcontroller set-up would be studied. Preliminary skills: Knowing of basic C grammar and basic.
11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou.
E-LABORATORY PRACTICAL TEACHING FOR APPLIED ENGINEERING SCIENCES W O R K S H O P University of Oradea, Romania February 6, 2012 G E N E R A L P R E S E.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
NETWORK CENTRIC COMPUTING (With included EMBEDDED SYSTEMS)
Basic Input Output System
A modern NM registration system capable of sending data to the NMDB Helen Mavromichalaki - Christos Sarlanis NKUA TEAM National & Kapodistrian University.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
LAB 1 MATLAB, dSPACE and Simulink
Electronics for PS and LHC transformers Grzegorz Kasprowicz Supervisor: David Belohrad AB-BDI-PI Technical student report.
Chapter 6 Control Using Wireless Throttling Valves.
Data Acquisition Data acquisition (DAQ) basics Connecting Signals Simple DAQ application Computer DAQ Device Terminal Block Cable Sensors.
Upgrade to Real Time Linux Target: A MATLAB-Based Graphical Control Environment Thesis Defense by Hai Xu CLEMSON U N I V E R S I T Y Department of Electrical.
MICROPROCESSOR INPUT/OUTPUT
Data Acquisition Systems
Foot Throttle Foot throttle device for lower limb rehabilitation.
Gauge Operation and Software by Scott A. Ager. Computer Recommendations 750 MHz Pentium III 64 Meg SRAM 40 Gig Hard Drive 1024 x 768 graphics CD Writer.
Other Chapters From the text by Valvano: Introduction to Embedded Systems: Interfacing to the Freescale 9S12.
Turbine Crane CRANES TURBINE NEA39. Turbine Crane PLANT STATUS! PV Daily Status Report.
HARDWARE INTERFACE FOR A 3-DOF SURGICAL ROBOT ARM Ahmet Atasoy 1, Mehmed Ozkan 2, Duygun Erol Barkana 3 1 Institute of Biomedical Engineering, Bogazici.
M.S. Thesis Defense Jason Anderson Electrical and Computer Engineering Dept. Clemson University.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Feedback Control system
Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015.
SIMULINK-Tutorial 1 Class ECES-304 Presented by : Shubham Bhat.
Electronic Analog Computer Dr. Amin Danial Asham by.
PPI-8255.
July 18, UCSD - R.A. de Callafon Short Intro to Micro Processors and I/O functions of our Kinetic Sculpture Control Box Raymond de Callafon.
Digital Control CSE 421.
Embedded Control Systems Dr. Bonnie Heck School of ECE Georgia Tech.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
ECE 101 Exploring Electrical Engineering Chapter 7 Data Acquisition Herbert G. Mayer, PSU Status 11/30/2015 Derived with permission from PSU Prof. Phillip.
실험 구성 (DC모터 속도제어) -Matlab xPC Target 이용
Software Troubleshooting Eliminate possible programming and timing errors by stopping all programs ( and ). Use the Executive program terminal and send.
KNU RTLAB A Real-Time Linux System For Autonomous Navigation And Flight Attitude Control Of An Uninhabited Aerial Vehicle Charles E. Hall, Jr. Mechanical.
Intelligent Control Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
MECH 373 Instrumentation and Measurements
Intro to USB-6009 DAQ.
Digital Control CSE 421.
Prototyping SoC-based Gate Drive Logic for Power Convertors by Generating code from Simulink models. Researchers Rounak Siddaiah, Graduate Student-University.
SCADA for Remote Industrial Plant
Microcontroller Applications
Operating Systems Chapter 5: Input/Output Management
Single Event Upset Simulation
Presentation transcript:

1 In this lecture, you will learn the following. 1. Basics of real-time control engineering 2. Effects of fixed and unfixed (also probably unknown) sampling rate on the control system performance. By using a simple system, we will demonstrate the effects of use of an real-time system and a nonreal-time system on the controller performance.

2 1. Basics of Real-Time Control Engineering Vast majority of the computer based systems operates in a way that some data produced by sensors or by something else are written to a file, which this may be a text (.txt) file or a data file (.dat), then the data are read by the computer, and the results produced by the algorithm embedded into the computer is written a file again. A real-time system, on the other hand, must be able to keep up with external events. Writing to or reading from a file takes a while and this may cause loosing some events occurring during the reading and/or writing period. Consider our famous motor control system again. It will be meaningless to write the speed and current information produced by speed and current sensors to a file, run the control algorithm by reading the data from the file, and finally write the resulting voltage information to a file again. During reading and writing period, a huge load may be suddenly loaded to the motor, and the control system will be failed to maintain the control objective in such a case. This example reveals only the “fastness” aspect of the real time systems. Let us take a look the definition of real time systems made by IEEE:

3 1. Basics of Real-Time Control Engineering A real-time system is one in which the correctness of a result not only depends on the logical correctness of the calculation but also upon the time at which the result is made available. * This definition emphasizes the notion that time is one of the most important entities of the system, and there are timing constraints associated with systems tasks. Such tasks have normally to control or react to events that take places in the outside world, which are happening in “real time”. Thus, a real-time task must be able to keep up with external events, with which it is concerned. ** *IEEE POSE Standard (Portable Operation System Interface for Computer Environments) ** Real-time Control Systems: A Tutorial, A. Gambier

4 1. Basics of Real-Time Control Engineering In general, real-time implementation of an analog feedback control system involves the following components. System to be controlled State measurement sensors for feedback Data acquisition system PC-based system with a real-time software Drive system Sensors measure the system states for feedback and produce a low amplitude electrical signal (voltage or current). A data acquisition system (generally a data acquisition card, or input ports of a microcontroller) receives this signal, converts it to a digital signal, and then sends to PC-based system that runs the control algorithm designed. Information produced by the control algorithm is sent by PC-based system (a host PC, or microprocessor unit of a microcontroller) to data acquisition system again. Data acquisition system converts this signal to an analog signal, and then sends it to drive system via its output ports. Main function of the drive system is to produce drive signals proper for the plant, that is, the system to be controlled. The drive system may be linear amplifier, or a power electronic system.

5 Let us consider our control system for PMDC motor : PMDC Motor Current sensor and encoder Quanser Q4 DAC A host PC and a target PC with xPC Target real- time software Linear amplifier Remember that we have three state variables; current, velocity, and position. For a full-state feedback, we will use a hall-effect current sensor and an encoder. The incremental encoder can be used for both velocity and position feedback. Quanser Q4 card receives sensor outputs, converts the analog current information to a digital one, and then sends measured values to target PC. The target PC downloads the control algorithm from the Simulink file in host PC, runs this code, produce the control input signal (voltage) information, and finally sends this information back to the host PC. The host PC transmits this signal to the Quanser card. The low-amplitude voltage at the output of the card is amplified by a linear amplifier. This actual control input signal is then supplied to the motor.

6 Real-time System SoftHard Dynamic Static SYSTEMS Non-Real-time System Speed and predictability are both critical. Response to input has to come at a precise time. System timing parameters are known before execution. Emphasis will not be upon the theory of real-time systems in this class. Instead, we will introduce the hardware and software that we will use during the experiments. But, even so, some important points explained below should be considered. In ECE 893, we use a Static, Hard Real-Time System. Degraded operation in a rarely occurring peak load can be tolerated. Timing parameters and the priority for tasks is modified at run-time.

7 Hard Real-time System Soft Real-time System D/A Error in output waveform Error in execution time Example: Produce a sinusoid output

8 MATLAB/SIMULINK have a toolbox called xPC Target. This toolbox enables you to real-time control prototyping and testing. It provides a library of drivers, a real-time kernel, and a host- target interface for real-time monitoring, parameter tuning, and data logging. You create a real-time testing environment for Simulink models by connecting a host computer (a laptop), a target computer (a desktop), and your hardware under test (PMDC motor). You connect the host computer running xPC Target, Simulink, and a C compiler to the target computer via a single TCP/IP communications link (an ethernet cable). You then connect the target computer to your hardware under test and download code generated by Simulink Coder from a Simulink model to the target computer via the communication links.

9 You create an xPC Target application using xPC Target with Simulink Coder to automatically generate and compile a C/C++ code representation of a Simulink model. You then download the target application via a LAN (Ethernet) connection from the host computer to the target computer. xPC Target enables you to access the target application and control it directly from the host computer using either the xPC Target Explorer tool or the MATLAB command line. You can download your target application, start and stop real-time test execution, change the sample time and stop time, and modify other target application properties. To monitor and acquire data, xPC Target includes scopes for both the host and target computers. Scopes support several trigger modes you can use to control the acquisition, timing, and duration of data collection. You can also display multiple signals in a single scope and attach multiple scopes to a single model. Signal monitoring enables you to view signal values at the current sample rate. Signal tracing lets you capture, store, and display bursts of data, similar to the behavior of a digital oscilloscope. Signal logging lets you acquire and store signals during the entire test execution. You can then upload the logged data to the host computer for signal display, analysis, or archiving.

Design a Simulink model on the host PC Program is downloaded to target for real- time execution Boot CD installs a real- time kernel on target Build the Simulink model Host and target coordinate for downloading programs Some parameters can be changed on host. This change is communicated to target. Host Computer Target Computer

11 System Output Feedback + _ Input Target PC xPC OS from Mathworks Q4 HIL Board Host MATLAB with Simulink C++ Programming Interface to Target PC User Interface Execute High-level Programs

4 x 14 bit Analog Inputs 4 x 12 bit D/A Outputs 4 Quadrature Encoder Inputs 16 Programmable Digital IO Channels 2 x 32 bit dedicated Counter/ Timers 2 External Interrupt sources 32 bit, 33MHz PCI Bus Interface Quanser Q4 card in the Target PC provides data acquisition for feedback. Output ports of the card is used to send the control signal calculated by the control algorithm implemented in Simulink to the linear amplifier.

13 Analog Out (D/A) Channels Ext Interrupt and Signal Pins (PWM,Watchdog) Analog In (A/D) Channels Encoder Channels Digital I/O Ports From Q4 board Q4 Terminal Board

14 Finally, a linear amplifier is used to produce actual control signals to be applied the system.

15 The Q4 cards being used for data acquisition and control are very useful… and very expensive. Read the manuals for voltage limitations and proper use. Download a supplementary document that explains in detail xPC Target setup, laptop configuration, Q4 card, linear amplifier calibration and some additional important issues from

16 The software and hardware introduced so far are not the only option to design and implement real time control systems. These are the things available in our labs. Of course there are some other software/hardware combinations to achieve a good real time performance. For example dSPACE provides a very useful hardware (dSPACE data acquisition card) and software (Real Time Interface - RTI) to implement the control algorithms embedded in MATLAB/Simulink environment.

17 2. Real Time vs. Non-Real Time In this section, we will use a very simple system to compare the effects of use of a real time system and a non-real time system on the controller performance. Consider the following first-order scalar system dynamics; where x is the state variable and u is the control input. The control objective is to drive x to a desired trajectory, x d. To observe the performance of the controller to be designed, an error signal can be defined as follows: Let’s use a simple PID controller to stabilize the system, where K p, K d, and K I are control gains. Having a real time system means that the control system software uses the last two samples of e ( t ) to calculate its derivative and integral with a fixed sampling period. This does not necessarily mean that the sampling rate must be fixed. Most of solvers provide variable (but known) step solving algorithms. By using Simulink, we will compare the controller performances with (i) fixed and known sampling period (to mimic a real time system), (ii) unfixed and unknown sampling period (to mimic a non-real time system).

18 First consider the following simulation. This blocks simulates the system with a fixed and known sampling rate. The desired trajectory is just a constant, 1, and the values of the control gains are K p =8, K d =3, and K I =0.01.

19 Time-variation of tracking error signal is shown in the following figure. After a very short transient, the error settles to a small constant and the system is stable.

20 Now we will use the same system, same control rule, and the same values of the control gains, but, for this time, we will also use some additional blocks to make the system a non- real time system. Newly-added “Variable Time Delay” block holds the last 10 samples of the error signal and “Uniform Random Number” block generates an integer ranging from 1 to 10 at each time step. In this way, the derivative and integrator embedded in PID Controller block use the existing value of the error signal and any random one of the last 10 sampled values of the error signal to calculate the derivative and integral of e ( t ). This means that this system is not a real time system anymore. Indeed, such a system can be used to simulate a non-real time system.

21 Time-variation of tracking error signal for this non-real time system is shown in the following figure. The tracking error goes to infinity as time goes to infinity. This implies that use of a non-real time system to implement the controller may make the overall system unstable even if your control system stable. This is the key point.