Skip to content

Commit 79258bf

Browse files
authored
Merge pull request #7 from HMCL-UNIST/hj
modified hj post
2 parents 6a4e9b5 + e068f63 commit 79258bf

8 files changed

Lines changed: 87 additions & 47 deletions

File tree

_posts/2026-01-05-vesc-firmware-upgrade-guide/2026-01-05-vesc-firmware-upgrade-guide-en.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Steps:
4949
6. The VESC will reboot automatically after upload.
5050
7. Reconnect and continue using it.
5151

52+
![Firmware - Custom File tab for manual upload](/assets/img/posts/vesc-firmware-upgrade-guide/custom-file-upload.webp)
5253

5354
---
5455

@@ -60,6 +61,8 @@ If your PC is online, you can use the built-in **Firmware Archive** feature in V
6061
- It automatically detects your hardware and matches compatible firmware.
6162
- The default selection is the latest version, so **manually switch it to 6.05**.
6263

64+
![Firmware - Archive tab with version 6.05 selected](/assets/img/posts/vesc-firmware-upgrade-guide/archive-firmware-select.webp)
65+
6366
## Wrap-up
6467

6568
The newest firmware is not always the most stable. For competition and research platforms, **6.05 remains a reasonable, well-tested choice**. After upgrading, re-check motor and sensor settings, as they can be reset during the process.

_posts/2026-01-05-vesc-firmware-upgrade-guide/2026-01-05-vesc-firmware-upgrade-guide.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ VESC 공식 펌웨어 아카이브는 아래 GitHub 저장소에서 관리됩니
4949
6. 업로드가 끝나면 VESC가 자동으로 재부팅됩니다.
5050
7. 재부팅 후 다시 연결해 사용합니다.
5151

52+
![Firmware - Custom File 탭에서 펌웨어 업로드](/assets/img/posts/vesc-firmware-upgrade-guide/custom-file-upload.webp)
5253

5354
---
5455

@@ -60,6 +61,8 @@ PC가 인터넷에 연결된 상태라면 VESC Tool의 **Firmware Archive 기능
6061
- VESC 하드웨어를 자동으로 인식해 호환 펌웨어를 매칭해 줍니다.
6162
- 기본값은 최신 버전이므로 **Version을 수동으로 6.05로 변경**하는 것을 추천합니다.
6263

64+
![Firmware - Archive 탭에서 6.05 버전 선택](/assets/img/posts/vesc-firmware-upgrade-guide/archive-firmware-select.webp)
65+
6366
## 마무리
6467

6568
최신 펌웨어가 항상 가장 안정적인 것은 아닙니다. 특히 대회용 차량이나 연구용 플랫폼에서는 **검증된 6.05 버전이 합리적인 선택**이 됩니다. 업그레이드 후에는 모터 및 센서 설정이 초기화될 수 있으므로, 반드시 설정을 다시 확인하고 적용하시기 바랍니다.

_posts/2026-02-03-erpm-gain-calibration/2026-02-03-erpm-gain-calibration-en.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $$
6363
### ERPM gain calculation
6464

6565
$$
66-
\text{speed_to_erpm_gain} = \frac{\text{pole_pairs} \cdot \text{gear_ratio}}{2\pi \cdot \text{wheel_radius}}
66+
\text{speed_to_erpm_gain} = \frac{60 \cdot \text{pole_pairs} \cdot \text{gear_ratio}}{2\pi \cdot \text{wheel_radius}}
6767
$$
6868

6969
Plugging in the values gives a theoretical speed_to_erpm_gain of **~7520** for the Traxxas Fiesta + Velineon setup. Update the value in `vesc.yaml` accordingly.
@@ -88,11 +88,22 @@ This is the most direct and accurate method.
8888
3. Measure the time for one full rotation using the high‑speed video.
8989
4. Compute the actual speed from rotation time and wheel circumference.
9090

