1 / 22

Lab 3

Lab 3. Real-Time Control of a Hot Air Plant using RTOS µC/OSII. Due Date: Week of Nov. 2 nd , 2010. Today's Activities. Lab 3 Presentation Special topic presentation Rate Monotonic Scheduling (RMS) Lab 2 demos. Lab 1 Development Environment. LabVIEW 2009 software Nios II IDE

barnettj
Télécharger la présentation

Lab 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 3 Real-Time Control of a Hot Air Plant using RTOS µC/OSII Due Date: Week of Nov. 2nd, 2010

  2. Today's Activities • Lab 3 Presentation • Special topic presentation • Rate Monotonic Scheduling (RMS) • Lab 2 demos.

  3. Lab 1 Development Environment • LabVIEW 2009 software • Nios II IDE • Altera Nios II Embedded Evaluation Kit

  4. Simple Hot Air BlowerPT 326 Process Trainer

  5. Lab 1 Architecture Control Signal Input Voltage UART Write Serial Read Altera Nios II LabVIEW Plant Comm. PID Controller Operator Input Plant Model UART Read Serial Write Feedback Signal Measured Voltage

  6. Plant/Controller Features

  7. Lab Requirements • Plant interface • Input from plant • Output to plant • PID control system • Operator Interface • LCD display • Operator input

  8. Plant Interface • Input from plant • Plant output voltage (from LabVIEW) • Output to plant • Heater control (manipulated variable) • Communication implemented using serial communication with termination character.

  9. Operator Interface - Inputs • Input from LCD touch screen • ON/OFF signal • Auto/Manual mode control • Setpoint voltage (Auto Mode) • Voltage input (Manual Mode)

  10. Operator Interface - Outputs • Output to LCD • Voltage/Time graph (Lab 1) + voltage setpoint • Current sampling time • Voltage reference • Voltage output (output to plant) • Proportional gain (Kc) • Integral time (Ti) • Derivative Time (Td) • Current time (HH:MM:SS)

  11. Operator Display

  12. PID Control System • m(t) = manipulated variable (output to plant) • r(t) = plant setpoint • c(t) = controlled variable (voltage from LabVIEW) • e(t) = plant error = r(t) – c(t) • Kp=Proportional gain • Ti = Integral time • Td= Derivative time

  13. PID Control Discrete Time Implementation • Where s(n) is the sum of errors • Ts = sampling time = ∆t

  14. Implementation Requirements • LabVIEW model • Two tasks: Plant Model task, communication task. • Data communication between tasks using queues. • Serial communication using termination character • Altera implementation • Must employ at least three tasks • PID controller must have a dedicated task • Semaphores used for data synchronization • Note that ALL timing requirements discussed in the lab manual MUST be implemented. • Task priorities MUST be discussed and justified in your report • Time delays on time critical tasks MUST be discussed and justified in your report

  15. Real-Time System Implementation – pg. 58-59 of lab manual

  16. Real-Time Constraints • Control system must operate with a sampling rate of [100-500] ms • ON/OFF buttons • Sampled every 2-5 seconds • Auto/Manual controls • Sampled every 2-5 seconds • Vinput and Vref buttons • Sampled every 1-2 seconds • Clock/Time • Must execute every 1 second • Operator display must be updated every 5 seconds

  17. Task Priorities • uC/OS II can manage up to 63 tasks • OS has it’s own system tasks • It is recommended that you DON’T use priorities 0-5 (Highest priority = 6) • Each task must be assigned a unique priority level. • The lower the priority number the higher the priority of the task • uC/OS II will always execute the highest priority task ready to run.

  18. Assigning Task Priorities • Assigning task priorities in complex real-time systems is a difficult job • Noncritical tasks should obviously be given low priorities • Most real-time systems have a combination of soft and hard requirements • Soft RT systems: tasks are performed as quickly as possible but they don’t have to finish by specific times • Hard RT systems: tasks must be performed correctly within the required time

  19. High Priority Low Task Execution Rate (HZ) Rate Monotonic Scheduling (RMS) • Priorities are assigned based on how often the tasks execute • Tasks with the highest rate of execution are given the highest priorities

  20. RMS Theorem– cont… • RMS makes a number of assumptions • All tasks are periodic (occur at regular intervals) • The CPU must always execute the highest priority task that is ready to run • Given a set of n tasks that are assigned RMS priorities, the basic RMS theorem states that all task hard-real time deadlines are always met if the following inequality holds

  21. Cont… • Where • Ei= maximum execution time of task i • Ti= execution period of task i • Ei/Ti = the fraction of CPU time required to execute task i • Note: CPU use of all time-critical tasks should be less than 70%

  22. Deadlines and Marking • Lab 3 is worth 12%. • 6% for the report, and 6% for the demo • The Demo is due Nov. 2nd, 2010 in the Lab. • The Report is due Nov. 2nd, 2010 in the Lab. • A signed group evaluation sheet must be submitted with the lab report

More Related