Author Topic: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?  (Read 10876 times)

WhiteHare

  • Hero Member
  • *****
  • Posts: 1296
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #15 on: January 17, 2016, 08:44:41 PM »
I did an experiment where I ran the above code both with and without the same EMI source that I used previously (see the OP), and there was no discernible change.  I'm not sure why that would be, unless perhaps there's no automatic gain calibration going on (as there appears to be when measuring the RSSI that's tied to actual packet reception).  In any case, on its face, I take it as good news.   :)  I'm now wondering to what degree, if any, Moteino Rx would suffer if run without automatic gain calibration (assuming that's even possible).  Perhaps there's a chance (?) that doing so could serve as a stopgap which is better than nothing until there is a proper EE solution (e.g. for combination Moteino and Pi Gateway).

What ultimately results from the automatic gain calibration?  Is the result simply picking an LNA Gain Setting in Table 12 of the SX1231H datasheet, or is it something else altogether?
« Last Edit: January 17, 2016, 10:40:10 PM by WhiteHare »

emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #16 on: January 18, 2016, 08:46:54 AM »
@WhiteHare,

From the datasheet:
Quote
The receiver is capable of automatic gain calibration, in order to improve the precision of its RSSI measurements. This function injects a known RF signal at the LNA input, and calibrates the receiver gain accordingly. This calibration is automatically performed during the PLL start-up, making it a transparent process to the end-user

AGC aka Automatic Gain Control is a different beast entirely.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1296
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #17 on: January 18, 2016, 12:26:03 PM »
@WhiteHare,

From the datasheet:
Quote
The receiver is capable of automatic gain calibration, in order to improve the precision of its RSSI measurements. This function injects a known RF signal at the LNA input, and calibrates the receiver gain accordingly. This calibration is automatically performed during the PLL start-up, making it a transparent process to the end-user

AGC aka Automatic Gain Control is a different beast entirely.

So, by "a different beast entirely," I take it you mean that "calibrates the receiver gain accordingly" is completely unrelated to "Automatic Gain Control" and does not influence it in any way?

Maybe nothing more can be done.  I'm definitely very close to throwing in the towel on this.

oric_dan

  • Jr. Member
  • **
  • Posts: 64
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #18 on: January 18, 2016, 11:56:12 PM »
WH, I'm interested in listening to what you're doing here, but am buried in writing software for my robot tank RoBurt. It's taken me months of work and trying out different platforms until I finally have something working even half-well. The program is over 60 pages now. So, not enough time to delve into this too. I know very little about the radio operation, and it would take a lot of playing around to come up to speed. So, it looks like you're the guy, good luck :-).

emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #19 on: January 19, 2016, 02:56:55 AM »
@WhiteHare,

AGC is simply a control loop to keep the magnitude of the received signal reasonably matched to the capabilities of the stages from the mixer onwards. Kinda Goldilocks - not too large else clipping will occur, not too small else the signal gets buried in the noise.  For this chip, the AGC choice is quantized into some fairly broad chunks, predefined as LNA gain settings.  Recall that FSK is essentially constant carrier amplitude - this approach works well for shortish packets: measure the energy in the channel during preamble, compute the best gain block size to match the mixer linearity requirements, lock this in for the duration of the packet (and as an aside, update LnaCurrentGain for interested observers when time permits)

Automatic gain calibration is to ensure the RSSI dB value you read out has some connection with reality.  Chip tolerances can be surprisingly large for absolutes (just look at the spread of T estimate on the chips that retain access to a temperature sensor).  So as described, at some convenient start up, a known signal is injected into the gain chain and some offset register adjusted to make the answer look right.

Note that I've just shot myself in the foot there - how can there be a precise 'known signal' to inject without the same tolerance issue?  Techniques include laser trimming of the raw die during chip functional probing or post packaging adjustment by writing to eprom calibration registers.

Here you hit an event horizon - it isn't documented, may not even be described accurately. Why? Because this may be touching on an area the vendor wants to keep close to his chest. It's a competitive world out there!
Many of the puzzling aspects could be resolved by seeing the code run by the internal state machine e.g. when do the externally visible registers actually get updated?

Regretably, that just isn't going to happen. 
« Last Edit: January 19, 2016, 04:07:40 AM by emjay »

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #20 on: January 29, 2016, 06:58:28 AM »
Most conducted and radiated EMI is caused by common mode noise on signals entering or exiting a box. If you tie your box ground to digital ground with a very low DC and RF impedance (large, fat and very short connections) at the point a signal exits or enters the box the common mode noise is significantly reduced. On the power leads a capacitor (e.g. 470nF) with a low RF ground connection to chassis (short, fat connections) tends to get rid of a lot of power-line conducted EMI. A 5mm wire will have significant impedance at RF frequencies and will do very little to stop it, you need wide, fat and very short connections.
Mark.
« Last Edit: January 29, 2016, 07:00:20 AM by perky »

emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #21 on: January 29, 2016, 09:36:56 AM »
Hmm - better put those decoupling caps on a diet.  Anything in the uF range is no longer a capacitor above a couple of MHz, it's an inductor!  Parallel up with 0.1uF, 0.001uf and 47pF for decoupling to be effective up to the 1GHz needed.
« Last Edit: January 29, 2016, 04:38:46 PM by emjay »

WhiteHare

  • Hero Member
  • *****
  • Posts: 1296
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #22 on: January 29, 2016, 03:36:03 PM »
Most conducted and radiated EMI is caused by common mode noise on signals entering or exiting a box. If you tie your box ground to digital ground with a very low DC and RF impedance (large, fat and very short connections) at the point a signal exits or enters the box the common mode noise is significantly reduced. On the power leads a capacitor (e.g. 470nF) with a low RF ground connection to chassis (short, fat connections) tends to get rid of a lot of power-line conducted EMI. A 5mm wire will have significant impedance at RF frequencies and will do very little to stop it, you need wide, fat and very short connections.
Mark.

1.  Just how fat and how short does it need to be? 

If 5mm is already too long, then I guess that by itself might explain why the 47-ohm antenna "short" I tried seemed to work so poorly.   ::)

