Pololu 3pi Robot User's GuidePololu 3pi Robot User's Guide © 2001–2014 Pololu Corporationhttp://www.pololu.com/docs/0J21/all Page 1 of 63
Two rechargeable AAA Ni-MHbatteries.5. How Your 3pi Works5.a. BatteriesIntroduction to BatteriesThe power system on the 3pi begins with the batteries,
output is multiplied by the number of batteries. When they are connected in series, with the positive terminal of oneconnected to the negative termina
• Linear regulators use a simple feedback circuit to vary how much energy is passed through and how much isdiscarded. The regulator produces a lower o
A typical small brushed DCmotor, with no gearbox.One other interesting thing about this power system is that instead of gradually running out of power
The 30:1 gearmotor used on the3pi.Motor operation: current and speed vs. torque.The free-running speed of a small DC motor is usually many thousands o
If switches 1 and 4 are closed (the center picture), current flows through the motor from left to right, and the motorspins forward. Closing switches
PWM speed control, showing gradual deceleration.Speed control is achieved by rapidly switching themotor between two states in the table. Suppose wekee
The 3pi demonstrating the effects of various motorsettings.5.d. Digital inputs and sensorsThe microcontroller at the heart of the 3pi, an Atmel AVR me
The sensing element of the reflectance sensor is the phototransistor shown in the left half of U4, which is connected inseries with capacitor C21. A s
time = 0;last_time = TCNT2;while (time < _maxValue){// Keep track of the total time.// This implicity casts the difference to unsigned char, so// w
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
You can download a pdf version of the schematic here [http://www.pololu.com/file/download/3pi-schematic.pdf?file_id=0J119](481k pdf).Pololu 3pi Robot
6. Programming Your 3piTo do more with your 3pi than explore the demo program or use it as a serial slave to a master device, you will needto program
Pololu 3pi robot on a 3/4" black line.7. Example Project #1: Line Following7.a. About Line FollowingNow that you have learned how to compile a si
function used later in the code also depends on having calibrated values. For more information, see Section 19of the command reference [http://www.pol
• Display sensor readings on the LCD. Since writing to the LCD takes a significant amount of time, you shoulddo this at most few times per second.• In
lcd_load_custom_character(levels+4,4);lcd_load_custom_character(levels+5,5);lcd_load_custom_character(levels+6,6);clear(); // the LCD must be cleared
if(counter < 20 || counter >= 60)set_motors(40,-40);elseset_motors(-40,40);// This function records a set of sensor readings and keeps// track o
right_led(0);}else if(position < 3000){// We are somewhat close to being centered on the line:// drive straight.set_motors(100,100);left_led(1);rig
// Compute the derivative (change) and integral (sum) of the// position.int derivative = proportional - last_proportional;integral += proportional;//
8. Example Project #2: Maze Solving8.a. Solving a Line MazeThe next step up from simple line following is to teachyour 3pi to navigate paths with shar
1. IntroductionNote: Starting with serial number 0J5840, 3pi robots are shipping with the newer ATmega328Pmicrocontroller instead of the ATmega168. Th
switch(dir){case 'L':// Turn left.set_motors(-80,80);delay_ms(200);break;case 'R':// Turn right.set_motors(80,-80);delay_ms(200);b
// The "proportional" term should be 0 when we are on the line.int proportional = ((int)position) - 2000;// Compute the derivative (change)
that on the way, since you’ll travel down every hallway exactly twice. We use this simple, reliable strategy in our 3pimaze solving example:// This fu
}}The first main loop needs to drive down a segment of the course, decide how to turn, and record the turn in the pathvariable. To pass the correct ar
We’ll discuss the call to simplify_path() in the next section. Before that, let’s take a look at the second main loop,which is very simple. All we do
// Path simplification. The strategy is that whenever we encounter a// sequence xBx, we can simplify it by cutting out the dead end. For// example,
The above list of actions is a record of all the steps we took to fully explore the maze while looking for the end,which is marked by the large black
When we encounter the first intersection after our first “back” action, we know we have reached a dead end that canbe removed from our list of actions
We next end up with the sequence ‘RBL’, which reduces to a single back ‘B’, and this combines with the next actionto produce the sequence ‘LBL’, which
The last dead end gives us the sequence ‘SBL’, which reduces to a sigle right turn ‘R’. Our action list is now just ‘R’and represents the shortest pat
2. Contacting PololuYou can check the 3pi product page [http://www.pololu.com/product/975] for additional information, including pictures,videos, exam
• Increasing the line-following speed.• Improving the line-following PID constants.• Increasing turning speed.• Identifying situations where the robot
Typically, one might use encoders to measure the lengths of the segments. We were able to just use timing on the3pi, however, because of the 3pi’s pow
9. Pin Assignment TablesGeneral features of the Pololu 3pi robot, top view.Pololu 3pi Robot User's Guide © 2001–2014 Pololu Corporation9. Pin Ass
Labeled bottom view of the Pololu 3pi robot.Pololu 3pi Robot User's Guide © 2001–2014 Pololu Corporation9. Pin Assignment Tables Page 43 of 63
Specific features of the Pololu 3pi robot, top view.Pololu 3pi Robot User's Guide © 2001–2014 Pololu Corporation9. Pin Assignment Tables Page 44
Pin Assignment Table Sorted by FunctionFunction ATmegaxx8 Pin Arduino Pinfree digital I/Os (x3)(remove PC5 jumper to free digital pin 19)PD0, PD1, PC5
Pin Assignment Table Sorted by PinATmegaxx8Pin3pi Function Notes/Alternate FunctionsPD0 free digital I/O USART input pin (RXD)PD1 free digital I/Oconn
10. Expansion Information10.a. Serial slave programThe Pololu AVR library (see Section 6) comes with an example serial slave program for the 3pi in li
(XBee, Wixel [http://www.pololu.com/product/1337], Bluetooth, etc). Please note that the m3pi robot is also available fullyassembled. Please see the m
CommandbyteCommandDatabytesResponsebytesDescription0x81 signature 0 6Sends the slave name and code version, e.g. “3pi1.0”. Thiscommand also sets motor
3. Important Safety Warning and Handling PrecautionsThe 3pi robot is not intended for young children! Younger users should use this product only under
0xBA autocalibrate 0 1Turns the robot left and right while calibrating. For use whenthe robot it positioned over a line. Returns the character ‘c’when
serial_set_mode(SERIAL_AUTOMATIC);unsigned int position = read_line(sensors, IR_EMITTERS_ON);serial_set_mode(SERIAL_CHECK);// The "proportional&q
}// Returns true if and only if the byte is a data byte (< 0x80).char is_data(char byte){if (byte < 0)return 0;return 1;}// If it's not a d
int message[1];unsigned int tmp_sensors[5];int line_position;if(pid_enabled)line_position = last_proportional+2000;else line_position = read_line(tmp_
void do_play(){unsigned char tune_length = read_next_byte();if(check_data_byte(tune_length))return;unsigned char i;for(i=0;i<tune_length;i++){if(i
set_motors(-60, 60);while(get_ms() < 750)calibrate_line_sensors(IR_EMITTERS_ON);set_motors(60, -60);while(get_ms() < 1000)calibrate_line_sensors
break;case (char)0x87:send_calibrated_sensor_values(1);break;case (char)0xB0:send_trimpot();break;case (char)0xB1:send_battery_millivolts();break;case
• GND-GND• PD0-PD1• PD1-PD0Turn on both master and slave. The master will display a “Connect” message followed by the signature of the slavesource cod
// character, and character 255 (a full black box), we get 10// characters in the array.// The variable c will have values from 0 to 9, since// values
// print to the slave LCDvoid slave_print(char *string){serial_send_blocking("\xB8", 1);char length = strlen(string);serial_send_blocking(&a
4. Getting Started with Your 3pi RobotGetting started with your 3pi can be as simple as taking it out of the box, adding batteries, and turning it on.
// get the line positionserial_send("\xB6", 1);int line_position[1];if(serial_receive_blocking((char *)line_position, 2, 100))break;// get t
In addition to PD0 and PD1, the 3pi robot has a limited number of I/O lines that can be used as inputs for additionalsensors or to control additional
11. Related ResourcesTo learn more about using the Pololu 3pi Robot, see the following list of resources:• Pololu AVR Programming Quick Start Guide [h
12. Revision History and Errata• 3pi robots with serial numbers less than 0J7259 have AREF connected to AVCC. This makes it unsafe toconfigure the AVR
Labeled bottom view of the Pololu 3pi robot.The following subsections will give you all the information you need to get your 3pi up and running!4.a. W
You might find the following materials useful in creating an environment for your robot to explore:• Several large sheets of white posterboard (availa
all of the sensors should return entirely black readings with IR off. Removing the jumper marked PC5 disablescontrol of the emitters, causing them to
Kommentare zu diesen Handbüchern