Orangutan X2 Robot Controller - Pololu Robotics and Electronics

Orangutan X2 Robot Controller
Quick-Start Guide
Introduction
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 twinmicrocontroller 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.
Contacting Pololu
Check the Orangutan X2 product pages at http://www.pololu.com/orangutanx2 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 support@pololu.com. 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!
Hardware Overview
Two circuit boards. 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.
Two microcontrollers. 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 twomicrocontroller 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.
Top board
motor drivers
(e.g. VNH2SP30)
and power
connection
PORTC
Main board
10x2 2mm
connector
buzzer
USB-to-serial
adapter
(CP2102)
LCD
UART
auxiliary
microcontroller
(mega328)
SPI
main user
microcontroller
(mega1284)
PORTA,
PORTD
LEDs and
pushbuttons
general
purpose
I/O headers
Orangutan X2 Block Diagram
Pololu
© 2011 Pololu Corporation
http://www.pololu.com/
page 1 of 6
org03a
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 right
side, but the two uncommitted port B pins and the optional mega328 handshaking lines are in the middle of the board. The motor driver
board has a few power supply capacitor options; the picture below shows a single capacitor bent over for a low-profile installation.
LCD contrast or
PLED brightness
control
reset/program
switch
motor driver ICs (VNH2SP30/VN3SP30)
mounting hole
or probe
ground point
mounting hole
display
connector
16 user
I/O pins
with
power
and
ground
to each
pin
3 user
buttons,
5 user
LEDs
optional user
potentiometer
power LED
power button
VIN GND
M2
outputs
M1
outputs
Orangutan X2 Top View
ATmega328P auxiliary microcontroller
USB connector
power connection
for bottom PCB
motor direction
indicator LEDs
10x2 connector to
motor driver board
USB and
programming
status LEDs
buzzer
CP2102
USB-to-serial adapter
5 V voltage
regulator
mega1284:PB4
USB suspend status
(high for USB active)
mega1284:PB2
LCD backlight control
(low to turn LEDs off)
auto shutdown pin
(high to power-down)
mega328 attention line
mega328 slave select (SS) line
ATmega1284P main microcontroller
Orangutan X2 Main Board, Component Side
Pololu
© 2011 Pololu Corporation
http://www.pololu.com/
page 2 of 6
org03a
Module Layout (continued)
Some hardware options on the Orangutan X2 are accessed by making or breaking solder bridges across surface-mount pads on the bottom
side of the main printed circuit board; the pads are indicated below.
This jumper connects
USB bus power to
the 5V net on the board.
This eliminates the
need for a power supply
when only the bottom
board is being used.
Connect this jumper
at your own risk!
general I/O
power selection
(note: each jumper
controls four pins;
and the position
of different voltages
is different for
each jumper)
this jumper connects
ADC6 to just under
1/3 of the input voltage
this jumper connects ADC7 to the
output of the user potentiometer
(which is on the other side of this corner)
Orangutan X2 Bottom View
Power Connections and Limits
The Orangutan X2 power input is on the two lower, middle pins of the upper board. The operating range is 6-16V. When using large
motors, 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 is
generally 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 driver
performance.
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 to
approximately 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 it
can 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 this
supply 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 to
work with just the lower board, without motors or a large power supply connected. In such cases, the two power input pins above the 20-pin
connector 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 power
source. 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.
Power Button
The Orangutan X2 power is controlled by a pushbutton; push it to toggle the unit on and off. Because 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.
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 motor
driver quiescent current and power supply capacitor leakage current. Note: the power switch does not actually disconnect the power
supply from the board, so even if the board is turned off, it is possible to do things like accidentally short-circuit the power supply!
Pololu
© 2011 Pololu Corporation
http://www.pololu.com/
page 3 of 6
org03a
Connecting the Orangutan to a Computer
The mega328 microcontroller is the programmer for the main mega1284 MCU. The mega328 performs this function by emulating an
AVRISP programmer, which connects to a computer serial (COM) port and programs AVR microcontrollers via the SPI (serial peripheral
interface) port. Instead of a standard serial port, the Orangutan X2 uses a USB-to-serial bridge that allows a USB connection to look like a
COM port. Before connecting the Orangutan X2 to a computer, the driver must be installed to allow the computer’s operating system to
treat the USB connection as an old-fashioned serial connection. The driver and installation instructions are available on the Orangutan X2
web page.
Once the USB-to-serial driver is installed and the Orangutan X2 is connected, the mega328 can communicate with the computer through its
serial port, and the green LED next to the USB connector will be lit. When programming the mega1284, the Orangutan X2 will look like an
AVRISP programmer; during normal operation, the mega328 can send and receive data to or from the computer (e.g. using a terminal
program) for debugging or other purposes.
Programming the Orangutan X2
The Orangutan X2 can be programmed using any platform for which there is a USB driver and for which there is AVRISP-compatible
programmer software. We recommend using Atmel’s AVR Studio, an integrated development environment (IDE) that works with the free
GCC C compiler and includes a simulator and other useful tools, including AVRISP support. A development software bundle is available
for 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. The
buzzer will beep, and the yellow LED will turn on, indicating that you have entered programming mode. The mega328 will no longer
respond to commands from the mega1284, and it will wait for programming commands from the computer via the USB connection. When
programming is in progress, the red LED will be lit. When programming completes, the mega1284 is allowed to execute, but the mega328
will 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, and
any incoming serial data is treated as coming from the computer programming software. When programming is requested, the mega328
will program the mega1284 and then reset itself and the mega1284, allowing full operation to resume immediately upon completion of
programming.
When programming the mega1284, access to some fuse settings is not available. The most important setting is the clock source setting
since the mega1284 must be set for an external resonator, and the mega1284 provides a 20 MHz clock to the mega328. In general, the fuses
should only be changed rarely and with great care since the Orangutan X2 could become unresponsive.
Running the Orangutan X2
Using the Orangutan X2 is generally identical to using any other mega1284-based project, and most of the mega1284’s resources are
available to the user. The exceptions are the reset system and the SPI port, which are connected to the mega328.
Reset
Because the mega328 and mega1284 need to stay synchronized, it is not desirable to reset the mega1284 independently. The reset button
does not connect directly to either processor’s hardware reset line. Instead, the mega328 monitors the reset button and determines when to
reset itself or the mega1284. Typically, the mega328 will reset both processors, keep the mega1284 reset while it initializes, and then
finally allow the mega1284 to begin execution. The reset button will not work during programming.
SPI Port
The SPI port is the main connection between the two MCUs. During programming, the mega328 becomes the master; during normal
operation, the mega1284 is the master and sends the mega328 commands via the SPI interface. The default setup of the Orangutan X2
assumes 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 to
one 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 to
use 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.
Pololu
© 2011 Pololu Corporation
http://www.pololu.com/
page 4 of 6
org03a
Orangutan X2 Robot Controller Schematic Diagram
VCC
JP8
R31
9.1Ohm
LCD
backlight
power
1
2
JP27
1
2
R32
10k
Q4
TP2
2
3
1
4
5
6
7
8
9
10
11
12
13
14
VDD
Vo
Vss
RS
R/W
E
DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7
JP26
VCC
From mega328
1284 Atention Request
SS
1
19
20
21
22
23
24
25
26
PC0 (SCL)
PC1 (SDA)
PC2 (TCK)
PC3 (TMS)
PC4 (TD0)
PC5 (TDI)
PC6 (TOSC1)
PC7 (TOSC2)
40
41
42
43
44
1
2
3
Y1 20MHz
3
4
RESET
2
GND
GND
GND
GND
GND
AVCC1284
29
AREF
XTAL1
XTAL2
6
18
28
39
45
5
17
38
27
VCC
VCC
VCC
AVCC
PA0 (ADC0)
PA1 (ADC1)
PA2 (ADC2)
PA3 (ADC3)
PA4 (ADC4)
PA5 (ADC5)
PA6 (ADC6)
PA7 (ADC7)
37
36
35
34
33
32
31
30
PD0 (RXD)
PD1 (TXD)
PD2 (INT0)
PD3 (INT1))
PD4 (OC1B)
PD5 (OC1A)
PD6 (OC2B/ICP)
PD7 (OC2A)
9
10
11
12
13
14
15
16
PB0 (XCK0/T0)
PB1 (T1/CLKO)
PB2 (AIN0/INT2)
PB3 (AIN1/OC0A)
PB4 (SS/OC0B)
PB5 (MOSI)
PB6 (MISO)
PB7 (SCK)
8
1284 CLK out 7
Header 2
R6
4.7K
VCC
U3
PC0
PC1
PC2
PC3
PC4
PC5
PC6
PC7
MOSI
MISO
SCK
JP3
VCC
C17
0.1uF
C7
0.1uF
2
1
JP9 User
AVCC1284
10uH
R7
TRIMPOT
10K
LCD/User
R33
NP
1
2
L2
VCC
VCC
Internally pulled high 1284 Reset
JP4
TP4
1
C8
2
3
0.1uF
JP5
4
1
2
ADC6
3
ADC7
4
JP6
1
2
3
4
1
2
3
4
User Connectors
ATmega644/ATmega1284P
PC6
PC4
PC1
User pushbuttons
PC7
PC5
PC3
PC2
PC0
SW3
R27
SW4
R26
1K
R12 1K
1K
R25
1K
R24
R23
1K
D9
D8
Y
D7
D6
G
R
(bottom of PCB)
D5
JP24
G
R
(top of PCB)
L1
JP2
2
5
4
1
6
3
avrisp2x3
328 Reset
12
13
SS
14
MOSI
15
MISO
16
SCK
17
R3 1K 1284 CLK out 7
8
PB0 (ICP)
PC0 (ADC0)
PB1 (OC1A)
PB2 (SS/OC1B)
PC1 (ADC1)
PC2 (ADC2)
PB3 (MOSI/OC2)
PC3 (ADC3)
PB4 (MISO)
PC4 (ADC4/SDA)
PB5 (SCK)
PB6 (XTAL1/TOSC1) PC5 (ADC5/SCL)
PB7 (XTAL2/TOSC2)
PC6 (RESET)
D2
(red)
RXD
30 PD0 (RXD)
TXD
31 PD1 (TXD)
Internally pulled high
32 PD2 (INT0)
Motor 2 PWM 1 PD3 (INT1)
RST/PROG
Motor 2 DIAG 2 PD4 (XCK/T0)
Motor 1 PWM 9 PD5 (T1)
10 PD6 (AIN0)
1284 Atention Request11 PD7 (AIN1)
VCC
R4
1K
SW1
C5
0.1uF
D3
(yellow)
AVCC328
10uH
U2
1284 Reset
4.53K
R14
TRIMPOT
10K
SMTjumper
VCC
BUZZER
C13
0.1uF
1K
ADC7
pushbutton
VCC
R30
SMTjumper
R13 1K
BZ1
10.0K
ADC6
VCC
pushbutton
R10 10K
R29
JP25
R11 1K
pushbutton
R9 10K
VIN
User LEDs
VCC
SW2
R8 10K
JP7
ATmega168/ATmega328P
ADC6
ADC7
23
24
25
26
27
28
29
Motor 1 IN A
Motor 1 DIAG
Motor 1 IN B
Motor 2 IN B
Motor 2 IN A
VCC
AVCC328
C12
0.1uF
R5
10K
328 Reset
19 Motor 1 Current Sense
22 Motor 2 Current Sense
6
VCC 4
VCC
18
AVCC 20
AREF
5
GND
GND 3
21
GND 33
GND
VCC
C6
0.1uF
JP1
Motor 1 IN A
Motor 1 PWM
Motor 1 DIAG
Motor 1 Current Sense
Motor 1 IN B
VCC
VBAT
VBAT
GND
GND
GND
GND
VBAT
VBAT
Motor 2 IN B
VCC
Motor 2 DIAG
Motor 2 Current Sense
Motor 2 IN A
Motor 2 PWM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Header 10x2 2mm
to motor driver board
Pololu
© 2011 Pololu Corporation
http://www.pololu.com/
page 5 of 6
org03a
VCC
VCC
VBAT
U1
R1 4.7k
VBAT
JP2
6
VCC
10 ENA/DIAGA
VCC
ENB/DIAGB
VCC
5 INA
VCC/HEATSLG1
11
INB
OUTA
8
OUTA
PWM
OUTA
9
OUTA/HEATSLG3
CS
26
GNDA
OUTB
27 GNDA
OUTB
28 GNDA
OUTB
18
GNDB
OUTB/HEATSLG2
19 GNDB
20 GNDB
R2 1k
5
4
3
2
1
R3 1k
R4 1k
middle
0.1” pins
C3
0.1uF
R5 1k
R6 10k
C1
33nF
R19
10k
JP4
R7
1.5k
Q1
1
2
VCC
4
VBAT
VBAT
7
1
21
16
15
32
2
D3
D2
VBAT
2
20
19
18
28
27
26
Q2
R10 10k
9
CS
R11 1k
8
PWM
R12 1k
11
5
R13 1k
R14 1k
Motor driver daughter board
R18
10k
C2
33nF
GNDB
GNDB
GNDB
GNDA
GNDA
GNDA
R9
1.5k
R16
1.5k
32
15
16
21
OUTB/HEATSLG2
OUTB
OUTB
OUTB
OUTA/HEATSLG3
OUTA
OUTA
OUTA
33
1
25
30
VCC/HEATSLG1
VCC
10 ENB/DIAGB
VCC
6 ENA/DIAGA
VCC
31
3
13
23
INB
INA
VCC U2
R15
4.7k
NC
NC
NC
NC
NC
NC
NC
NC
NC
10
11
12
13
14
15
16
17
18
19
20
VIN
1
D1
R8
100k
29
24
22
17
14
12
7
4
2
9
R17
1.5k
M1
Note: NC pins connected to nearby nets
8
10x2 2mm
to main board
30
25
1
33
29
24
22
17
14
12
7
4
2
5
6
23
13
3
31
NC
NC
NC
NC
NC
NC
NC
NC
NC
3
VNH2SP30/VNH3SP30
M2
1
2
D4
D5
VBAT
VNH2SP30/VNH3SP30
C6
10 mm radial
C4
axial
C5
10 mm radial
External power button
SW5
VIN
D12
BTN2
BTN1
VBAT
D10
VServo
D13
D11
VCC
D14
5V regulator
VIN
1
VOUT
3
GND
4
C9
U4
0.1uF
2
Shut Down
R21
4.7k
GND
OFF
OUT
GND
TP1
IN
C10
C14
C15
C16
10uF
10uF
0.1uF
0.1uF
D4
Power (blue)
VCC
USBPOWER
J1
U1
USBMINIB
SMTjumper
VServo
VDD
D-
JP11
VCC
D+
VIN
JP10
1
2
3
4
1
2
3
4
GND
6
7
8
9
10
11
User I/O power
selection x4
NC
NC
NC
NC
NC
NC
NC
JP18
8
7
5
1
2
3
4
4
3
5
C1
1.0 uF
C2
0.1uF
VCC
C4
0.1uF
Pololu
© 2011 Pololu Corporation
http://www.pololu.com/
10
13
14
15
16
17
18
19
20
21
22
VBUS
VREGIN
D-
3.3V
RST
D+
GND
NC
NC
NC
NC
NC
NC
NC
NC
NC
NC
NC
SUSPEND
SUSPEND
TXD
RXD
RI
DCD
CTS
DSR
DTR
RTS
6
9
C3
0.1uF
R1 10k
11
12
26
25
2
1
23
27
RXD
TXD
R2
TP3
1K
D1
(green)
28
24
CP2102
page 6 of 6
org03a
Download PDF