2.  Unrelated:  Since the RFM69's radio is being driven by a 32Mhz crystal, does that make it more likely that the RFM69 could be getting EMI/RFI directly from the rest of the Moteino, which, IIRC, typically operates at 8Mhz?  I guess the hypothesis would be that whatever up-converts the 32Mhz crystal frequency up to 915Mhz might be upconverting whatever noise/harmonics there might be also.

Maybe a ghetto way to test the hypothesis would be to see whether the Moteino can receive a distant node while the RFM69 is in Listen-Mode, with the rest of the Monteino asleep, that it can't otherwise receive with the Moteino fully powered on?  Such a test would be easier said than done, I realize.  Perhaps someone reading this has proper instrumentation and could check for it directly without resorting to ghetto methods.

However, if it turns out to be true, then it would be good to know: for instance, maybe running a modified Moteino at a much lower speed, like 1Mhz, would yield reduced EMI/RFI?  If such a modification were made, it could at least be tested for effect using the RSSI measurements being discussed on the other thread.

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #23 on: January 29, 2016, 05:56:58 PM »
I've just had a look at the Moteino schematics.

Switching noise may well be getting into the radio due to lack of decoupling, and changing the MCU frequency may have an effect. The first thing I would try though is add some decoupling caps to the MCU power pins (low inductance connections as close as possible to the pins, use 100nF multilayer ceramics). Ideally a ferrite filter too if you can. Putting a decoupling cap and ferrite filter on the radio's supply could also help.

Mark.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1296
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #24 on: January 30, 2016, 02:20:08 PM »
Would removing the voltage regulator and powering directly from a battery accomplish the same thing?  Or would the decoupling caps still be advisable even there.

We're starting to narrow down the source(s).  Maybe, though, it's already nearly as good as it will ever get.  -121dB is the lowest RSSI that I can recall measuring so far, and that's pretty close to the -127dB theoretical limit (well, the lowest that the hardware can represent anyway).

« Last Edit: January 30, 2016, 02:30:29 PM by WhiteHare »

emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #25 on: January 30, 2016, 05:51:48 PM »
@WhiteHare,

Chasing those last uV of RF noise can be a challenge. An alternative path would be to switch to battery power and provided you can buffer up enough readings, put everything in an 'Altoids' tin.  Right now you are still seeing a combination of several noise sources:

 * Internal to the RF chip
 * Conducted hash through power, asynch etc connections
 * EMI coupled into the RX pin (I'm assuming your solder blob is at ANT, not the chip RX pin)

Completely encasing and switching to battery power will substantially reduce the last two.


WhiteHare

  • Hero Member
  • *****
  • Posts: 1296
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #26 on: January 30, 2016, 10:13:32 PM »
(I'm assuming your solder blob is at ANT, not the chip RX pin)


Yes, see attached photo.

An alternative path would be to switch to battery power and provided you can buffer up enough readings, put everything in an 'Altoids' tin. 

I agree.  I'm thinking I could buffer the readings into the non-volatile memory and then play it back from there after opening the can.  So, I'm slowly inching my way toward that.  Perhaps we'll get lucky by going these extra steps and identify a cause that can be mitigated.  Anyhow, there's no way of knowing without pressing on a bit further.

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #27 on: January 31, 2016, 06:30:52 AM »
Changing to battery could help. There are two issues here I think. Conducted interference, where reducing the source noise and ferrite filtering on the MCU and radio power pins will help, and radiated noise. The Vdd is tracked, meaning switching noise from gulps of current that the MCU takes on its power pins are forced to travel in loops under the radio module, those are magnetically coupled near field interference sources for the radio. You'll need some decoupling very close to the MCU's power pins to reduce those, that would also help E field coupling as well.
Mark.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1296
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #28 on: February 01, 2016, 04:47:26 PM »
By itself, changing to battery didn't make much difference:
http://pastebin.com/v45TquBG
No USB connection, and DTR wired to ground.

Now, here are the RSSI measurement results taken inside a sealed metal can while running on battery power (obviously, no USB connection) and with the Moteino DTR pin wired to GND:
http://pastebin.com/iGDFq869

Do you see any meaningful difference?

So, that clears up one theory.  Whatever noise or RFI there may be can't be coming  from coming outside the metal can.  Whatever EMI/RFI there may be originates within the metal can, and the only thing there is a battery connected to Vin and GND on the solder tacked Moteino, and a dupont wire connecting the DTR pin to GND.

So, at least that narrows the list of possible causes.
« Last Edit: February 01, 2016, 04:57:55 PM by WhiteHare »

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #29 on: February 01, 2016, 05:28:25 PM »
There is an MCU directly underneath the radio with no decoupling on its power pins, no ferrite filtering on Vdd, tracked in Vdd and no ferrite filtering or decoupling on the radio's power pin. Have you eliminated the MCU's switching noise from this?

Also the noise floor will depend on the width of the RxBw filter, you should program that to the narrowest possible.

Mark.