FUTABA- SFHSS

发布时间:2019-08-18 12:54:20   来源:文档文库   
字号:

Futaba S-FHSS Protocol Overview

In order to analyse the Futaba R3006SB RF Architecture, I needed to know the data rate so I could estimate receiver sensitivity. This led me to the C source code for the Devo implementation of S-FHSS. Since not everyone reads C, I thought I would summarise what I learned about the S-FHSS protocol from this excellent resource, read in conjunction with the CC2500 datasheet.

Protocol Description

An S-FHSS transmission consists of multiple hops, with adjacent hops being on different frequencies. Each hop consists of one or more packets. Each packet consists of the following fields:

S-FHSS传输由多个跳组成,相邻跳跳跃的频率不同。每个跳频点由一个或多个数据包组成。每个数据包由以下字段组成:

1. A 32-bit preamble which consists of alternating “0” and “1” bits and is used to synchronise the receiver clock.

由交替的“0”和“1”位组成的32位前导码,用于同步接收器时钟。

2. A 16-bit synchronisation word with the value 0xd391). This is used to identify a valid frame and determine the start of the user data block.

一个16位同步字,值为0xd391。这用于标识有效的帧并确定用户数据块的起始位置。

3. The byte 0x81. This may be a protocol indicator, e.g. to distinguish between FHSS, S-FHSS and T-FHSS transmissions.

字节0x81。这可能是一个协议指示器,例如区分fhsss-fhsst-fhss传输。

4. A 16-bit transmitter ID. This is what the receiver remembers when it binds to a transmitter. The receiver will ignore any packets that do not have the ID of the transmitter that the receiver is bound to.

一个16位发送器ID。这是接收器与发送器绑定时对应的内容。接收器将忽略没有接收器绑定到的发送器ID的任何数据包。

5. Two bytes 0x00 (probably unused).

两个字节0x00(可能未使用)

6. Eight bytes that contain 10-bit values for 4 RC channels, a 5-bit hopping_code (values 0 to 27) that determines the frequency hopping sequence, and a 6-bit field that indicates which frame this is (for example, the first or second data frame). For details of the packing of these fields into the eight bytes refer to the devo source code.

8个字节,其中包含4RC信道的10位值,一个5位跳频码(值027),用于确定跳频序列,以及一个6位字段,用于指示这是哪个帧(例如,第一个或第二个数据帧)。有关将这些字段打包成8个字节的详细信息,请参阅DEV源代码。

7. A 16-bit CRC to detect errors in the packet.

16CRC,用于检测数据包中的错误。

The total length of a packet is 168 bits and it is transmitted using 2-FSK at a symbol rate of 128,143 baud (and hence a bit rate of 128 kbps) so the transmission time is 1311µs. The FSK deviation is 38 kHz (so the frequency shift is 76 kHz).

Since each packet only contains values for 4 RC channels, multiple packets are transmitted for radios with more than 4 RC channels. When multiple packets are transmitted, the time from the start of one packet to the start of the next packet is 1,650µs.

包的总长度为16821个字节),使用2-FSK128143波特的符号速率(比特率为128 kbps)传输,因此传输时间为1311微秒。FSK偏差为38 kHz(因此频移为76 kHz)。由于每个数据包只包含4RC信道的值,因此多个数据包会传输给4个以上RC信道的无线电。当传输多个数据包时,从一个数据包开始到下一个数据包开始的时间为1650微秒。

After all packets have been transmitted, the transmitter changes frequency. The 2.4 GHz frequency band is divided into 30 RF channels, each with a channel width of 1.5 MHz. The next RF channel is calculated as

next_rf_channel = current_rf_channel + 2 + hopping_code

在所有数据包传输完毕后,发送器改变频率。2.4 GHz频段分为30个射频信道,每个信道宽度为1.5 MHz。下一个射频通道计算如下

下一个射频通道=当前射频通道+2+跳频代码

RF Channel numbers wrap around from 29 to 0. So if hopping_code is 0, then the channel number is incremented by 2. If it is 27 (the maximum value) then the channel number is effectively decremented by 3. Presumably a single-channel increment or decrement is not allowed to reduce the chance of two adjacent hops being interfered with by a single narrow-band interferer on the boundary between the hop frequencies. I don’t know why he minimum decrement is 3, though – it would make sense for it to be the same as the minimum increment.

射频信道数从290。因此,如果跳跃代码为0,那么通道号将增加2。如果它是27(最大值),那么通道号将有效地减少3。假设单通道增量或减量不允许减少两个相邻跳点被跳点频率之间边界上的一个窄带干扰器干扰的机会。我不知道为什么最小减量是3,但是,它和最小增量一样是合理的。

There’s also a bit of cunning that essentially decrements the channel number each time it wraps from 29 to 0, to prevent certain hopping codes from generating short sequences of frequencies (although a more elegant alternative might have been to have 31 channels, since this is a prime number which would have prevented the problem in the first place). I verified that the resulting sequences do all hop onto each of the 30  channels before the sequence is repeated, so it serves its purpose.

还有一些巧妙的方法,即每次将信道数从29折减到0,以防止某些跳频码生成较短的频率序列(尽管一个更优雅的方法可能是有31个信道,因为这是一个素数,可以避免第一个pl中的问题)。王牌)。我验证了产生的序列在重复序列之前都会跳到30个通道中的每一个通道上,因此它是有意义的。

The time from the start of a hop to the start of the next hop (on a different frequency) is 6800µs. This allows a maximum of 4 frames per hop, with 200µs remaining to change frequency between hops (the CC2500 frequency synthesizer has a settling time of 90µs so this should be achievable). However as far as I can see, S-FHSS only supports a maximum of 8 RC channels, which would require only 2 frames per hop.

从一个跳开始到下一个跳开始的时间(在不同的频率上)是6800微秒。这允许每个跳最多4帧,在两个跳之间更改频率剩余200微秒(CC2500频率合成器的稳定时间为90微秒,因此应该可以实现)。但是据我所见,S-FHSS最多只支持8RC信道,每个跳仅需要2帧。

It is possible that the T-FHSS protocol uses the additional 2 frames per hop for telemetry.

T-FHSS协议可能使用额外的每跳2帧进行遥测

Observations

Packet Overhead

The use of two transmit packets per hop incurs significant overhead. Taking into account the preamble, sync word, protocol id, transmitter id, hopping code,  frame type indicator, and CRC, about 94 bits are unnecessarily duplicated by using two packets instead of one. Since the two packets together consist of  336 bits, this represents an overhead of about 28% – not to mention the idle time of 339µs between packets. When idle times are taken into account, the overhead is almost 50%. This means that for a given power output, the energy per bit is only about half of what it could have been, resulting in a higher than necessary bit error rate.

每跳使用两个传输包会产生很大的开销。考虑到前导码、同步字、协议ID、发送器ID、跳频码、帧类型指示器和CRC,用两个数据包代替一个数据包不必要地复制了约94位。由于这两个数据包一起包含336位,这意味着大约28%的开销,更不用说数据包之间339微秒的空闲时间了。当考虑空闲时间时,开销几乎是50%。这意味着,对于一个给定的功率输出,每比特的能量仅是它可能的一半,从而导致高于必要的比特错误率。

Forward Error Correction

The lack of Forward Error Correction (FEC) is surprising. FEC includes additional bits in the transmitted packet that allow the packet to be recovered even when some of the transmitted bits are corrupted, making transmissions more robust against interference. Although FEC would increase the packet length, this could be compensated by reducing redundancy in the data.

缺少前向误差校正(FEC)是令人惊讶的。FEC包括传输包中的附加位,即使在某些传输位损坏时,也允许恢复包,从而使传输更可靠地抵御干扰。尽管fec会增加包的长度,但是可以通过减少数据中的冗余来补偿。

For example, by combining the two transmitted packets into one, and removing redundant bits, one could transmit the same data, complete with 1/2 rate forward error correction (in other words, there is one additional FEC bit for every data bit), using 304 bits per frame instead of the current 336 bits per frame (by frame I mean the data transmission required to transmit the values of all RC channels, so two packets in the current protocol). This would allow the same data rate to be used, achieving the same (or better) frame rate, but with a significantly better bit error rate performance and hence longer operating range. The CC2500 implements FEC in hardware, so this could be added using the existing transmitter and receiver hardware designs and without any additional CPU overhead.

例如,通过将两个传输的数据包组合成一个数据包,并删除冗余位,可以传输相同的数据,并完成1/2速率的正向错误校正(换句话说,每个数据位都有一个额外的FEC位),使用每帧304位,而不是当前每帧336位(在帧中,I表示数据传输n需要传输所有RC通道的值,所以当前协议中有两个包)。这将允许使用相同的数据速率,实现相同(或更好)的帧速率,但具有显著更好的比特误码率性能,因此操作范围更长。CC2500在硬件上实现了FEC,因此可以使用现有的发送器和接收器硬件设计添加FEC,而不需要任何额外的CPU开销。

Bandwidth

The 1.5 MHz bandwidth RF channel seems excessive given the 128 kbps data rate. This means spectral efficiency is only 0.085 bit/s/Hz. Minimum-shift keying (MSK), which is supported by the CC2500, should be able to achieve a spectral efficiency of 0.5 bit/s/Hz, which is 5.8 times better. I suspect this is due to the relatively poor filter shape of the CC2500 (see graphs on p. 49 of the datasheet), combined with a receiver architecture that has no additional narrow-band filtering. So I’ll count this as reasonable given the cost constraints.

考虑到128 kbps的数据速率,1.5兆赫带宽的射频信道似乎过多。这意味着频谱效率仅为0.085比特//赫兹。由CC2500支持的最小移位键控(MSK)应能实现0.5比特//赫兹的频谱效率,这是5.8倍。我怀疑这是由于CC2500的滤波器形状相对较差(见数据表第49页的图表),加上没有附加窄带滤波器的接收器结构。因此,考虑到成本限制,我认为这是合理的。

Data Rate

By eliminating redundancy, including the dead time between packets, it would be possible to reduce the user data rate without affecting control latency. This would further increase the energy per bit for the same output power, resulting in longer range and reduced susceptibility to interference.

通过消除冗余(包括数据包之间的死区时间),可以在不影响控制延迟的情况下降低用户数据速率。这将进一步增加相同输出功率下的每比特能量,从而导致更大的范围和对干扰的敏感性降低

Hopping Codes

Only 28 hopping codes are available, even though there are something like 29! (10^31) possible hopping codes with 30 channels. This again increases the possibility of a conflict between two S-FHSS systems operating in the same vicinity.

The actual probability of conflict between two S-FHSS systems is

Pconflict = 2 / (No_of_RF_channels * No_of_hopping_codes) = 0.24%

只有28个跳码可用,即使有类似29个!(10^3130个信道的可能跳码。这再次增加了在同一附近运行的两个S-FHSS系统之间发生冲突的可能性。

两个S-FHSS系统之间的实际冲突概率为

pconflict=2/(没有_-rf_频道*没有_-hopping_代码)=0.24%

By “conflict”, I mean that the two radios will interfere with each other on every single hop, which would almost certainly result in the complete failure of both links.

Note that the factor of 2 in the numerator is because the two hop sequences will not be time aligned, which doubles possibility of interference as only a small overlap between frames on the same frequency would be sufficient to cause a conflict, as no forward error correction is used.

我所说的“冲突”是指两个无线电在每一跳上都会相互干扰,这几乎肯定会导致两个链路完全失效。

请注意,分子中的系数2是因为两个跳跃序列不会时间对齐,这将使干扰的可能性加倍,因为同一频率上的帧之间只有很小的重叠就足以引起冲突,因为不使用正向误差校正。

Frame Rate

It seems clear that a high frame rate was a priority when developing this protocol, as both the range and the robustness against interference from other users has been compromised to achieve a 6.8 ms frame duration, resulting in a frame rate of 147 frames per second. (By “frame” I mean the complete transmission of all channels – in the case of S-FHSS this consists of a single frequency hop, possibly with multiple packets).

很明显,在开发该协议时,高帧速率是一个优先考虑的问题,因为范围和抗其他用户干扰的鲁棒性都已受到影响,以达到6.8毫秒的帧持续时间,导致每秒147帧的帧速率。(在“帧”中,我指的是所有信道的完整传输——在S-FHSS中,这包括一个单跳频,可能有多个数据包)。

Although my initial thought was that 147 frames per second is unnecessarily high, when one considers that a couple of adjacent frames may get knocked out by interference, which would reduce the frame rate to about 50 frames per second, then it seems reasonable.

虽然我最初的想法是每秒147帧是不必要的高,当一个人认为一对相邻的帧可能会被干扰击倒,这将降低帧速率到大约每秒50帧,那么这似乎是合理的。

Conclusion

Better protocol design would give longer range and better resistance to interference while retaining the same frame rate and using the same hardware. The key improvements would be to reduce data redundancy, add forward error correction, reduce the user data rate and provide for more hopping codes.

更好的协议设计将在保持相同的帧速率和使用相同的硬件的同时,提供更长的范围和更好的抗干扰能力。关键的改进将是减少数据冗余,增加前向纠错,降低用户数据率,并提供更多跳码

Overall I’m not as impressed with the protocol as with the receiver design. If an engineering student submitted the receiver design as a final year project, I’d give him or her an “A” since, while there are some limitations to the design, they are reasonable trade-offs to meet the cost constraints.  If s/he brought me this protocol, I’d give it a “C” – still a passing grade, but should try harder.

总的来说,我对协议的印象不如对接收器设计的印象深刻。如果一个工科学生提交了接收器设计作为最后一年的项目,我会给他或她一个“A”,因为虽然设计有一些限制,但它们是合理的权衡以满足成本限制。如果他给我带来了这个方案,我会给它一个“C-仍然是一个及格的分数,但应该更努力

Postscript: I calculate the maximum range of the S-FHSS protocol when using a 100 mW transmitter in Estimating the Maximum Range of a 100mW Futaba S-FHSS RC System.

后记:在估算100mw futaba s-fhss RC系统的最大范围时,我计算了S-fhss协议的最大范围。

本文来源:https://www.2haoxitong.net/k/doc/3d94c2f72e60ddccda38376baf1ffc4fff47e2cb.html

《FUTABA- SFHSS.doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式