Connecting to sources…

How to build Barkour agile quadruped (Google DeepMind, vB): the whole process

191 steps to build Barkour agile quadruped (Google DeepMind, vB), from buying parts, printing and assembly to software, calibration and training, with the bill of materi…

The creators give no cost: the BOM (hardware/barkour_robot_bill_of_materials.csv) lists parts, specs, quantities and sources without prices, and most structural parts and all 11 custom boards are marked Custom Order

Bill of materials · Parts Needed for PHASE 1: "Universal DFB"

PartQty
3D-printed Deep Fry Basket1
RUS_Power_In · Red and black cable bundle with1

Bill of materials · Parts Needed for PHASE 2: "Designated DFB"

PartQty
Deep Fry Basket · This is what we built up in PHASE 11
Hamilton with IMU · Measures IMU data1

Buy parts

  • Order the paired Grace and Hopper E-stop boards

    The Grace board is the off-robot transmitter and the Hopper board is the receiver inside the robot's torso. The two boards are paired, so each robot has its own E-stop.

  • Select the Regional DeWalt Battery

    Use DCB546 (UK) in the UK and DCB606 (US) in the US; the battery voltage is 60V (15 cell lithium ion), and the capacity is approximately 122 Wh.

  • Select the i7-1185G7 Processor

    Use the Intel Core i7-1185G7 processor in the onboard computer.

  • Select the AX201 WiFi 6 Module

    Use the WiFi 6 AX201 module for the NUC's wireless networking.

  • Select 64GB Kingston FURY RAM

    Use Kingston FURY Impact 64GB RAM configured as 2x32GB, 3200MT/s DDR4 CL2 KF432S20IBK2/64.

  • Select the Kingston KC3000 NVMe SSD

    Use a Kingston 2048G KC3000 PCIe 4.0 NVMe M.2 SSD.

  • Prepare ECAT/STO Cables and Connectors

    Use AlphaWire 76030 teal cable with Molex NanoFit connectors to transfer the EtherCAT and STO signals.

  • Gather universal DFB parts

    Gather 1 U-shaped Electrode, 1 Battery Holder, 2 M3x8mm SHCS, and 2 RGB Fans. Solder the anode and cathode electrodes in the specified orientation, and modify the fans with 2POS nanofit molex connectors.

  • Gather the designated DFB parts

    Gather 3 M2x16mm SHCS, 3 M2 locknuts, 1 NUC, 1 Rus_to_NUC cable, 4 M3x6mm SHCS for the NUC, 1 Hopper PCBA and XBee Transceiver, and 4 M3x6mm SHCS for the Hopper.

  • Review the bill of materials

    Use the Bill of Materials (BOM) to identify the robot parts.

Print and make

  • Choose and obtain CAD models

    The robot has two versions: one with a fixed head and one with an actuated head and mouth gripper; obtain both versions from the linked CAD models.

  • Obtain the custom electronics designs

    Obtain the schematics and PCB layout files for the Barkour custom electronics in the `hardware/electronics` folder.

  • Laser cut an Ada separator

    Laser cut an Ada separator.

