orangutan x2 robot controller - pololu

6
Quick-Start Guide Introduction Contacting Pololu The Orangutan X2 is the third release in Pololu's line of Orangutan robot controllers. Like the original Orangutan and subsequent Baby Orangutan, the Orangutan X2 is designed to be a compact, high-performance control center for robotics and automation projects. The Orangutan X2’s two-board design allows the unit to maintain the compactness characteristic of the Orangutan line while offering substantially more electrical and computational power: the X2 can deliver up to a horsepower across two motor channels, and the twin- microcontroller architecture allows maximum access to the primary microcontroller, an Atmel ATmega1284P with 64 KB of program space and 4 KB of RAM. Abattery, motors, and sensors can be connected directly to the module for quick creation of advanced robots. Check the Orangutan X2 product pages at for additional information and resources, including more detailed documentation, file downloads, application examples, and troubleshooting tips. We would be delighted to hear from you about your project and about your experience with the Orangutan X2. You can contact us through our online feedback form or by email at . Tell us what we did well, what we could improve, what you would like to see in the future, or anything else you would like to say! http://www.pololu.com/orangutanx2 [email protected] Hardware Overview Two circuit boards. Two microcontrollers. A block diagram of the Orangutan X2 is shown below. The Orangutan X2 consists of two printed circuit boards connected by a 20-pin connector. The top board holds the high-power motor drivers and power terminals; the rest of the electronics, including the microcontrollers, is on the bottom board. The connections on the top board are symmetric, so until the connectors are soldered on, the board can be mounted in either orientation. The Orangutan is available with two motor driver options: the VNH3SP30 costs less, but has slightly lower performance; the VNH2SP30 can deliver more current and adds current sensing. Battery and motor leads (or leads to your favorite connector style) can be soldered directly to the top board, or the supplied terminal blocks can be used for quick convenient motor or power supply changes. The Orangutan X2 has two microcontrollers: an Atmel ATmega1284P for the main application, and an auxiliary ATmega328P that interfaces to most of the dedicated hardware on the X2 and serves as a programmer for the main processor. The two- microcontroller design simplifies multitasking by relieving the main processor of common tasks such as motor control and melody generation, and the approach also leaves the mega1284 completely unencumbered, allowing the mega1284 hardware, such as timers and interrupts, to be used for your higher-level design. For more details, please check the complete schematic included at the end of this document. © 2011 Pololu Corporation http://www.pololu.com/ Pololu page 1 of 6 org03a Orangutan X2 Robot Controller motor drivers and power connection (e.g. VNH2SP30) 10x2 2mm connector buzzer main user microcontroller (mega1284) auxiliary microcontroller (mega328) USB-to-serial adapter (CP2102) SPI UART general purpose I/O headers PORTA, PORTD PORTC LCD Top board Main board LEDs and pushbuttons Orangutan X2 Block Diagram

Upload: others

Post on 07-Jan-2022

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Orangutan X2 Robot Controller - Pololu

Quick-Start Guide

Introduction

Contacting Pololu

The Orangutan X2 is the third release in Pololu's line of Orangutan robot controllers. Like the original Orangutan and subsequent BabyOrangutan, the Orangutan X2 is designed to be a compact, high-performance control center for robotics and automation projects. TheOrangutan X2’s two-board design allows the unit to maintain the compactness characteristic of the Orangutan line while offeringsubstantially more electrical and computational power: the X2 can deliver up to a horsepower across two motor channels, and the twin-microcontroller architecture allows maximum access to the primary microcontroller, an Atmel ATmega1284P with 64 KB of programspace and 4 KB of RAM. Abattery, motors, and sensors can be connected directly to the module for quick creation of advanced robots.

Check the Orangutan X2 product pages at for additional information and resources,

including more detailed documentation, file downloads, application examples, and troubleshooting tips.

We would be delighted to hear from you about your project and about your experience with the Orangutan X2. You can contact us throughour online feedback form or by email at . Tell us what we did well, what we could improve, what you would like

to see in the future, or anything else you would like to say!

http://www.pololu.com/orangutanx2

[email protected]

Hardware Overview

Two circuit boards.

Two microcontrollers.

A block diagram of the Orangutan X2 is shown below. The Orangutan X2 consists of two printed circuit boardsconnected by a 20-pin connector. The top board holds the high-power motor drivers and power terminals; the rest of the electronics,including the microcontrollers, is on the bottom board. The connections on the top board are symmetric, so until the connectors aresoldered on, the board can be mounted in either orientation. The Orangutan is available with two motor driver options: the VNH3SP30costs less, but has slightly lower performance; the VNH2SP30 can deliver more current and adds current sensing. Battery and motor leads(or leads to your favorite connector style) can be soldered directly to the top board, or the supplied terminal blocks can be used for quickconvenient motor or power supply changes.

