整體架構大致如下,架構還蠻簡單的
- X9D+ 遙控器輸出電源與PPM訊號
- Arduino
- 負責選擇protocol
- 控制NRF24L01對頻
- 收PPM訊號,解析出來
- 透過NRF24L01傳送各通道訊號
目前可以動了,但有幾個問題
- jj1000 led 燈幾秒會閃一下
- 不動時,有時油門會突然稍微轉一下
- 目前懷疑控輸出的PPM 有問題,導致arduino 計算錯誤
- 上面兩個問題可以調整timing解決
jj1000 對頻方法
X9D
|
Leonardo
|
NRF24L01
|
PPM(pin1)
|
pin2
|
|
Vout(battery
voltage, pin3)
|
Vin
|
|
GND(pin4)
|
GND
|
GND
|
SPI-MISO(pin14)
|
MISO
|
|
SPI-MOSI(pin15)
|
MOSI
|
|
SPI-SCK(pin16)
|
SCK
|
|
pin9
|
CE
|
|
pin10
|
CS
|
|
3.3V
|
VCC
|
|
DBG(pin6
to 5V or 0V)
|
||
我的code(porting to Arduino Leonardo)
Use D:\work\arduino\arduino-1.6.8
porting to
arduino leonardo
1. change pin define
2. add debug function and dynamic debug message
- set DBG_ON=1 in source code
- connect DBG_pin(enable debug) to VCC or GND(disable debug)
3. abstract PPM_INPUT_MIN/MAX
4. fix bug about PPM ISR setup
- use digitalPinToInterrupt(PPM_pin)
5. increase throttle safe check delay to 1s
2. add debug function and dynamic debug message
- set DBG_ON=1 in source code
- connect DBG_pin(enable debug) to VCC or GND(disable debug)
3. abstract PPM_INPUT_MIN/MAX
4. fix bug about PPM ISR setup
- use digitalPinToInterrupt(PPM_pin)
5. increase throttle safe check delay to 1s
原始github source
除了AETR前四個通道,其餘通道功能如下(依協定不同有些微差異)
Channel 5: led
light, 3 pos. rate on CX-10, H7, inverted flight on H101
Channel 6: flip
control
Channel 7:
still camera
Channel 8:
video camera
Channel 9:
headless
Channel 10:
calibrate Y (V2x2), pitch trim (H7), RTH (H8 mini/H20), 360deg flip mode (H8
mini 3D/H22)
Channel 11:
calibrate X (V2x2), roll trim (H7)
Channel 12:
Reset / Rebind
reference:
遙控器輸出PPM格式 http://www.geek-workshop.com/thread-2408-1-1.html
reference:
遙控器輸出PPM格式 http://www.geek-workshop.com/thread-2408-1-1.html
沒有留言:
張貼留言