Skip to content

Commit 11c0100

Browse files
KF606: subprotocol ZC-Z50v2 Cessna (#797)
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.
1 parent f49f03d commit 11c0100

File tree

7 files changed

+73
-23
lines changed

7 files changed

+73
-23
lines changed

Lua_scripts/MultiChan.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
71,1,JJRC345,SkyTmblr,1,Flip,HLess,RTH,LED,UNK1,UNK2,UNK3
118118
49,0,KF606,KF606,1,Trim
119119
49,1,KF606,MIG320,1,Trim,LED
120+
49,2,KF606,ZCZ50,1,Trim,UNK
120121
9,0,KN,WLToys,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim
121122
9,1,KN,Feilun,0,DRate,THold,IdleUp,Gyro,Ttrim,Atrim,Etrim
122123
73,0,Kyosho,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14

Multiprotocol/KF606_ccnrf.ino

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Multiprotocol is distributed in the hope that it will be useful,
2020

2121
//#define FORCE_KF606_ORIGINAL_ID
2222
//#define FORCE_MIG320_ORIGINAL_ID
23+
//#define FORCE_ZCZ50_ORIGINAL_ID
2324

2425
#define KF606_INITIAL_WAIT 500
2526
#define KF606_PACKET_PERIOD 3000
@@ -30,10 +31,16 @@ Multiprotocol is distributed in the hope that it will be useful,
3031

3132
static void __attribute__((unused)) KF606_send_packet()
3233
{
34+
uint8_t len = KF606_PAYLOAD_SIZE;
3335
if(IS_BIND_IN_PROGRESS)
3436
{
35-
packet[0] = 0xAA;
36-
memcpy(&packet[1],rx_tx_addr,3);
37+
if(sub_protocol != KF606_ZCZ50)
38+
{
39+
packet[0] = 0xAA;
40+
memcpy(&packet[1],rx_tx_addr,3);
41+
}
42+
else
43+
memcpy(packet,rx_tx_addr,4);
3744
}
3845
else
3946
{
@@ -43,25 +50,32 @@ static void __attribute__((unused)) KF606_send_packet()
4350
packet[0] = 0x55;
4451
packet[1] = convert_channel_8b(THROTTLE); // 0..255
4552
// Deadband is needed on aileron, 40 gives +-6%
46-
if(sub_protocol == KF606_KF606)
53+
switch(sub_protocol)
4754
{
48-
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
49-
packet[3] = convert_channel_16b_limit(CH5,0xC1,0xDF); // Aileron trim must be on a separated channel C1..D0..DF
50-
}
51-
else
52-
{
53-
packet[2] = convert_channel_8b_limit_deadband(AILERON,0x00,0x80,0xFF,40); // Aileron: High rate:2B..80..DA
54-
packet[3] = convert_channel_16b_limit(CH5,0x01,0x1F); // Aileron trim must be on a separated channel 01..10..1F
55-
packet[3] += (packet[2]-0x80)>>3; // Drive trims for more aileron authority
56-
if(packet[3] > 0x80)
57-
packet[3] = 0x01;
58-
else if(packet[3] > 0x1F)
59-
packet[3] = 0x1F;
60-
packet[3] |= GET_FLAG(CH6_SW, 0xC0); // 0xC0 and 0xE0 are both turning the LED off, not sure if there is another hidden feature
55+
case KF606_KF606:
56+
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
57+
packet[3] = convert_channel_16b_limit(CH5,0xC1,0xDF); // Aileron trim must be on a separated channel C1..D0..DF
58+
break;
59+
case KF606_MIG320:
60+
packet[2] = convert_channel_8b_limit_deadband(AILERON,0x00,0x80,0xFF,40); // Aileron: High rate:2B..80..DA
61+
packet[3] = convert_channel_16b_limit(CH5,0x01,0x1F); // Aileron trim must be on a separated channel 01..10..1F
62+
packet[3] += (packet[2]-0x80)>>3; // Drive trims for more aileron authority
63+
if(packet[3] > 0x80)
64+
packet[3] = 0x01;
65+
else if(packet[3] > 0x1F)
66+
packet[3] = 0x1F;
67+
packet[3] |= GET_FLAG(CH6_SW, 0xC0); // 0xC0 and 0xE0 are both turning the LED off, not sure if there is another hidden feature
68+
break;
69+
case KF606_ZCZ50:
70+
len--; // uses only 3 bytes of payload
71+
packet[0] = packet[1]; // Throttle: 0x00..0xFF
72+
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.
73+
packet[2] = convert_channel_16b_limit(CH5,0x01,0x1F); // Trim: 0x01..0x10..0x1F
74+
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?
75+
break;
6176
}
6277
}
6378

64-
uint8_t len = KF606_PAYLOAD_SIZE;
6579
if(sub_protocol == KF606_MIG320)
6680
{
6781
len++;
@@ -107,6 +121,19 @@ static void __attribute__((unused)) KF606_initialize_txid()
107121
hopping_frequency[0]=68;
108122
hopping_frequency[1]=71;
109123
#endif
124+
if(sub_protocol == KF606_ZCZ50)
125+
{
126+
rx_tx_addr[1] = rx_tx_addr[0];
127+
rx_tx_addr[0]=0xAA;
128+
}
129+
#ifdef FORCE_ZCZ50_ORIGINAL_ID
130+
rx_tx_addr[0]=0xAA;
131+
rx_tx_addr[1]=0x67;
132+
rx_tx_addr[2]=0x64;
133+
rx_tx_addr[3]=0x01;
134+
hopping_frequency[0]=48;
135+
hopping_frequency[1]=51;
136+
#endif
110137
}
111138

112139
static void __attribute__((unused)) KF606_RF_init()
@@ -126,7 +153,7 @@ uint16_t KF606_callback()
126153
if(--bind_counter==0)
127154
{
128155
BIND_DONE;
129-
XN297_SetTXAddr(rx_tx_addr, 3);
156+
XN297_SetTXAddr(rx_tx_addr, sub_protocol != KF606_ZCZ50 ? 3 : 4);
130157
}
131158
KF606_send_packet();
132159
return KF606_PACKET_PERIOD;
@@ -153,3 +180,14 @@ void KF606_init()
153180
// P[2] = AIL 2B..80..DA
154181
// P[3] = TRIM 01..10..1F
155182
// channels 68=BB&3F+9 and 71
183+
184+
185+
// ZCZ50v2 protocol (with fake front propeller)
186+
// Bind
187+
// 250K C=7 S=Y A= E7 E7 E7 E7 E7 P(4)= AA 67 64 01
188+
// 3ms on ch7
189+
// Normal
190+
// 250K C=48 S=Y A= AA 67 64 01 P(3)= 00 80 10
191+
// P[0] = THR 0x00..0xFF
192+
// P[1] = AIL low rate 0x52..0x80..0xB1, high rate: 0x41..0x80..0xC3
193+
// P[2] = TRIM 0x01..0x10..0x1F + UNKNOWN 0x00 or 0xC0

Multiprotocol/Multi.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
46,V911S,V911S,E119
4747
47,GD00x,GD_V1,GD_V2
4848
48,V761,3CH,4CH,TOPRC
49-
49,KF606,KF606,MIG320
49+
49,KF606,KF606,MIG320,ZCZ50
5050
50,Redpine,Fast,Slow
5151
51,Potensic,A20
5252
52,ZSX,280

Multiprotocol/Multi_Protos.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const char STR_SUBTYPE_KYOSHO2[] = "\x05""KT-17";
171171
const char STR_SUBTYPE_FUTABA[] = "\x05""SFHSS";
172172
const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr";
173173
const char STR_SUBTYPE_MOULKG[] = "\x06""Analog""Digit\0";
174-
const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320";
174+
const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320""ZCZ50\0";
175175
const char STR_SUBTYPE_E129[] = "\x04""E129""C186";
176176
const char STR_SUBTYPE_FX[] = "\x03""816""620";
177177
#define NO_SUBTYPE nullptr
@@ -360,7 +360,7 @@ const mm_protocol_definition multi_protocols[] = {
360360
{PROTO_JOYSWAY, STR_JOYSWAY, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_A7105, JOYSWAY_init, JOYSWAY_callback },
361361
#endif
362362
#if defined(KF606_CCNRF_INO)
363-
{PROTO_KF606, STR_KF606, STR_SUBTYPE_KF606, 2, OPTION_RFTUNE, 0, 0, SW_NRF, KF606_init, KF606_callback },
363+
{PROTO_KF606, STR_KF606, STR_SUBTYPE_KF606, 3, OPTION_RFTUNE, 0, 0, SW_NRF, KF606_init, KF606_callback },
364364
#endif
365365
#if defined(KN_NRF24L01_INO)
366366
{PROTO_KN, STR_KN, STR_SUBTYPE_KN, 2, OPTION_NONE, 0, 0, SW_NRF, KN_init, KN_callback },

Multiprotocol/Multiprotocol.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define VERSION_MAJOR 1
2020
#define VERSION_MINOR 3
2121
#define VERSION_REVISION 3
22-
#define VERSION_PATCH_LEVEL 24
22+
#define VERSION_PATCH_LEVEL 25
2323

2424
#define MODE_SERIAL 0
2525

@@ -450,6 +450,7 @@ enum KF606
450450
{
451451
KF606_KF606 = 0,
452452
KF606_MIG320 = 1,
453+
KF606_ZCZ50 = 2,
453454
};
454455
enum E129
455456
{

Multiprotocol/_Config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
717717
PROTO_KF606
718718
KF606_KF606
719719
KF606_MIG320
720+
KF606_ZCZ50
720721
PROTO_KN
721722
WLTOYS
722723
FEILUN

Protocols_Details.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ CFlie|38|CFlie||||||||NRF24L01|
110110
[J6Pro](Protocols_Details.md#J6Pro---22)|22|||||||||CYRF6936|
111111
[JJRC345](Protocols_Details.md#JJRC345---71)|71|JJRC345|SkyTmblr|||||||NRF24L01|XN297
112112
[JOYSWAY](Protocols_Details.md#JOYSWAY---84)|84|||||||||NRF24L01|XN297
113-
[KF606](Protocols_Details.md#KF606---49)|49|KF606|MIG320|||||||NRF24L01|XN297
113+
[KF606](Protocols_Details.md#KF606---49)|49|KF606|MIG320|ZCZ50||||||NRF24L01|XN297
114114
[KN](Protocols_Details.md#KN---9)|9|WLTOYS|FEILUN|||||||NRF24L01|
115115
[Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|||||||A7105|
116116
[Kyosho2](Protocols_Details.md#Kyosho2---93)|93|KT-17||||||||NRF24L01|
@@ -1049,6 +1049,15 @@ CH1|CH2|CH3|CH4|CH5|CH6
10491049
---|---|---|---|---|---
10501050
A||T||TRIM|LED
10511051

1052+
### Sub_protocol ZCZ50v2 - *2*
1053+
Model: ZC-Z50 Cessna
1054+
1055+
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).
1056+
1057+
CH1|CH2|CH3|CH4|CH5|CH6
1058+
---|---|---|---|---|---
1059+
A||T||TRIM|UNKNOWN
1060+
10521061
## MJXQ - *18*
10531062
Autobind protocol
10541063

0 commit comments

Comments
 (0)