Author Topic: Changing the RMF69 radio configuration [+300kbps settings]  (Read 13561 times)

sid1202

  • Newbie
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #15 on: September 10, 2016, 05:25:17 PM »
I'm starting to understand what is throwing me off. Its the side bands.

I learned about FM was you have a carrier wave at a given amplitude that never changes. To transfer information you change the frequency of the carrier wave (which now Fdev makes perfect sense)  and MI being the ratio between how far off from the center frequency the bits are represented and how fast they the value changes. But I don't understand where the side bands are coming from. If there is other carrier waves that are very close to the main one, it would definitely make demodulation more difficult.

How are those side bands created in the first place. Are the wanted and produced, or are they a side effect  (echo) of the antenna ?

Sid.

[edit] I see later that we create those side bands and it is part of what makes the bandwidth.... Still reading ...

[edit] On page 3 right below figure 2, the document states
Quote
For instance, if β=0.25, only one sideband is needed; while if β=5, eight sidebands are required
, and a few phrases later
Quote
The bandwidth is equal to the number of discrete spectral tones multiplied by the frequency spacing set by the message signal frequency
explaining that the side bands are required and how to determine the number of sidebands but How are the side bands used ? do they contain parallel data ?
« Last Edit: September 10, 2016, 06:32:59 PM by sid1202 »

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Changing the RMF69HCW configuration and back
« Reply #16 on: September 10, 2016, 06:12:57 PM »
Whenever you modulate signals you get sidebands which are frequencies at either side of the centre frequency. Amplitude modulation is relatively easy to determine as its simply a multiplication of the modulation signal and a fixed carrier (and if you remember your maths two sines multipled together have sines with the sum and difference frequencies), but FM is more complex and requires Bessel functions to calculate.
This might explain it a bit better:
http://www.radio-electronics.com/info/rf-technology-design/fm-frequency-modulation/spectrum-bandwidth-sidebands.php

As an interesting note this says "The total spectrum can be seen to consist of the carrier plus an infinite number of sidebands spreading out on either side of the carrier at integral multiples of the modulating frequency". So what is the maximum frequency you can modulate these radios at to determine your maximum used bandwidth? Well it's an alternating sequence of 1's and 0's, the frequency of that is the bitrate divided by 2. This is where the BR/2 factor comes in.

sid1202

  • Newbie
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #17 on: September 10, 2016, 06:50:32 PM »
In this reference it states
Quote
As the modulation index increases it is found that other sidebands at twice the modulation frequency start to appear.
So the side bands are a resonances effect of the frequency deviation and the signal frequency and are not wanted ??? or are they required ... I'm lost...

On the other hand everything else is making more sense.

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Changing the RMF69HCW configuration and back
« Reply #18 on: September 10, 2016, 08:47:08 PM »
The sidebands are part of the signal. They are what you get when you FM modulate a carrier and look at the resulting signal's frequency content, you can't escape them they are just there. What you have to do is make the receiver bandwidth big enough to get as much of the signal energy (i.e. as much of the sidebands as needed) to get a good enough SNR to demodulate it, and that is given by the RxBw >= Fdev + BR/2 equation.
Mark,

sid1202

  • Newbie
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #19 on: September 11, 2016, 03:35:47 AM »
Now I understand. The sidebands are an side defect from the modulation and reflect the main carrier wave and its part of the package. So the more of the energy you target at the receiver the better the reception. (within limits). Man this one was hard to wrap my mind around. 

Ok time to start over reading the documents. There is still a few thing I want to clarify....

I greatly appreciate this guidance guys, thank you

Sid

