This repository contains code and resources for the Pololu 3pi+ RP2040 Robot, powered by the Raspberry Pi RP2040 microcontroller. The robot is a versatile platform for experimentation and learning, featuring motor drivers, sensors, and support for various programming configurations. Repository Structure
-
config/: Contains configuration files that define various operational parameters for the robot. These configurations influence how different operational modes in the robot's control system behave.
-
trajectories/ : Contains the trajectory files in .json format
-
Dongle Software/: Contains the build application for the nrf52840 Dongle
-
control.py: A core script that manages different operational modes for the robot. This script allows the robot to switch between distinct behaviors depending on user input or pre-defined conditions.
-
Connect the Pololu 3pi+ RP2040 to your computer.
-
But the Robot into bootloader mode restarting it and pressing the b button
-
Download the newest version of the Pololu firmware and load it on to the device
-
Further Instructions https://www.pololu.com/docs/0J86/all#5.1
-
Firmware Versions : https://github.com/pololu/micropython-build/releases
-
-
Delete all of the contents from the Micropython folder
-
Pull from https://github.com/IMRCLab/Pololu_3pi-.git 0xe7
Modify the configuration files in the config/ folder to customize parameters for different operational modes. Ensure that the JSON syntax is correct to prevent runtime errors.
Customize the following values
- ID
- The ID of the robot, usually at the bottom of the frame
- trajectory
- The name of the trajectory file
- Logging
- 1 for Logging 0 for not Logging
There are more values that can be customized but dont need to be for stable performance. They are the following:
- gains
- a Tuple with he gains of the robot
- [KX,KY,KTheta]
- Logging Time
- The difference between saves
- Logging Intervall
- The Interval between saved States
- Max Speed
- max RPM
To run a trajectory one just needs to start the robot and ensure that the launch script is running that is responsible for the communication with the MoCap. The robots running sequence can be divided into the following segments:
Is the state right after the start of the robot. In this mode the screen should be black. All of the processes are being initialized. The robot is waiting for position information from the robot.
In this mode positional information already has been received, the robot is ready and waiting for the start signal.
Display Output :
READY
______
/|_||_\`.__
( _ _ _\
=`-(_)--(_)-'
-- --- --- --- -
READY
The robot received the start signal and starts driving.
DRIVING...
______
/|_||_\`.__
( _ _ _\
=`-(_)--(_)-'
-- --- --- --- -
DRIVING...
The trajectory is completed, the projected time of the trajectory has been reached.
----------------
| ______ |
| /|_||_\`.__ |
|( _ _ _ \ |
|=`-(_)--(_)-' |
----------------
DONE DRIVING
If Logging is enabled, all available data has been saved to the drive
----------------
| ______ |
| /|_||_\`.__ |
|( _ _ _ \ |
|=`-(_)--(_)-' |
----------------
DONE SAVING
It is recommended to use a 50Hz update rate in the MoCap software, higher frequencies might also work, but have not been tested.
A common tool for debugging is the Thonny ide. It allows for a simple connection to the MCU on the RP2040 and allows to run programms in the console. For the rest of the development VSC with MicroPico was used, because of the many usefull tools it has to offer, like code suggestions and git integration.
A quick way to fix this issue is to update the firmware and install the software again.
This usually means that the incoming messages are either decoded incorrectly.
The robot stops because it tries to allocate to much data. To solve this issue one can increase Logging Interval or decrease the Logging Time.
The controller is based on the Collective Intelligence from a Synthetic and Biological Perspective Summer School of which Prof. W. Hönig was one of the organizers. For more information about the differential drive controller check out the /collision_avoidance/slides.pdf of the slides available on the website.
The code for the nrf Dongle can be found here. The compiled file can be found in the Dongle Software folder.
Collective Intelligence from a Synthetic and Biological Perspective Summer School : http://modelai.gettysburg.edu/2024/collective/
Pololu 3pi+ 2040 User guide : https://www.pololu.com/docs/0J86/all
Dynobench : https://github.com/quimortiz/dynobench/tree/05bafb374e5b00e858d351e2e89d8f4b409f56ab