Pololu Balboa 32U4 User Manual

Pololu Balboa 32U4 User Manual

Balancing robot

Advertisement

Quick Links

Pololu Balboa 32U4 Balancing Robot User's Guide
© 2001–2019 Pololu Corporation
Pololu Balboa 32U4 Balancing
Robot User's Guide
https://www.pololu.com/docs/0J70/all
Page 1 of 97

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Balboa 32U4 and is the answer not in the manual?

Questions and answers

Summary of Contents for Pololu Balboa 32U4

  • Page 1 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Pololu Balboa 32U4 Balancing Robot User’s Guide https://www.pololu.com/docs/0J70/all Page 1 of 97...
  • Page 2: Table Of Contents

    4. Assembling the Balboa 32U4 kit ....... . . 45...
  • Page 3: Overview

    LCD allow the robot to provide feedback. The Balboa 32U4 can be used either as a standalone control solution or as a base for a more powerful Raspberry Pi controller. Its on-board connector and mounting holes allow a compatible Raspberry...
  • Page 4: Included Components

    A software add-on is available that makes it easy to program a Balboa 32U4 robot from the Arduino environment, and we have Arduino libraries and example sketches to help get you started. A...
  • Page 5 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation The Balboa 32U4 is available as a [https://www.pololu.com/ that requires product/3575] assembly and soldering. The includes following components: • Balboa core chassis ◦ battery box and cover ◦ two motor retention clips/ gearbox housings ◦...
  • Page 6 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation ◦ jumper wires (for soldering motors to the main board) ◦ two magnetic encoder discs (12 CPR) [https://www.pololu.com/product/2599] ◦ four 3/16″ #2-56 screws and nuts • bumper cage kit , which includes: [https://www.pololu.com/product/3574]...
  • Page 7 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 1. Overview Page 7 of 97...
  • Page 8: What You Will Need

    You will need a number of additional components and tools to complete your Balboa robot, the most important of which are motors and wheels. Since the Balboa 32U4 robot kit works with a variety of motors and wheels, motors and wheels are not included; this means you can choose your own to personalize your robot.
  • Page 9 Micro metal gearmotor HPCB with extended motor shaft. The kit includes magnetic encoder discs, and the encoder sensors are built into the Balboa 32U4 control board, so you do not need to order encoders with your motors. Wheel selection We recommend using the Balboa with 80×10mm Pololu wheels, which are available in five colors...
  • Page 10 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Pololu wheel 80×10mm pair – red. These additional items are also needed for using and assembling the Balboa 32U4 robot kit: Other things you will need • six AA batteries [https://www.pololu.com/...
  • Page 11 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation • tape or small clamps (for holding parts together when soldering) • small 2 mm slotted screwdriver for adjusting the LCD contrast Optional accessories You might also consider getting these for your Balboa: •...
  • Page 12: Supported Operating Systems

    [https://www.pololu.com/product/2588] 1.3. Supported operating systems The Balboa 32U4 control board can be programmed using any operating system that supports the Arduino environment. This includes Microsoft Windows 10, 8.1, 8, 7, Vista, XP (with Service Pack 3), Linux, and macOS.
  • Page 13: Contacting Pololu

    Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 2. Contacting Pololu We would be delighted to hear from you about any of your projects and about your experience with the Balboa 32U4. You can contact us directly or post on our forum [https://www.pololu.com/contact]...
  • Page 14: Balboa 32U4 In Detail

    , which allows it to be easily programmed using the [https://www.pololu.com/docs/0J66/7] Arduino IDE. For more information about programming the Balboa 32U4, see Section The board also has a 6-pin ISP header that allows it to be programmed with an external programmer,...
  • Page 15 LED indicates when the USB bus voltage (VBUS) is present. Pushbuttons The Balboa 32U4 control board has five pushbuttons: a power button in the bottom left corner, a reset button in the top right corner, and three user pushbuttons located along the bottom edge. The user pushbuttons, labeled A, B, and C, are on Arduino pin 14 (PB3), pin 30 (PD5), and pin 17 (PB0), respectively.
  • Page 16 Buzzer buzzer included with the Balboa 32U4 control board can be [https://www.pololu.com/product/1484] soldered into the designated through-holes and used to generate simple sounds and music. By default, it is connected to digital pin 6 (which also serves as OC4D, a hardware PWM output from the AVR’s 10-bit Timer4).
  • Page 17: Motors

    Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 3.3. Motors Motor drivers Two on-board Texas Instruments DRV8838 motor drivers power the Balboa’s two micro metal gearmotors. Four Arduino pins are used to control the drivers: • Digital pin 15, or PB1, controls the right motor direction (LOW drives the motor forward, HIGH drives it in reverse).
  • Page 18 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Each drive motor on the Balboa 32U4 has a corresponding quadrature encoder system consisting of a magnetic disc attached to the extended motor shaft and a pair of Hall effect sensors mounted on the control board.
  • Page 19: Inertial Sensors

    Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation The XORed signal and the channel B signal can be used to reconstruct the channel A signal by simply XORing them again: (A XOR B) XOR B = A. For both encoders, channel B leads channel A when the motor is rotating in the forward direction;...
  • Page 20 The Balboa32U4 library (see Section 6) includes example programs that demonstrate how to use the sensors, including a balancing demo. In addition, the sensor ICs on Balboa 32U4 are the same as those on our MinIMU-9 v5 , so software written for the [https://www.pololu.com/product/2738]...
  • Page 21: Power

    © 2001–2019 Pololu Corporation 3.6. Power The Balboa 32U4 control board includes battery terminal connections that provide access to power from the Balboa chassis’s six-AA battery compartment. We recommend using rechargeable AA NiMH cells, which results in a nominal voltage of 7.2 V (1.2 V per cell). You can also use alkaline cells, which would nominally give you 9 V.
  • Page 22 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation The power switch circuit also offers several alternate pushbutton connection options that result in push-on-only or push-off-only operation, and additional inputs enable further power control options like allowing your robot to turn off its own power. These advanced control options are available through the...
  • Page 23 The Balboa 32U4 control board also contains a 3.3 V LDO that draws its power from the output of the logic power selection circuit described below. The output of the 3.3 V regulator is designated 3V3 and is used to supply the on-board inertial sensors and level shifters.
  • Page 24: Expansion Headers

    3.7. Expansion headers The Balboa 32U4 control board has expansion headers on its four edges that break out several free general-purpose I/O lines from the ATmega32U4 microcontroller along with a few power pins.
  • Page 25 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Pinout diagram of the Balboa 32U4 control board (ATmega32U4 pinout and peripherals). 3. Balboa 32U4 in detail Page 25 of 97...
  • Page 26 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Pinout diagram of the Balboa 32U4 control board (Raspberry Pi pinout and peripherals, level shifter, and board power control). 3. Balboa 32U4 in detail Page 26 of 97...
  • Page 27: Raspberry Pi Interface And Level Shifters

    Power distribution diagram of the Balboa 32U4 control board. 3.8. Raspberry Pi interface and level shifters The Balboa 32U4 control board was designed to be easy to interface with a Raspberry Pi single- board computer to expand Balboa’s processing power. The board has mounting locations for a...
  • Page 28 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation The Balboa 32U4 kit does not include a Raspberry Pi connector or mounting hardware. To add a Raspberry Pi, you will need a 2×20-pin 0.1″ female header and a set of two standoffs [https://www.pololu.com/product/1037]...
  • Page 29 [https://www.pololu.com/product/3119] Raspberry Pi and Raspberry Pi slave library for Arduino still apply for the Balboa 32U4, and we will be releasing an updated tutorial with steps specific to the Balboa soon.
  • Page 30 , using the utilities provided there. When suitably programmed, the [https://github.com/raspberrypi/hats] EEPROM can help the Raspberry Pi identify and configure itself to work with the Balboa 32U4 control board. Write protection for the EEPROM can be enabled by using solder to bridge the surface-mount jumper 3.
  • Page 31: Pin Assignments

    The table below lists the most important pin assignments for the ATmega32U4 on the Balboa 32U4 control board. This table is helpful if you want to add your own electronics to Balboa 32U4, write your own low-level code for interfacing with the hardware, or just want to understand better how Balboa32U4 works.
  • Page 32 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation ATmega32U4 Arduino Balboa 32U4 control board Notes/alternate functions pin name pin names functions Timer0 PWM output A (OC0A) Timer1 PWM output C LCD control line (E) (OC1C) UART flow control (RTS)
  • Page 33 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation ATmega32U4 Arduino Balboa 32U4 control board Notes/alternate functions pin name pin names functions Timer1 PWM output B (OC1B) Timer4 PWM output B (OC4B) Pin-change interrupt (PCINT6) SPI Master Output/Slave...
  • Page 34: Adding Electronics

    Analog input (ADC1) internally pulled high, active RESET Reset pushbutton AREF Analog reference 3.10. Adding electronics This section gives tips for how additional electronics can be connected to the Balboa 32U4 control board. 3. Balboa 32U4 in detail Page 34 of 97...
  • Page 35 Be careful about connecting electronics to pin 13 (PC7), pin 17 (PB0), and pin 30 (PD5) on the LCD connector. These pins are used to control the LEDs on Balboa 32U4. All three of these pins are controlled as outputs by the bootloader. Pin 17 (PB0) and pin 30 (PD5) are used as RX and TX indicators, so if you are sending or receiving data over USB then the Arduino USB code will drive those pins in its interrupt service routines while your sketch is running.
  • Page 36: Avr Timers

    For more information about these power nodes and how much current they can provide, see Section 3.6. It is also possible to add your own power switch to control power to Balboa 32U4, as described in Section 3.6. Ground You should make sure that all the grounds in your system are connected.
  • Page 37: Bumper Cage

    Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 3.12. Bumper cage Along with protecting the robot during falls or collisions, the bumper cage can be used to hold the robot in a particular position when not balancing. See the instructions in...
  • Page 38 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation The diagrams below show the bumper cage assembled and installed on the Balboa in various positions; the top pictures show various inclined positions available, while the bottom picture shows the declined positions.
  • Page 39 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 3. Balboa 32U4 in detail Page 39 of 97...
  • Page 40 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation These diagrams are also available in a downloadable PDF [https://www.pololu.com/file/0J1284/ (2MB pdf). cha01-bumper-cage-diagrams.pdf] Additionally, the included spacers can be used in place of the pair of bumper skids on either side of the robot and allow you to use just one side of the bumper cage.
  • Page 41: Stability Conversion Kit

    Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 3.13. Stability Conversion Kit This accessory kit is an add-on extension for the Balboa chassis that provides additional mounting options and support for a ball caster. 3. Balboa 32U4 in detail...
  • Page 42 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Stability Conversion Kit for Balboa. When installed on the Balboa chassis, the ball caster on the Stability Conversion Kit provides a smooth third point of contact for traditional differential-drive applications. See Section 4 for assembly details.
  • Page 43: Schematics And Dimensions

    These diagrams are also available in a downloadable PDF [https://www.pololu.com/file/0J1533/stability- (392k pdf). conversion-kit-for-balboa-dimensions.pdf] 3.14. Schematics and dimensions Schematics The schematic diagram for the Balboa 32U4 control board is available as a PDF: Balboa 32U4 control board schematic diagram [https://www.pololu.com/file/0J1267/balboa-32u4-control-board- (587k pdf).
  • Page 44 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Dimensions of the Balboa 32U4 Balancing Robot with 80×10mm wheels. 3. Balboa 32U4 in detail Page 44 of 97...
  • Page 45: Assembling The Balboa 32U4 Kit

    Preparing electronics 1. Before doing any assembly, now is a good time to solder in the buzzer to the Balboa 32U4 control board. 2. Optional: This is a convenient time to add any other optional electronics or headers (such as 2×20 female header...
  • Page 46 3. Cut two of the included jumper wires in half and solder them to the motor output pins with the excess wire protruding out of the top of the board as shown. Battery contacts and electronics 4. Set aside the Balboa 32U4 control board and insert the double-sided battery contacts as shown below. 4. Assembling the Balboa 32U4 kit...
  • Page 47 5. Flip the chassis over and insert the two individual battery contact terminals into the top of the chassis. 6. Place the Balboa 32U4 control board on the chassis, making sure the battery terminals insert into the slots on the board. Secure the board in place using the four included #2-56 screws 4.
  • Page 48 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation and nuts. 7. Solder the battery terminals to the Balboa 32U4 control board. 4. Assembling the Balboa 32U4 kit Page 48 of 97...
  • Page 49 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Motors and encoders 8. Place a motor into one of the motor slots on the chassis with its positive terminal toward the longer end of the board, as indicated. (When the Balboa is fully assembled and balancing upright, the positive motor terminal should be closer to the top.) When properly seated in the...
  • Page 50 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 9. Install the motor retention clip/gearbox housing by aligning the two tabs on the chassis with the slots on the clip, sliding the clip up until the tabs are seated in the slots, and rotating the clip into position until you hear it click into place.
  • Page 51 11. Install the magnetic encoder disc on the motor’s extended motor shaft. It should be flush with the end of the shaft and align with the sensors on the Balboa 32U4 control board. 12. Repeat steps 8 through 11 for the second motor (again making sure the + terminal of the motor is toward the longer end of the board).
  • Page 52 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Gearboxes 13. Choose a gear ratio to use with your Balboa. There are five combinations of the included gears to choose from, each resulting in a different ratio. The...
  • Page 53 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 16. Repeat steps 14 and 15 to assemble the other gearbox, making sure to use the same gear ratio. Wheels and batteries 17. Press the wheels onto the output shafts of the gearboxes until the shaft is flush with the outer surface of the wheel.
  • Page 54 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 18. Install six new or freshly charged AA batteries in the battery compartment (we recommend using rechargeable AA NiMH cells ). The correct [https://www.pololu.com/product/1003] orientation for the batteries is indicated by the battery-shaped holes in the Balboa chassis as well as the + and –...
  • Page 55 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation The basic assembly of your Balboa chassis is now complete! 4. Assembling the Balboa 32U4 kit Page 55 of 97...
  • Page 56 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 4. Assembling the Balboa 32U4 kit Page 56 of 97...
  • Page 57 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Adding the Stability Conversion Kit <div class="player-unavailable"><h1 class="message">An error occurred.</h1><div class="submessage"><a If you have the Stability Conversion Kit for the Balboa , you [https://www.pololu.com/product/3572] can use it to provide a smooth third point of contact for traditional differential-drive applications.
  • Page 58 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Align the slots on the Stability Conversion Kit with the rails on the Balboa chassis and slide the two pieces together until the clips snap into place. Optionally, you can use the two mounting holes (located just outside of the clips) to further secure the Stability Conversion Kit to the Balboa chassis.
  • Page 59 To remove the Stability Conversion Kit from the Balboa, push on the extension piece while simultaneously pulling back on the clips. If you have the Balboa 32U4 control board (or other electronics) mounted on the Balboa chassis, you might consider using a small screwdriver to help reach the clips.
  • Page 60 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Adding protection against falls When you are using the Balboa as a balancing robot, it is important to protect the electronics from hard falls that could damage them. In general, we recommend running the Balboa on soft surfaces, such as carpet.
  • Page 61 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 4. Assembling the Balboa 32U4 kit Page 61 of 97...
  • Page 62 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation The bumper cage cross bars (shown below) help stabilize the bumper cage and can be installed in various locations, as needed, along the slots or in the designated mounting holes on each bumper skid.
  • Page 63 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 4. Assembling the Balboa 32U4 kit Page 63 of 97...
  • Page 64 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation The bumper cage also comes with two spacers, which allow just one side of the bumper cage to be used. This is achieved by substituting one set of bumper skids with the spacers.
  • Page 65 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Home-made bumper cages could also be used to not only protect electronics, but also add uniqueness and creativity to your robot. The pictures below show two such home-made examples: 4.
  • Page 66 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Balboa 32U4 Balancing Robot with Balboa 32U4 Balancing Robot with 80×10mm wheels and arms made from 80×10mm wheels and 3D-printed arms. LEGO blocks. We have made the arms in the left picture available on Thingiverse [http://www.thingiverse.com/...
  • Page 67: Programming The Balboa 32U4

    Service Pack 3, so we recommend Service Pack 3 over the hotfix. Before you connect your Pololu A-Star 32U4 (or another of our 32U4 family of boards) to a computer running Microsoft Windows, you should install its drivers: 1.
  • Page 68 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 4. Windows will not tell you when the installation is complete, but it should be done after a few seconds. Windows 10, Windows 8, Windows 7, and Windows Vista users: After installing the drivers, your computer should automatically recognize the device when you connect it via USB.
  • Page 69: Programming Using The Arduino Ide

    After installing the drivers and plugging in an A-Star, in the “Ports (COM & LPT)” category of the Device Manager, you should see a COM port for the A-Star’s running sketch named “Pololu A-Star 32U4”. You might see that the COM port is named “USB Serial Device” in the Device Manager instead of having a descriptive name.
  • Page 70 URL on a new line. Adding a Boards Manager index for Pololu boards in the Arduino IDE’s Preferences dialog. 3. Click the “OK” button to close the Preferences dialog.
  • Page 71 7. After the installation finishes, click the “Close” button to close the Boards Manager dialog. 8. In the Tools > Board menu, select the “Pololu A-Star 32U4” entry. If you do not see your device listed in the Board menu, try restarting the Arduino IDE.
  • Page 72 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Windows 10 Device Manager showing the A-Star’s virtual COM port. 10. Open up the “Blink” Arduino example, which can be found under File > Examples > 01.Basics > Blink. The code in this example will blink the yellow LED. When you select the Blink example, a new Arduino IDE window will open up.
  • Page 73 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation USB port, then Windows might take several seconds to recognize the A-Star bootloader. The bootloader times out after 8 seconds and goes back to running the sketch, so the upload might fail if Windows does not recognize it quickly enough.
  • Page 74: Programming Using Avr-Gcc And Avrdude

    Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation the LED. The A-Star 32U4 boards are similar enough to the Arduino Leonardo that you do not actually have to install the add-on. If you want to, you can just select the “Arduino Leonardo”...
  • Page 75 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation sudo apt-get install gcc-avr avr-libc avrdude After you have installed the prerequisites, open a command prompt and try running these commands to make sure all the required utilities are available:...
  • Page 76 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation In Windows, should work if the A-Star is the only USB device connected that is \\\\.\\USBSER000 using the usbser.sys driver, but you can change it to be the actual name of the COM port (e.g.
  • Page 77: Balboa 32U4 Arduino Library

    [https://github.com/pololu/lis3mdl-arduino] LSM6 library is required to run the Balboa32U4 library’s “Balancer” example). If you are using your Balboa 32U4 with a Raspberry Pi, you might also want to make use of our Raspberry Pi slave library for Arduino , which [https://github.com/pololu/pololu-rpi-slave-arduino-library]...
  • Page 78: How To Make A Balboa Balance

    Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 7. How to make a Balboa balance Balancing a two-wheeled robot like the Balboa is a classic problem in control theory, known as the “inverted pendulum”, and there are many approaches to solving it. This section discusses the simple...
  • Page 79 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation void setup() // Initialize IMU. Wire.begin(); (!imu.init()) while(true) Serial.println("Failed to detect and initialize IMU!"); delay(200); imu.enableDefault(); imu.writeReg(LSM6::CTRL2_G, 0b01011000); // 208 Hz, 1000 deg/s // Wait for IMU readings to stabilize.
  • Page 80: An Example Balancing Algorithm

    The next section discusses the approach to balancing used in our example code. 7.2. An example balancing algorithm Angle convention used by the Balboa 32U4 balancing example. The gyro measurements we described in the previous section gave us two important variables: •...
  • Page 81 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Now suppose we push it harder, so that it falls over onto its other side. This time, it continues rotating as it passes through vertical, then falls backwards onto the floor: 7.
  • Page 82 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation Somewhere between these two paths lies a perfectly-balanced trajectory, indicated by the gray dashed line. If we could give it the exact right push, it would follow that line, rising up to vertical just as the rate of rotation falls to zero, and remain balanced forever.
  • Page 83 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation When a Balboa is actively balancing, it “pushes” itself by adjusting the speed of its motors. When the motors make a sudden change in speed, they give a push to the chassis (the combined effect of direct motor torque and of the horizontal motion of the wheels).
  • Page 84 The Balboa 32U4 includes integrated quadrature encoders that allow a continuous measurement of how fast and far the wheels have turned. We can prevent the robot from driving away by adding additional adjustments to the motor speed that depend on the encoder readings.
  • Page 85 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation <div class="player-unavailable"><h1 class="message">An error occurred.</h1><div class="submessage"><a The yellow, green, and red LEDs visible in the second part of the video display what the Balboa thinks of its state, with each of the eight possible color combinations indicating a different eighth of the graph.
  • Page 86 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation One thing you can see from the graph is that the amount of forward acceleration and backward acceleration are about the same, so that overall effect is to drive forward then decelerate to a stop. It’s also important to note that the graph makes it look like the robot only does two large corrections, while in reality it is constantly making small adjustments to the motor speed.
  • Page 87: The Balboa 32U4 Usb Interface

    On a Windows computer, you can see the virtual serial port by going to your computer’s Device Manager and expanding the “Ports (COM & LPT)” list. You should see a COM port labeled “Pololu A- Star 32U4”. In parentheses after the name, you will see the name of the port (e.g. “COM3” or “COM4”).
  • Page 88 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 32U4” COM port. Near it, you should see the parent composite device. The Windows 10 Device Manager in “Devices by connection” mode, showing that the A-Star is a composite device.
  • Page 89: The A-Star 32U4 Bootloader

    Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 9. The A-Star 32U4 Bootloader Our 32U4 family of boards come with a USB bootloader that can be used in conjunction with the Arduino IDE or AVRDUDE to load new programs onto the device. This section documents some technical details of the bootloader for advanced users who want to better understand how it works.
  • Page 90 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation The startup logic for the A-Star 32U4 bootloader. Brown-out detection Unlike many other ATmega32U4 boards, our 32U4 family of boards have brown-out detection enabled. The brown-out threshold is 4.3 V, and if the voltage on VCC goes below this then the AVR will reset.
  • Page 91 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation The bootloader was designed so that the user program can detect brown-out resets. To do so, check to see if the BORF bit in the MCUSR register is set, and then clear it later. Here is some example code...
  • Page 92: Reviving An Unresponsive Balboa 32U4

    Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation 10. Reviving an unresponsive Balboa 32U4 In order to load a new program onto your A-Star 32U4 device, you will need to get it into bootloader mode and send programming commands to it over its virtual serial port using appropriate software. If...
  • Page 93 1. Connect the device to your computer via USB. 2. In the “Tools” menu, open the “Board” sub-menu and check to see if the “Pololu A-Star 32U4 (bootloader port)” entry is visible. If this entry is visible, you can skip to step 6.
  • Page 94: Reviving Using Avrdude

    Blink example that can be found under File > Examples > 01.Basics > Blink. After reviving your device, be sure to change the Board setting back to “Pololu A-Star 32U4” and select the right Port.
  • Page 95 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation using the command-line utility AVRDUDE in case your usual method of [http://www.nongnu.org/avrdude/] programming is not working. AVRDUDE stands for “AVR Downloader/UploaDEr”, and it is compatible with the A-Star bootloader.
  • Page 96: Related Resources

    Atmel Studio 7 [https://www.microchip.com/avr-support/atmel-studio-7] • AVRDUDE [http://www.nongnu.org/avrdude/] • AVR Freaks [http://www.avrfreaks.net/] Datasheets for some of the components found on the Balboa 32U4 control board are available below: • ATmega32U4 documentation [https://www.microchip.com/wwwproducts/en/ATmega32u4] • Texas Instruments DRV8838 motor driver datasheet [https://www.pololu.com/file/0J806/ (1MB pdf) drv8838.pdf]...
  • Page 97 Pololu Balboa 32U4 Balancing Robot User’s Guide © 2001–2019 Pololu Corporation • Texas Instruments TPS2113A power multiplexer datasheet [https://www.pololu.com/file/ (1MB pdf) 0J771/tps2113a.pdf] Finally, we would like to hear your comments and questions on the Pololu Robotics Forum [https://forum.pololu.com/] 11. Related resources...

Table of Contents