Real Time System Design - University Of Guelph

2y ago
11 Views
2 Downloads
2.55 MB
57 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Wren Viola
Transcription

9 /6 /2 0 1 2ENGG*4420Real Time System Design(mmayhew@uoguelph.ca)FVMI 219A (Connected to 219)Friday 2:30 - 5:20Monday 2:30 – 5:20ENGG*4420 Lab 111

9 /6 /2 0 1 2Today’s Activities General IntroductionLab 1 IntroductionFill in Fob formMake groups (min 2 students, max 3)Start work on Lab 1ENGG*4420 Lab 122

9 /6 /2 0 1 2General Introduction Course consists of 4 labs: Modeling the PT 326 Process Trainer. Real-Time Automotive SuspensionSimulator. Real-Time Control of a Hot Air Plantusing RTOS uC/OSII. Multi-Core Real-Time SuspensionControl using LabVIEW Real-Time OS.ENGG*4420 Lab 133

9 /6 /2 0 1 2 Demos and reports are due at the sametime. Both a hard copy of the report and anelectronic copy should be submitted. LabLabLabLab1:2:3:4:WeekWeekWeekWeekth28 /Oct.st14, Sep.thth6, Oct. 12 /Oct. 15ndth9, Nov. 2 /Nov. 5rdth12, Nov. 23 /Nov. 26ENGG*4420 Lab 144

9 /6 /2 0 1 2Marking Labs 1 and 2 4% for the 4% for the Labs 3 and 4 6% for the 6% for the- 8% each.demo,report.- 12% each.demo,report.ENGG*4420 Lab 155

9 /6 /2 0 1 2Group Evaluation Forms A group work evaluation form MUST besubmitted with every lab report. 90-W06.htm Individual student contributions for each labshould not vary beyond a small amount. E.g. /10% on 100% scale. For larger discrepancies, lab marks will bescaleddownforlowercontributionpercentages.6

9 /6 /2 0 1 2Modeling the PT 326Process TrainerDue Dates: Friday Sep.Monday Octst1 ,ENGG*4420 Lab 1th28 ,2012201277

9 /6 /2 0 1 2Lab 1 Development Environment LabVIEW 2009 software Nios II IDE Altera Nios II Embedded EvaluationKitENGG*4420 Lab 188

9 /6 /2 0 1 2Lab 1 – Simple Hot Air BlowerPT 326 Process TrainerENGG*4420 Lab 199

9 /6 /2 0 1 2Architecture for Labs 1 & 3ENGG*4420 Lab 11010

9 /6 /2 0 1 2Control of a Thermal SystemLabVIEWAltera11

9 /6 /2 0 1 2Plant ModelτdSVi Ke VO τs Equation (6)12

9 /6 /2 0 1 2LabVIEW Plant Implementation The Plant system is defined in LVusing transfer function VIs.Setup Plant Transfer FunctionExecute Plant System13

9 /6 /2 0 1 2Control System PID-based control system ProportionalIntegralDerivativeControl is based on an Error signal Implemented in LabVIEW using thePID VISet PointProcess VariableOutput14

9 /6 /2 0 1 2Lab Equations Unclear formulas for lab 1 in printedmanual. Eqn. 2(a), heat loss in control volume:1q t TR Eqn. 8(a), general formula for responseof first order system with dead time: τd t VO K ( Vinfinite Voriginal)(1 eτ)15

9 /6 /2 0 1 2Lab 1 Requirements/Steps Step 1: Study and understand theimplementation files provided: Hot Air Plant Model CD Vis Lab1.vi. Engg4420 example.c Engg4420 example.h C:\engg4420 lab1 labview C:\engg4420 lab1ENGG*4420 Lab 11616

9 /6 /2 0 1 2Lab 1 Requirements/Steps Step 2: Tune the PID controllerusing the Ziegler and Nicholsmethod. Perform BOTH open loop, and closedloop tuning procedures. Step 3: Establish communicationbetween LabVIEW and Altera. Step 4: Graph the plant output onthe Altera LCD.ENGG*4420 Lab 11717

9 /6 /2 0 1 2Introduction to LabVIEWENGG*4420 Lab 11818

9 /6 /2 0 1 2LabVIEW Graphical development environment. Usedformeasurements,dataacquisition, measurement analysis,report generation, plant modeling,control systems, Embedded Design,Signal Processing etc Dataflow Languagewww.ni.com/labviewENGG*4420 Lab 11919