The Orangutan X2 has two microcontrollers: an Atmel ATmega1284P for the main application, and an auxiliaryATmega328P that interfaces to most of the dedicated hardware on the X2 and serves as a programmer for the main processor. The two-microcontroller design simplifies multitasking by relieving the main processor of common tasks such as motor control and melodygeneration, and the approach also leaves the mega1284 completely unencumbered, allowing the mega1284 hardware, such as timers andinterrupts, to be used for your higher-level design.

For more details, please check the complete schematic included at the end of this document.

© 2011 Pololu Corporationhttp://www.pololu.com/

Pololu page 1 of 6 org03a

Orangutan X2 Robot Controller

motor drivers

and powerconnection

(e.g. VNH2SP30)

10x2 2mmconnectorbuzzer

main usermicrocontroller

(mega1284)

auxiliarymicrocontroller

(mega328)

USB-to-serialadapter

(CP2102)

SPIUART general

purposeI/O headers

PORTA,PORTD

PORTC

LCD

Top board

Main board LEDs andpushbuttons

Orangutan X2 Block Diagram

Page 2: Orangutan X2 Robot Controller - Pololu

Module Layout

The main features of the Orangutan X2 are indicated below. Most of the mega1284 I/O lines come out to the 0.1″ header along the rightside, but the two uncommitted port B pins and the optional mega328 handshaking lines are in the middle of the board. The motor driverboard has a few power supply capacitor options; the picture below shows a single capacitor bent over for a low-profile installation.

© 2011 Pololu Corporationhttp://www.pololu.com/

Pololu page 2 of 6 org03a

Orangutan X2 Top View

motor driver ICs (VNH2SP30/VN3SP30)reset/programswitch

LCD contrast orPLED brightnesscontrol

3 userbuttons,5 userLEDs

displayconnector

power button

optional userpotentiometer

16 userI/O pinswithpowerandgroundto eachpin

motor directionindicator LEDs

M1outputs

M2outputs

VIN GND

mounting holeor probeground point

mounting hole

power LED

Orangutan X2 Main Board, Component Side

10x2 connector tomotor driver boardUSB connector

ATmega1284P main microcontroller

5 V voltageregulator

auto shutdown pin(high to power-down)

LCD backlight control(low to turn LEDs off)

USB suspend status(high for USB active)

CP2102USB-to-serial adapter

power connectionfor bottom PCB

ATmega328P auxiliary microcontroller

buzzer

mega1284:PB4

mega1284:PB2

mega328 attention line

mega328 slave select (SS) line

USB andprogrammingstatus LEDs

Page 3: Orangutan X2 Robot Controller - Pololu

Module Layout (continued)

Some hardware options on the Orangutan X2 are accessed by making or breaking solder bridges across surface-mount pads on the bottomside of the main printed circuit board; the pads are indicated below.

Orangutan X2 Bottom View

general I/Opower selection(note: each jumpercontrols four pins;and the positionof different voltagesis different foreach jumper)

this jumper connectsADC6 to just under1/3 of the input voltage

this jumper connects ADC7 to theoutput of the user potentiometer

(which is on the other side of this corner)

This jumper connectsUSB bus power tothe 5V net on the board.This eliminates theneed for a power supplywhen only the bottomboard is being used.Connect this jumperat your own risk!

© 2011 Pololu Corporationhttp://www.pololu.com/

Pololu page 3 of 6 org03a

Power Connections and Limits

The Orangutan X2 power input is on the two lower, middle pins of the upper board. The operating range is . When using largemotors, make sure the power supply and wiring can handle the current; you might also consider putting a fuse in line with the main power.The motor drivers are capable of delivering surges of up to 30 A, and continuous current will depend on the environment. The VNH3 isgenerally good for up to about 9 A continuous, and the VNH2 is good for up to about 14 A. Heat sinks can improve the motor driverperformance.

The power to the main PCB is delivered through four pairs of pins on the 2mm connector, which limits the total power to the bottom board toapproximately 6 A. The onboard linear 5 V regulator is good for up to 500 mA, but since the practical limit comes from power dissipation,the usable current will depend on the input voltage and the ambient temperature. The Vservo line is about 2V below the input voltage, and itcan be used to power servos when the main supply is just a bit too high for servos, as with 6- or 7-cell NiMH battery packs. The limit for thissupply is about 3A, but as with most power issues, it depends on how much heat the rest of the board is dissipating.

