Documents »Baby Orangutan B User's GuideView document on multiple pages.
1. OverviewThe Baby Orangutan B-48 and B-168 robot controllers are complete control solutions for small robots. The small module includes a powerful Atmel ATmega48/168 microcontroller, two channels of bidirectional motor control, a user potentiometer, 18 user I/O lines (16 of which can be used as general-purpose digital I/Os and 8 of which can be used as analog input channels) that can be used to expand the system. A battery, motors, and sensors can be connected directly to the module to create simple robots. Note: This user’s guide applies only to the most recent Baby Orangutan B revision. The older, discontinued Baby Orangutans have green solder masks while the new Baby Orangutan Bs have blue solder masks. 2. Contacting PololuYou can check the Baby Orangutan B-168 robot controller page for additional information, including pictures, example code, and application notes. We would be delighted to hear from you about any of your projects and about your experience with the Baby Orangutan Robot controller. You can contact us directly or post on our forum. 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! 3. Schematic DiagramThe basic schematic of the Baby Orangutan B is identical to that of the larger Orangutan LV-168 robot controller. You can effectively build your own Orangutan LV-168 by adding a buzzer, LCD, and pushbuttons as indicated in the Orangutan LV-168 schematic. This design means software can be written for one device that will work on the other, provided the Baby Orangutan is given matching hardware connections.
4. Module Pinout and Component IdentificationThe Baby Orangutan contains a programmable ATmega48 or ATmega168 AVR microcontroller, a TB6612FNG dual H-bridge for direct control of two DC motors, a 10k user trimmer potentiometer (connected to ADC7), a green power LED, a red user LED (connected to PD1), a 20 MHz resonator, and a reverse-battery-protection MOSFET, all containted in a tiny 1.2" x 0.7" 24-pin DIP package. Power pins, one of the motor outputs, and several I/O lines are all accessible from one side to enable use of the Baby Orangutan as a single in-line pin (SIP) package for applications that do not require all of the I/O lines.
Warning: Pins PB4 and PB5 are used as ISP programming pins in addition to digital user I/O lines. Be careful not to connect anything to these pins that might interfere with programming (e.g. large capacitance or an external device that could drive those lines during programming). Similarly, don’t connect anything to those lines that might behave unexpectedly when they are driven during programming (e.g. if you use these lines as inputs to a motor driver IC, it could drive your motors in strange and potentially dangerous ways during programming) . You can tap into the Baby Orangutan’s regulated 5-V Vcc line using the pin labeled “Vcc” or either of the two pads on the bottom of the board directly to the left of this pin. You can tap into the Baby Orangutan’s ground using the two pads on the bottom of the board directly to the right of the “GND” pin.
5. Included Header PinsThe Baby Orangutan ships with 0.1" header pins as shown in the left picture below: two 12×1 strips and one 3×2 ISP programming header. Both 12×1 strips can be soldered in to allow the module to be used as a DIP component on breadboards or prototyping boards, or a single 12×1 strip can be soldered in to allow the module to be used as a single in-line pin (SIP) component (since power pins, one of the motor outputs, and several I/O lines are all accessible from one side). The header pins can be left off and wires can be directly soldered to the Baby Orangutan for space-constrained installations.
If you solder in the 3×2 ISP header pins, the solder connections should be made along the bottom side of the board so the pin connections are available from the top side of the board, as shown in the right picture above. If you solder the ISP pins to the wrong side of the board, your programmer’s ISP cable will not be able to connect correctly to the Baby Orangutan. 6. Getting StartedThe Baby Orangutan will run with power applied across the VIN and GND pins, which are located at the top-right corner of the board. The device is protected by a MOSFET against accidental reverse-battery connection. The supply voltage should be 5 – 13.5 V, with an absolute maximum of 15 V, so a 5- to 10-cell NiCd or NiMH battery pack is a good choice. When the Orangutan is powered, the green power LED will be illuminated. The RESET pin can be brought low to reset the controller, but it can otherwise be left disconnected (it is internally pulled high). To program the on-board Atmel ATmega48 or ATmega168 microcontroller, you will need an AVR ISP programmer, a compiler, and AVR ISP programming software.
As a first test, we recommend you try to program your Baby Orangutan with a simple program that blinks the red user LED on pin PD1: BlinkLED.zip (14k zip). This archive is a compressed AVR Studio project that is configured for the Baby Orangutan B-168. If you have a Baby Orangutan B-48, go into the project’s configuration options (via the Project->Configuration Options menu with the BlinkLED project open) and change the device to atmega48, then rebuild the project. Connect your programmer to the Baby Orangutan so that pin 1 of your programmer’s 6-pin ISP cable lines up with pin 1 of the Baby Orangutan’s programming header and then use AVR Studio to program your Baby Orangutan. You can accomplish this by selecting Tools->Program AVR->Auto Connect, which should bring up an AVRISP dialog box. Navigate to the project’s hex file (which is created in the default directory when you build the project) under the Flash section of this new dialog’s Program tab and click the Program flash button. If everything has worked correctly, you should see the Baby Orangutan’s red user LED blinking around once per second. For a more detailed account of how to get started using AVR Studio, including screenshots, please see our Orangutan USB programmer user’s guide. The user guide is specific to our Orangutan USB programmer, but much of the section on using AVR Studio should apply to you even if you have a different programmer. 7. AVR Pin Assignment Table Sorted by Function
8. AVR Pin Assignment Table Sorted by Pin
9. Motor Driver Truth Table
Motor 1 is controlled by pins PD5 and PD6, and motor 2 is controlled by PD3 and PB3. These pins are connected to the ATmega48/168’s four eight-bit hardware PWM outputs, which allows you to achieve variable motor speeds through hardware timers rather than software. This frees the CPU to perform other tasks while motor speed is automatically maintained. The suggested procedure for using hardware PWM outputs to control the motors is as follows:
Using these PWM settings, OCR0B = 255 is equivalent to holding PD5 low while OCR0A = 0 is equivalent to holding PD6 high. As you can see from the truth table above, in this state M1B will be connected to your battery’s positive terminal and M1A will be connected to ground. Decreasing OCR0B to something less than 255 decreases the percentage of time PD5 is low, causing M1B to alternate between VIN and GND (and hence causing motor 1 to alternate between drive and brake). Similarly, OCR2B = 255 is equivalent to holding PD3 low while OCR2A = 0 is equivalent to holding PB3 high. In this state, M2B will be connected to your battery’s positive terminal and M2A will be connected to ground. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Home
|
Contact
|
About
|
Forum
|
US toll free: 1-877-7-POLOLU |