9 /6 /2 0 1 2LabVIEW Virtual Instruments(VIs) Built in functions used to developapplications. Each VI requires a specific number ofinputs. Selecta VI and press “ctrl H” for informationregarding the VI.ENGG*4420 Lab 12020

9 /6 /2 0 1 2Front Panel Contains the user interface.ENGG*4420 Lab 12121

9 /6 /2 0 1 2Block Diagram Contains the VIs and the necessaryconnections. ExecutionControl(loops,structures, formula node, etc ). ArithmeticOperations,Communication.ENGG*4420 Lab 1caseFunctions,2222

9 /6 /2 0 1 2Altera Nios II EmbeddedEvaluation KitENGG*4420 Lab 12323

9 /6 /2 0 1 2Altera Nios II Board Devices16 MB of Intel P30/P33 flash.32 MB of DDR SDRAM.Color LCD touch-screen display.USB connector.Serial connector.10/100 Ethernet physical layer/mediaaccess control (PHY/MAC). Six push buttons total. Seven LEDs total. Embedded FPGA board. ENGG*4420 Lab 12424

9 /6 /2 0 1 2Altera Nios II IDE Altera - Nios II EDS 8.0 - Nios IIIDE 8.0 les’ Follow ‘ENGG4420 example.c’ forrelevant operations. LCD Multitasking Serial Comm.ENGG*4420 Lab 12525

9 /6 /2 0 1 2 uC/OS-II is a highly portable, very scalable,preemptive real-time, deterministic, multitaskingkernel. It can manage up to 64 tasks. Certain task priority levels are reserved. Lower Number Higher Priority. It has connectivity with uC/GUI and uC/FS. It is ported to more than 100 microprocessorsand microcontrollers. It supports all type of processors from 8 to 64bits.ENGG*4420 Lab 12626

9 /6 /2 0 1 2How to implement Lab1?1. Read chapter 1 of the lab manual.2. Preparation 1- Review the Implementationof the Plant System. Hot Air Plant Model Vis Lab1.vi!Hot Air Plant Model CD Vis Lab1.vi!3. Preparation 2 – Review and Analyze theimplementation of the uC/OSII tasks. ENGG4420 example.cENGG4420 example.h4. Preparation 3 – Establish connectionbetween LabVIEW and Altera board.ENGG*4420 Lab 12727

9 /6 /2 0 1 2How to implement Lab1? Cont.5. Tuning (Lab Manual section 1.3 – pg. 12) Perform Open and Closed loop tuning methodsto derive a set of workable PID constants.6. Implement the required communicationtasks in LabVIEW and NIOS-II.Talk to your TA if you are not familiar withPID controlENGG*4420 Lab 12828

9 /6 /2 0 1 2How to implement Lab1? Cont.6. Cont.a) LabVIEW- Transmit the plant outputvalue to the Altera board using serialcommunication.b) Altera- Receive the transmittedvalue and graph it on the LCD in RT.c) Altera- Send the output value backto LabVIEW.d) LabVIEW - Read the plant valuefrom serial IO and process it.ENGG*4420 Lab 12929

9 /6 /2 0 1 2Implementation Suggestions Use synchronization semaphores toorganize the communication process. Create a new RxTx uart task on theAltera board. Set a delay on the taskthat matches the LabVIEW sampleinterval. Create a separate task on the Alteraboard for graphing the voltagevalues.30

9 /6 /2 0 1 2How to set up yourProject: IMPORTANTAltera1. Navigate to:“C:\Altera\80\kits\cycloneIII 3c25 niosII\examples”2. Right-clickandcopythe“application selector” directory.3. Create a project directory on your Hdrive.4. Paste the “application selector” intoyour project folder.31

9 /6 /2 0 1 2How to setProject Cont.upyourAltera5. Open the NIOS-II IDE from the startmenu (found in the “Altera” submenu).6. In the “Project Location” window,enter the name of your projectdirectory. “H:\Your project directory\workspace”32

9 /6 /2 0 1 2How to setProject Cont.upyourAltera7. Click on the “Workbench” option inthe top right corner.33

