Author Topic: Optimizing radio settings for power (rfm69w/hw) [+300kbps settings]  (Read 7828 times)

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Optimizing radio settings for power (rfm69w/hw)
« Reply #30 on: October 29, 2016, 01:18:19 PM »
It probably has something to do with how I'm setting the bitrate, because if I keep the bitrate the same as in Felix's example code, but change the RxBw, RxBwAfc, and FDEV as in the boiled down version, then RSSI is correct (i.e. the same as before changing them), and I continue to receive packets at the lower bitrate (55,555bps).

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Optimizing radio settings for power (rfm69w/hw)
« Reply #31 on: October 29, 2016, 01:20:36 PM »
BR calcs are wrong, I use 12kb/s and the MSB is 0xA!
Forget that, my mistake. I calculate 0x006B for 300kHz.

Mark.
« Last Edit: October 29, 2016, 01:32:49 PM by perky »

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Optimizing radio settings for power (rfm69w/hw)
« Reply #32 on: October 29, 2016, 01:47:41 PM »
Didn't we have some strange anomoly with reading RSSI before that appeared to be BR dependent? I came to the conclusion the best place to read it was after the payloadreay interrupt, but before reading data out of the FIFO as this is frozen until the next RX reset event (i.e. reading data out of the FIFO).

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Optimizing radio settings for power (rfm69w/hw)
« Reply #33 on: October 29, 2016, 01:49:12 PM »
I think I found my  mistake.  I wasn't raising the RSSI threshhold.  -110db worked OK at the narrower threshhold bandwidth, but I should have raised the threshhold for the much higher (and noisier) bandwidth.  So, apparently RSSI would trigger on noise alone but then decode anyway.  So, the RSSI that was getting reported was the abnormally low noise figure rather than the actual transmitted RSSI.

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Optimizing radio settings for power (rfm69w/hw)
« Reply #34 on: October 29, 2016, 02:02:10 PM »
OK, that sounds sensible.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Optimizing radio settings for power (rfm69w/hw)
« Reply #35 on: October 29, 2016, 02:45:08 PM »
I'll try Joe's settings now.  His RSSI threshhold is set to the absolute lowest possible, though, so maybe he's doing something non-standard wrt to that?

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: Optimizing radio settings for power (rfm69w/hw)
« Reply #36 on: October 29, 2016, 05:40:38 PM »
Quote
I'll try Joe's settings now.  His RSSI threshhold is set to the absolute lowest possible, though, so maybe he's doing something non-standard wrt to that?

You can either set the rssi thresh so low that it triggers on background noise right away or try to set it such that it's above the noise floor. The RFM69 uses the first approach due to its very low threshold. The advantage is that then you don't need to determine the noise floor which can be a pretty dynamic problem esp with low bitrates that only require minimal signal to noise ratios. The disadvantage is that AGC doesn't work because it sets gain according to background noise.

For these tests I've also used the first approach but made it more explicit by setting rssithresh to 255. Even if for this particular bitrate signal to noise needs to be fairly high so determining a good enough noise floor might work.

Rfm69 lib records rssi at packet available so it shouldn't matter either way.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Optimizing radio settings for power (rfm69w/hw)
« Reply #37 on: February 04, 2017, 11:10:30 AM »
Here are my 300kbit settings:

Code: [Select]
SX1231_REG_BITRATEMSB, SX1231_BITRATEMSB_300000,
SX1231_REG_BITRATELSB, SX1231_BITRATELSB_300000,
SX1231_REG_FDEVMSB, SX1231_FDEVMSB_200000,
SX1231_REG_FDEVLSB, SX1231_FDEVLSB_200000,
SX1231_REG_RXBW, SX1231_RXBW_DCCFREQ_010 | SX1231_RXBW_400000,
SX1231_REG_RSSITHRESH, 255,
SX1231_REG_PREAMBLELSB, 6,
SX1231_REG_PACKETCONFIG2, SX1231_PACKET2_RXRESTARTDELAY_2BITS | SX1231_PACKET2_AUTORXRESTART_OFF |  SX1231_PACKET2_AES_OFF,
SX1231_REG_PACKETCONFIG1, SX1231_PACKET1_FORMAT_VARIABLE | SX1231_PACKET1_DCFREE_WHITENING | SX1231_PACKET1_CRC_ON | SX1231_PACKET1_CRCAUTOCLEAR_ON | SX1231_PACKET1_ADRSFILTERING_OFF,
SX1231_REG_PARAMP, SX1231_PARAMP_10,
SX1231_REG_LNA, SX1231_LNA_GAINSELECT_MAX



It looks as though you're setting DCC to 010 even though, in this scenario, that results in low beta?

Or, maybe I'm calculating it wrong.  With your other settings, my calculations are:
[FDev] 3277Hz
[FDEV] 200012Hz
Beta=((2*FDev)/BitRate)=0.02
Fcutoff=15915.50Hz
  Percentage=3.98%

On a different topic: you aren't doing address filtering, and I guess maybe that's because you aren't sending addresses?  And that is because... why?  Is it to save energy (or make smaller frames) from not sending address bits?  Instead of addresses I gather you used time division to differentiate the intended recipient?  Or just embed the address  in the packet if and when it's needed?

It's also interesting that you aren't doing encryption.  Any particular reason?

[Edit1: Also, for the benefit of anyone else who may be reading this, I presume when you're setting the REG_LNA that you're setting LnaZin (bit 7) to zero to designate an input impedance of 50 ohms.  The default setting is 200 ohms.]

[Edit2: Likewise, I presume you have AFC turned off because of the wide RxBW?  I also presume that because you don't appear to be setting RxBwAFC anywhere.]
« Last Edit: February 04, 2017, 04:16:26 PM by WhiteHare »

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Optimizing radio settings for power (rfm69w/hw)
« Reply #38 on: February 04, 2017, 08:30:13 PM »
Or, maybe I'm calculating it wrong.  With your other settings, my calculations are:
[FDev] 3277Hz
[FDEV] 200012Hz
Beta=((2*FDev)/BitRate)=0.02
Fcutoff=15915.50Hz
  Percentage=3.98%
Note sure how you got this value for FDEV, that beta calculation is way off! ;-)
Mark.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Optimizing radio settings for power (rfm69w/hw) [+300kbps settings]
« Reply #39 on: February 04, 2017, 08:36:18 PM »
OK, thanks.  Apparently I need to revisit the topic.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Optimizing radio settings for power (rfm69w/hw) [+300kbps settings]
« Reply #40 on: February 05, 2017, 07:03:33 AM »
Anyway, Joe's settings run great.  They are my new defaults.  Thanks, Joe!

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: Optimizing radio settings for power (rfm69w/hw) [+300kbps settings]
« Reply #41 on: February 06, 2017, 01:58:54 AM »
Beta is 2x fdev / Bitrate which is around 1.3 which is not yet low beta. I've tested multiple betas and this gets me the best PER.

Great that these settings work well for you. I generally go only up to 200kbit since then I can use 3 bytes preamble for all settings. Yeah I use neither AGC nor AFC and 50 Ohm.

You're right, I don't use address filtering. Originally that was because I'm used to it (RFM69 does that too to enable promiscuous mode). But today it also comes in handy because it allows reception of the smallest possible variable size packet: just a 0 Len byte. Even with encryption enabled this doesn't add the 16 bytes for the first chunk of encrypted data. This makes rapid sync possible for frequency hopping.