91+
**Calculation example**
92+
93+
| Item | Value |
94+
|------|-------|
95+
| Commanded speed | 1.0 m/s |
96+
| Time for 1 rotation | 0.25 sec |
97+
| Wheel circumference | 0.314m (radius 0.05m) |
98+
| Actual speed | 0.314 / 0.25 = 1.256 m/s |
99+
100+
In this case, the actual speed (1.256 m/s) is higher than the commanded speed (1.0 m/s), so the gain should be decreased.
101+
91102
**Adjusting gain**
92-
- If actual speed is higher than commanded, increase the gain.
93-
- If actual speed is lower, decrease the gain.
103+
- If actual speed is higher than commanded, decrease the gain.
104+
- If actual speed is lower, increase the gain.
94105

95-
### Method 2: Odometry (noisy, not recommended)
106+
### Method 2: Odometry (very noisy, not recommended)
96107

97108
This method uses ROS odometry.
98109

@@ -109,17 +120,17 @@ This method uses ROS odometry.
109120

110121
**Calibration formula**
111122
$$
112-
\text{new\_gain} = \text{old\_gain} \times \frac{\text{actual\_distance}}{\text{odom\_distance}}
123+
\text{new_gain} = \text{old_gain} \times \frac{\text{odom_distance}}{\text{actual_distance}}
113124
$$
114125

115126
For example, if old gain is 7520 and odom shows 5.5 m while the actual distance is 5 m:
116127

117128
$$
118-
\text{new\_gain} = 7520 \times \frac{5.0}{5.5} \approx 6840
129+
\text{new_gain} = 7520 \times \frac{5.5}{5.0} \approx 8272
119130
$$
120131

121132
Repeat until odom distance matches the actual distance.
122133

123134
## Wrap-up
124135

125-
ERPM gain calibration is fundamental for accurate speed control and odometry in autonomous vehicles. If calibration is off, odometry drift can accumulate and cause path deviations or accidents. Take the time to measure carefully and tune the gain precisely.
136+
ERPM gain calibration is fundamental for accurate speed control and odometry in autonomous vehicles. If calibration is off, odometry drift can accumulate and cause localization failures and other accidents. Take the time to measure carefully and tune the gain precisely.

_posts/2026-02-03-erpm-gain-calibration/2026-02-03-erpm-gain-calibration.md

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ image:
99
lang: ko
1010
lang_ref: erpm-gain-calibration
1111
math: true
12+
recommended : true
1213
---
13-
1414
모터를 Throttle 제어가 아닌 속도를 활용해 제어할 때, 사용자의 명령을 하드웨어 조합에 맞게 적절히 변환하는 비례 상수를 찾는 것은 매우 중요합니다. 해당 상수는 자율 주행에서 위치 추정 오차 누적의 원인이 되며, 잘못된 제어로 사고를 유발할 수 있습니다. 이 글에서는 ERPM 게인의 개념과 이론적 계산 방법, 그리고 실험을 통한 캘리브레이션 방법을 정리했습니다.
1515

1616
## ERPM이란?
@@ -43,14 +43,14 @@ Traxxas Fiesta 차량에 Velineon 모터 조합으로 이론적 ERPM 게인을
4343

4444
### 하드웨어 스펙
4545

46-
| 항목 ||
47-
| --- | --- |
48-
| 모터 | Traxxas Velineon 3500 (4극) |
49-
| 극 쌍수 (pole_pairs) | 2 |
50-
| 피니언-스퍼 기어비 | 12 : 83 |
51-
| 디퍼런셜-샤프트 기어비 | 13 : 37 |
52-
| 바퀴 지름 | 10cm |
53-
| 바퀴 반지름 (wheel_radius) | 0.05m |
46+
| 항목 | |
47+
| -------------------------- | --------------------------- |
48+
| 모터 | Traxxas Velineon 3500 (4극) |
49+
| 극 쌍수 (pole_pairs) | 2 |
50+
| 피니언-스퍼 기어비 | 12 : 83 |
51+
| 디퍼런셜-샤프트 기어비 | 13 : 37 |
52+
| 바퀴 지름 | 10cm |
53+
| 바퀴 반지름 (wheel_radius) | 0.05m |
5454