sid1202

  • Newbie
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #20 on: September 11, 2016, 11:40:55 AM »
So This is what I understand now. When you configure the radio, parameters are set in steps. I want to target a MI of 5 but the parameters my not let me get a perfect 5, I try to stay as close to a MI of 5 as possible (based on commercial FM settings
Quote
in North
America, the maximum frequency deviation, f∆ , is 75 kHz for commercial FM broadcasting. If the maximum message frequency is equal to 15 kHz for audio, then 51575 == kHzkHzβ


To set up a 300 kbsp connection,

From rule 1, I can find my ideal  target Fdev with Fdev = MI  * BR/2 = 5 * 300/2 = 750

Use rule 3 to get RxBw: RxBw >= Fdev + BR/2 = 750 + 300/2 = 900 or more

Verify that it within limits with rule 2: BR < 2*RxBw == 300 < 2*900 == 300 < 1800 == TRUE

Confirm I'm within hard limits for RxBw with rule 5: Fdev + BR/2 < 500kHz  == 900 < 500 == FALSE

Since I want to use 300kbps, the only variable left to change is the MI, I need to lower it no lower that 0.5 and satisfy rule 5. To satisfy rule 5 RxBw can not be higher that 500 - 150 = 350

Get new Fdev from rule 3: RxBw >= Fdev + BR/2 == Fdev <= RxBw - BR/2 == 350 - 300/2 = 200

Verify Rule 1 with rule 1 if MI is within limits: 2 * Fdev/BR = 2 * 200 / 300 = 1

So to set up a 300 kbps connection
BR=300
Fdev=200
RxBw=350

The only parameter left to figure out is RxBwAfc. I've read a little about AFC and seems that the RFM69 AFC is pretty fast so it wont really slow down the connection and according to NXP document there is a lot of advantages to using AFC.

On the other hand I haven't seen a register for RxBwAfc. Section 3.5.15 of the sx1231 talks about turning it on and 3.5.16 using Optimized Setup for Low Modulation Index Systems by setting the appropriate bits. But I'll have to read on to figure out the details.

Sid

[edit] From the "Definition of RxBw with RFM69"discusion I figured that @ 915 Mhz the LOoffset is a factor 20ppm = 18.3 Khz. What does ppm stand for here. Can't be parts per million... lol

RegAfcBw
(0x1A)
7-5 DccFreqAfc rw 100 DccFreq parameter used during the AFC => RxBwAfc value goes here ?
4-3 RxBwMantAfc rw 01 RxBwMant parameter used during the AFC
2-0 RxBwExpAfc rw 011 * RxBwExp parameter used during the AFC


« Last Edit: September 11, 2016, 12:29:22 PM by sid1202 »

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Changing the RMF69HCW configuration and back
« Reply #21 on: September 11, 2016, 01:05:03 PM »
I would have selected the RxBw first as these are only available in disrete steps. For example the nearest one to 350kK is 333kHz. Also for AFC this has to include the offset between the transmitter frequency and the receiver frequency, which is set by the ppm difference between the two crystals and scaled to the frequency band your using.

So, let's assume it's 868MHz and the crystals are +/- 10ppm. This means the transmitter might be at +10ppm and the receiver at -10ppm or the other way round, so LOoffset is 20ppm of 868MHz, or about 17.4kHz.

I'd set RxBwAfc at 333kHz, and my actual needed RxBw is (333-17.4)kHz, i.e. 315.6kHz, so I'd also set that to 333kHz as the next one down is 250kHz and is too low.

Then I'd use rules 1 and 3 to get two equations for Fdev and BR so I can solve it for both variables, with a goal of a high BR. Let's make MI of 1.5 (i.e. 3/2), that won't require low beta stuff which is a complication.

So:
MI = 2 * Fdev/BR = 3/2, i.e. Fdev = BR * 3/4, or
A) Fdev = BR * 0.75.

Now from equation 3:
RxBw >= Fdev + BR/2. We've already said RxBw is 315.6kHz, so:
315.6 >= Fdev + BR/2, substituting A) we get:

B) 315.6 >= BR * 3/4 + BR/2, or 315.5 = BR * 5/4.

So: BR = 252.5KHz. Let's say 250kHz (a little smaller)

This means Fdev is 189.3KHz. Let's say 185kHz (a little smaller)

So with Fdev = 250kHz and BR = 185kHz let's check all the rules:
1)  0.5 <= 2 * Fdev/BR <= 10
2 * Fdev/BR is 1.48. So OK.

2)  BR < 2*RxBw
250 < (2 * 185) , so OK.

3) RxBw >= Fdev + BR/2
333 >= (185 + 125), so OK.

4) RxBwAfc >=  Fdev + BR/2 + LOoffset
333 >= (185 + 125 + 17.4), so OK.

5) Fdev + BR/2 < 500kHz
(250 + 125) < 500, so OK.

Final settings:
BR = 250kHz
Fdev = 185kHz
RxBw = 333kHz
RxBwAfc = 333kHz

If you wanted a higher BR follow the same process as above, but choose 400kHz or 500kHz as your RxBw values.

BTW the RxBwAfc is in register 0x1A.


sid1202

  • Newbie
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #22 on: September 11, 2016, 05:55:46 PM »
Got it. I think, lol

My radio is 915 Mhz the LOoffset is a factor 20ppm = 18.3 kHz then.

So I use table 13 and 14 to set RxBwAfc as we do for the the RxBw register I assume.

This means that when our RxBw start to get high, basicly the RxBwAfc = RxBw...

Ok so, lets see if I can do the math and lets try to get the numbers starting from 500kHz RxBw and see if it works.

This means RxBw and RxBwAfc will be 500 since the next lower step is 400.

A) If we choose an MI of 1.5 to avoid low beta stuff we have Fdev = BR * 3/4

B) 481.7 >= BR * 5/4 = 385.36 >> 384 ?

C) so Fdev is 192.68 >> 192 ?

1)  0.5 <= 2 * Fdev/BR <= 10
2 * 192 / 384 is 1 so OK

2)  BR < 2*RxBw
384 < (2 * 192 ) , so is it OK is its equal ?

3) RxBw >= Fdev + BR/2
500 >= (192 + 192), so OK.

4) RxBwAfc >=  Fdev + BR/2 + LOoffset
500 >= (192 + 192 + 18.3), so OK.

5) Fdev + BR/2 < 500kHz
(192 + 192) < 500, so OK.

So I have

BR = 384kHz
Fdev = 192kHz
RxBw = 500kHz
RxBwAfc = 500kHz

