← Documents Documentation/input/devices/walkera0701.rst GitHub 원문 ↗

Linux 6.18.37 · Input

Walkera WK-0701 Transmitter

Walkera WK-0701 RC 송신기를 병렬 포트 조이스틱으로 연결하고 97비트 PCM 프레임을 해석하는 방법입니다.

Source pathDocumentation/input/devices/walkera0701.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

walkera0701.rst:1-128

WK-0701 송신기의 S-video modulation signal을 LED와 NPN transistor로 증폭·반전해 병렬 포트 ACK에 넣고, interrupt 간 펄스 길이로 97비트 PCM 프레임과 여덟 채널을 복원합니다.

문서 개요
항목내용
SourceDocumentation/input/devices/walkera0701.rst
분량128 source lines
신호S-video pin 2; Ground pin 3
회로Green LED + BC109 NPN -> DB25 ACK pin 10
측정Parport IRQ + hrtimer
프레임24 binary+octal nibbles + 1 binary = 97 bits
채널두 영역에 각 4개 10-bit analog channels

회로와 프레임의 핵심입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ===========================
2 Walkera WK-0701 transmitter
3 ===========================
4
5 Walkera WK-0701 transmitter is supplied with a ready to fly Walkera
6 helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
7 this transmitter as joystick
8
9 Devel homepage and download:
10 http://zub.fei.tuke.sk/walkera-wk0701/
11
12 or use cogito:
13 cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick
14
15
16 Connecting to PC
17 ================
18
19 At back side of transmitter S-video connector can be found. Modulation
20 pulses from processor to HF part can be found at pin 2 of this connector,
21 pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get
22 modulation pulses to PC, signal pulses must be amplified.
23
24 Cable: (walkera TX to parport)
25
26 Walkera WK-0701 TX S-VIDEO connector::
27
28 (back side of TX)
29 __ __ S-video: canon25
30 / |_| \ pin 2 (signal) NPN parport
31 / O 4 3 O \ pin 3 (GND) LED ________________ 10 ACK
32 ( O 2 1 O ) | C
33 \ ___ / 2 ________________________|\|_____|/
34 | [___] | |/| B |\
35 ------- 3 __________________________________|________________ 25 GND
36 E
37
38 I use green LED and BC109 NPN transistor.
39
40 Software
41 ========
42
43 Build kernel with walkera0701 module. Module walkera0701 need exclusive
44 access to parport, modules like lp must be unloaded before loading
45 walkera0701 module, check dmesg for error messages. Connect TX to PC by
46 cable and run jstest /dev/input/js0 to see values from TX. If no value can
47 be changed by TX "joystick", check output from /proc/interrupts. Value for
48 (usually irq7) parport must increase if TX is on.
49
50
51
52 Technical details
53 =================
54
55 Driver use interrupt from parport ACK input bit to measure pulse length
56 using hrtimers.
57
58 Frame format:
59 Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.
60 (downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)
61
62 Signal pulses
63 -------------
64
65 ::
66
67 (ANALOG)
68 SYNC BIN OCT
69 +---------+ +------+
70 | | | |
71 --+ +------+ +---
72
73 Frame
74 -----
75
76 ::
77
78 SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC ..
79
80 pulse length
81 ------------
82
83 ::
84
85 Binary values: Analog octal values:
86
87 288 uS Binary 0 318 uS 000
88 438 uS Binary 1 398 uS 001
89 478 uS 010
90 558 uS 011
91 638 uS 100
92 1306 uS SYNC 718 uS 101
93 798 uS 110
94 878 uS 111
95
96 24 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits
97
98 (Warning, pulses on ACK are inverted by transistor, irq is raised up on sync
99 to bin change or octal value to bin change).
100
101 Binary data representations
102 ---------------------------
103
104 One binary and octal value can be grouped to nibble. 24 nibbles + one binary
105 values can be sampled between sync pulses.
106
107 Values for first four channels (analog joystick values) can be found in
108 first 10 nibbles. Analog value is represented by one sign bit and 9 bit
109 absolute binary value. (10 bits per channel). Next nibble is checksum for
110 first ten nibbles.
111
112 Next nibbles 12 .. 21 represents four channels (not all channels can be
113 directly controlled from TX). Binary representations are the same as in first
114 four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is
115 checksum for nibbles 12..23.
116
117 After last octal value for nibble 24 and next sync pulse one additional
118 binary value can be sampled. This bit and magic number is not used in
119 software driver. Some details about this magic numbers can be found in
120 Walkera_Wk-0701_PCM.pdf.
121
122 Checksum calculation
123 --------------------
124
125 Summary of octal values in nibbles must be same as octal value in checksum
126 nibble (only first 3 bits are used). Binary value for checksum nibble is
127 calculated by sum of binary values in checked nibbles + sum of octal values
128 in checked nibbles divided by 8. Only bit 0 of this sum is used.
129

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

WK-0701 송신기 연결 회로와 드라이버 실행

