Author Topic: Freq Vs. Temperature Update  (Read 50864 times)

john k2ox

  • Full Member
  • ***
  • Posts: 111
Freq Vs. Temperature Update
« on: March 01, 2014, 04:52:37 PM »
Last fall I posted some data that described how the RX/TX frequency drifted with temperature.  At that time I used the internal RFM69 temp sensor.  What I didn't realize at that time was that the chips temperature changes dozens of degrees depending on what the chip is doing.  Since the frequency is derived from an external  crystal and not the chip, I couldn't rely on the internal sensor.

In November I added an 18B20 to track the ambient temperature and correct for frequency drift.  The results have been outstanding.  I have a Moteino about 1200 ft from my house setting in a snow covered field.  RXBW set to 12KHz.

It has worked flawless from -12F to 65F degrees. 

I just added 18b20s to a couple more Moteinos.  This time I used a little heat sink compound and arranged the sensor to be in contact with the crystal.  The close coupling allows for even better compensation.

In the attachment you can see that an uncorrected Moteino drifts more than 14,000 Hz over -5C to 60C degrees.  With compensation less than 488Hz, usually within +/-122Hz.  Blue is uncorrected measurement data, Black is the error equation(curve fit), and Red is the corrected measurement results.

To apply this technique to your Moteino take the polynomial on the graph and put it in your sketch. 'x' is the temperature you get from your sensor in Celsius and 'y' is the resultant  error in Hz.

So, Freq(corrected) = Freq(wanted) - y;  Then set Moteino to Freq(corrected).

Bottom Line:  You should only care about this if you want to change BR, Deviation, and RXBW to small values that increase the radio's sensitivity. Say for long distance experimentation. Or if you have two or more Moteinos in vastly different environments where the temperatures don't track. 


Cheers,
john

 



 

KanyonKris

  • Full Member
  • ***
  • Posts: 113
Re: Freq Vs. Temperature Update
« Reply #1 on: March 02, 2014, 02:28:39 AM »
John, excellent work. Eye-opening that the frequency can shift 14kHz.

I know you said the internal RFM69 temp sensor didn't work for you, but do you think there could be any case in which it could be used for frequency correction?
For instance, if the Moteino and radio were asleep for 10 minutes, then woke up and immediately took a temperature reading from the RFM69 (before it had a chance to heat up), do you think the reading would be accurate enough for frequency compensation?

john k2ox

  • Full Member
  • ***
  • Posts: 111
Re: Freq Vs. Temperature Update
« Reply #2 on: March 02, 2014, 09:31:04 AM »
Hi KanyonKris,

Thanks.   Yes, I believe that is the only way to use the internal temp sensor.

That would be a worthwhile project.  Connect an 18b20 and capture the readings from it and the internal sensor. 

There is one other issue. If the crystal oscillator is also sleeping, the crystal will heat up when it wakes up.  In the first 30 seconds it's  +0.7C, about -183Hz. In five minutes it goes up +3C and -305Hz.   Not that bad, but it does happen.

If it were sleeping long enough so that everything was at ambient temp, it woke, measured its temp, corrected its freq, and sent its payload the correction should be very accurate.  In this case the chip and the crystal would have little time to self heat.

Using this correction and the narrowest RBW I'm going for a distance record of more than 2 miles. :)

john

KanyonKris

  • Full Member
  • ***
  • Posts: 113
Re: Freq Vs. Temperature Update
« Reply #3 on: March 02, 2014, 07:58:54 PM »
John, thank you for the informative reply.

I'm surprised the oscillator warms up that much, and so quickly.

2 miles? Astounding. Well done.

One other thing I've been wanting to ask you. In your work making frequency corrections, do you use a frequency analyzer to measure frequency or another Moteino? Certainly an analyzer would be best. But I imagine a pair of Moteinos, TX and RX could tune themselves by having the TX vary the sending frequency and the RX report back the RSSI so TX can look for the peak.

john k2ox

  • Full Member
  • ***
  • Posts: 111
Re: Freq Vs. Temperature Update
« Reply #4 on: March 03, 2014, 10:11:57 AM »
I used an Agilent MXG Signal Generator to produce a known stable CW signal.  It uses an oven to keep its crystal on frequency.  My Moteino code then triggers the RFM69 to do an FEI measurement that sends the freq error result to the serial port.

The FEI measurement compares the received signal with its own and saves it in the FEI register.  It has a resolution of 61 Hz.

If you do this with two Moteinos you can keep them within a couple hundred Hz of each other.  You have to do it often enough though so that they don't get 'lost'.   I haven't had an issue when syncing once every 15 minutes.  Once an hour should be OK.

With T vs F correction the FEI correction isn't necessary. 

john

hdphilip

  • NewMember
  • *
  • Posts: 17
Re: Freq Vs. Temperature Update
« Reply #5 on: May 18, 2014, 01:24:52 AM »
Quote
In the attachment you can see that an uncorrected Moteino drifts more than 14,000 Hz over -5C to 60C degrees.  With compensation less than 488Hz, usually within +/-122Hz.  Blue is uncorrected measurement data, Black is the error equation(curve fit), and Red is the corrected measurement results

would this frequency drift be for the 900 MHz radios?

Philip


Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Freq Vs. Temperature Update
« Reply #6 on: October 22, 2014, 08:49:45 AM »
I found this Semtech document which outlines some of the techniques to adjust the frequency drift of the oscillator, adding it here for posterity and as extra reference:
http://www.semtech.com/images/datasheet/xo_precision_std.pdf