Assemble

  • Assemble the electronics basket

    Bring together the Barkour Robot's central compute, sensor systems, and associated unique assets in the electronics basket. Keep all designated parts together after assignment; the camera's final configuration is deferred until the end because it uses a special structure attached to the torso.

  • Assemble the torso

    Assemble the torso as the robot's body, onto which the four legs and the "brain" will be attached.

  • Assemble the trimotor leg

    Combine three mono-motor sub-assemblies into a leg with a specific orientation. The valid configurations are FL, HL, FR, and HR; the hip bracket determines left or right, while the cable harness determines front or hind.

  • Install and wire the legs

    Install and wire one trimotor leg of each orientation on the torso in the appropriate sequence. The legs currently end at the knee actuators without shells or proper feet; follow the Range of Motions document for ECAT chain ordering.

  • Complete the leg mechanics

    Attach the remaining leg linkages and shells to the torso assembly. At this point, the robot is mechanically complete.

  • Complete the robot assembly

    Ensure the robot has a complete body and fully assembled legs, wire up the entire "brain," and place all assets in their final positions. The assembled robot is then ready for software bringup and general use.

  • Install the DFB electrodes

    Press the electrodes into the DFB slots in the shown order, with the black lead longer than the red lead, then hand-tighten the Battery Holder with 2 M3x8mm bolts.

  • Install the NUC-cooling fans

    Install the 2 fans in the shell, securing each with 2 M3x18mm bolts and nuts and orienting the airflow upwards and away from the robot torso.

  • Install the power button

    Install the power button, confirm that the o-ring is present, and tighten the retention nut with pliers until it feels tight.

  • Install the antenna cover

    Install the cover with the on-robot E-stop antenna, carefully routing its delicate cable to the left side without damaging it. Hand-tighten the cover to the top with 2 M3x6mm bolts.

  • Install the RUS power distribution board

    Mount the RUS power distribution board to the right side of the DFB with 2 shorter M3x12mm bolts.

  • Fasten the RUS to the DFB

    Fasten the RUS to the DFB using a single M3x16 through the center.

  • Leave the fourth mounting spot open

    Leave the fourth mounting spot open for now and secure it with a zip-tie later.

  • Align the top-side ports

    Align the ports on the top side of the RUS as shown.

  • Connect the fans and electrode leads

    Connect the FANS from step 2 to J8 and J9, then plug the electrode leads from step 1 into the appropriate slot.

  • Install the IMU

    Secure the IMU to the underside of the DFB with three M2x16mm bolts and complementary nuts.

  • Preconnect the NUC power cable

    Plug the NUC into the RUS power cable in advance and bend the cable because the port is on the back of the NUC.

  • Fasten the NUC to the DFB

    Fasten the NUC to the back of the DFB with four M3x6mm bolts.

  • Route and connect the NUC power cable

    Route the power cable along the right side of the DFB and plug it into the RUS, taking care not to crush the cable or press on NUC components.

  • Route the NUC antenna cables

    Route the two NUC antenna cables as shown.

  • Connect the NUC power button

    Plug the power button from step 2 into the NUC. Some power-button cables still have all eight pins, so expose the top two pins as demonstrated to prevent damage to the NUC.

  • Add Zip-Tie Strain Relief

    Add zip-ties for strain relief and cable management.

  • Install and Connect Hopper and XBee

    Install the Hopper PCBA on the left side of the DFB with x4 M3x6mm bolts, then plug it into the XB without bending the delicate pins and connect the STO antenna.

  • Install NUC Ethernet Adaptor and ECAT

    Zip-tie the Ethernet adaptor in place and plug it into the NUC. Connect the three-headed NUC_ECAT_DFB split cable to the adaptor, route it around the front of the DFB and across the Rus heat-sink, and plug it into the appropriate slot.

  • Install USB Panel Mount and Cables

    Fasten the Panel Mount to the DFB with x2 M3x6mm bolts. Route the other ends of its connectors across the RUS heat sink and plug them into the NUC, then zip-tie the cables and bundles.

  • Install the STO Button

    Install the STO button, tighten the retention nut, and plug it into the 'STO But' port on the Rus.

  • Install Rus Outbound STO ECAT Cable
  • Install RUS to FeiFei Power Cable

    Install the RUS to FeiFei power cable and zip-tie the parallel bundles together.

  • Install Ethernet Access Port

    Keep the port in place with x1 M3x20mm and nut, then plug it into the remaining NUC Ethernet port on the right side of the DFB. The cable keeps adjacent cables under tension so they do not fall into the fans.

  • Wire Up the IMU

    Wire the IMU to the NUC.

  • Finalize and angle the antennas

    Finalize the left and right antenna placements and angle the antennas upward.

  • Prepare the empty torso shell

    Start with an empty chassis shell and confirm that the M4 heat-inserts are pre-installed and the mounting holes have been tapped and reamed in advance.

  • Install the Luxonis board

    Plug the ribbon cable into the CAMB-2L slot on the back of the PCBA, carefully bend the FRC without damaging the cable, and route it through the front-side torso channels.

  • Secure the Luxonis board

    Bolt the PCBA down with four M2x5mm bolts until finger-tight.

  • Install the FeiFei board

    Position the FeiFei board at its designated location in the torso; for an actuated head, use a FeiFei board with spare XT30 connectors.

  • Secure the FeiFei board

    Secure the board with four M3x5mm thread-forming bolts until finger-tight, and confirm the final positions of both the Luxonis and FeiFei boards before proceeding.

  • Install the combined face plates

    Align each face plate to the front or back of the torso, use four M4x22mm long bolts with square nuts on the outer edges, and fasten the center with seven M4x16mm button-head bolts; repeat on the other side.

  • Remove three front-face bolts

    When installing the static or actuated head, remove the three M4x16mm bolts from the front face.

  • Combine Bracket and End Stop

    Combine the abduction bracket with its physical end stop.

  • Press in Two Dowel Pins

    Press 2 pins into the two smooth bore openings on the hip bracket. These pins keep the end stop in place.

