From abfebb3da47507c0e7ba1f5bece03007167fbeb0 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Sat, 2 Sep 2023 01:11:37 +0200 Subject: [PATCH] QIDI-550 model Using FX/9630 Added trims !! Need to find out the first RF channel calculation !! --- Lua_scripts/MultiChan.txt | 1 + Lua_scripts/MultiChannelsUpdater.lua | 2 +- Multiprotocol/FX_nrf24l01.ino | 28 ++++++++++++++++++++++------ Multiprotocol/Multiprotocol.h | 2 +- Protocols_Details.md | 13 ++++++++++++- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/Lua_scripts/MultiChan.txt b/Lua_scripts/MultiChan.txt index e7d563d..b9dbd07 100644 --- a/Lua_scripts/MultiChan.txt +++ b/Lua_scripts/MultiChan.txt @@ -88,6 +88,7 @@ 55,3,FrSkyRX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 58,0,FX,816,1 58,1,FX,620,1 +58,2,FX,9630,1,Rate,Gyro,TrimR,TrimA,TrimE 20,0,FY326,FY326,1,Flip,RTH,HLess,Expert,Calib 20,1,FY326,FY319,1,Flip,RTH,HLess,Expert,Calib 23,0,FY326,FY326,1,Flip,RTH,HLess,Expert diff --git a/Lua_scripts/MultiChannelsUpdater.lua b/Lua_scripts/MultiChannelsUpdater.lua index 6581753..a905cd8 100644 --- a/Lua_scripts/MultiChannelsUpdater.lua +++ b/Lua_scripts/MultiChannelsUpdater.lua @@ -257,7 +257,7 @@ local function Multi_Init() stick_names[4] = "Aux3" elseif ( protocol == 48 and sub_protocol == 0 ) then -- V761 3CH stick_names[4] = "n-a" - elseif protocol == 47 or protocol == 49 or protocol == 58 then -- GD00x, KF606, FX816 + elseif protocol == 47 or protocol == 49 or ( protocol == 58 and sub_protocol < 2 ) then -- GD00x, KF606, FX816 stick_names[1] = "n-a" stick_names[2] = "n-a" end diff --git a/Multiprotocol/FX_nrf24l01.ino b/Multiprotocol/FX_nrf24l01.ino index 3b2808e..1a65733 100644 --- a/Multiprotocol/FX_nrf24l01.ino +++ b/Multiprotocol/FX_nrf24l01.ino @@ -41,9 +41,12 @@ Multiprotocol is distributed in the hope that it will be useful, //#define FORCE_FX620_ID //#define FORCE_FX9630_ID +//#define FORCE_QIDI_ID static void __attribute__((unused)) FX_send_packet() { + static uint8_t trim_ch = 0; + //Hopp if(IS_BIND_DONE) { @@ -51,8 +54,12 @@ static void __attribute__((unused)) FX_send_packet() if(sub_protocol == FX9630) { XN297_SetTXAddr(rx_tx_addr, 4); - if (hopping_frequency_no > FX9630_NUM_CHANNELS) + if (hopping_frequency_no >= FX9630_NUM_CHANNELS) + { hopping_frequency_no = 0; + trim_ch++; + if(trim_ch > 3) trim_ch = 0; + } } else // FX816 and FX620 { @@ -70,9 +77,13 @@ static void __attribute__((unused)) FX_send_packet() packet[1] = convert_channel_8b(AILERON); packet[2] = 0xFF - convert_channel_8b(ELEVATOR); packet[3] = convert_channel_8b(RUDDER); - packet[4] = 0x20; - packet[5] = GET_FLAG(CH5_SW, 0x01); // DR toggle swich: 0 small throw, 1 large throw - packet[5] |= (Channel_data[CH6] < CHANNEL_MIN_COMMAND ? 0x00 : (Channel_data[CH6] > CHANNEL_MAX_COMMAND ? 0x02 : 0x01)) << 1; // Mode A(0) : 6D small throw, B(1) : 6D large throw, C(2) : 3D + val = trim_ch==0 ? 0x20 : (convert_channel_8b(trim_ch + CH6) >> 2); // no trim on Throttle + packet[4] = val; // Trim for channel x 0C..20..34 + packet[5] = (trim_ch << 4) // channel x << 4 + | GET_FLAG(CH5_SW, 0x01) // DR toggle swich: 0 small throw, 1 large throw + // FX9630 =>0:6G small throw, 1:6G large throw, 2:3D + // QIDI-550=>0:3D, 1:6G, 2:Torque + | ((Channel_data[CH6] < CHANNEL_MIN_COMMAND ? 0x00 : (Channel_data[CH6] > CHANNEL_MAX_COMMAND ? 0x02 : 0x01)) << 1); } else // FX816 and FX620 { @@ -200,12 +211,17 @@ static void __attribute__((unused)) FX_initialize_txid() { #ifdef FORCE_FX9630_ID memcpy(rx_tx_addr,(uint8_t*)"\xCE\x31\x9B\x73", 4); - memcpy(hopping_frequency,"\x13\x1A\x38", FX9630_NUM_CHANNELS); //Original dump=19=0x13,26=0x1A,56=0x38 + memcpy(hopping_frequency,"\x13\x1A\x38", FX9630_NUM_CHANNELS); //Original dump=>19=0x13,26=0x1A,56=0x38 #else - hopping_frequency[0] = 0x13; // constant + hopping_frequency[0] = 0x13; // constant??? hopping_frequency[1] = RX_num & 0x0F + 0x1A; hopping_frequency[2] = rx_tx_addr[3] & 0x0F + 0x38; #endif + #ifdef FORCE_QIDI_ID + memcpy(rx_tx_addr,(uint8_t*)"\x23\xDC\x76\xA2", 4); + memcpy(hopping_frequency,"\x08\x25\x33", FX9630_NUM_CHANNELS); //Original dump=>08=0x08,37=0x25,51=0x33 + #endif + //??? Need to find out how the first RF channel is calculated ??? } } diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 3fdbebd..3f17fc7 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 3 -#define VERSION_PATCH_LEVEL 30 +#define VERSION_PATCH_LEVEL 31 #define MODE_SERIAL 0 diff --git a/Protocols_Details.md b/Protocols_Details.md index 2024aa5..88eeace 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -96,7 +96,7 @@ CFlie|38|CFlie||||||||NRF24L01| [FrskyX2](Protocols_Details.md#FRSKYX2---64)|64|CH_16|CH_8|EU_16|EU_8|Cloned|Cloned_8|||CC2500| [Frsky_RX](Protocols_Details.md#FRSKY_RX---55)|55|Multi|CloneTX|EraseTX|CPPM|||||CC2500| [Futaba/SFHSS](Protocols_Details.md#Futaba---21)|21|SFHSS||||||||CC2500| -[FX](Protocols_Details.md#FX---58)|28|816|620|||||||NRF24L01| +[FX](Protocols_Details.md#FX---58)|28|816|620|9630||||||NRF24L01| [FY326](Protocols_Details.md#FY326---20)|20|FY326|FY319|||||||NRF24L01| [GD00X](Protocols_Details.md#GD00X---47)|47|GD_V1*|GD_V2*|||||||NRF24L01|XN297L [GW008](Protocols_Details.md#GW008---32)|32|||||||||NRF24L01|XN297 @@ -1646,6 +1646,17 @@ Only 8 TX IDs available ### Sub_protocol 620 - *1* Model: FX620 SU35 +### Sub_protocol 9630 - *2* +Model: FX9630 and QIDI-550 + +CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9 +---|---|---|---|---|---|---|---|--- +A|E|T|R|RATE|GYRO|TrimR|TrimA|TrimE + +FX9630 Gyro: -100%=6G small throw, 0%=6G large throw, +100%=3D + +QIDI-550 Gyro: -100%=3D, 0%=6G, +100%=Torque + ## FY326 - *20* ### Sub_protocol FY326 - *0*