129 lines · plain
1===========================2Walkera WK-0701 transmitter3===========================4 5Walkera WK-0701 transmitter is supplied with a ready to fly Walkera6helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use7this transmitter as joystick8 9Devel homepage and download:10http://zub.fei.tuke.sk/walkera-wk0701/11 12or use cogito:13cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick14 15 16Connecting to PC17================18 19At back side of transmitter S-video connector can be found. Modulation20pulses from processor to HF part can be found at pin 2 of this connector,21pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get22modulation pulses to PC, signal pulses must be amplified.23 24Cable: (walkera TX to parport)25 26Walkera WK-0701 TX S-VIDEO connector::27 28 (back side of TX)29 __ __ S-video: canon2530 / |_| \ pin 2 (signal) NPN parport31 / O 4 3 O \ pin 3 (GND) LED ________________ 10 ACK32 ( O 2 1 O ) | C33 \ ___ / 2 ________________________|\|_____|/34 | [___] | |/| B |\35 ------- 3 __________________________________|________________ 25 GND36 E37 38I use green LED and BC109 NPN transistor.39 40Software41========42 43Build kernel with walkera0701 module. Module walkera0701 need exclusive44access to parport, modules like lp must be unloaded before loading45walkera0701 module, check dmesg for error messages. Connect TX to PC by46cable and run jstest /dev/input/js0 to see values from TX. If no value can47be changed by TX "joystick", check output from /proc/interrupts. Value for48(usually irq7) parport must increase if TX is on.49 50 51 52Technical details53=================54 55Driver use interrupt from parport ACK input bit to measure pulse length56using hrtimers.57 58Frame format:59Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.60(downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)61 62Signal pulses63-------------64 65::66 67 (ANALOG)68 SYNC BIN OCT69 +---------+ +------+70 | | | |71 --+ +------+ +---72 73Frame74-----75 76::77 78 SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC ..79 80pulse length81------------82 83::84 85 Binary values: Analog octal values:86 87 288 uS Binary 0 318 uS 00088 438 uS Binary 1 398 uS 00189 478 uS 01090 558 uS 01191 638 uS 10092 1306 uS SYNC 718 uS 10193 798 uS 11094 878 uS 11195 9624 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits97 98(Warning, pulses on ACK are inverted by transistor, irq is raised up on sync99to bin change or octal value to bin change).100 101Binary data representations102---------------------------103 104One binary and octal value can be grouped to nibble. 24 nibbles + one binary105values can be sampled between sync pulses.106 107Values for first four channels (analog joystick values) can be found in108first 10 nibbles. Analog value is represented by one sign bit and 9 bit109absolute binary value. (10 bits per channel). Next nibble is checksum for110first ten nibbles.111 112Next nibbles 12 .. 21 represents four channels (not all channels can be113directly controlled from TX). Binary representations are the same as in first114four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is115checksum for nibbles 12..23.116 117After last octal value for nibble 24 and next sync pulse one additional118binary value can be sampled. This bit and magic number is not used in119software driver. Some details about this magic numbers can be found in120Walkera_Wk-0701_PCM.pdf.121 122Checksum calculation123--------------------124 125Summary of octal values in nibbles must be same as octal value in checksum126nibble (only first 3 bits are used). Binary value for checksum nibble is127calculated by sum of binary values in checked nibbles + sum of octal values128in checked nibbles divided by 8. Only bit 0 of this sum is used.129