Software

  • Compile the firmware

    Run the Bazel build command from the top-level directory to build the firmware binaries and helper scripts.

  • Run firmware unit tests

    Run the host-based firmware tests from the top-level directory.

  • Use J-Link for first flashing

    Flash the motor driver using a J-Link connected to the Mataric debugger board or through the EtherCAT bootloader; use J-Link when flashing the board for the first time.

  • Flash EEPROM for EtherCAT

    Enter actuator/ethecat_eeprom and write barkour_robot_sii.hex to EtherCAT slave 0.

  • Replace the EtherCAT vendor ID

    Replace Google's EtherCAT vendor ID in the provided file with your own vendor ID from the EtherCAT Technology Group.

  • Connect Mataric to the motor board

    Connect the Mataric board to the Cortes or Holberton board as shown in the image.

  • Flash the board with J-Link

    Run the helper script with --flash -jlink to flash the board.

  • Flash one device over EtherCAT

    Invoke the helper script with paths to the M4 and M7 binaries and the EtherCAT device alias to update. The script must run on the same machine that built it because multiple runtime dependencies and external libraries are required.

  • Restart the device for new firmware

    After binaries are transferred successfully over EtherCAT, restart the device so the STM32H755 boots the new firmware; power cycling is the most reliable method. A restart command can also be sent over EtherCAT.

  • Flash All Devices with EtherCAT Bootloader

    Run helper with the --flash command and --all flag, specifying the M4 and M7 firmware files with --m4 and --m7.

  • Power-Cycle the EtherCAT Network

    After updating all devices, power-cycle the network so the microcontrollers boot the new firmware. Restarting each device separately can disrupt the EtherCAT network and cause some devices to lose connection.

  • Update Firmware in Bank 2

    Use `flash_firmware()` to write the update to flash bank 2, then perform a bank swap to activate the new firmware.

  • Compile Firmware for Both Cores

    Use the `helper` script to compile the M7 and M4 firmware separately, producing two ELF files and two BIN files.

  • Check M7 Boot Addresses

    On M7 startup, `main_m7.cc` checks the M7 and M4 boot addresses; if they are incorrect, it updates the relevant STM32 registers and reboots the device.

  • Modify Firmware Flash Function

    To change the boot-address split, update `flash_firmware()` in `actuator/firmware/barkour/m4/ecat_device.cc`.

  • Update Both Core Linker Files

    To change the boot-address split, update the linker files in `actuator/firmware/targets/m4` and `actuator/firmware/targets/m7`, and ensure the M4 code starts at the beginning of a 128 kB flash sector.

  • Set Correct M7 Boot Addresses

    To change the boot-address split, modify `actuator/firmware/barkour/m7/main_m7.cc` to set the correct boot addresses for the M7 and M4.

  • Implement an interface to the hardware

    Implement ESC_init(const esc_cfg_t *config), ESC_read(uint16_t addr, void *buf, uint16_t len) and ESC_write(uint16_t addr, void *buf, uint16_t len) for communication between the ESC and SOES. The ESC is connected via an SPI bus clocked at 30 MHz.

  • Configure the SOES header files

    Set the general options configuring the device in actuator/firmware/barkour/m4/ecat/ecat_options.h, and define the structs for all data exchanged between the SOES kernel and application in actuator/firmware/barkour/m4/ecat/utypes.h.

  • Merge everything into your application

    Merge the files containing the kernel state machine and general device functionality — esc.c, esc.h, esc_coe.c, esc_coe.h, esc_foe.c, esc_foe.h, ecat_slv.c, ecat_slv.h together with their corresponding headers — into the application.

  • Define the EtherCAT object dictionary

    Define the EtherCAT object dictionary in `actuator/firmware/barkour/m4/ecat/objectlist.c`.

  • Implement required SOES callbacks

    Implement `cb_set_outputs()` and `cb_get_inputs()` in `actuator/firmware/barkour/m4/ecat_device.cc`; the former sets outputs after an RxPDO is received, and the latter provides inputs before transfer to the output buffer.

  • Configure optional SOES callbacks

    Configure `set_defaults()`, `pre_state_change()`, `post_state_change()`, and `safeoutput()` in `struct EthercatDevice`, and pass the structure to SOES during stack initialization.

  • Implement the EtherCAT main loop

    In `EthercatDevice::run()`, configure the stack with `ecat_slv_init()`, then enter an infinite loop that waits on a semaphore and calls `ecat_slv_poll()` for status and `DIG_process()` for PDOs.

  • Implement interrupt-driven EtherCAT synchronization

    Implement `EthercatDevice::EofInterrupt()` to release the semaphore when an EtherCAT packet generates an interrupt, allowing the main loop to continue; this is SM-Synchronous operation.

  • Install the EtherCAT kernel module

    Install the Etherlab kernel module and confirm that the motor drivers appear on the bus. Use the same version for the kernel module and user-mode code.

  • Install EtherLab build dependencies

    Install the packages needed to build EtherLab and the headers for the current Linux kernel.

  • Clone and check out EtherLab

    Enter the EtherCAT host directory, remove any existing EtherLab directory, clone the repository, and check out the stable-1.5 branch.

  • Generate the EtherLab configuration

    Run the bootstrap script, then configure EtherLab to generate config.h and enable the generic interface.

  • Compile and run the motor-control example

    Compile and run the EtherCAT host-side example to connect to the motors through EtherCAT and send torque or position commands to the actuators.

  • Compile and flash the motor firmware

    Compile and flash the firmware using the instructions in the linked firmware document.

  • Compile and run the EtherCAT example

    Go to the repository root, build the EtherCAT example in optimized mode, and run the generated executable.

  • Run with a simulated EtherCAT host

    Add the fake_ethercat_host flag to try the example without hardware.

  • Power Wireless E-Stop with USB-C

    Connect the wireless E-stop to a USB-C power supply to power or charge it.

  • Flash new firmware with Mataric and J-Link

    The Mataric board provides debug buttons and LEDs for the Cortes & Gebru or Holberton motor driver. Combined with a J-Link, it is used to flash new firmware.

  • Obtain the MuJoCo simulation model

    Obtain the Barkour MuJoCo model from google_barkour_vb.