The Orangutan X2 is intended to be used as a single unit with both boards connected together. However, it may sometimes be convenient towork with just the lower board, without motors or a large power supply connected. In such cases, the two power input pins above the 20-pinconnector can be used. In cases where very little power needs to be supplied outside the board, the USB port can also be used as a powersource.

.

The Orangutan X2 power is controlled by a pushbutton; push it to toggle the unit on and off.

Only power for the main board is switched; the motor driver board power is not switched.

The power consumption in the off state depends on the input voltage, but it is typically under 100 uA, most of which comes from the motordriver quiescent current and power supply capacitor leakage current.

6-16V

Power ButtonBecause the power switch is operated by a

pushbutton, many buttons can be used in parallel, allowing for external power buttons in cases where the main unit is difficult to access.

In this case, the power switch will not work, and your computer will be exposed to any voltage fluctuations on your Vcc line,so do so at your own risk

Note: the power switch does not actually disconnect the powersupply from the board, so even if the board is turned off, it is possible to do things like accidentally short-circuit the power supply!

Page 4: Orangutan X2 Robot Controller - Pololu

Connecting the Orangutan to a Computer

Programming the Orangutan X2

Running the Orangutan X2

The mega328 microcontroller is the programmer for the main mega1284 MCU. The mega328 performs this function by emulating anAVRISP programmer, which connects to a computer serial (COM) port and programs AVR microcontrollers via the SPI (serial peripheralinterface) port. Instead of a standard serial port, the Orangutan X2 uses a USB-to-serial bridge that allows a USB connection to look like aCOM port. Before connecting the Orangutan X2 to a computer, the driver must be installed to allow the computer’s operating system totreat the USB connection as an old-fashioned serial connection. The driver and installation instructions are available on the Orangutan X2web page.

Once the USB-to-serial driver is installed and the Orangutan X2 is connected, the mega328 can communicate with the computer through itsserial port, and the green LED next to the USB connector will be lit. When programming the mega1284, the Orangutan X2 will look like anAVRISP programmer; during normal operation, the mega328 can send and receive data to or from the computer (e.g. using a terminalprogram) for debugging or other purposes.

The Orangutan X2 can be programmed using any platform for which there is a USB driver and for which there is AVRISP-compatibleprogrammer software. We recommend usingAtmel’sAVR Studio, an integrated development environment (IDE) that works with the freeGCC C compiler and includes a simulator and other useful tools, including AVRISP support. A development software bundle is availablefor download from resources tab of the Orangutan X2 product pages.

To enter programming mode, hold down the reset/programming button (next to the USB connector) for more than half a second. Thebuzzer will beep, and the yellow LED will turn on, indicating that you have entered programming mode. The mega328 will no longerrespond to commands from the mega1284, and it will wait for programming commands from the computer via the USB connection. Whenprogramming is in progress, the red LED will be lit. When programming completes, the mega1284 is allowed to execute, but the mega328will remain in programming mode until the reset button is pressed.

It is also possible to set the mega328 to always look out for programming commands. In that state, normal serial port use is unavailable, andany incoming serial data is treated as coming from the computer programming software. When programming is requested, the mega328will program the mega1284 and then reset itself and the mega1284, allowing full operation to resume immediately upon completion ofprogramming.

When programming the mega1284, access to some fuse settings is not available. The most important setting is the clock source settingsince the mega1284 must be set for an external resonator, and the mega1284 provides a 20 MHz clock to the mega328. In general, the fusesshould only be changed rarely and with great care since the Orangutan X2 could become unresponsive.

Using the Orangutan X2 is generally identical to using any other mega1284-based project, and most of the mega1284’s resources areavailable to the user. The exceptions are the reset system and the SPI port, which are connected to the mega328.

Because the mega328 and mega1284 need to stay synchronized, it is not desirable to reset the mega1284 independently. The reset buttondoes not connect directly to either processor’s hardware reset line. Instead, the mega328 monitors the reset button and determines when toreset itself or the mega1284. Typically, the mega328 will reset both processors, keep the mega1284 reset while it initializes, and thenfinally allow the mega1284 to begin execution. The reset button will not work during programming.

