Author Topic: Long Range parameters for RFM69HW (868 / 915 MHz)  (Read 18256 times)

fgomes

  • Jr. Member
  • **
  • Posts: 65
Re: Long Range parameters for RFM69HW (868 / 915 MHz)
« Reply #15 on: July 23, 2016, 01:24:12 PM »
It is still working well with the code from my previous post :-)

I was trying to introduce the AFC to compensate the crystal error and temperature frequency drift. Until now I was using the frequency calibrated manually (error observed on the SDR#).

The main comms parameters are BR=1200, Fdev=2000, RxBw=5kHz

If i introduce the AFC, it is not working, even if I introduce the adjusted frequency. The parameters I'm using are the following:

radio.writeReg(0x1a,0x4b);   //RegAfcBw 50kHz Bw (also tested with 25kHz)
radio.writeReg(0x1e,0x0C);   //AfcAutoClearOn, AfcAutoOn (also tested removing the AutoClearOn)
radio.writeReg(0x1e,0x04);   //AfcAutoOn

I tried also to increase the preamble to 9 bytes since a big frequency error might need additional preamble bytes for synchronization:
radio.writeReg(0x2d,0x09);   //Preamble 9 bytes

I made the tests starting with the corrected frequency, for example:

radio.setFrequency(868006500);

Also tested without setting the frequency, so starting at 868000000.

On the gateway node I only receive sporadic messages (one in each 100 messages or less). Is there any additional trick to use AFC? Does it work, or should I use a manual temperature compensation algorithm?

Best regards

Fernando

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Long Range parameters for RFM69HW (868 / 915 MHz)
« Reply #16 on: July 23, 2016, 07:19:54 PM »
What have you set the RSSI threshold to? Is it still at -110dB? The thing about AFC is it will trigger when the signal gets abouve the RSSI threshold, but it will latch on to those parameters forever until a payload ready is received or the software times out without an address match or payload ready and manually resets it. Since it can trigger with noise at low RSSI thresholds that can leave the receiver frequency offset from the desired one and incapable of receiving your real packets. Try setting the RSSI threshold higher to eliminate noise but still able to receive proper packets and see if that fixes it.
This document by Freescale MC12311 which uses the sx1231 silicon has a lot more information about AFC:
www.nxp.com/files/rf_if/doc/app_note/AN4983.pdf
Mark.

fgomes

  • Jr. Member
  • **
  • Posts: 65
Re: Long Range parameters for RFM69HW (868 / 915 MHz)
« Reply #17 on: July 23, 2016, 07:51:31 PM »
@perky, once again thanks for your answer. Now it makes a bit more sense to me why the AFC might not be so useful to long range communications without manual frequency calibration... To be able to use the standard crystal we will have to use a large bandwidth for the AFC in order to 'capture' the other node frequency (I've tried 25kHz and 50kHz), and that way we will have much more noise due to the large bandwidth, so we will have to choose an higher RSSI threshold in order for AFC to work... But perhaps it might work with manual calibration only for temperature compensation, using also a low bandwidth for AFC. I'll try it with a BW more close tothe RxBw.

Best regards

Fernando

fgomes

  • Jr. Member
  • **
  • Posts: 65
Re: Long Range parameters for RFM69HW (868 / 915 MHz)
« Reply #18 on: July 23, 2016, 09:45:07 PM »
With @perky tip of raising RSSI threshold I was able to communicate between two nodes with AFC and without frequency calibration and between -20ºC and 60ºC. All the non default parameters were the following:

  radio.writeReg(0x03,0x68);   //RegBitrateMsb 1200 bps
  radio.writeReg(0x04,0x2b);   //RegBitrateLsb
  radio.writeReg(0x05,0x00);   //RegFdevMsb 2000 Hz
  radio.writeReg(0x06,0x21);   //RegFdevLsb
  radio.writeReg(0x19,0x56);   //RegRxBw 5kHz Bw
  radio.writeReg(0x18,0x08);   //RegLna register
  radio.writeReg(0x1a,0x4b);   //RegAfcBw 50kHz Bw
  radio.writeReg(0x1e,0x0C);   //AfcAutoClearOn, AfcAutoOn
  radio.writeReg(0x29,210);     //RSSI Threshold = 105dBm

I'm a bit worried of two things:

  • I'm using a very large bandwidth for the AFC (50kHz), so lots of noise will be used for the AFC.I started by using a bandwidth of 25kHz but when I heated one of the nodes to 60ºC I had to raise the bandwidth otherwise there were no communication.
  • These two nodes have a frequency difference of about 4kHz but there are others with about 8kHz difference, I still don't know if it will work with frequencies so distant.

Best regards

Fernando

emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: Long Range parameters for RFM69HW (868 / 915 MHz)
« Reply #19 on: July 24, 2016, 03:39:03 AM »
@Fernando,

If you look at the FEI for the received packets, you can estimate the offset of each transmitter. This could be the basis of a dynamic auto-calibrate mechanism by passing the offset back in the ACK to the transmitting node so that it can adjust the next packet.
Beware though, the FEI value is noisy, it needs some careful averaging/filtering....

fgomes

  • Jr. Member
  • **
  • Posts: 65
Re: Long Range parameters for RFM69HW (868 / 915 MHz)
« Reply #20 on: July 24, 2016, 04:08:43 AM »
@emjjay,  thanks! What is the best way to read Fei, read the Fei register immediately after receiving a valid message?

Best regards

Fernando

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Long Range parameters for RFM69HW (868 / 915 MHz)
« Reply #21 on: July 24, 2016, 06:30:40 AM »
Unfortunately Hoperf don't publish the specs of the crystals, but the empirical data out there appears to suggest the crystals used are +/10ppm (maybe even closer tolerance from the data), and since the standard for low cost close tolerance crystals is +/-10ppm nowadays this is a reasonable assumption. The actual full receiver bandwidth at 868MHz has to be increased to cope with the maximum difference between transmitter and receiver, which is 20ppm or 17.36kHz.

Looking at the other criteria, there's a thread I started to try to derive some basic rules:
https://lowpowerlab.com/forum/rf-range-antennas-rfm69-library/definition-of-rxbw-with-rfm69/

1)  0.5 <= 2 * Fdev/BR <= 10    (modulation index, MI)
2)  BR < 2*RxBw     (bit rate)
3)  RxBw >= Fdev + BR/2   (receiver bandwidth)
4)  RxBwAfc >=  Fdev + BR/2 + LOoffset (receiver AFC bandwidth)
5)  Fdev + BR/2 < 500kHz  (maximum RxBw setting)

