lecture and demo 1.pptx

35
ACS6110 - Part 1 EMBEDDED CONTROL SYSTEMS Dr Simon A Pope [email protected] AJB room C07d

Upload: umar-iftikhar

Post on 14-Apr-2016

12 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Lecture and Demo 1.pptx

ACS6110 - Part 1EMBEDDED CONTROL SYSTEMS

Dr Simon A [email protected] room C07d

Page 2: Lecture and Demo 1.pptx

Module AimTo demonstrate how the desired functionality of a system, for example; a control system, fault detection system, health monitoring system, etc., can be developed and implemented using a CPU and external devices into an embedded system application/device to perform the desired tasks in the “real” world:• Interfacing hardware associated with

embedded systems• Realising the desired functionality of an

embedded system through software

Page 3: Lecture and Demo 1.pptx

Module Timetable – week 1ACS 6110: Embedded Systems & Rapid Control Prototyping Date:18th - 22nd January 2016

09.00 - 09.50 10.00 - 10.50 11.00 - 11.50 12.00 - 12.50 14.00 - 14.50 15.00 - 15.50 16.00 - 16.50 MON

Lecture and Demo 1

1. Collection of Kit

2. Start the Introductory lab

SHSB PC Lab and Real-Time lab

Lab booked for self-study

SHSB PC Lab and Real-Time lab

TUE

Support session for the Introductory lab

SHSB PC Lab and Real-Time lab

Lecture and Demo 2

WED

Assessed Lab 1 - Digital I/O and Timers

SHSB PC Lab and Real-Time lab

T HU

Lecture and Demo 3

FRI

Assessed Lab 2 - Serial Communication, Polling and Interrupts

SHSB PC Lab and Real-Time lab

Lecture and Demo 4

Page 4: Lecture and Demo 1.pptx

Module Timetable – week 2ACS 6110: Embedded Systems & Rapid Control Prototyping Date: 25th - 29th January 2016

09.00 - 09.50 10.00 - 10.50 11.00 - 11.50 12.00 - 12.50 14.00 - 14.50 15.00 - 15.50 16.00 - 16.50 MON

Support Session for RTOS Lab

SHSB PC Lab and Real-Time lab Introduction to the final assignment

Lab booked for self-study

SHSB PC Lab and Real-Time lab TUE

Lab booked for self-study

SHSB PC Lab and Real-Time lab

WED

Lab booked for self-study

SHSB PC Lab and Real-Time lab

(Assignment due at the end of Wednesday - midnight)

T HU

FRI

Page 5: Lecture and Demo 1.pptx

StructureThe module contains substantial inquiry based learning using take home lab kit:• Lectures cover general concepts and background.• Demos show the implementation of some of the concepts

on a real system.• Additional reading covers additional concepts and more

detail on those covered in the lectures.• Labs provide further information on the concepts covered in

this module and allow you to gain experience implementing them.

Page 6: Lecture and Demo 1.pptx

Assessment2 x Labs following a structured lab sheet (12.5% each)These will be available on MOLE 48 hours before the start of the related assessed lab session and you can work through these in your own time. However you will need to attend the correct assessed lab sessions indicated in the timetable to get your work marked (e.g. work for Lab 1 will not be marked in the Lab 2 session).1 x Assignment (25%)The assignment will be released on MOLE immediately after Lecture 4 on the Friday week 1. It will describe a problem that needs to be solved using the STM Discovery kit and you will need to design a solution. The deadline for submission of the assignment will be 11.59pm on Wednesday of week 2 of ACS6110.

All assessed work is to be conducted individually

Page 7: Lecture and Demo 1.pptx

Further ReadingDetails about all additional recommended sources of information are available on MOLE:• The additional reading sheets• A link to a folder containing the data sheets

and support material for the STM Discovery board – you will need to download this to be able to use the equipment.

• A list of books and external sources.

Page 8: Lecture and Demo 1.pptx

Feedback• Questions answered by me during and after the lectures.• Verbal and general written feedback on the board from me

during in class tasks.• Verbal and general written feedback during the lab support

sessions.• Verbal feedback on your solutions during the assessed lab.• Written feedback on MOLE for your submitted assignment