The SPI port is the main connection between the two MCUs. During programming, the mega328 becomes the master; during normaloperation, the mega1284 is the master and sends the mega328 commands via the SPI interface. The default setup of the Orangutan X2assumes no other use of the SPI lines (the mega328’s slave-select line is pulled down by a resistor). The SS line can instead be connected toone of the mega1284 I/O lines, and the mega1284 can then control multiple slave devices on the same SPI lines. It can also be desirable touse the SS line even without additional SPI devices since the SS line provides added robustness to the protocol.

The mega1284 to mega328 SPI interface is detailed in a separate document; please see the Orangutan X2 web page for more details.

Reset

SPI Port

© 2011 Pololu Corporationhttp://www.pololu.com/

Pololu page 4 of 6 org03a

Page 5: Orangutan X2 Robot Controller - Pololu

© 2011 Pololu Corporationhttp://www.pololu.com/

Pololu

Orangutan X2 Robot Controller Schematic Diagram

1

2

3

45

6

JP2

avrisp2x3PC6 (RESET)

29

30313212

VCC6

GND5

78

91011

1213141516

PD0 (RXD)PD1 (TXD)PD2 (INT0)PD3 (INT1)PD4 (XCK/T0)

PB6 (XTAL1/TOSC1)PB7 (XTAL2/TOSC2)

PD5 (T1)PD6 (AIN0)PD7 (AIN1)

PB0 (ICP)PB1 (OC1A)PB2 (SS/OC1B)PB3 (MOSI/OC2)PB4 (MISO)PB5 (SCK)

17

AVCC18

AREF20

GND21

PC0 (ADC0)23

PC1 (ADC1)24

PC2 (ADC2)25

PC3 (ADC3)26

PC4 (ADC4/SDA)27

PC5 (ADC5/SCL)28

GND3

VCC4

ADC619

ADC722

GND33

U2

ATmega168/ATmega328P

SW1

RST/PROG

0.1uFC5

0.1uFC6

VCC

VCC

1KR310K

R5

1KR4

VCC

BZ1

BUZZER

D2(red)

Motor 2 PWM

Motor 1 PWM

1284 Atention Request

D3(yellow)

1284 Reset

SS328 Reset

1284 CLK out

Motor 1 IN A

Motor 1 IN B

Motor 2 IN AMotor 2 IN B

Motor 1 DIAG

Motor 1 Current SenseMotor 2 Current Sense

VCC

MOSIMISOSCK

Internally pulled high

328 Reset

RXDTXD

AVCC328

Motor 2 DIAG

12

43

56

78

910

1112

1413

1516

1718

1920

JP1

Header 10x2 2mmto motor driver board

GNDGNDGNDGND

VBATVBAT

VBATVBAT

VCC

VCC

Motor 1 PWM

Motor 2 PWM

Motor 1 Current Sense

Motor 2 Current Sense

Motor 1 IN A

Motor 1 DIAG

Motor 1 IN B

Motor 2 IN B

Motor 2 DIAG

Motor 2 IN A

SW2

pushbutton

SW3

pushbutton

SW4

pushbutton

10KR8

10KR9

10KR10

1KR11

1KR12

1KR13

VCC

User pushbuttonsPC

1

PC

4

PC

6

JP25

SMTjumper

ADC6

VIN

10.0K

R29

4.53K

R30

0.1uFC13

10K

R14

TRIMPOT

VCC

ADC7JP24

SMTjumper

0.1uFC7

VCC

PB5 (MOSI)1

PB6 (MISO)2

PB7 (SCK)3

RESET4

GND6

XTAL27

XTAL18

PD0 (RXD)9

PD1 (TXD)10

PD2 (INT0)11

PD3 (INT1))12

PD4 (OC1B)13

PD5 (OC1A)14

PD6 (OC2B/ICP)15

PD7 (OC2A)16

GND18

PC4 (TD0)PC5 (TDI)

24

PC6 (TOSC1)25

PC7 (TOSC2)26

GND28

AREF29

PA7 (ADC7)30

PA6 (ADC6)31

PA5 (ADC5)32

PA4 (ADC4)33

PA3 (ADC3)34

PA2 (ADC2)35

PA1 (ADC1)36

PA0 (ADC0)37

GND39

PB0 (XCK0/T0)40

PB1 (T1/CLKO)41

PB2 (AIN0/INT2)42

PB3 (AIN1/OC0A)43

PB4 (SS/OC0B)44

GND45

ATmega644/ATmega1284P

0.1uFC8

MOSIMISOSCKFrom mega328

1284 Reset

1 3

2

20MHzY11284 CLK out

1234

JP6

1234

JP4

DB4DB5

