Posts by Paul
You are currently viewing a selection of posts from the Pololu Blog. You can also view all the posts.
Belgian distributor MCHobby has released an adapter that allows a MicroPython Pyboard to control a Zumo Robot for Arduino. Using their MicroPython port of our Zumo Shield library, you can run programs like this on the Zumo:
from zumoshield import ZumoShield zumo = ZumoShield() zumo.motors.setSpeeds( 100, 100 ) # -400..0..400 zumo.motors.stop()
Even cooler, the on-board REPL allows live programming/debugging over USB. Here’s an example from their library documentation that shows a test of the Zumo’s accelerometer:
MicroPython v1.16-92-g98c570302-dirty on 2021-07-16; PYBv1.1 with STM32F405RG Type "help()" for more information. >>> >>> import test_acc x -241 y -23 x -236 y -16 x -233 y -68 x -223 y -81 x 1110 y -7073 <--- Knocked on the right side x -309 y -35 x -242 y -69
MicroPython is a minimal Python interpreter designed to run on microcontrollers such as the the Espressif ESP8266 and ESP32, the Raspberry Pi RP2040, and a variety of Arm processors. The Pyboard we are talking about here is the official reference board for MicroPython, based on a powerful Arm Cortex-M4 processor by ST. As you can see in the pinout diagrams below, most of the pins of the Pyboard are also broken out on the Zumo adapter, and the two Pyboard buttons are duplicated in more convenient locations:
An included Pololu voltage regulator and power diode allow the robot to be fully powered with batteries and also to safely connect to USB for programming. The MCHobby libraries demonstrate how to access all of the Zumo features from the Pyboard, in particular including example MicroPython code for line following and maze solving. There are many more possibilities with MicroPython on the Zumo, and we’re excited to see what the community will do with it!
For more information or to buy a board, see the Adaptateur Pyboard pour ZUMO Robot product page.
Tomorrow is Cyber Monday and the final day of our sale; you can check out the Monday deals on our sale page now. The weekend deals are still active until midnight Pacific, so this is your chance to pick out what you want from those and what you want to get on Monday!
Twelve hours until the Black Friday doorbusters start!
You can check out Friday’s deals and doorbusters flyer on our sale page now; complete details will be available later tonight.
Thursday’s deals and doorbusters are now shown on our Black Friday sale page. It’s going to be a Zumo-themed day, with a big sale on the Zumo robots and kits as well as the motors you need to build them. Or you can take advantage of Thursday’s discounts on microcontroller and motor controller boards to build your own sumo bot! Like Wednesday, Thursday’s doorbusters start at 6:00 AM Pacific, and there will be many more deals available all day, including site-wide discounts and free items.
Please note that we will be closed Thursday, and have a happy Thanksgiving!
This is the fifth and final post in a series about how to make a Balboa 32U4 robot balance. In earlier posts I covered everything you need to get the robot balancing. In this post I will talk about how to get your Balboa to perform some fun and challenging maneuvers.
If you have been following along, you should now have your robot using its inertial sensors, motors, and encoders together to balance in place. Now it’s time to get it moving! Our first challenge will be to get it to “pop up” from a resting position into a balancing position. Then I will show how you can get the Balboa to drive around while balancing. Continued…
This is the fourth post in a series about how to make a Balboa 32U4 robot balance. In earlier posts I covered the basic sensors and mechanical parts used for balancing; in this post I will show you how to put everything together to make the robot actually balance.
From earlier posts we have obtained six basic variables for use in balancing: Continued…
This is the third post in a series about how to make a Balboa 32U4 robot balance. Last week I talked about inertial sensors, especially the gyro. In this post I will talk about the Balboa’s built-in encoders, which allow accurate measurements of motor speed and distance.
To get your Balboa to balance, you will soon need to create a balancing algorithm, a program that takes sensor input and computes the appropriate motor speed settings to keep the robot upright. So far our only inputs, both from the gyro, are the rate of rotation and current angle of the robot. These are not quite enough to make a good balancer. To see why, suppose that your program tries to balance by holding the angle at a constant 90°. If your definition of 90° is even slightly off-balance, the robot will need to keep accelerating, driving faster and faster to maintain it, until it reaches top speed or hits an obstacle. You might be able to account for this by using the motor output settings themselves as an input to your algorithm, but this is difficult, especially at the low speeds used for balancing. Also, even if you can avoid accelerating, your robot will gradually drift in one direction or the other. The Balboa’s encoders are valuable additional sensor inputs that allow you to measure how fast the wheels are actually turning, so you can directly control acceleration and drift. As a bonus, encoders are great for driving straight, precision turns, and navigation. Continued…
This is the second post in a series about how to make a Balboa 32U4 robot balance. Last week I talked about selecting mechanical components. In this post I will cover the inertial sensors included on the Balboa’s control board and how to use them in your code.
The key to Balboa’s balancing ability is the built-in ST LSM6DS33 IMU chip, which combines a 3D gyroscope and a 3D accelerometer. The Balboa also includes an ST LIS3MDL 3-axis magnetometer. Both sensors are connected to the AVR via I²C, giving it access to a total of nine sensor channels. These nine channels can be used in software to make an AHRS (attitude and heading reference system), a system that gives the robot a sense of its orientation in three dimensions. AHRS software is particularly important in aviation/drone applications, but for basic balancing, you don’t need anything that complicated. In fact, a single gyro channel is enough to determine the robot’s angle of rotation relative to vertical. The gyroscope’s y-axis channel measures the Balboa’s forward/backward rate of rotation; that is the channel we will be looking at here. Continued…
This is the first post in a series about how to make a Balboa 32U4 robot balance. Today I will talk about selecting mechanical parts for your Balboa. We offer a variety of gearmotors and wheels that work with the Balboa, and the Balboa kit includes five different gear ratios for the external gearbox, so even without considering non-standard modifications, there are many possible configurations of the robot. In this post I will give you some guidance about choosing the right parts. Continued…
What do you need to turn a Romi chassis into a functioning robot? Here are some Romi projects from the community, as well a couple of our example builds:
A variety of controllers can be used with the Romi, but until now you have had to figure out lots of wiring to connect everything together. You will always need some wiring to connect your own sensors or other devices, but we have been trying to make it easier to get started, beginning with the Romi power distribution board and motor driver board, which help simplify some of the more difficult parts. Our new Romi 32U4 Control Board is the culmination of this product line: a complete controller solution for the Romi that integrates power, motor control, and an Arduino-compatible microcontroller.
Romi power distribution board, motor driver board,
Here is how it looks when connected to a Romi Chassis with motors and encoders plugged in, as well as the optional LCD:
Features of the Romi 32U4 Control Board
Pinout diagram of the Romi 32U4 Control Board (ATmega32U4 pinout, peripherals, and board power control).
- Reverse-protected battery power switch circuit
- Powerful 5 V, 2 A switching regulator
- Dual 1.8 A DRV8838 motor drivers
- ATmega32U4 microcontroller with Arduino-compatible USB bootloader
- 16 free general-purpose I/O ports including 10 analog inputs
- LCD connector
- Three user buttons
- Five indicator LEDs (2 for power, 3 user-controllable)
- Battery voltage monitoring
- Quadrature encoder inputs
- Four general-purpose level shifters
- 3-axis I²C accelerometer
- 3-axis I²C gyroscope
- Raspberry Pi connector with I²C interface and HAT EEPROM
Raspberry Pi interface
Microcontrollers like the ATmega32U4 are great for fast, timing-sensitive operations such as reading sensors or driving servos, but their computing power is very limited compared to devices like the Raspberry Pi. That is why we built a Raspberry Pi interface into this board: to give you the option to expand your robot beyond what is possible with a microcontroller. This could be useful for anything from advanced applications like computer vision or room mapping to simply letting your robot share status updates on Twitter. Here is a Romi assembled with a Raspberry Pi:
When connected, the control board supplies power to the Raspberry Pi and connects to it as an I²C slave device. We include the ID EEPROM required by the HAT specification, though we have not found it particularly useful, so we ship it blank and unlocked for you to experiment with.
Our Arduino library gives example code for I²C connectivity, and you can check out our Raspberry Pi tutorial for the A-Star 32U4 Robot Controller, which we will be updating for the Romi 32U4 Control board.
For more information about the Romi 32U4 Control Board or to order, please see its product page.