5555
### 기어비 계산
5656

@@ -63,7 +63,7 @@ $$
6363
### ERPM 게인 계산
6464

6565
$$
66-
\text{speed_to_erpm_gain} = \frac{\text{pole_pairs} \cdot \text{gear_ratio}}{2\pi \cdot \text{wheel_radius}}
66+
\text{speed_to_erpm_gain} = \frac{60 \cdot \text{pole_pairs} \cdot \text{gear_ratio}}{2\pi \cdot \text{wheel_radius}}
6767
$$
6868

6969
위 값을 대입하면 Traxxas Fiesta + Velineon 조합의 이론적 speed_to_erpm_gain 값은 **약 7520**입니다. `vesc.yaml`에 기록된 speed_to_erpm_gain 값을 변경해 사용하면 됩니다.
@@ -77,49 +77,73 @@ $$
7777
가장 직관적이고 정확한 방법입니다.
7878

7979
**준비물**
80-
- 초고속 카메라(스마트폰 슬로모션 기능도 가능)
80+
81+
- 초고속 카메라(스마트폰 슬로우 모션 기능도 가능)
8182
- 바퀴에 부착할 마커(테이프 등)
8283

8384
![테이프가 부착된 타이어](/assets/img/posts/erpm-gain-calibration/tire-marker.png)
8485

8586
**측정 순서**
87+
8688
1. 바퀴에 회전수 측정용 표시를 합니다.
8789
2. 일정한 속도 명령을 줍니다. (PID 튜닝이 되어 있어야 일정한 속도 유지가 가능합니다.)
8890
3. 초고속 카메라로 바퀴가 한 바퀴 도는 시간을 측정합니다.
8991
4. 측정된 시간과 바퀴 둘레로 실제 속도를 계산합니다.
9092

9193
**보정 방법**
92-
- 명령한 속도보다 실제 속도가 빠르면 gain 값을 높입니다.
93-
- 느리면 gain 값을 낮춥니다.
9494

95-
### 방법 2: Odometry 활용 (노이즈 가능, 비추천)
95+
- 명령한 속도보다 실제 속도가 빠르면 gain 값을 낮춥니다.
96+
- 느리면 gain 값을 높입니다.
97+
98+
**계산 예시**
99+
100+
| 항목 ||
101+
| --------------- | -------------------------- |
102+
| 명령한 속도 | 1.0 m/s |
103+
| 바퀴 1회전 시간 | 0.25초 |
104+
| 바퀴 둘레 | 0.314m (반지름 0.05m 기준) |
105+
| 실제 속도 | 0.314 / 0.25 = 1.256 m/s |
106+
107+
이 경우 실제 속도(1.256 m/s)가 명령한 속도(1.0 m/s)보다 빠르므로, gain을 낮춰야 합니다.
108+
109+
### 방법 2: Odometry 활용 (노이즈 많음, 비추천)
96110

97111
ROS 토픽으로 캘리브레이션하는 방법입니다.
98112

99113
**준비물**
114+
100115
- 줄자 또는 측정 도구
101116
- 출발선 마킹용 테이프
102117
- Servo Offset Tuning이 완료된 차량
103118

104119
**측정 순서**
120+
105121
1. 차량 출발 지점을 마킹합니다.
106122
2. `/vesc/odom` 토픽의 position 값을 0으로 초기화하거나 기록합니다.
107123
3. 일정 거리(예: 5m)를 저속으로 직진 주행합니다.
108124
4. 실제 이동 거리와 `/vesc/odom` 토픽 상의 이동 거리를 비교합니다.
109125

