How to build ElectroPup: the whole process
60 steps to build ElectroPup, from buying parts, printing and assembly to software, calibration and training, with the bill of materials, shop links and the official sou…
ElectroPup is a quadruped robot built with low-cost BLDC motors. The repository provides printable 3D models, CAD designs, circuit-board files, and assembly and setup documentation.
Buy parts
- Read the entire guide first
Read the entire guide before beginning setup because the document may not be sequential.
- Install Git
Install git on the Raspberry Pi using apt.
- Clone the ElectroPup repository
Clone the ElectroPup repository from GitHub using git clone.
- Obtain the dual-channel isolated CAN HAT
Use the Waveshare 2-Channel Isolated CAN Expansion HAT as the CAN bus controller.
Print and make
- Design the PCBs in KiCad v8
Use KiCad v8 to design the auxiliary and power carrier boards; the custom libraries used by the project are available from reubenstr/kicad-libraries.
- Design the Auxiliary Board
Include an STM32 co-processor, LCD for errors and status, buzzer, 2 Neopixel strips, RC servo, button, and Raspberry Pi breakouts for BNO055 IMU, SBUS FrSKY receiver input, I2S, and 4 contact switches or auxiliary GPIO.
- Design the Power Carrier
Include actuator power distribution, actuator CAN bus networks, an isolated DC-DC for the Raspberry Pi, a main power switch, a battery holder, and a power connection.
- Fabricate the KiCad-designed PCBs
The PCBs are designed in KiCad v8 and fabricated by JLCPCB.
- Print Parts with PolyMax Tough PLA
Print the robot's 3D-printed parts using Polymaker PolyMax Tough PLA.
Assemble
- Wire the Power Carrier
The Power Carrier has a main on/off power switch and distributes power to the motor headers. It creates four CAN bus networks, one per leg; solder jumpers can merge the front two legs into one network and the back two legs into another.
- Install the optional auxiliary board
The auxiliary board is optional and is not required for quadruped operation. It can power an RPi through a terminal header and provides an LCD display, variable-pitch buzzer, NeoPixel strips, RC Servo channel, I2C expansion, and a button that controls the LCD and shuts down the Raspberry Pi before power off.
- Connect the auxiliary board breakouts
Connect a BNO055 IMU over I2C, 4x contact inputs or GPIO, I2S for a future sound driver, and an RC transmitter through SBUS directly to the RPi header. The RC transmitter can be used if the BLE gamepad fails in RF-congested areas.
- Use the CAN motor channels
Use each CAN controller for six motors with an average motor update rate of about 70 Hz. Updates include fetching encoder position, setting target angle or speed, and getting error states.
- Connect the STM32 auxiliary board
Use an STM32F401 Black Pill dev kit to operate the auxiliary board. The board displays motor and system status on an LCD and interfaces with peripherals such as the buzzer.
- Assemble the 6S1P Battery Pack
Build a custom 6S1P Li-Ion pack with Sanyo-branded 18650 cells rated at 3250mAH each and a load-balancing BMS; the estimated capacity is 72Wh.
- Install the HXYP-6S-CW15 BMS
Use an HXYP-6S-CW15 BMS for the battery pack.
- Install the Raspberry Pi OS
Use Raspberry Pi Imager to select Raspberry Pi OS Lite, Bookworm 64-bit for the Raspberry Pi 5.
- Configure the Pi network and account
Set the hostname to electropup, the username and password to pi, and the SSID and password to your Wi-Fi credentials.
Software
- Install VSCode and extensions
Install VSCode and the Remote Explorer extension on the development PC.
- Connect to the Pi and install Python
After setting up the Raspberry Pi, connect to it with Remote Explorer and install the Python extension.
- Select the Python interpreter
Use Ctrl+Shift+P to open the command palette, run “Python: Select Interpreter”, and choose an interpreter similar to Python 3.13.5.
- Reload the VSCode window
Use Ctrl+Shift+P to open the command palette, then run “Reload Window”.
- Copy SSH keys and log in
Copy the development PC's keys to the Raspberry Pi, then log in using [email protected].
- Update the Raspberry Pi packages
After logging in to the Raspberry Pi, run sudo apt update to update the packages.
- Generate and view the SSH key
Generate an SSH key by pressing Enter three times for the defaults, then read the ./.ssh/id_rsa.pub public key.
- Add the public key to a hosting service
Optionally add the generated public key to GitHub, GitLab, or a similar service.
- Install CAN Utilities
Install can-utils to check CAN communications.
- Scan and Pair the Controller
Run bluetoothctl on the Raspberry Pi and scan, then hold PS + Share until the controller flashes.
- Pair and Connect the Controller
Turn scanning off, pair, trust, and connect the controller using its scanned MAC address, then list the devices.
- Enable the Auxiliary Serial Port
Serial is for the optional auxiliary board. Append enable_uart=1 and dtoverlay=uart0 to /boot/firmware/config.txt.
- Enable I2C on Raspberry Pi
Enable I2C using raspi-config.
- Enter the UI source directory
Navigate to the ElectroPup src/ui directory.
- Run the UI server
Start the UI server with server.sh.
- Run the auxiliary heartbeat
When the auxiliary board is used, run heartbeat.sh.
- Run the main application in development
Run the main application with the --dev argument.
- Select development or live mode
--dev prevents motors from enabling and starting in a walking gait; --live allows motors to enable and start in a sitting pose.
- Use development helper arguments
The main service accepts --start, --stop, --restart, and --disable arguments.
- Install the main service
Navigate to ElectroPup/src/setup and run install_main.sh to install the main service.
- Install the UI server service
Run install_server.sh to install the UI server service.
- Install the heartbeat service
Run install_heartbeat.sh to install the auxiliary board heartbeat service.
- Check a service status
Use systemctl status to check a service status, with main.service as the example.
- Stop a service
Stop a service, using main.service as the example.
- Start a service
Start a service, using main.service as the example.
- Restart a service
Restart a service, using main.service as the example.
- View service logs live
View the main.service logs live with journalctl.
- Configure Raspberry Pi WiFi hotspot
Add the WiFi SSID and password environment variables to .bashrc so the Raspberry Pi can create a hotspot for SSH and UI access when it is not near the WiFi AP. The gamepad keybind image shows the commands to create a hotspot and connect back to the WiFi AP.
- Generate Bezier trajectory plots
Bezier curves, sin arcs, and curvature projection are used to generate trajectories. Run the plotting script to output example control-point configurations.
- Plot curvature projection
Rotation is achieved by projecting a linear trajectory onto a curve. The script outputs charts of example projection calculations.
- Start the MuJoCo simulation
Run the simulation script to start ElectroPup in MuJoCo. Input is currently provided only by a gamepad; the simulated quadruped is bouncy because ElectroPup.xml has no approximate masses or inertial values.
- Configure the robot gamepad
ElectroPup was coded for a PS4 controller. Using an xBox, PS5, or Logitech gamepad requires minor software modifications.
- Prepare the PC development environment
Prepare a desktop or laptop running Ubuntu Desktop or your preferred Linux flavor. The software includes VSCode with Remote SSH and PlatformIO extensions, Drawio, LibreOffice, KiCad, OrcaSlicer, and Chrome or Firefox.
- Prepare the Raspberry Pi environment
Use a Raspberry Pi 5 for the quadruped hardware driver. Install Raspberry Pi OS Lite Bookworm 64-bit and perform all development through remote SSH.
- Configure the STM32 development tools
Use VSCode with PlatformIO on the PC or laptop to develop the STM32 auxiliary board.
Calibrate and test
- Configure CAN Interfaces
Bring up can0 and can1 with a bitrate of 1000000.
- Check CAN Interfaces
Run ifconfig to check the interfaces.
- Run CAN Loopback Test
Optionally, connect can0 and can1, run candump in Terminal 1, and run the three cansend commands in Terminal 2.
- Reset the PlayStation Controller
Power on the controller, then press the button inside the hole on the back right side to reset it.
- Power Cycle and Test Gamepad
Power cycle the controller. Optionally install joystick and test with jstest /dev/input/js0.
- Scan Attached I2C Hardware
Install i2c-tools, list /dev/i2c-*, and run i2cdetect -y 1, or use the scanner script.
- Run the motor zeroing script
Run zero-motors.py to verify the motor configuration and zero the motors.