12

DB613

DB714

LCD/User

12JP9 User

1234

JP5

1234

JP7

User Connectors

ADC7

PC5PC6PC7

ADC6

AVCC1284

Internally pulled high

12

JP26

12

JP27

9.1OhmR31

10kR32

NPR33

Q4

TP2

VCC

VCC

LCDbacklightpower

TP4

4.7KR6

12

JP3

Header 2

SS1284 Atention Request

VCC5

VCC17

PC0 (SCL)19

PC1 (SDA)20

PC2 (TCK)21

PC3 (TMS)2223

AVCC27

VCC38

U3VCC

Vss1

VDD2

Vo3

RS4

R/W5

E6

DB07

DB18

DB29

DB31011

JP8

10K

R7

TRIMPOT

VCC

PC0PC1PC2PC3PC4

10uH

L1

0.1uFC12

VCCAVCC328

10uH

L2

0.1uFC17

VCCAVCC1284

D5D6D7D8D9

1K

R23

1K

R24

1K

R25

1K

R26

1K

R27

PC

0

PC

2

PC

3

PC

5

PC

7

User LEDs

RGRGY

(bottom of PCB) (top of PCB)

page 5 of 6 org03a

Page 6: Orangutan X2 Robot Controller - Pololu

0.1uF

C4

VCC

VDD1

D-2

D+3

NC4

GND5

NC

NC

NC

NC

NC

NC

67891011

J1 USBMINIB

3.3V6

4

578

3

13141516171819202122

D+

D-VREGINVBUS

GND

NCNCNCNCNCNCNCNCNCNC

NC10

RST9

SUSPEND11

SUSPEND12

DCD1

RI2

CTS23

RTS24

RXD25

TXD26

DSR27

DTR28

U1

CP2102

1.0 uFC1

0.1uFC2

0.1uFC3

10kR1

1K

R2

D1(green)

TXDRXD

VCC

TP3

USBPOWER

SMTjumper

12

43

5

JP2

0.1uFC3

VCC VBAT

middle0.1” pins

Motor driver daughter board

10x2 2mmto main board

1920

26272818

VCC/HEATSLG131

VCC3

VCC13

VCC23

OUTA30

OUTA25

OUTB15

OUTB16

5

106

8

11

OUTA1

OUTA/HEATSLG333

OUTB21

OUTB/HEATSLG232

GNDBGNDB

GNDAGNDAGNDAGNDB

INA

ENB/DIAGBENA/DIAGA

PWM

INB

CS9

NC

NC

NC

NC

NC

NC

NC

NC

NC

2 4 7 12 14 17 22 24 29

U1 VNH2SP30/VNH3SP30

1920

26272818

VCC/HEATSLG131

VCC3

VCC13

VCC23

OUTA30

OUTA25

OUTB15

OUTB16

5

106

8

11

OUTA1

OUTA/HEATSLG333

OUTB21

OUTB/HEATSLG232

GNDBGNDB

GNDAGNDAGNDAGNDB

INA

ENB/DIAGBENA/DIAGA

PWM

INB

CS9

NC

NC

NC

NC

NC

NC

NC

NC

NC

2 4 7 12 14 17 22 24 29

U2 VNH2SP30/VNH3SP30

Q1

Q2

D1

1

2

M1

1

2

M2

1

2VIN

100kR8

VBAT

VBAT

1kR3

1kR4

1kR510kR6

1.5kR7

10kR10

1.5kR9

1kR11

1kR12

1kR13

1kR14

1kR2

4.7kR1

4.7kR15

33nFC1

33nF

C2

VCC

VCC

VBAT

1.5kR16

1.5kR17

D2

D3

D4

D5

10kR18

10kR19

C4axial

C510 mm radial

C610 mm radial

VBAT

Note: NC pins connected to nearby nets

12

43

56

78

910

1112

1413

1516

1718

1920

JP4

VCC

VBAT

IN1

2G

ND

GN

D4

OUT3

U40.1uFC9

10uF

C10

4.7k

R21

SW5

D4

Power (blue)

TP1

Shut Down

D10 D11

D12 D13

D14

10uF

C14

0.1uF

C15

0.1uF

C16

VCC

VServo

VIN

VBAT

GN

DVIN VOUT

OFFB

TN

1

BTN

2

External power button

5V regulator

1234

JP10

1234

JP18

VIN

VServo

VCC

JP11

User I/O powerselection x4

© 2011 Pololu Corporationhttp://www.pololu.com/

Pololu page 6 of 6 org03a