KF606: new sub protocol MIG320

This commit is contained in:
Pascal Langer 2021-07-04 14:05:42 +02:00
parent a02586cca9
commit 25c052c0a3
7 changed files with 75 additions and 19 deletions

View File

@ -112,7 +112,8 @@
22,0,J6Pro,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12
71,0,JJRC345,JJRC345,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3
71,1,JJRC345,SkyTmblr,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3
49,0,KF606,Std,1,Trim
49,0,KF606,KF606,1,Trim
49,1,KF606,MIG320,1,Trim
9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim
9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim
73,0,Kyosho,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14

View File

@ -19,6 +19,7 @@ Multiprotocol is distributed in the hope that it will be useful,
#include "iface_xn297.h"
//#define FORCE_KF606_ORIGINAL_ID
//#define FORCE_MIG320_ORIGINAL_ID
#define KF606_INITIAL_WAIT 500
#define KF606_PACKET_PERIOD 3000
@ -35,25 +36,48 @@ static void __attribute__((unused)) KF606_send_packet()
memcpy(&packet[1],rx_tx_addr,3);
}
else
{
packet[0]= 0x55;
packet[1]= convert_channel_8b(THROTTLE); // 0..255
// Deadband is needed on aileron, 40 gives +-6%
packet[2]=convert_channel_8b_limit_deadband(AILERON,0x20,0x80,0xE0,40); // Aileron: Max values:20..80..E0, Low rates:50..80..AF, High rates:3E..80..C1
// Aileron trim must be on a separated channel C1..D0..DF
packet[3]= convert_channel_16b_limit(CH5,0xC1,0xDF);
}
if(IS_BIND_DONE)
{
XN297_Hopping(hopping_frequency_no);
hopping_frequency_no ^= 1; // 2 RF channels
packet[0] = 0x55;
packet[1] = convert_channel_8b(THROTTLE); // 0..255
// Deadband is needed on aileron, 40 gives +-6%
if(sub_protocol == KF606_KF606)
{
packet[2] = convert_channel_8b_limit_deadband(AILERON,0x20,0x80,0xE0,40); // Aileron: Max values:20..80..E0, Low rates:50..80..AF, High rates:3E..80..C1
packet[3] = convert_channel_16b_limit(CH5,0xC1,0xDF); // Aileron trim must be on a separated channel C1..D0..DF
}
else
{
packet[2] = convert_channel_8b_limit_deadband(AILERON,0x00,0x80,0xFF,40); // Aileron: High rate:2B..80..DA
packet[3] = convert_channel_16b_limit(CH5,0x01,0x1F); // Aileron trim must be on a separated channel 01..10..1F
packet[3] += (packet[2]-0x80)>>3; // Drive trims for more aileron authority
if(packet[3] > 0x80)
packet[3] = 0x01;
else if(packet[3] > 0x1F)
packet[3] = 0x1F;
}
}
uint8_t len = KF606_PAYLOAD_SIZE;
if(sub_protocol == KF606_MIG320)
{
len++;
packet[4] = 0; // additional channel?
}
#if 0
for(uint8_t i=0; i<len; i++)
debug("%02X ",packet[i]);
debugln("");
#endif
// Send
XN297_SetPower();
XN297_SetFreqOffset();
XN297_SetTxRxMode(TX_EN);
XN297_WritePayload(packet, KF606_PAYLOAD_SIZE);
XN297_WritePayload(packet, len);
}
static void __attribute__((unused)) KF606_initialize_txid()
@ -67,13 +91,20 @@ static void __attribute__((unused)) KF606_initialize_txid()
rx_tx_addr[1]=0x02;
rx_tx_addr[2]=0x00;
hopping_frequency[0]=0x20;
hopping_frequency[0]=0x23;
hopping_frequency[1]=0x23;
//TX2
rx_tx_addr[0]=0x25;
rx_tx_addr[1]=0x04;
rx_tx_addr[2]=0x00;
hopping_frequency[0]=0x2E;
hopping_frequency[0]=0x31;
hopping_frequency[1]=0x31;
#endif
#ifdef FORCE_MIG320_ORIGINAL_ID
rx_tx_addr[0]=0xBB;
rx_tx_addr[1]=0x13;
rx_tx_addr[2]=0x00;
hopping_frequency[0]=68;
hopping_frequency[1]=71;
#endif
}
@ -110,3 +141,14 @@ void KF606_init()
}
#endif
// MIG320 protocol
// Bind
// 250K C=7 S=Y A= E7 E7 E7 E7 E7 P(5)= AA BB 13 00 00
// 3ms on ch7
// Normal
// 250K C=68 S=Y A= BB 13 00 P(5)= 55 00 80 10 00
// P[1] = THR 00..FF
// P[2] = AIL 2B..80..DA
// P[3] = TRIM 01..10..1F
// channels 68=BB&3F+9 and 71