You have Fdev = 2000Hz, BR = 1200, RxBw = 5kHz, so RxBwAfc >= 2000 + 1200/2 + 17360,
i.e. RxBwAfc >= 20.6KHz.

So setting 25kHz for RxBwAfc should have been OK, even with a 17.36kHz difference in TX and RX frequencies. I suspect something else going on here if you needed to change to 50kHz. Have you enabled lowBetaOffset stuff?
Mark.

Edit: The reason I say this is that you don't have a very low beta (i.e. low modulation index < 1). Your MI is around 3.33, I'm wondering whether if lowBetaOffset is on this is messing things up. The other thing to look at is how sharp the roll-off is for the DC cutoff. Try putting 0x8C in RegRxBwAfc, that's for 25kHz with a DC cutoff frequency of 1% of RxBw rather than 4%.
« Last Edit: July 24, 2016, 07:14:57 AM by perky »

fgomes

  • Jr. Member
  • **
  • Posts: 65
Re: Long Range parameters for RFM69HW (868 / 915 MHz)
« Reply #22 on: July 25, 2016, 07:58:09 AM »
@perky, thanks for your feedback, I have changed the DC cutoff frequency to 1% and afc bw to 25KHz as you suggested and it worked even in the worst conditions, one node working at 50C, a total frequency deviation of about 6KHz. After some time testing it I decided to add the lna additional gain and after doing it the node freezes, even after removing the change, I don't know if it might have an hardware failure,  I'll check later today.

Best regards

Fernando

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Long Range parameters for RFM69HW (868 / 915 MHz)
« Reply #23 on: July 25, 2016, 10:15:20 AM »
Turning on the LNA gain allows weaker signals to be received but I think has an unfortunate side effect of saturating the input when devices are close together. If this setup is on the bench I'd set the power limit on both radios to the minimum possible and curl up the antennae ino tight spirals.
Mark.

fgomes

  • Jr. Member
  • **
  • Posts: 65
Re: Long Range parameters for RFM69HW (868 / 915 MHz)
« Reply #24 on: July 25, 2016, 11:47:54 AM »
@perky, I know about that saturation problem, but the nodes were far and one was in the metal 'climatic chamber' so I was seeing about -83dBm, and was trying to check the impact of the lna gain, but had no success. Seems the hardware is now broken.

Best regards

Fernando