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