9 /6 /2 0 1 2How to set up your AlteraProject Cont.8. In the workbench, go to “Tools Quartus II Programmer”.9. In the Programmer window, click on“Hardware Setup”.10.Choose “USB-Blaster”.34

9 /6 /2 0 1 2How to set up your AlteraProject Cont.11.Click “Auto-Detect” and highlight thedefault entry.12.Choose “Change File”13.Navigate to:“C:\altera\80\kits\cycloneIII 3c25 NiosII\examples\application selector”14.Select:“cycloneIII 3c25 NiosII applicationselector.sof”35

9 /6 /2 0 1 2How to set up your AlteraProject Cont.15.Click on “Start” to download the fileto the FPGA.Note: The Application Selector Must BeDownloaded Before You Will Be Ableto Load Your Project On the Board!36

9 /6 /2 0 1 2How to set up your AlteraProject Cont.16.In yourworkbench, go to“File Import”.17.Select “AlteraNIOS-II ExistingNIOS II IDEproject intoworkspace”.37

9 /6 /2 0 1 2How to set up your AlteraProject Cont.18.Browse to you project directory. “H:\your project directory\application selector\software”19.Import the “engg4420 lab1” folder.20.When prompted, click “Yes” to“Release and/or Debug 0 lab 1 syslib folder”38

9 /6 /2 0 1 2How to set up your AlteraProject Cont.22.You can now right click on the engg4420 lab1directory to build and run your project.39

9 /6 /2 0 1 2How to set up your AlteraProject Cont. Note:WheneveryouopentheNIOS-II IDE, youwill need to switchthe workspace toyour H drive as theIDE will default tothe C-drive.40

9 /6 /2 0 1 2Notes - How to set up HyperTerminal Start All Programs Accessories Communication HyperTerminal Assign aname to your hyperterminal select COM1 select 115200, 8,None, 1, None.ENGG*4420 Lab 14141

9 /6 /2 0 1 2Notes - LabVIEW Occasionally, you may need toconvert data for interconnectivity.This can be done using theconversion blocks (Mathematics Numeric Conversion)ENGG*4420 Lab 14242

9 /6 /2 0 1 2Notes - LabVIEW Local Variables can beused to give inputs tocontrols. They can befound in the “Structures”section of the functionpalette. You can configurethem to be either read orwritedependingtherequired operation.ENGG*4420 Lab 14343

9 /6 /2 0 1 2Notes - LabVIEW Queues provide a means of transmitting data. Queues can be used as an alternative to localvariables for passing data between tasks/loops. After creating a queue, elements can bequeued and dequeued. FIFO nature. VIs in “DataOperations”.Communication Queue44

9 /6 /2 0 1 2Notes - LabVIEW When setting up a feedback node,you need to wire in a constant fromoutside the loop for initialization.ENGG*4420 Lab 14545

9 /6 /2 0 1 2Notes - LabVIEW To easily locate VIs use the searchtool in the functions and controlspanels.ENGG*4420 Lab 14646

9 /6 /2 0 1 2Notes - LabVIEW The trace function can be used totrack internal signals on the blockdiagram. Note that since execution is slowed downwhilerunningtrace,timingandinterfacing will likely not work correctly.47

9 /6 /2 0 1 2Note – LabVIEW examples LabVIEWexamplescanbe found in the‘Help’Menuunder‘FindExamples’.48

9 /6 /2 0 1 2Note – LabVIEW examples Examplesusing specificVIs can befound throughthe‘contexthelp’.49

9 /6 /2 0 1 2Notes – Serial Communication LV serial comm. is performed using NIVISA. Perform the serial port write operationusing a termination char. See the “Advanced Serial Write andRead.vi” example.Setup serial comm.Write to serial portENGG*4420 Lab 1Read from serial port5050

9 /6 /2 0 1 2Note – Serial Communication Cont. Order of operations: Configure serial port: Enable read on termination char. Set termination char. Set timeout. Define VISA resource (COM1 or COM2). Define Baud rate . Define ‘write’ termination char. Define input buffer size. Write string (data must be in char not float). Close session at end.51

9 /6 /2 0 1 2Things to Note in the AlteraExample Task Creation Where are task stacks, priorities, etc. set? Where are tasks created and initialized? Semaphors and Mutexes How are they created? What functions are used to Pend and Post? Timing What functions can be used for delays? LCD Functions Look at header file as well as the main code.52

