iRobot CREATE - OPEN INTERFACE, Create User Manual

iRobot® Create
OPEN INTERFACE
www.irobot.com
Table of Contents
iRobot Create® Open Interface Overview .................................................3
Physical Connections ..............................................................................4
Serial Port Settings ................................................................................5
iRobot Create Open Interface Modes .......................................................6
Open Interface Command Reference........................................................7
Input Commands ..................................................................................13
Script Commands .................................................................................15
Wait Commands ...................................................................................15
iRobot Create Open Interface Sensor Packets .........................................17
iRobot Create Open Interface Commands Quick Reference .......................22
iRobot Create Open Interface Sensor Packets Quick Reference ................24
2iRobot Create Open Interface (OI) Specification
iRobot Create
®
Open Interface
Overview
The Create Open Inter face (OI) consists of an electronic interface and a software interface for controlling Create’s behavior and reading its sensors. The electronic inter face includes a 7 pin Mini-DIN connector and a DB-25 connector in the Cargo Bay for connecting hardware and electronics for sensors and actuators such as a robotic arm or light sensor to Create. The software interface lets you manipulate Create’s behavior and read its sensors through a series of commands including mode commands, actuator commands, song commands, demo commands, and sensor commands that you send to Create’s serial por t by way of a PC or microcontroller that is connected to the Mini-DIN connector or Cargo Bay Connector.
Anatomy
Tailgate
Cargo Bay
DB-25
Omnidirectional IR Receiver
Handle
6-32 Mounting Cavities
Mini-Din
Charging Socket
3iRobot Create Open Interface (OI) Specification
7
4
2
5
6
3
1
123456789101112
141516171717202122232425
13
Physical Connections
To use the OI, a processor capable of generating serial commands such as a PC or a microcontroller must be connected to the external Mini-DIN connector or the Cargo Bay Connector on Create. These connectors provide two-way, serial communication at TTL (0 – 5V) levels. The connectors also provide an unregulated direct connection to iRobot Create’s batter y, which you can use to power the OI applications. The Cargo Bay Connector also provides a regulated 5V power supply and several input and output pins (see details below). The Mini-DIN connector is located in the rear right side of Create, beneath a snap-fit plastic guard, while the Cargo Bay Connector is located in the front middle of the cargo bay.
Mini-DIN Connector
This diagram shows the pinout of the top view of the female connector in Create. Note that pins 5,6 and 7 are towards the outside circumference of Create.
Pin Name Description
1 Vpwr Create battery + (unregulated)
2 Vpwr Create battery + (unregulated)
3 RXD 0 – 5V Serial input to Create
4 TXD 0 – 5V Serial output from Create
5 BRC Baud Rate Change
6 GND Create battery ground
7 GND Create battery ground
Since the RXD and TXD pins use 0 – 5V logic voltage and the PC serial por ts use dif ferent voltages (rs232 levels), it is necessary to shift voltage levels. To do this, use an iRobot Create serial cable rather than a normal serial cable, as the iRobot Create serial cable contains all of the necessary hardware to shift the voltage levels, whereas the normal serial cable does not.
Cargo Bay Connector
The Cargo Bay Connector, located in the front middle of the cargo bay, contains 25 pins that you can use to attach electronics for peripheral devices such as additional sensors. The Cargo Bay Connector provides four digital inputs, an analog input, three digital output s, three high-current low side driver outputs (useful for driving motors), a charging indicator, a power toggle input, serial Tx and Rx, a 5V reference, batter y ground and batter y voltage.
Pin Name Description
1
RXD 0 – 5V Serial input to Create
2
TXD 0 – 5V Serial output from Create
3 Power control toggle Turns Create on or off on a low-to-high
transition
4 Analog input
5 Digital input 1 0 - 5V digital input to Create
6 Digital input 3 0 - 5V digital input to Create
7 Digital output 1 0 - 5V, 20 mA digital output from Create
8
Switched 5V Provides a regulated 5V 100 mA supply
9 Vpwr Create battery voltage (unregulated), 0.5A
10 Switched Vpwr Provides battery power @ 1.5 A when
11 Switched Vpwr Provides battery power @ 1.5 A when
12 Switched Vpwr Provides battery power @ 1.5 A when
13 Robot charging When Create is charging, this pin is high (5V)
14 GND Create batter y ground
15 Device Detect/Baud
Rate Change Pin
16 GND
17 Digital input 0 0 - 5V digital input to Create
18 Digital input 2 0 - 5V digital input to Create
19 Digital output 0
20 Digital output 2
21 GND Create batter y ground
22 Low side driver 0
23 Low side driver 1
24 Low side driver 2
25 GND
0 - 5V analog input to Create
and analog reference voltage when Create is switched on
Create is powered on.
Create is powered on.
Create is powered on.
0-5V digital input to Create which can also be used to change the baud rate to 19200 (see below)
Create battery ground
0 - 5V, 20 mA digital output from Create
0 - 5V, 20 mA digital output from Create
0.5A low side driver from Create
0.5A low side driver from Create
1.5A low side driver from Create
Create battery ground
4iRobot Create Open Interface (OI) Specification
Serial Port Settings
Baud: 57600 or 19200 (see below)
Data bits: 8
Parity: None
Stop bits: 1
Flow control: None
By default, iRobot Create communicates at 57600 baud. If you are using a microcontroller that does not support 57600 baud, there are two ways to force Create to switch to 19200:
Method 1:
When powering on Create, hold down the Play button. After about 4 seconds, Create plays a tune of descending pitches. Create will communicate at 19200 baud until the power is turned off, the battery is removed and reinserted, the batter y voltage falls below the minimum required for processor operation, or the baud rate is explicitly changed by way of the OI.
Method 2:
Use the Baud Rate Change pin (pin 15 on the Cargo Bay Connector/pin 5 on the Mini-DIN connector) to change Create’s baud rate. After turning on Create, wait 2 seconds and then pulse the Baud Rate Change low three times. Each pulse should last between 50 and 500 milliseconds. Create will communicate at 19200 baud until the processor loses battery power or the baud rate is explicitly changed by way of the OI.
5iRobot Create Open Interface (OI) Specification
iRobot Create Open Interface Modes
The Create OI has four operating modes: Of f, Passive, Safe, and Full. After a battery change or when is first supplied, the OI is in “off” mode. When it is off, the OI listens at the default baud rate (57600 or 19200 - see Serial Port Settings above) for an OI Star t command. Once it receives the Start command, you can enter into any one of the four operating modes by sending a mode command to the OI. You can also switch between operating modes at any time by sending a command to the OI for the operating mode that you want to use.
Passive Mode
Upon sending the Start command or any one of the demo commands (which also starts the specific demo, e.g., Spot Cover, Cover, Cover and Dock, or Demo), the OI enters into Passive mode. When the OI is in Passive mode, you can request and receive sensor data using any of the sensors commands, but you cannot change the current command parameters for the actuators (motors, speaker, lights, low side drivers, digital outputs) to something else. To change how one of the actuators operates, you must switch from Passive mode to Full mode or Safe mode.
While in Passive mode, you can read Create’s sensors, watch Create per form any one of its ten built-in demos, and charge the batter y.
Full Mode
When you send a Full command to the OI, Create enters into Full mode. Full mode gives you complete control over Create, all of its actuators, and all of the safety-related conditions that are restricted when the OI is in Safe mode, as Full mode shuts of f the cliff, wheel-drop and internal charger safety features. To put the OI back into Safe mode, you must send the Safe command.
If no commands are sent to the OI when in Full mode, Create waits with all motors and LEDs off and does not respond to Play or Advance button presses or other sensor input.
Note that charging terminates when you enter Full Mode.
Safe Mode
When you send a Safe command to the OI, Create enters into Safe mode. Safe mode gives you full control of Create, with the exception of the following safety-related conditions:
• Detection of a cliff while moving forward (or moving backward with a small turning radius, less than one robot radius).
• Detection of a wheel drop (on any wheel).
• Charger plugged in and powered.
Should one of the above safety-related conditions occur while the OI is in Safe mode, Create stops all motors and reverts to the Passive mode.
If no commands are sent to the OI when in Safe mode, Create waits with all motors and LEDs off and does not respond to Play or Advance button presses or other sensor input.
Note that charging terminates when you enter Safe Mode.
6iRobot Create Open Interface (OI) Specification
Open Interface Command Reference
The following is a list of all of iRobot Create’s Open Inter face commands. Each command starts with a one-byte opcode. Some of the commands must be followed by data bytes. All of Create’s OI commands including their required data bytes are described below.
NOTE: Always send the required number of data bytes for the command, otherwise, the processor will enter and remain in a “waiting” state until all of the required data bytes are received.
Getting Started Commands
The following commands star t the Open Inter face and get it ready for use.
Start Opcode:128 Data Bytes: 0
This command starts the OI. You must always send the Start command before sending any other commands to the OI.
• Serial sequence: [128].
• Available in modes: Passive, Safe, or Full
• Changes mode to: Passive. Create beeps once to acknowledge it is starting from “off” mode.
Baud Opcode: 129 Data Bytes: 1
This command sets the baud rate in bits per second (bps) at which OI commands and data are sent according to the baud code sent in the data byte. The default baud rate at power up is 57600 bps, but the star ting baud rate can be changed to 19200 by holding down the Play button while powering on Create until you hear a sequence of descending tones. Once the baud rate is changed, it persists until Create is power cycled by pressing the power button or removing the battery, or when the battery voltage falls below the minimum required for processor operation. You must wait 100ms after sending this command before sending additional commands at the new baud rate.
Note: at a baud rate of 115200, there must be at least 200μs between the onset of each character, or some characters may not be received.
• Serial sequence: [129][Baud Code]
• Available in modes: Passive, Safe, or Full
• Changes mode to: No Change
• Baud data byte 1: Baud Code (0 - 11)
Baud Code Baud Rate in BPS
0
1
2 1200
3 2400
4 4800
5 9600
6
7 19200
8 28800
9
10 57600
11 115200
300
600
14400
38400
Mode Commands
Create has four operating modes: Off, Passive, Safe, and Full. Create powers on in the Passive mode. The following commands change Create’s OI mode.
Safe Opcode: 131 Data Bytes: 0
This command puts the OI into Safe mode, enabling user control of Create. It turns off all LEDs. The OI can be in Passive, Safe, or Full mode to accept this command.
• Serial sequence: [131]
• Available in modes: Passive, Safe, or Full
• Changes mode to: Safe
Note: The effect and usage of the Control command (130) is identical to the Safe command. The Control command is deprecated but is present for backward compatibility with the Roomba Open Interface. Use Safe command instead.
Full Opcode: 132 Data Bytes: 0
This command gives you complete control over Create by putting the OI into Full mode, and turning of f the cliff, wheel-drop and internal charger safety features. That is, in Full mode, Create executes any command that you send it, even if the internal charger is plugged in, or the robot senses a cliff or wheel drop.
• Serial sequence: [132]
• Available in modes: Passive, Safe, or Full
• Changes mode to: Full
Note: Use the Start command (128) to change the mode to Passive.
7iRobot Create Open Interface (OI) Specification
Demo Commands
The following are commands to star t iRobot Create’s built-in demos.
Demo Opcode: 136 Data Bytes: 1
This command starts the requested built-in demo.
• Serial sequence: [136][Which-demo]
• Available in modes: Passive, Safe, or Full
• Changes mode to: Passive
• Demo data byte 1: Demo number (-1 - 9)
Demo Names, Descriptions and Numbers
Number Demo
-1 (255) Abort current demo
0 Cover
1 Cover and Dock Identical to the Cover demo, with one
2 Spot Cover Create covers an area around its
3 Mouse Create drives in search of a wall. Once
4 Drive Figure Eight Create continuously drives in a figure 8
5 Wimp Create drives forward when pushed from
6 Home
Description
Stops the demo that Create is currently performing.
Create attempts to cover an entire room using a combination of behaviors, such as random bounce, wall following, and spiraling.
exception. If Create sees an infrared signal from an iRobot Home Base, it uses that signal to dock with the Home Base and recharge itself.
starting position by spiraling outward, then inward.
a wall is found, Create drives along the wall, traveling around circumference of the room.
pattern.
behind. If Create hits an obstacle while driving, it drives away from the obstacle.
Create drives toward an iRobot Vir tual Wall as long as the back and sides of the virtual wall receiver are blinded by black electrical tape.
A Virtual Wall emits infrared signals that Create sees with its Omnidirectional Infrared Receiver, located on top of the bumper.
Number
7
8
9 Banjo
Demo Description
Tag Identical to the Home demo, except
Create drives into multiple virtual walls by bumping into one, turning around, driving to the next virtual wall, bumping into it and turning around to bump into the next virtual wall.
Pachelbel Create plays the notes of Pachelbel’s
Canon in sequence when cliff sensors are activated.
Create plays a note of a chord for each of its four cliff sensors. Select the chord using the bumper, as follows:
• No bumper: G major.
• Right/left bumper: D major 7
• Both bumpers (center): C major
You can also call the Cover, Cover and Seek Dock and Spot Demos using the Opcodes specified below. This is present for ensuring backward compatibility with the Roomba OI.
Cover Opcode: 135 Data Bytes: 0
This command starts the Cover demo.
• Serial sequence: [135]
• Available in modes: Passive, Safe, or Full
• Changes mode to: Passive
Cover and Dock Opcode: 143 Data Bytes: 0
This command starts the Cover and Dock demo.
• Serial sequence: [143]
• Available in modes: Passive, Safe, or Full
• Changes mode to: Passive
Spot Opcode: 134 Data Bytes: 0
This command starts the Spot Cover demo.
• Serial sequence: [134]
• Available in modes: Passive, Safe, or Full
• Changes mode to: Passive
If you want Create to home in on a Virtual Wall, cover all but a small opening in the front of the infrared receiver with black electrical tape.
Create spins to locate a virtual wall, then drives toward it. Once Create hits the wall or another obstacle, it stops.
8iRobot Create Open Interface (OI) Specification
Loading...
+ 17 hidden pages