Calibrate and test

  • Rescan and inspect the EtherCAT bus

    Rescan the bus and list the slaves. The device should show “0 1:0 INIT E Cortes”.

  • Connect the Calibration Board

    Attach the Mataric programmer board to the motor driver. The two calibration routines are independent and must be run separately.

  • Prepare the Motor for Calibration

    Do not attach a significant load to the motor, and position it so it can rotate freely by at least about 15 mechanical degrees in each direction. Ideally, align the rotation axis parallel to gravity.

  • Start Electrical Angle Calibration

    Hold `nButton` on the Mataric board while turning on power, or press `nRST` to reset the STM and start calibration. The results are stored in EEPROM as part of EtherCAT SII, and the EtherCAT stack restarts.

  • Check Calibration Status LEDs

    The orange Blinky2 LED lights when calibration starts. It turns off on success; on failure, the red Blinky1 LED lights and the board enters a hung error state. Debug information appears in the pw console output.

  • Power Cycle the Motor After Calibration

    Completing calibration restarts the EtherCAT stack, which can sometimes enter an error state. Power cycling the motor after calibration will usually resolve the issue.

  • Read Calibration Results via SDO

    Read the electrical angle offset at index `0x3000`, subindex `0x1`, as an `int32` in encoder counts. Read the `uint8` status at index `0x3000`, subindex `0x2`; `1` means calibration succeeded, while any other value means it did not.

  • Hold Joint at Negative Endstop

    Hold the robot joint against its negative endstop and attach a Mataric board to the joint.

  • Record and Save Zero Offset

    Holding `Blinky1` during firmware startup triggers encoder reads; their median becomes the zero offset, is stored in EEPROM as part of the EtherCAT SII, and the EtherCAT stack is then restarted.

  • Verify Motor Position Calibration

    After successful calibration, the motor position reported over DS402 is relative to the recorded position.

  • Read Joint Angle Offset

    Read the joint angle offset via SDO at index `0x3001`, subindex `0x1`, as an `int32` in encoder counts.

  • Check Calibration Completion

    Read the `uint8` SDO at index `0x3001`, subindex `0x2`; it should be `1` after successful calibration and another value otherwise.

  • Configure Error Status Monitoring

    The CANopen manufacturer status register at index `0x1002`, subindex `0x0`, contains a `uint32` error-status value that can be mapped to a PDO for monitoring errors in the host cyclic control loop.

  • Check the Abduction Joint

    Manually rotate the finished abduction motor joint from end to end and confirm smooth motion.

  • Check and mark leg designation

    At this stage, the apparatus should be designated as either a Right or Left leg and clearly marked accordingly.

  • Verify Completed Trimotor

    Check that the trimotor with cable harness assembly is fully completed.

  • Configure offsets after replacing motors

    When replacing motors, use the Mataric board together with a J-Link to configure the electrical and joint angle offsets.

  • Set the Logical EtherCAT Order

    Use EtherCAT aliases to ensure the logical motor order is front left, hind left, front right, and hind right despite the different physical connection order.

  • Check for Swapped Input and Output

    Accidentally swapping an ECAT/STO input and output connection will not damage the electronics, but it changes the logical order in which the motors appear as EtherCAT devices.

  • Add safety features for real systems

    This example does not include safety features; refine them before using it in a real system.

  • Check actuators and joint movement

    Confirm that all actuators are held in place while the joint of the actuator with device alias 1 slowly wiggles.

  • Test the motor assembly before flashing

    Before beginning flashing, turn on both power supplies to test the motor assembly so the motor moves as expected.

  • Confirm Green Ready Indicator

    The button on the DFB should be depressed, and the wireless red button should be disengaged. The button should light green for the motors to work.

  • Follow the hardware getting-started guide

    Follow the getting started guide to set up and begin using the Barkour robot hardware.