Now Rule 2 is busted by 1 and my MI is already at 1, looks like to get the the 300 kbps we have to get into the low beta stuff.

What's the threshold for the low beta it is MI = 1 yes ?

Sid






perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Changing the RMF69HCW configuration and back
« Reply #23 on: September 11, 2016, 06:37:42 PM »
Well, nearly. The radio is actually restricted to 300kHz for BR (probably should be one of the rules!). With a MI of 1.5 this yields an Fdev of 225kHz, and an absolute minimum RxBw of 375kHz. You can get away with using RxBw and RxBwAfc settings of 400kHz!

So with BR of 300kHz and Fdev of 225kHz, let's check the rules:

1)  0.5 <= 2 * Fdev/BR <= 10
2 * (225 / 300) is 1.5, So OK.

2)  BR < 2*RxBw
225 < (2 * 400) , so OK.

3) RxBw >= Fdev + BR/2
400 >= (225 + 150),  so OK.

4) RxBwAfc >=  Fdev + BR/2 + LOoffset
400 >= (225 + 150 + 18.3),  so OK.

5) Fdev + BR/2 < 500kHz
(225 + 150) < 500, so OK.

So I think to get the maximum 300kHz BR out of your radio you could have:

BR = 300kHz
Fdev = 225kHz
RxBw = 400kHz
RxBwAfc = 400kHz

(BTW you made a mistake in your rule 2, RxBw for your calculations was 500kHz not 192kHz)

Edit: I've just seen the datasheet suggests MI less than 2 is 'low beta' So MI of 2, not 1.5, to avoid low beta offset stuff.

That makes the calculations a little easier, BR == Fdev. For maximum of 300kHz BR, Fdev = 300kHz, and absolute minimum RxBw is 450kHz, so would need to set RxBw and RxBwAfc to 500kHz.

BR = 300kHz
Fdev = 300kHz
RxBw = 500kHz
RxBwAfc = 500kHz.

Mark.
« Last Edit: September 11, 2016, 06:52:21 PM by perky »

sid1202

  • Newbie
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #24 on: September 11, 2016, 07:14:27 PM »
An I knew that BR was limited to 300, but I got so wrap up in the calculations I missed it and my mistake in rule 2, well, that was a brain fart lol

This is not easy to grasp. There are many way to use these formulas to get numbers and you can start from different points. In the last example we started from the RxBw standpoint. We can also start from BR or even Fdev. This looks like it depends on your end goal. a really good understanding of the FM protocol is definitely a requirement. With you guidance I understand the basics, but I'll have to continue to increase my knowledge of FM to have a better grasp of these equations.

Is starting from RxBw a common practice or does it all depend on the objective ?


One thing I've learned is that the data sheet is not linear went it comes to figuring out the settings. I worked as a software engineer 12 year+ ago so I have some knowledge of datasheets and I used to be a very competent coder but after 12 years of not touching it at all, its a little rougher than I thought it would be. So I can just imagine someone that is just starting...

Anyway This is a great learn experience and I really appreciate it.

Sid

WhiteHare

  • Hero Member
  • *****
  • Posts: 1298
  • Country: us
Re: Changing the RMF69HCW configuration and back
« Reply #25 on: September 12, 2016, 09:21:00 PM »

sid1202

  • Newbie
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #26 on: September 13, 2016, 04:50:54 AM »
@perky

Have you had time to work on that spread sheet of yours BTW ?

I've been playing with some numbers and I'm not always getting the same values that are used the the libraries. I keep refering the the "Definition of RxBw with RFM69 " thread and I found some answers there, but it might be I'm simply not using the formula right.

One thing I'm curious about is when you one a different channel is there enough change in the carrier frequency @915MHz to warrant recalculating all the register values or is the difference low enough that it would not impact it. ?

@WhiteHare
Yes most definitely. I've been referring to the thread a lot.

sid1202

  • Newbie
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #27 on: September 13, 2016, 07:05:50 PM »
I was going through the forum and revisiting some posts and I'm actually starting to understand most of the discussions now.  I have a few more questions, but before I ask, I want to see what I can answer for my self.

Again, I am very grateful for the guidance.

Sid.

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Changing the RMF69HCW configuration and back
« Reply #28 on: September 13, 2016, 08:07:41 PM »
Glad you're getting to grips with it. I haven't had time to do the spreadsheet unfortunately. BTW if you mean the RadioHead library, there is at least one of the standard configurations that is wrong and theoretically shouldn't work too well, so if you came to that conclusion you're on the right track ;-)

sid1202

  • Newbie
  • *
  • Posts: 30
  • Country: ca
Re: Changing the RMF69HCW configuration and back
« Reply #29 on: September 13, 2016, 08:15:52 PM »
Thats really nice to know :)

I'm try to figure out, for mid range rates where we can play more with MI if having a mid range MI is better that in the higher rangers like MI=2 vs MI =9

From what I understand the ideal MI is around 5, but I'm not sure how much of an impact it has.

Can't seem to get what are the consequences of moving the MI around. I read that at both extremities there are difficulties, more so at the lower end.

Sid.