126+
**보정 방법**
127+
128+
| 상황 | 조치 |
129+
| --------------------- | ---------------- |
130+
| odom 거리 > 실제 거리 | gain 값을 높인다 |
131+
| odom 거리 < 실제 거리 | gain 값을 낮춘다 |
132+
110133
**보정 공식**
134+
111135
$$
112-
\text{new\_gain} = \text{old\_gain} \times \frac{\text{actual\_distance}}{\text{odom\_distance}}
136+
\text{new_gain} = \text{old_gain} \times \frac{\text{odom_distance}}{\text{actual_distance}}
113137
$$
114138

115139
예를 들어 기존 gain이 7520이고, odom이 5.5m를 표시했는데 실제로는 5m를 이동했다면 다음과 같이 보정합니다.
116140

117141
$$
118-
\text{new\_gain} = 7520 \times \frac{5.0}{5.5} \approx 6840
142+
\text{new_gain} = 7520 \times \frac{5.5}{5.0} \approx 8272
119143
$$
120144

121145
이 과정을 odom 거리와 실제 거리가 일치할 때까지 반복합니다.
122146

123147
## 마무리
124148

125-
ERPM 게인 캘리브레이션은 자율 주행 차량의 정밀한 속도 제어와 위치 추정의 기반이 되는 중요한 과정입니다. 캘리브레이션이 정확하지 않으면 Odometry 오차가 누적되어 경로 이탈이나 사고로 이어질 수 있으므로, 시간을 들여 정확하게 측정하기를 권장합니다.
149+
ERPM 게인 캘리브레이션은 자율 주행 차량의 정밀한 속도 제어와 위치 추정의 기반이 되는 중요한 과정입니다. 캘리브레이션이 정확하지 않으면 Odometry 오차가 누적되어 위치 추정 실패 등의 사고로 이어질 수 있으므로, 시간을 들여 정확하게 측정하기를 권장합니다.

_posts/2026-02-03-servo-parameter/2026-02-03-servo-parameter-en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ In autonomous driving, precise steering control directly affects path following
1717

1818
In the VESC ROS package, steering commands are input as steering angles in radians and converted to values between 0 and 1 that the servo understands. This conversion relationship can be represented by gain and offset as follows:
1919

20-
```
21-
servo_value = steering_angle_to_servo_gain × steering_angle + steering_angle_to_servo_offset
22-
```
20+
$$
21+
\text{servo_value} = \text{steering_angle_to_servo_gain} \times \text{steering_angle} + \text{steering_angle_to_servo_offset}
22+
$$
2323

2424
- **steering_angle**: Steering angle input by the user (radians)
2525
- **servo_value**: Command delivered to the servo (0 ~ 1)

_posts/2026-02-03-servo-parameter/2026-02-03-servo-parameter.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@ lang: ko
1010
lang_ref: servo-parameter
1111
math: true
1212
---
13-
1413
자율 주행에서 정확한 조향 제어는 경로 추종 성능에 직접적인 영향을 미칩니다. 조향 명령과 실제 바퀴 각도 사이의 변환이 정확하지 않으면, 차량은 의도한 경로를 따라가지 못하고 경로 이탈이나 사고로 이어질 수 있습니다. 본 포스트에서는 Servo Parameter의 개념과 특성, 그리고 실험을 통한 캘리브레이션 방법을 정리합니다.
1514

1615
## Servo Parameter란?
1716

1817
VESC ROS 패키지에서 조향 명령은 라디안 단위의 조향각으로 입력되며, 이를 서보가 이해하는 0에서 1 사이의 값으로 변환하여 전달합니다. 이 변환 관계는 다음과 같이 gain과 offset으로 나타낼 수 있습니다.
1918

20-
```
21-
servo_value = steering_angle_to_servo_gain × steering_angle + steering_angle_to_servo_offset
22-
```
19+
$$
20+
\text{servo_value} = \text{steering_angle_to_servo_gain} \times \text{steering_angle} + \text{steering_angle_to_servo_offset}
21+
$$
2322