(within 3 weeks)• General feedback to the whole class on module

performance.

Page 9: Lecture and Demo 1.pptx

Lecture 1Introduction to Embedded Systems• What is an embedded system?• Examples of embedded systems• Characteristics of embedded systems• Embedded systems case study

Page 10: Lecture and Demo 1.pptx

How do you realise a design?Theoretical idea/design

Model and simulate designRapid control prototyping

Embedded system

Introduction

Page 11: Lecture and Demo 1.pptx

IntroductionWhat is an Embedded System?• An embedded computer system is

any device that includes a programmable computer but is not itself intended to be a general-purpose computer

Page 12: Lecture and Demo 1.pptx

MP3 Player

Page 13: Lecture and Demo 1.pptx

Engine management unit

Page 14: Lecture and Demo 1.pptx

Wireless router

Page 15: Lecture and Demo 1.pptx

Generalisation

Microprocessor/Microcontroller OutputInput

MEM

Digital/Analog

Digital/Analog

Otherhardware

Storage of codeand data

Page 16: Lecture and Demo 1.pptx

Plant

Embedded Control System

Generalisation

PlantController 2

Controller 1

Controller 3

Embedded Control System

Page 17: Lecture and Demo 1.pptx

Engine management unitWhat are its functions?

• Sample the sensor signals (fuel/air flow rate, valve positions, throttle position, emissions, etc.).

• Determine how to vary the output signals such as the various valve positions.

• Output the determined voltages to adjust the desired output signals (valve positions, etc.) to provide the desired engine response.

Page 18: Lecture and Demo 1.pptx

Characteristics of Embedded Systems• Embedded systems constitute the widest possible use of

computer systems• Fastest growing market of microprocessors• Widest range of hardware (power and cost)

• Usually designed to perform selected functions at low-cost• Potentially high volume manufacture.• Price of an embedded system is a key factor in the

design

Page 19: Lecture and Demo 1.pptx

Hardware specification• Speed and cost requirements are different for each

application • Can require some form of user interface• Embedded systems often use custom hardware (e.g. DSP)

to perform computationally intensive functions combined with lower power CPU.

• Power consumption affects cost of hardware, battery life and also weight

• Minimise memory (code and data size)• Minimise processor speed

Page 20: Lecture and Demo 1.pptx

Microprocessors / Microcontrollers

• Processors are the hub of embedded systems:• Microprocessor – general purpose chip• Microcontroller – Designed with specialist

functionality in mind. Microcontrollers can contain memory, A/D, UARTS, DSPs all within the same integrated circuit.

• Microprocessors are a very efficient way to implement digital systems and vastly reduce the complexity of digital circuits

Page 21: Lecture and Demo 1.pptx

Canon IXUS 130

Canon IXUS 105

Both use the same digital image processor

Broadcom microprocessor updated over several versions (125MHz increased up to 216MHz), while case and other components such as memory remained the same

Linksys WRT 54G series of wireless routers

Page 22: Lecture and Demo 1.pptx

Software specification• The program and data which enables most of the functions

of embedded systems, particularly basic functions, is often called firmware. Usually it cannot be altered by the user.

• In some cases additional software can be used to add more user functionality.

• Firmware/Software on embedded systems often run with real-time constraints and limited hardware resources.

Page 23: Lecture and Demo 1.pptx

Reliability• Embedded systems often run continuously for years without

errors and may be outside the reach of humans:• Often avoid moving parts (rotating disk drives) in

favour of solid state devices (flash memory)• Firmware developed and tested more rigorously than

software for PCs

Page 24: Lecture and Demo 1.pptx

Hard and Soft Real-Time Embedded Systems• Many embedded systems have a real-time constraint

Actions/Outputs must occur in a timely fashion (e.g. valve timing in an engine)

Software routines / calculations may be time bound (e.g. data transfer between devices must occur before a deadline)

• There is a distinction between hard real-time systems and soft real-time systems: Hard real-time: the response time is critical. Otherwise

catastrophic! (e.g. valve timing in an engine) Soft real-time: delays can be tolerated - system