The temperature compensation section is similar to what john has done, except they suggest keeping compensation tables at each frequency used, which might eat a lot of memory.

john k2ox

  • Full Member
  • ***
  • Posts: 111
Re: Freq Vs. Temperature Update
« Reply #7 on: November 09, 2014, 10:31:31 PM »
Yes.  All my experiments are with 900MHz radios as of 11/2014.

maxim

  • NewMember
  • *
  • Posts: 1
Re: Freq Vs. Temperature Update
« Reply #8 on: February 17, 2015, 11:54:09 AM »
Hi,

New to this board and just wanted to share another type of fix to ensure that these radios can communicate while exposed to very cold temperatures. Right now it's -24C and the radios are communicating with rarely a retry and an RSSI of ~ -70dBm for the last month with a transmission at least every hour with the RFM sleeping between transmissions.

This tweak is applied to the RFM's AFC algorithm and gives it more time to analyze the incoming transmission's preamble to perform the usual frequency correction. Since the likelihood that these radios will transmit "bang on" is handicapped by a relatively low quality xtal, one solution is to adapt each receiver to the incoming transmission's frequency (acceptable under an unlicensed band scenario).

Steps:
1) Reduce the AFC feedback loop gain.
2) Increase the wait period between AFC corrections.
3) Increase the Preamble length.

The net effect is to increase the number of AFC corrections (by reducing the weight of each correction), and to increase the delay between corrections to allow the VCO to stabilize before a new correction is applied.

In code (using the RADIOHEAD library by Mike McCauley - Version 1.39) it looks like this:

rf22.setFrequency(923.0,0.1);  // Increase FM capture range from default 0.05 to 0.1.
rf22.spiWrite(0x1D, 0x50);  // Reduce AFC gain (Default is 0x44).
rf22.spiWrite(0x1E, 0x1A);  // Increase wait time between AFC corrections (Default 0x0A).
rf22.setPreambleLength(25);  // Increase Preamble to 100 bits (25 x 4bits).

Once I confirmed that the settings were useful I switched to a narrower & Gaussian-smoothed modulation using:
rf22.setModemConfig(RH_RF22::GFSK_Rb2_4Fd36);

The radio used was an RFM22B in the 900 MHz band. I've attached snapshots of the register descriptions.

-- Max


« Last Edit: February 17, 2015, 11:23:24 PM by maxim »

luisr320

  • Sr. Member
  • ****
  • Posts: 255
  • Country: pt
Re: Freq Vs. Temperature Update
« Reply #9 on: March 10, 2015, 09:56:02 AM »
Hi! I'm well out of my feet on this subject, but sure would like to try to understand it a bit more.

I have installed a moteino with a 433mhz RFM69HW inside the bonnet of my car that is used to open the outer gate and garage door of my house.
I'm sure the temperature inside the bonnet will shoot to 80ÂșC or even more.
The moteino works flawlessly in this environment. But looking at your post it is obvious that the transmitting frequency will drift a lot thus reducing the range. Also, because of all the metal around it, the signal is further attenuated.

Since I decided to make a new PCB for the car moteino, I will insert a ds18B20 temp sensor directly under the radio but now I'm  completely lost on what to do next in order to implement a pratical solution for temperature compensation.

Do I need to log the temperature and determine the polinomial function to correct the frequency? Is it possible to create a turn key solution that could be applied to any situation, cold or hot that would depend of the type of radio?
« Last Edit: March 10, 2015, 09:59:46 AM by luisr320 »

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: Freq Vs. Temperature Update
« Reply #10 on: March 10, 2015, 01:50:16 PM »
May I ask why you put the moteino near the engine? My 868 MHz gate opener RC is working just fine from inside the car. You gain nothing from putting it under the bonnet, on the contrary, you need to deal with other sorts of problems like heat as you mentioned.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Freq Vs. Temperature Update
« Reply #11 on: March 10, 2015, 03:20:15 PM »
And dust and water/humidity ...

luisr320

  • Sr. Member
  • ****
  • Posts: 255
  • Country: pt
Re: Freq Vs. Temperature Update
« Reply #12 on: March 10, 2015, 03:20:38 PM »
My car is an Audi TT and I can't find any holes that allow me to pass a wire to the inside of the car. I guess its a question of being practical.
I have waterproofed the box. And with all that heat there will be no humidity there. Ever.

« Last Edit: March 10, 2015, 04:01:27 PM by luisr320 »

kobuki

  • Sr. Member
  • ****
  • Posts: 289
Re: Freq Vs. Temperature Update
« Reply #13 on: March 10, 2015, 03:27:29 PM »
I don't know the Audi TT's internals but in that case I'd ask for suggestions from a professional. They know all the places you can mount and hide your stuff. Though I'd imagine it'd be practical to mount it under the dash on either side of the console. There are usually conveniently sized compartments there. Or you can just hide it in or behind the glove box (remove the door to have a look). I've seen many onboard DIY electronics there in a wide variety of cars.

luisr320

  • Sr. Member
  • ****
  • Posts: 255
  • Country: pt
Re: Freq Vs. Temperature Update
« Reply #14 on: March 10, 2015, 08:57:54 PM »
Thank you for your advice.
All that makes sense and at the end I will probably look for a way to install it inside the car.
But at the present time I would like to try to understand a bit more on how temperature affects the frequency stability on these radios and for that I really want it to be where it is.

After looking a bit around the Forum I can't find a clear description on how to implement temperature compensation. It looks like I have to address some bits on the radio but I'm not sure how.
I'll dig a bit into the radio datasheet to see if I get some epiphany but I'm guessing I just be wasting time without any guru guidance.