View File

@ -46,7 +46,7 @@
46,V911S,V911S,E119
47,GD00x,GD_V1,GD_V2
48,V761,3CH,4CH
49,KF606
49,KF606,KF606,MIG320
50,Redpine,Fast,Slow
51,Potensic,A20
52,ZSX,280

View File

@ -159,6 +159,7 @@ const char STR_SUBTYPE_KYOSHO[] = "\x04""FHSS""Hype";
const char STR_SUBTYPE_FUTABA[] = "\x05""SFHSS";
const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr";
const char STR_SUBTYPE_MOULKG[] = "\x06""Analog""Digit\0";
const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320";
#define NO_SUBTYPE nullptr
@ -346,7 +347,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_JOYSWAY, STR_JOYSWAY, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_A7105, JOYSWAY_init, JOYSWAY_callback },
#endif
#if defined(KF606_CCNRF_INO)
{PROTO_KF606, STR_KF606, NO_SUBTYPE, 0, OPTION_RFTUNE, 0, 0, SW_NRF, KF606_init, KF606_callback },
{PROTO_KF606, STR_KF606, STR_SUBTYPE_KF606, 2, OPTION_RFTUNE, 0, 0, SW_NRF, KF606_init, KF606_callback },
#endif
#if defined(KN_NRF24L01_INO)
{PROTO_KN, STR_KN, STR_SUBTYPE_KN, 2, OPTION_NONE, 0, 0, SW_NRF, KN_init, KN_callback },

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 2
#define VERSION_PATCH_LEVEL 87
#define VERSION_PATCH_LEVEL 88
#define MODE_SERIAL 0
@ -445,6 +445,12 @@ enum MOULDKG
MOULDKG_DIGIT = 1,
};
enum KF606
{
KF606_KF606 = 0,
KF606_MIG320 = 1,
};
#define NONE 0
#define P_HIGH 1
#define P_LOW 0

View File

@ -709,7 +709,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
PROTO_JOYSWAY
NONE
PROTO_KF606
NONE
KF606_KF606
KF606_MIG320
PROTO_KN
WLTOYS
FEILUN

View File

@ -110,7 +110,7 @@ CFlie|38|CFlie||||||||NRF24L01|
[J6Pro](Protocols_Details.md#J6Pro---22)|22|||||||||CYRF6936|
[JJRC345](Protocols_Details.md#JJRC345---71)|71|JJRC345|SkyTmblr|||||||NRF24L01|XN297
[JOYSWAY](Protocols_Details.md#JOYSWAY---84)|84|||||||||NRF24L01|XN297
[KF606](Protocols_Details.md#KF606---49)|49|||||||||NRF24L01|XN297
[KF606](Protocols_Details.md#KF606---49)|49|KF606|MIG320|||||||NRF24L01|XN297
[KN](Protocols_Details.md#KN---9)|9|WLTOYS|FEILUN|||||||NRF24L01|
[Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|||||||A7105|
[LOLI](Protocols_Details.md#LOLI---82)|82|||||||||NRF24L01|
@ -1008,12 +1008,17 @@ First generation of GD models, ZC-Z50
New generation of GD models
## KF606 - *49*
Model: KF606
CH1|CH2|CH3|CH4|CH5
---|---|---|---|---
A||T||TRIM
### Sub_protocol KF606 - *0*
Model: KF606
### Sub_protocol MIG320 - *1*
Model: Zhiyang MIG-320
## MJXQ - *18*
Autobind protocol