behaviour is still acceptable (e.g. data transfer between devices on a network often fall into this category. Equally in some industrial situations they could be hard)

Page 25: Lecture and Demo 1.pptx

Periodic and Aperiodic Real-Time Tasks• Many real-time systems are composed of multiple tasks →

periodic or aperiodic• Periodic tasks have a continuous and deterministic pattern

of time intervals between requests of a resource. (e.g. sampling a sensor output). Can be characterised by a tuple:

• the request period• the service time

• Aperiodic tasks request resources at non-deterministic periods (e.g. read/write to a data port such as the WAN port on a network)

• Real-time tasks must be scheduled to be completed before a deadline → Scheduling algorithms

Page 26: Lecture and Demo 1.pptx

In class task• In groups (or on your own) select an example of

an embedded system.

• Determine what the expected tasks of the system are by consideration of its main functions.

• Are these tasks hard or soft?

• Which would you expect to be periodic and which aperiodic?

Page 27: Lecture and Demo 1.pptx

Who designs embedded systems?• Application/Systems design engineers

• Hardware engineers

• Software engineers

Page 28: Lecture and Demo 1.pptx

• One of the first recognisably modern embedded systems: Apollo Guidance Computer

• Ran the inertial guidance system of both the command module and Lunar Module (LEM)

Page 29: Lecture and Demo 1.pptx

Case Study – Apollo Guidance Computer

• Each of the moon bound Apollo missions (except Apollo 8) carried two AGCs, one in the Command Module (Guidance & Navigation System) and one in the Lunar Module (Primary Guidance, Navigation and Control System).

• CPU: 2.048 MHz crystal clock• Central Registers: Four 16-bit registers for general

computational use, including an accumulator and program counter.

•  Other Registers: Used internally during operation, including sequence register, memory buffer, ADDER register, pre-fetch register and four 16-bit input and four 16-bit output registers.

Page 30: Lecture and Demo 1.pptx

• Memory: ROM (Block I: 24Kb words, Block II: 32 Kb words), RAM (Block II: 4Kb words)

•  Data Bus: 16-bit read/write•  Device Control: 5 vectored interrupts•  Software: Written in AGC Assembly Language. It included

a real time operating system with an executive to schedule tasks allowing multitasking (running up to 8 tasks simultaneously)

• All of these concepts will be covered later in the course and it will become evident that even the earliest embedded system contains components that are still widely used today.

Page 31: Lecture and Demo 1.pptx

Summary• Module Timetable and Structure• Module Assessment• What is an embedded system?• Characteristics of embedded systems• Examples of embedded systems• Some brief definitions:

• Hard and soft real-time systems• Periodic and aperiodic tasks

Additional reading document – Bits, bytes and bitwise logic operations.

Page 32: Lecture and Demo 1.pptx

Demo 1Introduction to the individual lab kit• Introduction to the STM32F4Discovery• Introduction to the Keil µVision

programming environment• Developing your first basic program

Page 33: Lecture and Demo 1.pptx

The STM32F4 Discovery board

- An embedded system for teaching and learningProcessor• ARM Cortex M-4

• 32-bit and clocked up to 168MHz

• 1 MB Flash• ADC, DAC, SPI, I2S, UART,

etc.

Peripherals• Accelerometer (LIS3DSH)• Microphone and audio driver• 4 general user

programmable LEDs• 1 user programmable push-

button• Micro and mini USB

connectors

Base board

STM32F4Discovery

Page 34: Lecture and Demo 1.pptx

Keil µVision - The programme development environment

• Supports the STM32F4 Discovery

• Contains peripheral drivers and a Real-Time Operating System

• Program development and debugging interface

• Compiler and Simulator

Page 35: Lecture and Demo 1.pptx

Using the STM32F4 Discovery and Keil µVision

• The Introductory lab sheet is a self-contained introduction to the STM32F4 Discovery and using Keil µVision to develop a project.

• You will use the STM32F4 Discovery and Keil µVision for all of the embedded systems labs and the assignment.

• The code that you will write will use the ‘C’ programming language.

• This demonstration will go through the steps in the Introductory lab that are required to setup a project with the STM32F4 Discovery and Keil µVision.