2423
- **steering_angle**: 사용자가 입력하는 조향각 (라디안)
2524
- **servo_value**: 서보에 전달되는 명령 (0 ~ 1)
@@ -34,9 +33,9 @@ ERPM gain의 경우, 기어비, 극 쌍수, 바퀴 반지름 등의 하드웨어
3433

3534
### Ackermann Steering Geometry란?
3635

37-
차량이 회전할 때, 앞바퀴 두 개는 회전 중심으로부터 서로 다른 거리에 위치합니다. 내측 바퀴는 회전 중심에 가깝고, 외측 바퀴는 멀습니다.
36+
차량이 회전할 때 두 앞바퀴는 회전 중심으로부터 서로 다른 거리에 위치합니다. 내측 바퀴는 회전 중심에 가깝고, 외측 바퀴는 멉니다.
3837

39-
바퀴는 축에 수직인 방향으로만 순수하게 굴러갈 수 있습니다. 만약 두 앞바퀴가 같은 조향각으로 꺾이면, 두 바퀴 축의 연장선이 서로 평행해지고, 각 바퀴의 회전 반경이 달라지며 옆으로 끌려가는 슬립이 발생합니다.
38+
바퀴는 축에 수직인 방향으로만 순수하게 굴러갈 수 있습니다. 만약 두 앞바퀴가 같은 조향각으로 꺾이면, 두 바퀴 축의 연장선이 서로 평행해지고, 각 바퀴의 회전 중심이 달라지며 옆으로 끌려가는 슬립이 발생합니다.
4039

4140
이를 방지하기 위해, 두 바퀴 축의 연장선이 동일한 회전 중심에서 만나도록 내측 바퀴는 더 크게, 외측 바퀴는 더 작게 꺾어야 합니다. 이러한 기하학적 조건을 **Ackermann Steering Geometry**라고 합니다.
4241

@@ -45,11 +44,11 @@ _Ackermann Steering Geometry_
4544

4645
### Bellcrank 시스템의 비선형성
4746

48-
RC카에서는 bellcrank 시스템과 타이로드, 너클 암 등의 링키지를 통해 Ackermann Steering Geometry를 근사적으로 구현합니다. 이 복잡한 기구학적 구조로 인해, 서보 각도와 실제 바퀴 조향각 사이의 관계는 **비선형**입니다.
47+
RC카에서는 bellcrank 시스템과 타이로드, 너클 암 등의 링키지를 통해 Ackermann Steering Geometry를 근사적으로 구현합니다. 이 복잡한 기구학적 구조로 인해, 서보 각도와 실제 바퀴 조향각 사이의 관계는 **비선형적**입니다.
4948

5049
| ![Traxxas Bellcrank](/assets/img/posts/servo-parameter/traxxas-bellcrank.png) | ![Traxxas Ackermann](/assets/img/posts/servo-parameter/traxxas-ackermann.png) |
51-
|:---:|:---:|
52-
| Traxxas Fiesta의 조향 시스템 (Bellcrank) | Traxxas Fiesta의 Ackermann Steering Geometry |
50+
| :-------------------------------------------------------------------------: | :-------------------------------------------------------------------------: |
51+
| Traxxas Fiesta의 조향 시스템 (Bellcrank) | Traxxas Fiesta의 Ackermann Steering Geometry |
5352

5453
즉, 우리가 설정하는 `steering_angle_to_servo_gain`은 사실 선형 근사이며, 중앙(직진) 부근에서는 잘 맞지만 최대 조향각 부근에서는 오차가 발생할 수 있습니다. 따라서 Servo Parameter는 이론적 계산보다 실험을 통해 자주 사용하는 범위에 맞게 캘리브레이션하는 것이 일반적입니다.
5554

@@ -67,7 +66,7 @@ RC카에서는 bellcrank 시스템과 타이로드, 너클 암 등의 링키지
6766

6867
### 서보 혼 초기 위치의 중요성
6968