9 /6 /2 0 1 2Demo Marking Front Panel All necessary controls/graphs present Tuning Procedure Open and Closed loop Functional PID settings Altera Board Communication LCD Display Questions Answered individually, 2/3 chances53

9 /6 /2 0 1 2Lab Report General outline presented on Page 68of Lab Manual (Appendix A). Introduction & Problem Description System Requirements What do you have to implement? InputsOutputsCalculationsRelation to physical system, etc.54

9 /6 /2 0 1 2Lab Report Cont. Background Why use LabVIEW to simulate the system? PID tuning and comparison of results. Implementation Top-Down functional implementation Main modules and functions on each module Connections between modules DescriptionofLabVIEWandImplementations. Discussion of simulation parameters.Altera55

9 /6 /2 0 1 2Lab Report Cont. Include pictures of front panel, blockdiagram, and code snippets in mainreport where appropriate. Full images of front panel, blockdiagram, and all Altera code inAppendix.56

9 /6 /2 0 1 2Deadlines and Marking Lab 1 is worth 8%. 4% for the report, and 4% for the demo.thst The Demo is due Sep. 28 /Oct 1 , 2012 in theLab.thst The Report is due Sep. 28 /Oct 1 , 2012 in theLab. Physical and Electronic copy. A signed group evaluation sheet must besubmitted with the lab report. Do NOT include student numbers on lab report.ENGG*4420 Lab 15757

3 General Introduction Course consists of 4 labs: Modeling the PT 326 Process Trainer. Real-Time Automotive Suspension Simulator. Real-Time Control of a Hot Air Plant using RTOS uC/OSII. Multi-Core Real-Time Suspension Control using LabVIEW Real

Related Documents:

1.1 Hard Real Time vs. Soft Real Time Hard real time systems and soft real time systems are both used in industry for different tasks [15]. The primary difference between hard real time systems and soft real time systems is that their consequences of missing a deadline dif-fer from each other. For instance, performance (e.g. stability) of a hard real time system such as an avionic control .

Introduction to Real-Time Systems Real-Time Systems, Lecture 1 Martina Maggio and Karl-Erik Arze n 21 January 2020 Lund University, Department of Automatic Control Content [Real-Time Control System: Chapter 1, 2] 1. Real-Time Systems: De nitions 2. Real-Time Systems: Characteristics 3. Real-Time Systems: Paradigms

asics of real-time PCR 1 1.1 Introduction 2 1.2 Overview of real-time PCR 3 1.3 Overview of real-time PCR components 4 1.4 Real-time PCR analysis technology 6 1.5 Real-time PCR fluorescence detection systems 10 1.6 Melting curve analysis 14 1.7 Passive reference dyes 15 1.8 Contamination prevention 16 1.9 Multiplex real-time PCR 16 1.10 Internal controls and reference genes 18

Applied Biosystems 7300/7500/7500 Fast Real‐Time PCR System Applied Biosystems 7900HT/7900HT Fast Real‐Time PCR System Applied Biosystems ViiA 7 Real‐Time PCR System QuantStudio 6 Flex Real‐Time PCR System QuantStudio 7 Flex Real‐Time PCR System QuantStudio 12k Flex System

Real -time Real -life O riented DSP Lab Modules Abstract: In this p aper , we present a sequence of engaging lab exercises that implement real -time real -life signal/data acquisition, analysis, and processing using MatL ab , LabV iew, and NI myDAQ. Examples of these signals include real -time human voice and music signals.

Real-Time Analysis 1EF77_3e Rohde & Schwarz Implementation of Real -Time Spectrum Analysis 3 1 Real-Time Analysis 1.1 What “Real-Time” Stands for in R&S Real-Time Analyzers The measurement speed available in today's spectrum analyzers is the result of a long

real-time side to the non-real-time one, as shown in Figure 1. The information flow for the WaitFreeReadQueue is from the non-real-time side to the real-time one, as shown in Figure 2. When a NHRT wants to send data to a regu-lar Java thread, it uses the write (real-time) operation of WaitFreeWriteQueue class. Regular threads use the

6 Real Time Constraints Many Embedded Systems must meet real-time constraints zA real-time system must react to stimuli from the controlled object (or the operator) within the time interval dictated by the environment. zFor real-time systems, right answers arriving too late are wrong. Frequently connected to physical environment through sensors and actuators.