Skip to content

A basic state-estimator and for the Pololu 3pi+ 2040 ground robot.

Notifications You must be signed in to change notification settings

IMRCLab/Pololu_3pi-

Repository files navigation

Pololu 3pi+ RP2040 Robot Development Repository

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.

Configuration

1. Setup Instructions

2. Configuration

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

Running a Trajectory

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:

Start

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.

Ready

In this mode positional information already has been received, the robot is ready and waiting for the start signal.

Display Output :


READY
  ______
 /|_||_\`.__
(   _    _ _\ 
=`-(_)--(_)-'
-- --- --- --- -
READY

Driving

The robot received the start signal and starts driving.


DRIVING...
  ______
 /|_||_\`.__
(   _    _ _\ 
=`-(_)--(_)-'
-- --- --- --- -
DRIVING...

Done Driving

The trajectory is completed, the projected time of the trajectory has been reached.


----------------
|  ______      |
| /|_||_\`.__  |
|( _ _ _     \ |
|=`-(_)--(_)-' |
----------------
DONE DRIVING

Done Saving

If Logging is enabled, all available data has been saved to the drive


----------------
|  ______      |
| /|_||_\`.__  |
|( _ _ _     \ |
|=`-(_)--(_)-' |
----------------
DONE SAVING

Usage of multiple robots

It is recommended to use a 50Hz update rate in the MoCap software, higher frequencies might also work, but have not been tested.

Development

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.

Common Issues

Pololu Drive in Read Only mode

A quick way to fix this issue is to update the firmware and install the software again.

Pololu is in Driving Mode but doesnt drive

This usually means that the incoming messages are either decoded incorrectly.

Pololu stops mid execution with memory issues

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.

Details

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.

Radio Receiver

The code for the nrf Dongle can be found here. The compiled file can be found in the Dongle Software folder.

References

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

About

A basic state-estimator and for the Pololu 3pi+ 2040 ground robot.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •