KF606: subprotocol ZC-Z50v2 Cessna

Maybe newer iteration of Z50. My plane does not have front propeller.
But if there is one, its just for design. This model does not have front motor.

Thanks @pascallanger for support and reviews.
This commit is contained in:
Filip Kotoucek 2022-12-27 22:15:09 +01:00
parent 401cc76f20
commit 9ff1b59795
7 changed files with 73 additions and 23 deletions

View File

@ -117,6 +117,7 @@
71,1,JJRC345,SkyTmblr,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3 71,1,JJRC345,SkyTmblr,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3
49,0,KF606,KF606,1,Trim 49,0,KF606,KF606,1,Trim
49,1,KF606,MIG320,1,Trim,LED 49,1,KF606,MIG320,1,Trim,LED
49,2,KF606,ZCZ50,1,Trim,UNK
9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim 9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim
9,1,KN,Feilun,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 73,0,Kyosho,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14

View File

@ -20,6 +20,7 @@ Multiprotocol is distributed in the hope that it will be useful,
//#define FORCE_KF606_ORIGINAL_ID //#define FORCE_KF606_ORIGINAL_ID
//#define FORCE_MIG320_ORIGINAL_ID //#define FORCE_MIG320_ORIGINAL_ID
//#define FORCE_ZCZ50_ORIGINAL_ID
#define KF606_INITIAL_WAIT 500 #define KF606_INITIAL_WAIT 500
#define KF606_PACKET_PERIOD 3000 #define KF606_PACKET_PERIOD 3000
@ -30,11 +31,17 @@ Multiprotocol is distributed in the hope that it will be useful,
static void __attribute__((unused)) KF606_send_packet() static void __attribute__((unused)) KF606_send_packet()
{ {
uint8_t len = KF606_PAYLOAD_SIZE;
if(IS_BIND_IN_PROGRESS) if(IS_BIND_IN_PROGRESS)
{
if(sub_protocol != KF606_ZCZ50)
{ {
packet[0] = 0xAA; packet[0] = 0xAA;
memcpy(&packet[1],rx_tx_addr,3); memcpy(&packet[1],rx_tx_addr,3);
} }
else
memcpy(packet,rx_tx_addr,4);
}
else else
{ {
XN297_Hopping(hopping_frequency_no); XN297_Hopping(hopping_frequency_no);
@ -43,13 +50,13 @@ static void __attribute__((unused)) KF606_send_packet()
packet[0] = 0x55; packet[0] = 0x55;
packet[1] = convert_channel_8b(THROTTLE); // 0..255 packet[1] = convert_channel_8b(THROTTLE); // 0..255
// Deadband is needed on aileron, 40 gives +-6% // Deadband is needed on aileron, 40 gives +-6%
if(sub_protocol == KF606_KF606) switch(sub_protocol)
{ {
case 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[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 packet[3] = convert_channel_16b_limit(CH5,0xC1,0xDF); // Aileron trim must be on a separated channel C1..D0..DF
} break;
else case KF606_MIG320:
{
packet[2] = convert_channel_8b_limit_deadband(AILERON,0x00,0x80,0xFF,40); // Aileron: High rate:2B..80..DA 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] = 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 packet[3] += (packet[2]-0x80)>>3; // Drive trims for more aileron authority
@ -58,10 +65,17 @@ static void __attribute__((unused)) KF606_send_packet()
else if(packet[3] > 0x1F) else if(packet[3] > 0x1F)
packet[3] = 0x1F; packet[3] = 0x1F;
packet[3] |= GET_FLAG(CH6_SW, 0xC0); // 0xC0 and 0xE0 are both turning the LED off, not sure if there is another hidden feature packet[3] |= GET_FLAG(CH6_SW, 0xC0); // 0xC0 and 0xE0 are both turning the LED off, not sure if there is another hidden feature
break;
case KF606_ZCZ50:
len--; // uses only 3 bytes of payload
packet[0] = packet[1]; // Throttle: 0x00..0xFF
packet[1] = convert_channel_8b_limit_deadband(AILERON,0x20,0x80,0xE0,40); // Aileron: Max values:20..80..E0, low rate 0x52..0x80..0xB1, high rate: 0x41..0x80..0xC3.
packet[2] = convert_channel_16b_limit(CH5,0x01,0x1F); // Trim: 0x01..0x10..0x1F
packet[2] |= GET_FLAG(CH6_SW, 0xC0); // Unknown: 0x00 or 0xC0. Left top switch on original TX changes nothing on my plane. Maybe ON/OFF for main motor?
break;
} }
} }
uint8_t len = KF606_PAYLOAD_SIZE;
if(sub_protocol == KF606_MIG320) if(sub_protocol == KF606_MIG320)
{ {
len++; len++;
@ -107,6 +121,19 @@ static void __attribute__((unused)) KF606_initialize_txid()
hopping_frequency[0]=68; hopping_frequency[0]=68;
hopping_frequency[1]=71; hopping_frequency[1]=71;
#endif #endif
if(sub_protocol == KF606_ZCZ50)
{
rx_tx_addr[1] = rx_tx_addr[0];
rx_tx_addr[0]=0xAA;
}
#ifdef FORCE_ZCZ50_ORIGINAL_ID
rx_tx_addr[0]=0xAA;
rx_tx_addr[1]=0x67;
rx_tx_addr[2]=0x64;
rx_tx_addr[3]=0x01;
hopping_frequency[0]=48;
hopping_frequency[1]=51;
#endif
} }
static void __attribute__((unused)) KF606_RF_init() static void __attribute__((unused)) KF606_RF_init()
@ -126,7 +153,7 @@ uint16_t KF606_callback()
if(--bind_counter==0) if(--bind_counter==0)
{ {
BIND_DONE; BIND_DONE;
XN297_SetTXAddr(rx_tx_addr, 3); XN297_SetTXAddr(rx_tx_addr, sub_protocol != KF606_ZCZ50 ? 3 : 4);
} }
KF606_send_packet(); KF606_send_packet();
return KF606_PACKET_PERIOD; return KF606_PACKET_PERIOD;
@ -153,3 +180,14 @@ void KF606_init()
// P[2] = AIL 2B..80..DA // P[2] = AIL 2B..80..DA
// P[3] = TRIM 01..10..1F // P[3] = TRIM 01..10..1F
// channels 68=BB&3F+9 and 71 // channels 68=BB&3F+9 and 71
// ZCZ50v2 protocol (with fake front propeller)
// Bind
// 250K C=7 S=Y A= E7 E7 E7 E7 E7 P(4)= AA 67 64 01
// 3ms on ch7
// Normal
// 250K C=48 S=Y A= AA 67 64 01 P(3)= 00 80 10
// P[0] = THR 0x00..0xFF
// P[1] = AIL low rate 0x52..0x80..0xB1, high rate: 0x41..0x80..0xC3
// P[2] = TRIM 0x01..0x10..0x1F + UNKNOWN 0x00 or 0xC0

View File

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

View File

@ -171,7 +171,7 @@ const char STR_SUBTYPE_KYOSHO2[] = "\x05""KT-17";
const char STR_SUBTYPE_FUTABA[] = "\x05""SFHSS"; const char STR_SUBTYPE_FUTABA[] = "\x05""SFHSS";
const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr"; const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr";
const char STR_SUBTYPE_MOULKG[] = "\x06""Analog""Digit\0"; const char STR_SUBTYPE_MOULKG[] = "\x06""Analog""Digit\0";
const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320"; const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320""ZCZ50\0";
const char STR_SUBTYPE_E129[] = "\x04""E129""C186"; const char STR_SUBTYPE_E129[] = "\x04""E129""C186";
const char STR_SUBTYPE_FX[] = "\x03""816""620"; const char STR_SUBTYPE_FX[] = "\x03""816""620";
#define NO_SUBTYPE nullptr #define NO_SUBTYPE nullptr
@ -360,7 +360,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_JOYSWAY, STR_JOYSWAY, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_A7105, JOYSWAY_init, JOYSWAY_callback }, {PROTO_JOYSWAY, STR_JOYSWAY, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_A7105, JOYSWAY_init, JOYSWAY_callback },
#endif #endif
#if defined(KF606_CCNRF_INO) #if defined(KF606_CCNRF_INO)
{PROTO_KF606, STR_KF606, STR_SUBTYPE_KF606, 2, OPTION_RFTUNE, 0, 0, SW_NRF, KF606_init, KF606_callback }, {PROTO_KF606, STR_KF606, STR_SUBTYPE_KF606, 3, OPTION_RFTUNE, 0, 0, SW_NRF, KF606_init, KF606_callback },
#endif #endif
#if defined(KN_NRF24L01_INO) #if defined(KN_NRF24L01_INO)
{PROTO_KN, STR_KN, STR_SUBTYPE_KN, 2, OPTION_NONE, 0, 0, SW_NRF, KN_init, KN_callback }, {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_MAJOR 1
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_REVISION 3 #define VERSION_REVISION 3
#define VERSION_PATCH_LEVEL 24 #define VERSION_PATCH_LEVEL 25
#define MODE_SERIAL 0 #define MODE_SERIAL 0
@ -450,6 +450,7 @@ enum KF606
{ {
KF606_KF606 = 0, KF606_KF606 = 0,
KF606_MIG320 = 1, KF606_MIG320 = 1,
KF606_ZCZ50 = 2,
}; };
enum E129 enum E129
{ {

View File

@ -717,6 +717,7 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
PROTO_KF606 PROTO_KF606
KF606_KF606 KF606_KF606
KF606_MIG320 KF606_MIG320
KF606_ZCZ50
PROTO_KN PROTO_KN
WLTOYS WLTOYS
FEILUN FEILUN

View File

@ -110,7 +110,7 @@ CFlie|38|CFlie||||||||NRF24L01|
[J6Pro](Protocols_Details.md#J6Pro---22)|22|||||||||CYRF6936| [J6Pro](Protocols_Details.md#J6Pro---22)|22|||||||||CYRF6936|
[JJRC345](Protocols_Details.md#JJRC345---71)|71|JJRC345|SkyTmblr|||||||NRF24L01|XN297 [JJRC345](Protocols_Details.md#JJRC345---71)|71|JJRC345|SkyTmblr|||||||NRF24L01|XN297
[JOYSWAY](Protocols_Details.md#JOYSWAY---84)|84|||||||||NRF24L01|XN297 [JOYSWAY](Protocols_Details.md#JOYSWAY---84)|84|||||||||NRF24L01|XN297
[KF606](Protocols_Details.md#KF606---49)|49|KF606|MIG320|||||||NRF24L01|XN297 [KF606](Protocols_Details.md#KF606---49)|49|KF606|MIG320|ZCZ50||||||NRF24L01|XN297
[KN](Protocols_Details.md#KN---9)|9|WLTOYS|FEILUN|||||||NRF24L01| [KN](Protocols_Details.md#KN---9)|9|WLTOYS|FEILUN|||||||NRF24L01|
[Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|||||||A7105| [Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|||||||A7105|
[Kyosho2](Protocols_Details.md#Kyosho2---93)|93|KT-17||||||||NRF24L01| [Kyosho2](Protocols_Details.md#Kyosho2---93)|93|KT-17||||||||NRF24L01|
@ -1049,6 +1049,15 @@ CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|--- ---|---|---|---|---|---
A||T||TRIM|LED A||T||TRIM|LED
### Sub_protocol ZCZ50v2 - *2*
Model: ZC-Z50 Cessna
This might be newer version of the model. My plane does not have front propeller, but its just fake anyway (no motor in the front).
CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A||T||TRIM|UNKNOWN
## MJXQ - *18* ## MJXQ - *18*
Autobind protocol Autobind protocol