1-51

Walkera WK-0701 송신기는 HM36, HM37, HM60 같은 ready-to-fly 헬리콥터와 함께 제공됩니다. `walkera0701` 모듈은 이 무선 조종 송신기를 Linux 조이스틱으로 사용할 수 있게 합니다. 원문에는 개발 홈페이지와 `cg-clone` 저장소 주소가 보존돼 있습니다.

송신기 뒷면 S-video 커넥터의 pin 2에서 프로세서가 HF 부분으로 보내는 modulation pulse를 얻고 pin 3을 Ground로 사용합니다. Pin 3과 CPU 사이에는 5.6 kOhm 저항이 있으며, PC 병렬 포트에 넣기 전 신호를 증폭해야 합니다.

Walkera 송신기-병렬 포트 회로
송신기/부품연결PC 병렬 포트
S-video pin 2LED 직렬 통과NPN transistor Base
NPN Collector증폭·반전 출력DB25 pin 10 ACK
S-video pin 3공통 GroundNPN Emitter와 DB25 pin 25 GND
원문 사용 부품Green LED + BC109 NPNACK interrupt 입력

원문의 S-video·LED·NPN·DB25 ASCII 회로를 연결 단계로 다시 그렸습니다.

커널에 `walkera0701` 모듈을 포함해야 하며 이 모듈은 병렬 포트를 독점 사용합니다. `lp` 같은 다른 병렬 포트 모듈을 먼저 내리고 `dmesg`의 오류를 확인합니다. 케이블로 TX를 연결한 뒤 `jstest /dev/input/js0`에서 값을 확인합니다.

실행 점검
검사기대 결과
`lp` 등 parport 사용자 제거`walkera0701`이 포트를 독점 확보
`dmesg`로드·IRQ 관련 오류 없음
`jstest /dev/input/js0`송신기 스틱에 따라 값 변화
`/proc/interrupts`송신기가 켜지면 보통 parport IRQ7 카운터 증가

모듈 충돌과 IRQ 동작을 확인하는 절차입니다.

송신기 연결
S-video pin 2 modulation signal 확인LED와 NPN으로 신호 증폭·반전Collector를 DB25 ACK pin 10에 연결Ground를 S-video pin 3과 DB25 pin 25에 공통 연결충돌 모듈 제거 후 `walkera0701` 로드`jstest`와 interrupt counter로 동작 검증

하드웨어 배선부터 입력 확인까지의 흐름입니다.

===========================
Walkera WK-0701 transmitter
===========================

Walkera WK-0701 transmitter is supplied with a ready to fly Walkera
helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
this transmitter as joystick

Devel homepage and download:
http://zub.fei.tuke.sk/walkera-wk0701/

or use cogito:
cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick


Connecting to PC
================

At back side of transmitter S-video connector can be found. Modulation
pulses from processor to HF part can be found at pin 2 of this connector,
pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get
modulation pulses to PC, signal pulses must be amplified.

Cable: (walkera TX to parport)

Walkera WK-0701 TX S-VIDEO connector::

 (back side of TX)
     __   __              S-video:                                  canon25
    /  |_|  \             pin 2 (signal)              NPN           parport
   / O 4 3 O \            pin 3 (GND)        LED        ________________  10 ACK
  ( O 2   1 O )                                         | C
   \   ___   /      2 ________________________|\|_____|/
    | [___] |                                 |/|   B |\
     -------        3 __________________________________|________________ 25 GND
                                                          E

I use green LED and BC109 NPN transistor.

Software
========

Build kernel with walkera0701 module. Module walkera0701 need exclusive
access to parport, modules like lp must be unloaded before loading
walkera0701 module, check dmesg for error messages. Connect TX to PC by
cable and run jstest /dev/input/js0 to see values from TX. If no value can
be changed by TX "joystick", check output from /proc/interrupts. Value for
(usually irq7) parport must increase if TX is on.


ACK 인터럽트와 PCM 펄스 프레임

52-100

드라이버는 병렬 포트 ACK 입력의 interrupt와 high-resolution timer를 사용해 pulse 길이를 측정합니다. 프레임 설명은 Shaul Eizikovich의 Walkera WK-0701 PCM 형식을 기반으로 합니다.

신호 펄스 종류
종류펄스 길이
Binary0288 us
Binary1438 us
Sync-1306 us
Analog octal000318 us
Analog octal001398 us
Analog octal010478 us
Analog octal011558 us
Analog octal100638 us
Analog octal101718 us
Analog octal110798 us
Analog octal111878 us

원문의 파형과 길이표를 논리 값으로 구조화했습니다.

한 프레임은 `SYNC, BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25` 뒤 다음 SYNC로 이어집니다. 24개의 binary+octal 조합은 각각 1+3비트이고 마지막 binary 1비트를 더해 `24*4+1 = 97`비트입니다.

