Getting Started

Great that you want to learn more about Pluto! In this section, we will provide everything that is needed to get started with the Pluto project.

Tutorial: Setting up pluto-pico:

Flashing pluto-pico firmware

Get yourself a raspberry-pico and a Micro-USB cable that can be used for USB-based communication. Push the Button and while keep pushing connect the raspberry-pico with your pc. After connecting to the pc you can release the button. The raspberry-pico should now be visible as a mass-storage-device. Now go to the pluto-pico repository and download the artefacts. (https://gitlab.com/pluto-ipek/pluto_pico/-/jobs) Flash the uf2 file onto the raspberry-pico by dragging the file to the raspberry-pico mass-storage-device.

You know that this step was successful if the raspberry-pico starts blinking the led.

Get a serial connection with raspberry-pico

After flashing your firmware you can get a serial connection and start communicating with the raspberry-pico. You need to download a program for serial connection. This example will show you how to set up MobaXTerm but there are multiple alternatives that work in the same way. Open MobaXterm. Select New Connection -> Serial Connection. As a baudrate you can chose 115200 (pluto-pico will automatically adjust to a lower baudrate if chosen) Select your Com-port. Click Accept. You are done.

Talking with pluto-pico

Congratulations, you are almost done! Now it’s time to communicate with pluto-pico. Commands can be used to interact with sensors and actuators. Depending on the version various commands are available.

Please don’t hesitate to play around with various commands. That’s what these commands were made for. :-)

All commands have a common rule-set:

  • All commands are safe to use. No hardware can be destroyed when putting in commands. Exceptions are actuators, so motors and relays. Please take care when using those and go through the in-depth explanation of them before using them.

  • All commands have help subcommands. Any command and even any subcommand can be called with a “--help” parameter.

  • All commands/configuration are volatile. The configuration is lost when the raspberry-pico is power-cycled.

  • If a permanent configuration is desired please have a look at pluto-control.

  • Using <Tab> to autocomplete and <Arrow-up> for previous commands improves usability

  • In-depth documentation of commands can be found at the Pluto Pico section.

Example interactions

Example I: Call the version of pluto-pico

version --help
# Response:
# App version
version
# Response: 1.0.0

Example II: Configure and control motor1

# Step 1: Check current motor configuration
motor1 get-motor

# Response:
# name: Pluto Motor
# direction: 0
# speed: 0
# acceleration_rate: 50
# acceleration_rate_delay: 300ms
# braking_rate: 40
# braking_rate_delay: 200ms

# Step 2: Set motor direction to 1
motor1 set-dir 1

# Step 3: Set motor speed to 60%
motor1 set-speed 60

# Step 4: Configure acceleration and braking rates
motor1 config-acc-rate 70
motor1 config-brak-rate 50

# Step 5: Set acceleration and braking delays
motor1 config-acc-rate-delay 400
motor1 config-brak-rate-delay 200

# Step 6: Verify settings
motor1 get-motor

# Response:
# name: Pluto Motor
# direction: 1
# speed: 60
# acceleration_rate: 70
# acceleration_rate_delay: 400ms
# braking_rate: 50
# braking_rate_delay: 200ms

Example III: Configure safety-critical sensor

# Step 1 (Optional): Asking functionality of em_btn config-mode
em_btn config-mode --help
# Response:
# Enable(1)/disable(0) motor stop on emergency button press.
# Step 2: Enabling safety functionality for Emergency_button
em_btn config-mode 1
# Step 3 (Optional): Asking sensor value from em_btn
em_btn get
# Response
# 1

Tutorial: Setting up pluto-control:

Prerequisites

Since pluto-control is a python application some prerequiries are required.

Open project with Pycharm and set up a new Interpreter (use pyenv Virtual Environment) In your Run Configuration you need to select the correct Interpreter for the run configurations “pluto_control” & “generate_ui”.

Your python interpreter is now missing required packages. They need to be manually installed. For that open the Terminal and type in the following command.

pip install -m requirements.txt

Once these steps have been executed successfully the setup is complete.

Starting pluto-control

Select pluto_control as your Run Configuration and run it.

You should see the GUI application Pluto-control popping up. Here is a small summary of all the functions.

Pluto-Control

Additionally, in your Run terminal you should be able to see the Debug messages which could be something like:

C:\Users\Pluto\Desktop\pluto-control-motor-control\.venv\Scripts\python.exe C:\Users\Pluto\Desktop\pluto-control-motor-control\src\pluto_control -vv -f pluto_control.log
2024-11-14 17:11:42 [INFO    ] loading config file: C:\Users\Pluto\Desktop\pluto-control-motor-control\src\pluto_control\pluto_control.conf
pygame 2.6.1 (SDL 2.28.4, Python 3.12.1)
Hello from the pygame community. https://www.pygame.org/contribute.html
2024-11-14 17:11:45 [INFO    ] loading config file: C:\Users\Pluto\Desktop\pluto-control-motor-control\src\pluto_control\pluto_control.conf
2024-11-14 17:11:45 [INFO    ] Version: 0.6.3
2024-11-14 17:11:45 [INFO    ] Application will run in Windowed mode
2024-11-14 17:11:45 [DEBUG   ] Creating Qt Application Window
2024-11-14 17:11:48 [DEBUG   ] Setup ControlConfigWindow
2024-11-14 17:11:48 [DEBUG   ] Loading Default Control Keys ControlConfigWindow
2024-11-14 17:11:48 [DEBUG   ] Loading Default Relay Keys ControlConfigWindow
...

The Log messages are additionally collected and can be found at “pluto_control.log” at the src folder of your application.

Configuring pluto-control

A part of Pluto-control is its configuration interface. With the configuration interface you can customize your robots actuators and sensors and store the configuration.

The configuration is stored at “pluto_control.conf” and loaded automatically on launching pluto-control. To configure your robot you can click on the “⚙️” symbol.

Pluto-Control-Config

Click OK to save the configuration. The saved configuration is sent to pluto-pico when the connection is established. Since pluto-pico is volatile the configuration will be sent to pluto-pico every time a connection is established.

Due to a bug sometimes the configuration saving is not working properly. In this case it is also possible to edit the configuration directly at the “pluto_control.conf”.

Interacting with pluto-pico

As a final step you have to establish a connection to your pluto-pico. For that you can select the COM-port where your pluto-pico is connected. Click on “❤️” to establish a connection. You should be able to see the communication with pluto-pico in the terminal. Based on your configuration you should be able to see the sensor data. If you enable keyboard control you can also trigger the relays and control the robots movements. If the motors don’t start make sure to release the handbrake.

Due to a bug the gaming console control is not possible. Sorry about that.