70-
servo gain과 offset이 적용된 상태에서 하드웨어의 한계까지 조향 명령을 주었을 때, 좌측이나 우측 한 방향으로만 제약되지 않도록 주의해야 합니다. 즉, 최대 조향 명령을 주어도 서보 명령은 항상 0에서 1 사이에 존재해야 합니다.
69+
servo gain과 offset이 적용된 상태에서 하드웨어의 한계까지 조향 명령을 주었을 때, 좌측이나 우측 한 방향으로만 하드웨어의 한계치에 제약되지 않도록 주의해야 합니다. 즉, 최대 조향 명령을 주어도 서보 명령은 항상 0에서 1 사이에 존재해야 합니다.
7170

7271
이를 위해 서보 혼 초기 위치를 가동범위 중앙에 잘 위치시키는 것이 중요합니다. 서보 혼이 잘 장착된 경우, offset은 0.5에 근접하게 측정됩니다.
7372

@@ -86,7 +85,7 @@ offset은 조향각 0일 때의 서보 값입니다. 바퀴가 정확히 직진
8685
5. 차량이 정확히 직진할 때의 값을 `steering_angle_to_servo_offset`으로 설정합니다.
8786

8887
> 서보 혼이 잘 장착되어 있다면 offset은 0.5 근처가 됩니다. 만약 0.5에서 크게 벗어난다면, 서보 혼을 분리 후 재장착하여 중앙에 맞추는 것을 권장합니다.
89-
{: .prompt-tip }
88+
> {: .prompt-tip }
9089
9190
### Gain 찾기
9291

@@ -97,7 +96,7 @@ gain은 조향각 변화에 따른 서보 값 변화의 비율입니다. rviz에
9796
Ackermann steering geometry에서 조향각과 회전반경의 관계는 다음과 같습니다. wheelbase는 앞 차축과 뒷 차축 사이의 거리로, 자를 통해 직접 측정하거나, 제조사에 적혀있는 정보를 참고하면 됩니다.
9897

9998
$$
100-
\text{turning_radius} = \frac{\text{wheelbase}}{\tan(\text{steering_angle})}
99+
\text{turning_radius(R)} = \frac{\text{wheelbase}}{\tan(\text{steering_angle})}
101100
$$
102101

103102
명령한 조향각으로 예상 회전반경을 계산하고, 실제 측정된 회전반경과 비교하여 gain을 조정합니다.
@@ -114,19 +113,19 @@ _Rviz를 통해 회전 반경을 측정하는 모습_
114113

115114
### 계산 예시 (Traxxas Fiesta 기준)
116115

117-
| 항목 ||
118-
|------|-----|
119-
| 휠베이스 | 0.33m |
120-
| 명령한 조향각 | 0.2 rad |
121-
| 예상 회전반경 | 0.33 / tan(0.2) ≈ 1.62m |
122-
| 실제 측정된 회전반경 | 1.8m |
116+
| 항목 | |
117+
| -------------------- | ------------------------ |
118+
| 휠베이스 | 0.33m |
119+
| 명령한 조향각 | 0.2 rad |
120+
| 예상 회전반경 | 0.33 / tan(0.2) ≈ 1.62m |
121+
| 실제 측정된 회전반경 | 1.8m |
123122

124123
이 경우, 예상(1.62m)보다 실제(1.8m)가 크므로 실제 조향각이 명령보다 작다는 의미입니다. 따라서 gain의 절댓값을 늘려야 합니다.
125124

126125
### 보정 방법
127126

128-
| 상황 | 조치 |
129-
|------|------|
127+
| 상황 | 조치 |
128+
| ----------------------------- | ---------------------- |
130129
| 실제 회전반경 > 예상 회전반경 | gain의 절댓값을 늘린다 |
131130
| 실제 회전반경 < 예상 회전반경 | gain의 절댓값을 줄인다 |
132131

55.4 KB
Loading
50.4 KB
Loading

0 commit comments

Comments
 (0)