Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Embedded Robotics (Thomas Braunl, 2 ed, 2006)

.pdf
Скачиваний:
251
Добавлен:
12.08.2013
Размер:
5.37 Mб
Скачать

Servo Entry

The default serial interface for the radio transfer

Valid values are SERIAL1, SERIAL2, SERIAL3

short serspeed:

The default baudrate for the selected serial interface.

Valid values are SER9600, SER19200, SER38400, SER57600, SER115200

short imagemode:

The mode in which the images of the camera should be transferred to the PC. Valid values are IMAGE_OFF (no image), IMAGE_REDUCED (reduced quality), IMAGE_FULL (original frame)

short protocol:

This specifies the module type connected to the serial port.

Valid values are RADIO_METRIX (message length 50 Bytes), RADIO_BLUETOOTH (mes.len. 64KB), RADIO_WLAN (message lenngth 64KB)

C.13 Servo Entry

typedef struct

{

int

driver_version;

int

tpu_channel;

int

tpu_timer;

int

pwm_period;

int

pwm_start;

int

pwm_stop;

}servo_type;

e.g.

servo_type servo0 = {1, 0, TIMER2, 20000, 700, 1700};

int driver_version:

The maximum driver version for which this entry is compatible.

Because newer drivers will surely need more information, this tag prevents this driver from reading more information than actually available.

int tpu_channel:

The tpu channel the servo is attached to. Valid values are 0..15

Each servo needs a pwm (pulse width modulated) signal to turn into different positions.

The internal TPU of the MC68332 is capable of generating this signal on up to 16 channels. The value to be entered here is given through the actual hardware design.

int tpu_timer:

The tpu timer that has to be used. Valid values are TIMER1, TIMER2

The tpu generates the pwm signal on an internal timer basis. There are two different timers that can be used to determine the actual period for the pwm signal.

TIMER1 runs at a speed of 4MHz up to 8MHz depending on the actual CPU-clock which allows periods between 128Hz and 4MHz (with 4MHz basefrq) up to 256Hz - 8MHz (with 8MHz)

TIMER2 runs at a speed of 512kHz up to 1MHz depending on the actual CPU-clock which allows periods between 16Hz and 512kHz (512kHz base) up to 32Hz - 1MHz (1MHz base)

To determine the actual TIMERx speed use the following equation: TIMER1[MHz] = 4MHZ * (16MHz + (CPUclock[MHz] % 16))/16 TIMER2[MHz] = 512kHZ * (16MHz + (CPUclock[MHz] % 16))/16

int pwm_period:

This value sets the length of one pwm period in microseconds (us).

425

C Hardware Description Table

A normal servo needs a pwm_period of 20ms which equals 20000us. For any exotic servo this value can be changed accordingly. It is always preferable to take TIMER2 because only here are enough discrete steps available to position the servo accurately. The values are in a certain interval (see motor), independent of the CPUclock.

int pwm_start:

This is the minimal hightime of the pwm period in us. Valid values are 0..pwm_period

To position a servo the two extreme positions for it have to be defined. In the normal case a servo needs to have a minimal hightime of 0.7ms (700us) at the beginning of each pwm period. This is also one of the two extreme positions a servo can take.

int pwm_stop:

This is the maximum hightime of the pwm period. Valid values are 0..pwm_period. Depending on the rotation direction of a servo, one may choose pwm_stop less than or greater than pwm_start.

To position a servo the two extreme positions for it have to be defined. In the normal case a servo needs to have a maximum hightime of 1.7ms (1700us) at the beginning of each pwm period. This is also one of the two extreme positions a servo can take.

All other positions of the servo are linear interpolated in 256 steps between these two extremes.

Hint: If you don't need the full range the servo offers you can adjust the start and stop parameters to a smaller 'window' like 1ms to 1.5ms and gain a higher resolution in these bounds. Or the other way around, you can enlarge the 'window' to adjust the values to the real degrees the servo changes its position: Take for example a servo that covers a range of 210 degrees. Simply adjust the stop value to 1.9ms. If you now set values between 0 and 210 you will reach the two extremes in steps corresponding to the real angles. Values higher than 210 would not differ from the result gained by the value of 210.

C.14 Startimage Entry

typedef BYTE image_type[16*64];

e.g.

image_type startimage = {0xB7,0x70,0x1C,...0x00};

Here a user-defined startup image can be entered as a byte array (16*64 = 1024Bytes).

This is a 128x64 Pixel B/W picture where each pixel is represented by a bit.

C.15 Startmelody Entry

no typedef

e.g.

int startmelody[] = {1114,200, 2173,200, 1114,200, 1487,200, 1669,320, 0};

Here you can enter your own melody that will be played at startup. It is a list of integer pairs. The first value indicates the frequency, the second the duration in 1/100s of the tone. As last value there must be single 0 in the list.

426

VW Drive Entry

C.16 VW Drive Entry

typedef struct

{

version;

int

int

drive_type;

drvspec

drive_spec; /* -> diff_data */

}vw_type;

 

typedef struct

 

{

quad_left;

DeviceSemantics

DeviceSemantics

quad_right;

float

wheel_dist; /* meters */

}diff_data;

 

e.g.

vw_type drive = {0, DIFFERENTIAL_DRIVE, {QUAD_LEFT, QUAD_RIGHT, 0.21}};

int driver_version:

The maximum driver version for which this entry is compatible.

Because newer drivers will surely need more information, this tag prevents this driver from reading more information than actually available.

int drive_type:

Define the type of the actual used drive.

Valid values are DIFFERENTIAL_DRIVE (ACKERMAN_DRIVE, SYNCHRO_DRIVE, TRICYCLE_DRIVE)

The following parameters depend on the selected drive type.

DIFFERENTIAL_DRIVE:

The differential drive is made up of two parallel independent wheels with the kinematic center right between them. Obviously two encoders with the connected motors are needed.

DeviceSemantics quad_left:

The semantics of the encoder used for the left wheel.

DeviceSemantics quad_right:

The semantics of the encoder used for the right wheel.

float wheel_dist:

The distance (meters) between the two wheels to determine the kinematic center.

C.17 Waitstates Entry

typedef struct

{

short version; short rom_ws; short ram_ws; short lcd_ws; short io_ws; short serpar_ws;

}waitstate_type;

e.g.

waitstate_type waitstates = {0,3,0,1,0,2};

int version:

427

C Hardware Description Table

The maximum driver version for which this entry is compatible.

Because newer drivers will surely need more information, this tag prevents this driver from reading more information than actually available.

short rom_ws:

Waitstates for the ROM access Valid values (for all waitstates):

waitstates = 0..13, Fast Termination = 14, External = 15

short ram_ws:

Waitstates for the RAM access

short lcd_ws:

Waitstates for the LCD access

short io_ws:

Waitstates for the Input/Output latches access

short serpar_ws:

Waitstates for the 16c552 Serial/Parallel Port Interface access

Thomas Bräunl, Klaus Schmitt, Michael Kasper 1996-2006

428

HARDWARE

 

D

SPECIFICATION

 

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

 

 

. . . . . . . . .

 

The following tables speficy details of the EyeCon controller hardware.

Version

Features

 

 

 

 

Mark 1

First prototypes, two boards, double-sided, rectangular push

 

button, no speaker

 

 

Mark 2

Major change: two boards, double-sided, speaker and micro-

 

phone on board, changed audio circuit

 

 

Mark 2.1

Minor change: connect digital and analog ground

 

 

Mark 3.0

Completely new design: single board design, four layers, di-

 

rect-plug-in connectors for sensors and motors, motor control-

 

lers on board, BDM on board, wireless module and antenna on

 

board

 

 

Mark 3.11

Minor change: miniature camera port added

 

 

Mark 3.12

Minor change: replaced fuse by reconstituting polyswitch

 

 

Mark 4.02

Major change: extension to 2MB RAM, adding fast camera

 

framebuffer, additional connector for third serial port, redesign

 

of digital I/O

 

 

Mark 5

Major redesign: camera plugs in directly into controller, new

 

motor connectors, video out, additional servo connectors

 

 

Table D.1: Hardware versions

429429

D Hardware Specification

Chip Select

 

Function

 

 

 

 

 

 

 

 

 

CSBOOT

 

Flash-ROM

 

 

 

 

 

CS 0+1

 

RAM (1MB)

 

 

 

 

 

CS 2

 

LCD

 

 

 

 

 

CS 3+7

 

RAM (additional 1MB)

 

 

 

 

 

CS 4

 

Input/Output latch (IOBase)

 

 

 

 

 

CS 5

 

FIFO camera buffer

 

 

 

 

 

CS 6

 

Address A19

 

 

 

 

 

CS 7

 

Autovector acknowledge generation

 

 

 

 

 

CS 8

 

Parallel port of 16C552

 

 

 

 

 

CS 9

 

Serial port 1 of 16C552

 

 

 

 

 

CS 10

 

Serial port 2 of 16C552

 

 

 

 

 

Table D.2: Chip-select lines

 

 

 

 

 

Address

 

Memory Usage

Chip Selects

 

 

 

 

 

 

 

 

0x00000000

 

RoBIOS RAM (128KB)

CS0,1,3,7

0x00020000

 

User RAM (max. 2MB-128KB)

CS0,1,3,7

0x00200000

 

End of RAM

 

...

 

unused addresses

 

0x00a00000

 

TpuBase (2KB)

 

0x00a00800

 

End of TpuBase

 

...

 

unused addresses

 

0x00c00000

 

Flash-ROM (512KB)

CS2

0x00c80000

 

End of Flash-ROM

 

...

 

unused addresses

 

0x00e00800

 

Latches

CS4

0x00e01000

 

FIFO or Latches

CS5

0x00e01800

 

Parallel Port/Camera

CS8

Table D.3: Memory map (continued)

430

Hardware Specification

Address

 

Memory Usage

 

Chip Selects

 

 

 

 

 

 

 

 

 

 

 

 

0x00e02000

 

Serial Port2

 

CS9

0x00e02800

 

Serial Port3

 

CS10

...

 

 

unused addresses

 

 

0x00fff000

MCU68332 internal registers (4KB)

 

 

0x01000000

End of registers and addressable RAM

 

 

Table D.3: Memory map (continued)

 

 

 

 

 

 

IRQ

 

 

Function

 

 

 

 

 

 

 

 

 

1

 

FIFO half-full flag (hardwired)

 

 

 

 

 

2

 

INT-SIM (100Hz Timer, arbitration 15)

 

 

 

 

3

 

INT serial 1 (neg.)/serial 2 (neg.) of 16C552 (hardwired)

 

 

 

 

4

 

INT QSPI and SCI of the QSM (arbitration 13)

 

 

 

 

 

5

 

INT parallel port (neg.) of 16C552 (hardwired)

 

 

 

 

 

6

 

INT-TPU (arbitration 14)

 

 

 

 

 

7

 

free

 

 

 

 

Note

 

INT 1,3,5 are hardwired to FIFO or 16C552, respectively,

 

 

all other INTs are set via software

 

 

 

 

Table D.4: Interrupt request lines

 

 

 

 

 

Port F

 

 

Key Function

 

 

 

 

 

 

 

 

 

PF0

 

KEY4

 

 

 

 

 

PF2

 

KEY3

 

 

 

 

 

PF4

 

KEY2

 

 

 

 

 

PF6

 

KEY1

 

 

 

 

 

 

 

Table D.5: Push buttons

431

D Hardware Specification

Description

 

 

Value

 

 

 

 

 

 

Voltage

 

Required: between 6V and 12V DC, normally: 7.2V

 

 

 

Power con-

 

EyeCon controller only: 235mA

sumption

 

EyeCon controller with EyeCam CMOS camera: 270mA

 

 

 

Run-time

 

With 1,350mAh, 7.2V Li-ion rechargeable battery (approx.):

 

 

4 – 5 hours EyeCon controller only

 

 

1 – 2 hours EyeCon controller with SoccerBot robot and

 

 

camera, constantly driving and sensing, depending on pro-

 

 

gram and speed

 

 

 

Power limi-

 

Total power limit is 3A

tation

 

3A polyswitch prohibits damage through higher current or

 

 

wrong polarity

 

 

Can drive DC motors with up to 1A each

 

 

 

Table D.6: Electrical characteristics

 

 

 

 

Description

 

 

Value

 

 

 

 

 

 

 

 

Size

 

Controller:

10.6cm u 10.0cm u 2.8cm

 

 

 

(width u height u depth)

 

 

EyeCam

3.0cm u 3.4cm u 3.2cm

 

 

 

 

Weight

 

Controller:

190g

 

 

EyeCam:

25g

 

 

 

 

Table D.7: Physical characteristics

432

Hardware Specification

Port

 

Pins

 

 

 

 

Serial 1

Download (9 pin), standard RS232 serial port, 12V, female

 

1

-

 

2

Tx

 

3

Rx

 

4

-

 

5

GND

 

6

-

 

7

CTS

 

8

RTS

 

9

-

 

 

Serial 2

Upload (9 pin), standard RS232 serial port, 12V, male

 

1

-

 

2

Rx

 

3

Tx

 

4

-

 

5

GND

 

6

-

 

7

RTS

 

8

CTS

 

9

5V regulated

 

 

Serial 3

RS232 at TTL level (5V)

 

1 CD'

 

2 DTR'

 

3 Tx

 

4 CTS'

 

5 Rx

 

6 RTS'

 

7 DSR'

 

8

RI'

 

9 GND

 

10 Vcc (5V)

 

 

Table D.8: Pinouts EyeCon Mark 5 (continued)

433

D Hardware Specification

Port

Pins

Digital

16 pin connector requires 1:1 connection

camera

(cable with female:female) to EyeCam digital color camera

 

Note: The little pin on the EyeCon side of the cable

 

 

has to point up:

 

 

|--^--|

 

 

|-----|

 

1 STB

 

2-9 Data 0-7

 

10

ACK

 

11 INT

 

12

BSY

 

13

KEY

 

14

SLC

 

15

Vcc (5V)

 

16

GND

 

 

Parallel

Standard parallel port

 

1 Strobe'

 

2 PD0

 

3 PD1

 

4 PD2

 

5 PD3

 

6 PD4

 

7 PD5

 

8 PD6

 

9 PD7

 

10 ACK

 

11 Busy'

 

12 PE

 

13 SLCT

 

14

Autofxdt'

 

15

Error

 

16

Init

 

17

Slctin'

 

18..25 GND

 

 

BDM

Motorola Background Debugger (10 pin),

 

connects to PC parallel port

Table D.8: Pinouts EyeCon Mark 5 (continued)

434