Walkera PCM 프레임
구간반복비트
SYNC프레임 시작구분 펄스
BINnn=1~24각 1비트
OCTnn=1~24각 3비트
BIN25마지막1비트
합계24 nibbles + 1 bit97 bits

SYNC 사이의 데이터 단위를 순서와 크기로 나타냅니다.

NPN transistor 때문에 ACK에서 관찰되는 pulse는 반전됩니다. IRQ는 sync에서 binary로 바뀔 때 또는 octal value에서 다음 binary로 바뀔 때 상승합니다.

펄스 디코딩
ACK interrupt 발생 시 hrtimer timestamp 읽기이전 에지와의 pulse length 계산1306 us 근처면 새 frame SYNC288/438 us를 binary 0/1로 분류318~878 us를 80 us 간격 octal 000~111로 분류24 nibble과 마지막 binary bit를 조립

ACK 에지 간 시간을 PCM 데이터로 바꾸는 흐름입니다.

Technical details
=================

Driver use interrupt from parport ACK input bit to measure pulse length
using hrtimers.

Frame format:
Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.
(downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)

Signal pulses
-------------

::

                     (ANALOG)
      SYNC      BIN   OCT
    +---------+      +------+
    |         |      |      |
  --+         +------+      +---

Frame
-----

::

 SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC ..

pulse length
------------

::

   Binary values:                Analog octal values:

   288 uS Binary 0                318 uS       000
   438 uS Binary 1                398 uS       001
                                478 uS       010
                                558 uS       011
                                638 uS       100
  1306 uS SYNC                        718 uS       101
                                798 uS       110
                                878 uS       111

24 bin+oct values + 1 bin value = 24*4+1 bits  = 97 bits

(Warning, pulses on ACK are inverted by transistor, irq is raised up on sync
to bin change or octal value to bin change).

채널 비트 배치와 두 checksum

101-128

Binary 1비트와 octal 3비트를 묶으면 nibble 하나가 됩니다. 두 SYNC 사이에서 24개 nibble과 추가 binary bit 하나를 채집합니다.

WK-0701 nibble 배치
Nibble내용
1~10첫 4개 analog joystick channels, 채널당 sign 1 + magnitude 9비트
11Nibbles 1~10 checksum
12~21다음 4개 channels, 같은 10비트 표현
22~23Special magic number
24Nibbles 12~23 checksum
BIN25추가 binary value; 드라이버에서 사용하지 않음

채널 값, checksum과 magic number의 위치입니다.

첫 네 채널은 첫 10개 nibble에 있으며 각 analog 값은 sign bit 1개와 9비트 절대 binary 값, 총 10비트입니다. Nibble 11은 첫 영역 checksum입니다. Nibbles 12~21은 같은 표현의 다음 네 채널이지만 송신기에서 모두 직접 제어할 수 있는 것은 아닙니다.

Nibbles 22와 23의 magic number와 nibble 24 뒤의 추가 binary bit는 소프트웨어 드라이버가 사용하지 않습니다. 두 번째 checksum은 nibbles 12~23을 검증합니다.

Checksum 계산
부분계산
Octal 3 bits대상 nibbles의 octal 값 합과 checksum nibble의 octal 값이 같아야 함
Binary bit대상 binary 값 합 + octal 값 합/8의 bit 0
첫 checksumNibbles 1~10을 nibble 11에서 확인
둘째 checksumNibbles 12~23을 nibble 24에서 확인

Checksum nibble의 octal 3비트와 binary 1비트 규칙입니다.

채널 보고 생성
Binary와 octal을 4비트 nibble로 결합Nibbles 1~10에서 첫 네 채널의 10비트 값 추출Nibble 11 checksum 검증Nibbles 12~21에서 다음 네 채널 추출Nibbles 22~23 포함 영역을 nibble 24로 검증Magic number와 BIN25는 무시하고 유효 채널 보고

97비트 프레임에서 조이스틱 축을 얻는 순서입니다.

Binary data representations
---------------------------

One binary and octal value can be grouped to nibble. 24 nibbles + one binary
values can be sampled between sync pulses.

Values for first four channels (analog joystick values) can be found in
first 10 nibbles. Analog value is represented by one sign bit and 9 bit
absolute binary value. (10 bits per channel). Next nibble is checksum for
first ten nibbles.

Next nibbles 12 .. 21 represents four channels (not all channels can be
directly controlled from TX). Binary representations are the same as in first
four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is
checksum for nibbles 12..23.

After last octal value for nibble 24 and next sync pulse one additional
binary value can be sampled. This bit and magic number is not used in
software driver. Some details about this magic numbers can be found in
Walkera_Wk-0701_PCM.pdf.

Checksum calculation
--------------------

Summary of octal values in nibbles must be same as octal value in checksum
nibble (only first 3 bits are used). Binary value for checksum nibble is
calculated by sum of binary values in checked nibbles + sum of octal values
in checked nibbles divided by 8. Only bit 0 of this sum is used.