{
  "generatedAt": "2026-11-14T16:35:49.608Z",
  "meta": {
    "slug": "microduck-build-log",
    "type": "library",
    "status": "published",
    "publishAt": "2026-11-03T22:44:00+09:00",
    "updatedAt": "2026-11-03T13:44:35.000Z",
    "category": "robotics",
    "tags": [
      "actuator",
      "simulation",
      "feedback-control"
    ],
    "authors": [
      "kwon-minjae"
    ],
    "series": "side-projects",
    "seriesOrder": 1,
    "project": "microduck",
    "thumbnail": "/data/img/cover.d331702b82.1200.webp",
    "ogImage": "/data/og/microduck-build-log.jpg?v=18568531c6",
    "noindex": false,
    "hasCover": true,
    "thumbnailSrcset": "/data/img/cover.d331702b82.480.webp 480w, /data/img/cover.d331702b82.1200.webp 1200w"
  },
  "locales": {
    "ko": {
      "language": "ko",
      "filename": "ko.html",
      "format": "html",
      "title": "Microduck 1 - 첫걸음 떼기",
      "summary": "서보 15개를 깨우고, 영점을 세 번 다시 잡고, 강화학습 정책으로 첫 걸음을 떼기까지의 하루",
      "description": "Pollen Robotics의 오픈소스 이족보행 로봇 Microduck을 라즈베리파이 4와 OpenRB-150으로 직접 만든 기록입니다. 전원과 배선, 50 Hz 제어 루프, 서보 ID와 영점 문제, 무게중심 보정과 재학습까지 정리합니다.",
      "content": "<p>Microduck은 Pollen Robotics가 공개한 키 25 cm 정도의 작은 이족보행 로봇입니다. 서보 15개로 두 다리와 목·머리를 움직이고, 시뮬레이션에서 강화학습으로 배운 정책이 1초에 50번 다음 자세를 정합니다. 로봇 소프트웨어(<code>microduck</code>)와 학습 코드(<code>microduck_rl</code>)가 Apache-2.0으로 열려 있어서, 부품만 모으면 직접 만들어 볼 수 있습니다.</p><p>이 글은 제가 만든 한 대, ‘곽곽이’가 처음 걷기까지의 기록입니다. 부품과 라즈베리파이 설정은 미리 해 두었고, 조립부터 서보 ID 매핑, 첫 걸음까지는 하루 만에 끝냈습니다.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 42%);\"><img src=\"/data/img/walk.5343b3a0e1.300.webp\" alt=\"바닥에서 몇 걸음 걷는 곽곽이\" title=\"\" data-width=\"42\" data-align=\"center\" data-caption=\"11월 3일, 바닥에서 걷는 곽곽이. 이날은 몇 걸음 걷고 자주 넘어졌습니다.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" width=\"300\" height=\"400\" data-img-tone=\"mixed\" decoding=\"async\"><figcaption>11월 3일, 바닥에서 걷는 곽곽이. 이날은 몇 걸음 걷고 자주 넘어졌습니다.</figcaption></figure><h2>부품</h2><p>원본은 Rockchip 보드를 쓰지만, 곽곽이는 손에 있던 라즈베리파이 4와 ROBOTIS OpenRB-150으로 꾸몄습니다. IMU도 새로 사지 않고 갖고 있던 보드를 I2C로 붙였습니다.</p><table><tbody><tr><th>역할</th><th>부품</th></tr><tr><td>두뇌</td><td>Raspberry Pi 4 (4 GB), Raspberry Pi OS Lite 64비트</td></tr><tr><td>서보 제어</td><td>ROBOTIS OpenRB-150 (USB, 1 Mbps, Protocol 2.0)</td></tr><tr><td>서보</td><td>Dynamixel XL330-M288-T 15개 (다리 10, 목·머리·입 5)</td></tr><tr><td>IMU</td><td>ICM-20948 (Waveshare 10DOF 보드, I2C 400 kHz)</td></tr><tr><td>전원</td><td>NP-F550 2S 배터리(7.4 V), 토글 스위치, MP1584EN 5 V 강압</td></tr><tr><td>무게</td><td>843 g (원본 모델 737 g)</td></tr></tbody></table><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 100%);\"><img src=\"/data/img/parts.7b1522bac5.1440.webp\" alt=\"책상 위에 펼친 3D 프린트 부품, 서보, 라즈베리파이와 배선\" title=\"\" data-width=\"100\" data-align=\"center\" data-caption=\"조립 중인 부품. 3D 프린트 외피와 서보, 라즈베리파이, 배선을 한 판에 늘어놓았습니다.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/parts.7b1522bac5.640.webp 640w, /data/img/parts.7b1522bac5.960.webp 960w, /data/img/parts.7b1522bac5.1440.webp 1440w\" sizes=\"(max-width: 767px) calc(100vw - 32px), 720px\" width=\"1600\" height=\"1200\" data-img-tone=\"mixed\" decoding=\"async\"><figcaption>조립 중인 부품. 3D 프린트 외피와 서보, 라즈베리파이, 배선을 한 판에 늘어놓았습니다.</figcaption></figure><h2>전원과 배선</h2><p>배터리 하나가 스위치를 지나 두 갈래로 나뉩니다. 한쪽은 OpenRB-150의 VIN으로 들어가 서보 15개에 전원을 주고, 다른 쪽은 MP1584EN에서 5 V로 내려 라즈베리파이 GPIO로 들어갑니다. 서보 버스는 오른다리·왼다리·목머리 세 갈래이고, ID는 갈래마다 10–14, 20–24, 30–34로 나눴습니다. 라즈베리파이와 OpenRB-150은 USB로, IMU는 I2C로 연결합니다.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 100%);\"><img src=\"/data/img/fig-wiring.9eb2a784c2.1440.webp\" alt=\"배터리에서 스위치를 지나 OpenRB-150과 MP1584EN으로 갈라지는 전원, USB·I2C·Wi-Fi 통신을 그린 배선도\" title=\"\" data-width=\"100\" data-align=\"center\" data-caption=\"곽곽이의 전원과 통신. 실선은 전원과 서보 버스, 점선은 통신입니다. 파란 점은 서보와 라즈베리파이가 같은 배터리를 나눠 쓰는 지점입니다.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/fig-wiring.9eb2a784c2.640.webp 640w, /data/img/fig-wiring.9eb2a784c2.960.webp 960w, /data/img/fig-wiring.9eb2a784c2.1440.webp 1440w\" sizes=\"(max-width: 767px) calc(100vw - 32px), 720px\" width=\"1440\" height=\"824\" data-img-tone=\"light\" decoding=\"async\"><figcaption>곽곽이의 전원과 통신. 실선은 전원과 서보 버스, 점선은 통신입니다. 파란 점은 서보와 라즈베리파이가 같은 배터리를 나눠 쓰는 지점입니다.</figcaption></figure><p>이 갈림길이 나중에 문제가 됐습니다. 서보가 한꺼번에 힘을 쓰면 배터리 전압이 순간적으로 떨어지고, 라즈베리파이가 저전압으로 재부팅됩니다. 11월 3일 오후에만 여섯 번 넘게 재부팅됐고, 저전압 기록(<code>throttled=0x50000</code>)이 남아 있었습니다. 라즈베리파이 전원을 서보와 떼어 놓는 것이 다음 과제입니다.</p><h2>제어 구조</h2><p>라즈베리파이에서는 Rust로 된 <code>robotd</code>가 50 Hz 루프를 돕니다(실측 49.98 Hz). 한 주기마다 서보의 위치·속도, IMU의 자이로와 중력 방향, 대시보드에서 받은 걷기 명령을 모아 61차원 관측을 만듭니다. ONNX로 내보낸 정책이 이 관측으로 14개 관절의 목표 각을 내고, 안전층을 거쳐 서보로 보냅니다. 정책 계산은 라즈베리파이 4에서 0.3 ms면 끝납니다.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 100%);\"><img src=\"/data/img/fig-loop.898c7d75a5.1440.webp\" alt=\"곽곽이 사진에서 관절·IMU 값이 관측 만들기, 정책, 안전층을 거쳐 서보 목표 각으로 돌아오는 50 Hz 제어 루프\" title=\"\" data-width=\"100\" data-align=\"center\" data-caption=\"50 Hz 제어 루프. 실선은 로봇 안에서 매 주기 도는 흐름, 점선은 밖에서 들어오는 것입니다. o는 관측(61차원), a는 행동(14차원)입니다.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/fig-loop.898c7d75a5.640.webp 640w, /data/img/fig-loop.898c7d75a5.960.webp 960w, /data/img/fig-loop.898c7d75a5.1440.webp 1440w\" sizes=\"(max-width: 767px) calc(100vw - 32px), 720px\" width=\"1440\" height=\"660\" data-img-tone=\"light\" decoding=\"async\"><figcaption>50 Hz 제어 루프. 실선은 로봇 안에서 매 주기 도는 흐름, 점선은 밖에서 들어오는 것입니다. o는 관측(61차원), a는 행동(14차원)입니다.</figcaption></figure><ul><li><p><strong>IMU</strong>는 별도 스레드에서 200 Hz로 읽고 Mahony 필터로 자세를 추정합니다. 몸통에 세로로 붙였기 때문에 축을 (−z, −x, +y)로 바꿔 읽습니다.</p></li><li><p><strong>정책</strong>은 학습 서버(RTX 4090)에서 mjlab(MuJoCo Warp)과 PPO로 학습합니다. 서보 특성은 Rhoban의 BAM 액추에이터 모델로 맞췄습니다.</p></li><li><p><strong>안전층</strong>은 배터리가 6.6 V 아래로 떨어지거나 넘어지면 멈추고, 머리가 학습한 범위를 벗어나지 않게 막습니다.</p></li></ul><h2>서보 15개 깨우기</h2><p>배선보다 오래 걸린 것이 서보를 하나씩 살리는 일이었습니다.</p><ul><li><p><strong>응답 없는 서보.</strong> 처음에는 6개가 LED만 켜지고 응답하지 않았습니다. DYNAMIXEL Wizard의 펌웨어 복구로 살렸는데, 복구할 때 모델을 잘못 골라 XC330 계열로 바뀐 서보가 두 번 나왔습니다. 둘 다 XL330-M288-T로 다시 복구했습니다.</p></li><li><p><strong>같은 ID.</strong> 새 서보는 모두 ID 1이라 한 버스에 두 개를 꽂으면 소프트웨어로 구분할 수 없습니다. 사슬 끝의 선을 하나씩 빼면서 ID를 하나씩 줬습니다.</p></li><li><p><strong>꺼지는 힘.</strong> 배터리를 처음 연결하자 서보의 힘이 바로 꺼졌습니다. 배터리 전압(7.5 V)이 서보의 최대 전압 설정 7.0 V를 넘었기 때문입니다. 셧다운 조건을 원본 설정과 같은 값으로 맞춰 해결했습니다.</p></li></ul><h2>영점 잡기</h2><p>가장 오래 헤맨 곳입니다. 모델의 영점(모든 관절이 0인 자세)은 다리를 쭉 편 자세가 아니라 허벅지가 앞으로 꺾인 ‘ㄱ자’ 자세입니다. 이걸 모르고 다리를 편 상태를 영점으로 잡아서 보정을 두 번 헛돌았습니다.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 72%);\"><img src=\"/data/img/zero-home.6f7fab5859.1040.webp\" alt=\"시뮬레이션 모델을 옆에서 본 영점 자세와 서기 자세\" title=\"\" data-width=\"72\" data-align=\"center\" data-caption=\"시뮬레이션 모델의 영점(왼쪽)과 서기 자세(오른쪽). 영점은 허벅지가 앞으로 접힌 자세입니다.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/zero-home.6f7fab5859.640.webp 640w, /data/img/zero-home.6f7fab5859.1040.webp 1040w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"1040\" height=\"640\" data-img-tone=\"dark\" decoding=\"async\"><figcaption>시뮬레이션 모델의 영점(왼쪽)과 서기 자세(오른쪽). 영점은 허벅지가 앞으로 접힌 자세입니다.</figcaption></figure><p>Homing Offset으로 다 맞추지 못한 관절은 <code>robotd</code>에 소프트웨어 영점(<code>joint_offsets</code>)을 따로 두었고, 혼(horn) 3개는 다시 끼웠습니다.</p><h2>대시보드</h2><p>노트북 브라우저에서 곽곽이를 조종하는 대시보드도 만들었습니다. <code>robotd</code>에 유닉스 소켓으로 붙어 상태를 20 Hz로 받고, 실제 관절 각과 IMU 기울기로 3D 모델을 움직입니다. 무게중심이 두 발 사이 어디에 있는지 바로 보여서 영점과 자세를 맞출 때 가장 많이 썼습니다. 서기·앉기, 정책 켜고 끄기, WASD 키 조종, 목과 몸 기울기 조절을 한 화면에서 합니다.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 100%);\"><img src=\"/data/img/dashboard.4e0c707bd3.1440.webp\" alt=\"3D 모델과 무게중심, 서기·정책 버튼, WASD 키 조종과 슬라이더가 있는 곽곽이 대시보드 화면\" title=\"\" data-width=\"100\" data-align=\"center\" data-caption=\"곽곽이 대시보드. 왼쪽은 실제 자세를 따라 움직이는 3D 모델과 무게중심, 오른쪽은 동작 버튼과 키보드 조종입니다.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/dashboard.4e0c707bd3.640.webp 640w, /data/img/dashboard.4e0c707bd3.960.webp 960w, /data/img/dashboard.4e0c707bd3.1440.webp 1440w\" sizes=\"(max-width: 767px) calc(100vw - 32px), 720px\" width=\"1690\" height=\"1160\" data-img-tone=\"dark\" decoding=\"async\"><figcaption>곽곽이 대시보드. 왼쪽은 실제 자세를 따라 움직이는 3D 모델과 무게중심, 오른쪽은 동작 버튼과 키보드 조종입니다.</figcaption></figure><h2>처음 걷기, 그리고 넘어짐</h2><p>11월 3일 아침 8시에 처음 정책을 켰고, 8시 46분에 제자리에 섰고, 몇 분 뒤 첫 걸음을 뗐습니다. 그리고 뒤로 넘어졌습니다.</p><p>원인은 무게중심이었습니다. 라즈베리파이 4가 몸통 안에 들어가지 않아 보드들을 등 뒤에 달았더니, 무게중심이 모델보다 20–30 mm 뒤에 있었습니다. 무게도 843 g으로 원본 모델(737 g)보다 무겁습니다.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 56%);\"><img src=\"/data/img/side.ecc1077dd2.1100.webp\" alt=\"등 뒤에 라즈베리파이와 OpenRB-150을 단 곽곽이의 옆모습\" title=\"\" data-width=\"56\" data-align=\"center\" data-caption=\"등에 단 라즈베리파이와 OpenRB-150. 이 무게 때문에 무게중심이 뒤로 갑니다.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/side.ecc1077dd2.640.webp 640w, /data/img/side.ecc1077dd2.1100.webp 1100w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.56), 403px\" width=\"1100\" height=\"1671\" data-img-tone=\"mixed\" decoding=\"async\"><figcaption>등에 단 라즈베리파이와 OpenRB-150. 이 무게 때문에 무게중심이 뒤로 갑니다.</figcaption></figure><ul><li><p><strong>IMU 보정.</strong> 서 있을 때 다리 각도로 계산한 몸 기울기는 뒤로 4.2°인데 IMU는 −0.6°를 가리켰습니다. IMU 트림과 좌우 다리 보정(1.7–3.9°)을 넣자, 제자리에서 오른쪽으로 돌던 속도가 2.3°/s에서 0.2°/s로 줄었습니다.</p></li><li><p><strong>다시 학습.</strong> 시뮬레이션 모델의 몸통에 100 g을 더하고 무게중심을 30 mm 뒤로 옮겨 다시 학습했습니다. 시뮬레이션에서 뒤로 0.4 m/s로 미는 시험을 해 보니 넘어짐이 48번 중 9번에서 1번으로 줄었습니다.</p></li><li><p><strong>약한 서보.</strong> 실제 서보는 시뮬레이션보다 약하게 처집니다. 서 있을 때 처짐이 시뮬레이션의 약 1.5배입니다. 서보 강도를 무작위로 바꿔 가며 다시 학습한 정책은, 시뮬레이션에서 강도를 70%로 낮춰도 거의 넘어지지 않았습니다.</p></li></ul><p>지금 곽곽이에 올라간 정책으로 26분을 기록해 보니, 실제로 걸은 시간은 7분이고 21번 넘어졌습니다. 직진할 때 한쪽으로 휘던 문제는 해결됐습니다.</p><h2>남은 것</h2><ul><li><p>시뮬레이션에서 학습을 마친 정책 두 개(서보 강도를 반영한 걷기, 쪼그려 앉았다 일어서기)를 로봇에 올리기</p></li><li><p>라즈베리파이 전원을 서보와 분리하기</p></li><li><p>왼쪽 무릎이 오른쪽보다 더 처지는 문제(14° 대 8°)</p></li><li><p>카메라 연결</p></li></ul><h2>참고</h2><ul><li><p>Pollen Robotics, <a href=\"https://www.pollen-robotics.com/microduck\" target=\"_blank\" rel=\"noopener noreferrer\">Microduck</a></p></li><li><p><a href=\"https://github.com/pollen-robotics/microduck_rl\" target=\"_blank\" rel=\"noopener noreferrer\">pollen-robotics/microduck_rl</a> (Apache-2.0)</p></li><li><p>Rhoban, BAM (Better Actuator Models)</p></li></ul>",
      "rendered": true
    },
    "en": {
      "language": "en",
      "filename": "en.html",
      "format": "html",
      "title": "Microduck 1 - First Steps",
      "summary": "Waking up 15 servos, setting the zero pose three times, and taking the first steps with a reinforcement-learning policy — all in one day",
      "description": "A build log of Pollen Robotics' open-source bipedal robot Microduck on a Raspberry Pi 4 and a ROBOTIS OpenRB-150: power and wiring, the 50 Hz control loop, servo IDs and the zero pose, and the centre-of-mass fixes and retraining that got it walking.",
      "content": "<p>Microduck is a small bipedal robot, about 25 cm tall, released by Pollen Robotics. Fifteen servos move its two legs, neck and head, and a policy trained with reinforcement learning in simulation picks the next pose 50 times a second. The robot software (<code>microduck</code>) and the training code (<code>microduck_rl</code>) are open under Apache-2.0, so you can build one yourself once you have the parts.</p><p>This post is the log of the one I built, nicknamed Gwakgwak (곽곽이, roughly “quack-quack”), up to its first steps. The parts and the Raspberry Pi were prepared beforehand; assembly, servo ID mapping and the first steps all happened in one day.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 42%);\"><img src=\"/data/img/walk.5343b3a0e1.300.webp\" alt=\"Gwakgwak taking a few steps on the floor\" title=\"\" data-width=\"42\" data-align=\"center\" data-caption=\"Gwakgwak walking on the floor on 3 November. That day it managed a few steps at a time and fell often.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" width=\"300\" height=\"400\" data-img-tone=\"mixed\" decoding=\"async\"><figcaption>Gwakgwak walking on the floor on 3 November. That day it managed a few steps at a time and fell often.</figcaption></figure><h2>Parts</h2><p>The original uses a Rockchip board. Gwakgwak uses a Raspberry Pi 4 and a ROBOTIS OpenRB-150 that I already had, and an IMU board I also had on hand, wired over I2C.</p><table><tbody><tr><th>Role</th><th>Part</th></tr><tr><td>Computer</td><td>Raspberry Pi 4 (4 GB), Raspberry Pi OS Lite 64-bit</td></tr><tr><td>Servo controller</td><td>ROBOTIS OpenRB-150 (USB, 1 Mbps, Protocol 2.0)</td></tr><tr><td>Servos</td><td>15 × Dynamixel XL330-M288-T (10 in the legs, 5 in the neck, head and mouth)</td></tr><tr><td>IMU</td><td>ICM-20948 (Waveshare 10DOF board, I2C 400 kHz)</td></tr><tr><td>Power</td><td>NP-F550 2S battery (7.4 V), toggle switch, MP1584EN 5 V buck converter</td></tr><tr><td>Weight</td><td>843 g (original model 737 g)</td></tr></tbody></table><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 100%);\"><img src=\"/data/img/parts.7b1522bac5.1440.webp\" alt=\"3D-printed shells, servos, a Raspberry Pi and wiring laid out on a desk\" title=\"\" data-width=\"100\" data-align=\"center\" data-caption=\"Parts during assembly: the 3D-printed shells, servos, the Raspberry Pi and the wiring.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/parts.7b1522bac5.640.webp 640w, /data/img/parts.7b1522bac5.960.webp 960w, /data/img/parts.7b1522bac5.1440.webp 1440w\" sizes=\"(max-width: 767px) calc(100vw - 32px), 720px\" width=\"1600\" height=\"1200\" data-img-tone=\"mixed\" decoding=\"async\"><figcaption>Parts during assembly: the 3D-printed shells, servos, the Raspberry Pi and the wiring.</figcaption></figure><h2>Power and wiring</h2><p>One battery goes through the switch and then splits in two. One branch feeds the OpenRB-150's VIN, which powers all 15 servos; the other is stepped down to 5 V by the MP1584EN and goes into the Raspberry Pi's GPIO header. The servo bus has three branches — right leg, left leg, and neck and head — with IDs 10–14, 20–24 and 30–34. The Raspberry Pi talks to the OpenRB-150 over USB and to the IMU over I2C.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 100%);\"><img src=\"/data/img/fig-wiring-en.3664b09d4c.1440.webp\" alt=\"Wiring diagram: the battery feeds the switch, then splits to the OpenRB-150 and the MP1584EN; USB, I2C and Wi-Fi links\" title=\"\" data-width=\"100\" data-align=\"center\" data-caption=\"Gwakgwak's power and signals. Solid lines are power and the servo bus, dashed lines are data. The blue dot is where the servos and the Raspberry Pi share one battery.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/fig-wiring-en.3664b09d4c.640.webp 640w, /data/img/fig-wiring-en.3664b09d4c.960.webp 960w, /data/img/fig-wiring-en.3664b09d4c.1440.webp 1440w\" sizes=\"(max-width: 767px) calc(100vw - 32px), 720px\" width=\"1440\" height=\"824\" data-img-tone=\"light\" decoding=\"async\"><figcaption>Gwakgwak's power and signals. Solid lines are power and the servo bus, dashed lines are data. The blue dot is where the servos and the Raspberry Pi share one battery.</figcaption></figure><p>That shared branch caused trouble later. When the servos pull hard at the same moment, the battery voltage sags and the Raspberry Pi reboots from undervoltage. It rebooted more than six times on the afternoon of 3 November alone, and the undervoltage flag (<code>throttled=0x50000</code>) was set. Giving the Raspberry Pi its own supply is the next job.</p><h2>Control structure</h2><p>On the Raspberry Pi, <code>robotd</code> (written in Rust) runs a 50 Hz loop (measured 49.98 Hz). Every cycle it collects the servo positions and velocities, the IMU's gyro and gravity direction, and the walk command from the dashboard into a 61-dimensional observation. The policy, exported to ONNX, turns that into target angles for 14 joints, which pass through a safety layer before going to the servos. On the Raspberry Pi 4 the policy takes 0.3 ms.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 100%);\"><img src=\"/data/img/fig-loop-en.730523b401.1440.webp\" alt=\"The 50 Hz control loop: joint and IMU readings from the robot go through the observation, the policy and the safety layer and return as servo targets\" title=\"\" data-width=\"100\" data-align=\"center\" data-caption=\"The 50 Hz control loop. Solid lines run inside the robot every cycle; dashed lines come from outside. o is the observation (61 values), a is the action (14 values).\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/fig-loop-en.730523b401.640.webp 640w, /data/img/fig-loop-en.730523b401.960.webp 960w, /data/img/fig-loop-en.730523b401.1440.webp 1440w\" sizes=\"(max-width: 767px) calc(100vw - 32px), 720px\" width=\"1440\" height=\"660\" data-img-tone=\"light\" decoding=\"async\"><figcaption>The 50 Hz control loop. Solid lines run inside the robot every cycle; dashed lines come from outside. o is the observation (61 values), a is the action (14 values).</figcaption></figure><ul><li><p><strong>The IMU</strong> is read at 200 Hz in its own thread, with a Mahony filter for orientation. It is mounted upright in the torso, so its axes are remapped to (−z, −x, +y).</p></li><li><p><strong>The policy</strong> is trained on a training server (RTX 4090) with mjlab (MuJoCo Warp) and PPO. The servo behaviour comes from Rhoban's BAM actuator model.</p></li><li><p><strong>The safety layer</strong> stops the robot when the battery drops below 6.6 V or when it falls, and keeps the head inside the range the policy was trained on.</p></li></ul><h2>Waking up 15 servos</h2><p>Bringing the servos back to life one by one took longer than the wiring.</p><ul><li><p><strong>Servos that did not answer.</strong> At first six of them lit their LED but never replied. DYNAMIXEL Wizard's firmware recovery brought them back, but twice I picked the wrong model during recovery and the servo came back as an XC330 variant. Both were recovered again as XL330-M288-T.</p></li><li><p><strong>Duplicate IDs.</strong> New servos all ship as ID 1, so two of them on one bus cannot be told apart in software. I unplugged the last cable in the chain and assigned IDs one servo at a time.</p></li><li><p><strong>Torque switching off.</strong> The moment the battery was connected, the servos dropped their torque. The battery voltage (7.5 V) was above the servos' maximum voltage setting of 7.0 V. Setting the shutdown condition to the same value as the original configuration fixed it.</p></li></ul><h2>Setting the zero pose</h2><p>This is where I lost the most time. The model's zero pose (all joints at 0) is not the straight-leg pose but an L-shape with the thighs bent forward. Not knowing that, I zeroed the legs straight and went round the calibration loop twice for nothing.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 72%);\"><img src=\"/data/img/zero-home.6f7fab5859.1040.webp\" alt=\"Side views of the simulation model in its zero pose and in its standing pose\" title=\"\" data-width=\"72\" data-align=\"center\" data-caption=\"The simulation model's zero pose (left) and standing pose (right). In the zero pose the thighs are folded forward.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/zero-home.6f7fab5859.640.webp 640w, /data/img/zero-home.6f7fab5859.1040.webp 1040w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.72), 518px\" width=\"1040\" height=\"640\" data-img-tone=\"dark\" decoding=\"async\"><figcaption>The simulation model's zero pose (left) and standing pose (right). In the zero pose the thighs are folded forward.</figcaption></figure><p>Joints that the servo's Homing Offset could not fully correct got a software zero in <code>robotd</code> (<code>joint_offsets</code>), and three servo horns were refitted.</p><h2>Dashboard</h2><p>I also built a dashboard to drive Gwakgwak from a laptop browser. It connects to <code>robotd</code> over a Unix socket, receives the state at 20 Hz, and moves a 3D model with the real joint angles and IMU tilt. Because it shows exactly where the centre of mass sits between the feet, it was the tool I used most while fixing the zero pose and posture. Stand and sit, policy on and off, WASD driving, and neck and body tilt are all on one screen.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 100%);\"><img src=\"/data/img/dashboard.4e0c707bd3.1440.webp\" alt=\"The Gwakgwak dashboard with a 3D model and centre of mass, stand and policy buttons, WASD driving and sliders\" title=\"\" data-width=\"100\" data-align=\"center\" data-caption=\"The Gwakgwak dashboard (UI in Korean). Left: a 3D model that follows the real pose, with the centre of mass. Right: action buttons and keyboard driving.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/dashboard.4e0c707bd3.640.webp 640w, /data/img/dashboard.4e0c707bd3.960.webp 960w, /data/img/dashboard.4e0c707bd3.1440.webp 1440w\" sizes=\"(max-width: 767px) calc(100vw - 32px), 720px\" width=\"1690\" height=\"1160\" data-img-tone=\"dark\" decoding=\"async\"><figcaption>The Gwakgwak dashboard (UI in Korean). Left: a 3D model that follows the real pose, with the centre of mass. Right: action buttons and keyboard driving.</figcaption></figure><h2>First steps, and falling</h2><p>On the morning of 3 November I switched the policy on for the first time. About 45 minutes later it was standing on its own, and a few minutes after that it took its first steps. Then it fell over backwards.</p><p>The cause was the centre of mass. The Raspberry Pi 4 does not fit inside the torso, so the boards went on its back, which put the centre of mass 20–30 mm behind the model's. It is also heavier: 843 g against the original model's 737 g.</p><figure data-type=\"image-block\" class=\"image-block image-block--center\" style=\"max-width: min(100%, 56%);\"><img src=\"/data/img/side.ecc1077dd2.1100.webp\" alt=\"Side view of Gwakgwak with the Raspberry Pi and OpenRB-150 mounted on its back\" title=\"\" data-width=\"56\" data-align=\"center\" data-caption=\"The Raspberry Pi and OpenRB-150 on its back. Their weight pulls the centre of mass backwards.\" class=\"editor-image image-align-center\" loading=\"lazy\" style=\"width: 100%; height: auto;\" srcset=\"/data/img/side.ecc1077dd2.640.webp 640w, /data/img/side.ecc1077dd2.1100.webp 1100w\" sizes=\"(max-width: 767px) calc((100vw - 32px) * 0.56), 403px\" width=\"1100\" height=\"1671\" data-img-tone=\"mixed\" decoding=\"async\"><figcaption>The Raspberry Pi and OpenRB-150 on its back. Their weight pulls the centre of mass backwards.</figcaption></figure><ul><li><p><strong>IMU correction.</strong> Standing still, the body tilt computed from the leg angles was 4.2° backwards, but the IMU read −0.6°. With an IMU trim and left/right leg corrections of 1.7–3.9°, the slow spin to the right on the spot dropped from 2.3°/s to 0.2°/s.</p></li><li><p><strong>Retraining.</strong> I added 100 g to the simulated torso, moved its centre of mass 30 mm back and trained again. In simulation, a 0.4 m/s push from behind now knocked it over 1 time in 48 instead of 9.</p></li><li><p><strong>Weaker servos.</strong> The real servos sag more than the simulated ones: standing, they sag about 1.5 times as much. A policy retrained with randomised servo strength barely fell in simulation even at 70% strength.</p></li></ul><p>With the policy now on Gwakgwak, a 26-minute recording had 7 minutes of actual walking and 21 falls. The drift to one side when walking straight is fixed.</p><h2>What's left</h2><ul><li><p>Put the two policies that finished training in simulation on the robot: walking with servo strength randomised, and standing up from a squat</p></li><li><p>Separate the Raspberry Pi's power from the servos</p></li><li><p>The left knee sags more than the right (14° against 8°)</p></li><li><p>Connect the camera</p></li></ul><h2>References</h2><ul><li><p>Pollen Robotics, <a href=\"https://www.pollen-robotics.com/microduck\" target=\"_blank\" rel=\"noopener noreferrer\">Microduck</a></p></li><li><p><a href=\"https://github.com/pollen-robotics/microduck_rl\" target=\"_blank\" rel=\"noopener noreferrer\">pollen-robotics/microduck_rl</a> (Apache-2.0)</p></li><li><p>Rhoban, BAM (Better Actuator Models)</p></li></ul>",
      "rendered": true
    }
  }
}