Data and training

  • Train a policy with the MJX tutorial

    Use the MJX tutorial to train a policy on GPUs or TPUs.

Use it

  • Enable Robot Torque

    Twist the red wireless E-stop button so it pops up, then press the STO button on the robot. When both conditions are met, the light inside the STO button turns green and the robot can move.

  • Keep E-Stop Engaged Inactive

    Whenever the robot is not in active use, the wireless STO should remain engaged, with its button pushed in. This includes before or after an experiment and during breaks.

  • Prioritize the Red External Button

    For safety, prioritize pressing the external red wireless E-stop button.

  • Use Wireless E-Stop in Emergencies

    When something goes wrong, push in the wireless E-stop. Do not attempt to reach the button on the robot's back, as this is unsafe even under normal conditions.

  • Use Rear Button to Disable Torque

    The back button lets a user near the robot force the torque off, preventing anyone else from moving the joints.

  • Secure an Unattended Robot

    If you find an unattended robot with its STO not engaged, err on the side of caution and press the wireless E-stop button.

  • Remove the battery
  • Keep the computer powered while swapping batteries

    When swapping batteries, the Rus board supplies backup power to the 24V circuit via the exposed XT30 connector, keeping the onboard computer and sensors up.

  • Use the External USB-C Ports

    Two USB-C ports are routed outside the robot and support USB4 and Thunderbolt, such as for connecting an external display.

  • Review the basic robot instructions

    Also review the basic robot instructions in the linked document.

Parts

  • 12 × T‑Motor AK80‑9 (48V, 9 N·m, 390 RPM), modified with an embedded thermistor and beefed-up fasteners
  • Motor drivers: a Gebru (gate driver) + Cortes (MCU, IMU, EtherCAT) + Ada (MA732 encoder) stack, or the single-board Holberton
  • Intel NUC 11 on-board computer (i7, 64 GB, 2 TB), MicroStrain 3DM‑CV7‑AHRS IMU, TP‑Link UE306 USB adapter for EtherCAT
  • Rus power board (battery to isolated 24V, inrush protection, STO) and Fei‑Fei power distribution; Grace (remote) and Hopper (on-robot) boards for the wireless E-stop
  • 2 DeWalt 60V 6Ah FLEXVOLT batteries (DCB606 / DCB546)
  • CNC-machined 7075 aluminium parts, PEEK lower legs, an HP PA11 nylon printed torso and covers, FKM printed feet and silicone bumpers
  • Fixed head: RealSense D435i plus an OAK‑FFC 4P with an OV9782 camera; the actuated head adds the Jackson board, OAK cameras and Dynamixel XH430‑W350‑T servos

Tools

  • A J‑Link Pro and the Mataric debug board (first flash of the motor-driver firmware), with a Samtec 20-pin cable
  • Hex drivers (ball-tipped strongly advised for some steps), torque tools and Loctite 243/245/262 threadlocker (the guide gives torques step by step, such as 2 N·m for M3 screws)
  • Outsourced CNC machining, SLS/MJF nylon printing, silicone and FKM printing, and Markforged continuous-fibre printing for the actuated head
  • The wireless E-stop (STO) paired with each robot: keep it pressed whenever the robot is not in use and press it first when things go wrong

Skills

  • Bazel 7 builds and dual-core STM32H755 firmware flashing (J‑Link, or over EtherCAT FoE in bulk)
  • EtherLab EtherCAT master and Linux network setup
  • PCBA assembly, harness crimping (Molex Nano‑Fit) and precision mechanical assembly
  • Reinforcement-learning training in MuJoCo / MJX

Software

  • actuator/firmware: Pigweed-based motor-driver firmware (M4 + M7 cores, FOC and a DS402 state machine)
  • actuator/ethercat_host: a C++ EtherCAT host example (no safety features; refine it before real use)
  • The google_barkour_vb model in MuJoCo Menagerie and the MJX training tutorial
  • v0 assets: the Barkour course model and scoring script (Brax)

Documents