1. Trang chủ
  2. » Công Nghệ Thông Tin

Seminar 10: Case Study potx

10 207 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 240,44 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Contains material from: Pont, M.J... Contains material from: Pont, M.J.. PES I - 264 Overview In this session, we will discuss the design of software to control a small mobile robot.. T

Trang 1

C OPYRIGHT © M ICHAEL J P ONT , 2001-2006 Contains material from:

Pont, M.J (2002) “Embedded C”, Addison-Wesley PES I - 263

Case Study:

Controlling a Mobile Robot

Trang 2

C OPYRIGHT © M ICHAEL J P ONT , 2001-2006 Contains material from:

Pont, M.J (2002) “Embedded C”, Addison-Wesley PES I - 264

Overview

In this session, we will discuss the design of software to control a

small mobile robot

The robot is “Mr Line”

He is produced by “Microrobot NA”

http://www.microrobotna.com

Trang 3

C OPYRIGHT © M ICHAEL J P ONT , 2001-2006 Contains material from:

Pont, M.J (2002) “Embedded C”, Addison-Wesley PES I - 265

What can the robot do?

The robot has IR sensors and transmitters that allow him to detect a black line on a white surface - and follow it

http://www.microrobotna.com

Trang 4

C OPYRIGHT © M ICHAEL J P ONT , 2001-2006 Contains material from:

Pont, M.J (2002) “Embedded C”, Addison-Wesley PES I - 266

The robot brain

Mr Line is controlled by an 8051 microcontroller (an AT89C2051)

We’ll use a pin-compatible AT89C4051 in this study

http://www.microrobotna.com

Trang 5

C OPYRIGHT © M ICHAEL J P ONT , 2001-2006 Contains material from:

Pont, M.J (2002) “Embedded C”, Addison-Wesley PES I - 267

How does the robot move?

Mr Line has two DC motors: by controlling the relative speed of

these motors, we can control the speed and direction in which he

will move

http://www.microrobotna.com

Trang 6

C OPYRIGHT © M ICHAEL J P ONT , 2001-2006 Contains material from:

Pont, M.J (2002) “Embedded C”, Addison-Wesley PES I - 268

Pulse-width modulation

V

Time

Duty cycle (%) = x

x+y× 100

Period = x + y, where x and y are in seconds

Frequency = 1

The key point to note is that the average voltage seen by the load is given by the duty cycle multiplied by the load voltage

See: “Patterns for Time-Triggered Embedded Systems”, Chapter 33

Trang 7

C OPYRIGHT © M ICHAEL J P ONT , 2001-2006 Contains material from:

Pont, M.J (2002) “Embedded C”, Addison-Wesley PES I - 269

Software PWM

PWM_PERIOD_G

PWM_position_G

if (PWM_position_G < PWM_G) {

PWM_pin = PWM_ON;

} else { PWM_pin = PWM_OFF;

} PWM_G

See: “Patterns for Time-Triggered Embedded Systems”, Chapter 33

Trang 8

C OPYRIGHT © M ICHAEL J P ONT , 2001-2006 Contains material from:

Pont, M.J (2002) “Embedded C”, Addison-Wesley PES I - 270

The resulting code

< We’ll discuss the resulting code in the lecture … >

Trang 9

C OPYRIGHT © M ICHAEL J P ONT , 2001-2006 Contains material from:

Pont, M.J (2002) “Embedded C”, Addison-Wesley PES I - 271

More about the robot

Please see:

http://www.le.ac.uk/engineering/mjp9/robot.htm

Trang 10

C OPYRIGHT © M ICHAEL J P ONT , 2001-2006 Contains material from:

Pont, M.J (2002) “Embedded C”, Addison-Wesley PES I - 272

Conclusions

That brings us to the end of this course!

Ngày đăng: 10/07/2014, 18:21

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN