better range: bitrate and receiver bandpass filter ?

Started by jbeale, October 02, 2013, 01:43:15 PM

jbeale

I've had some JeeNodes for a while, but just now trying to use them regularly for home sensors. I am getting occasional missed packets when I am going through several walls.  I just came across this 'moteino' which looks very attractive since it is so small, so I just ordered a few.

I see from the "RFM12B AirKBps parameter calculation" spreadsheet from github that you can set the transmit rate from 344.82 Kbps down to 5.305 Kbps. That is good, but my limited understanding of https://github.com/LowPowerLab/RFM12B/blob/master/RFM12B.cpp suggests that only the bitrate is being changed, and not the bandwidth of the receiver filter which is what I believe controls the noise energy. I think you have to reduce your filter bandwidth when you reduce the Tx/Rx bitrate, in order to optimize the signal to noise ratio at the receiver. Is this already being done and I just don't understand the RFM12B setup parameters (likely true)?
In other words, for much lower bitrates than the default 38.3 kbps, I am wondering if 94A2: Receiver Control : RX Bandwidth and perhaps also CC57: PLL Settings should change, referring to http://tools.jeelabs.org/rfm12b.html

I don't really know the architecture of the RFM12B transmitter or receiver side. I guess this is straighforward FSK modulation? I see that the TX frequency deviation can be configured ( 9850: TX Control ). Is it possible to keep a relatively wide input capture range on the RF center frequency (accounting for Rx/Tx drift due to crystal accuracy & tempco) but still limit to a more narrow bandpass for the FM deviation due to data modulation, to reduce the amount of broadband noise?

By the way, at least in theory, you should get better radio range performance if
1) both your 1/4-wave antenna wires are straight and parallel (eg. both Tx and Rx devices have wires pointing straight up)
2) you have a ground plane, eg. 1/4 wave radials from ground going out at right angles to the main antenna. Or sloping down.
3) as much as possible, position both Tx and Rx device up high and in the clear

(not to mention more directional antennas, which should work but are less attractive on such a tiny device.)

Felix

jbeale - all great thoughts!
You are most probably correct about the bitrate. At the time I put that together I didn't know as much about RF as I do now. Even now I don't know much. But it sounds like adjusting the bandwidth along with frequency/bitrate will help performance.
Also all the pointers about antennas are concise and correct, whoever can follow them, should do so.
At the moment I am very busy preparing some other projects and I hope to get some time in the near future to fiddle with all this good stuff that you and johnknox have posted about.
Although contribution from the community is always great, especially from people that actually know what they are doing and can explain the methodology and perhaps theory.

jbeale

Just received a pair of 915 MHz rev.2 Moteinos, thanks for sending them so quickly.  Just set them up covering the same path as a pair of 915 MHz JeeNodes. The demo Tx/Rx sketches on the Moteino pair show very consistent performance over the same path that the JeeNodes were having some occasional trouble. So, good job! 

I notice that my JeeNode antenna wires are longer, from 93 to 100 mm while the provided Moteino antenna wire was 74 mm.  So maybe my antennas were mistuned among other things.  1/4 wave at 915 MHz with a 95% velocity factor suggests 77 mm, so the Motetino length of 74 mm is just about right if you also have 3 mm trace on the circuit board.

Felix

Thanks!

Hey - about the antenna, it's one of those really hard problems to solve. It matters how long, how straight, how perpendicular to the GND plane, it is. With the RFM69 you can see the RSSI readings vary quite a bit just by bending/coiling or shielding the antenna with various objects.
There's another thread by johnknox who found a method to calibrate and adjust the frequency drift for RFM69, the same is possible for RFM12b from what I can tell, but haven't done much of that myself yet.
Anyway, I think the radios can work well if you treat them with decency and give them a chance :)
No more Xbees that's for sure...

john k2ox

Noise power = KTB.  Where 'B' is the bandwidth.  As jbeale suggests changing the RXBW does effect the sensitivity.  The sensitivity is limited by the noise the radio hears.  From the 'Noise Power' equation if we reduce the 'B' by 1/2 the noise power is reduced by 1/2.  Reduce BW by a factor of 10 and the noise goes down 10X.

In log terms, db = 10log(bw1/bw2), cutting the BW in half gives you a 3 db gain in sensitivety.  Reduce BW by 10X, you get another 10db in sensitivity!!!   This is the same result you get in increasing the TX power by 10db!!  Except increasing the TX power puts more drain on the battery.

Going from 200KHz RXBW to 2KHz can yield  a 100X (20db) improvement in weak signal detection.

Sounds wonderful.  What's the down side?  With the narrow bandwidth we need the tx and rx to have much tighter frequency alignment.  Narrower bandwidths mean slower bit rates. 

The tx signal needs to be set so that it is compatable with the RXBW.  The TX signal BW is dependent on the TX deviation.  The deviation is how far the tx freq will move from the resting freq.  Since the freq varies +/- the deviation the TXBW is 2X the deviation.  That means the RXBW >= 2*Deviation.

There are tricks that can be used (GMSK) but this discussion is fundamental in understanding the relationships.

john

anthonywebb

This is a great thread, thanks to all involved for taking the time to explain.  And, wonderful to be pulling on the same oars with such smart guys.  The insight you are giving means that moteino will continue to be top of the heap.

perky

Just to point out that the total transmit bandwidth is also a function of the bit rate and is equal to 2*(Fdev + Fm) where Fdev is the deviation from centre frequency and Fm is the modulation frequency (which is half the bit rate, as the maximum modulation frequency happens with alternating 1's and 0's). Also the BW programmed in the SiLabs chip is actually a 'single side' bandwidth as this is a zero-IF chip, it is half the total bandwidth of the incoming signal. This isn't made clear in the datasheet. Note the recommended values for BW in the datasheet are not twice the deviation. From the above we can conclude BW > Fdev + BR/2, you'll notice all their recommended settings meet that rule.

I've posted some rules for the RFM69 modules that gives more details as the principles are the same:
https://lowpowerlab.com/forum/index.php/topic,1434.0.html

Mark.

WhiteHare

This is an excellent and really important thread.  If it were up to me, I'd make it a sticky.   ;)

When I first started with the Moteino, I assumed that changing the bitrate would automatically optimize the other parameters to be consistent, and only later did I realize that it just isn't so.  I wouldn't be surprised if other unaware users may be lowering their bitrate in order to get extra range and yet not getting the full benefit of the trade-off.  FWIW as constructive feedback (not a criticism), the library would be more "beginner friendly" if it were perhaps modified to be more automatic like that.  Naturally the experts may have their own ideas and want to over-rule automatic default adjustments, but they'll have the skill to do that if they choose.