walkera0701.rst 4.0 KB

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