inav icon indicating copy to clipboard operation
inav copied to clipboard

Implement underclocking for F1/F3 targets (possible interference with 433MHz LRS)

Open digitalentity opened this issue 9 years ago • 46 comments

Quite a while ago (before going to airplanes) we removed emf_avoidance option. But F1 and F3 chips run at 72MHz, 6-th harmonic of which is 432MHz. This may cause issues with LRS operating in that band.

We need to think about a way to reduce interference to LRS to allow long-range airplanes to use INAV safely.

digitalentity avatar Feb 09 '17 08:02 digitalentity

Can emf_avoidance simply be reinstated? Why was it removed? What other options are there?

I also need this for UHF setups on planes.

csurf avatar Feb 09 '17 13:02 csurf

emf_avoidance was overclocking the CPU thus violating the specs and making the system potentially less stable. We'll look into putting it back with possibility of underclocking the CPU instead

digitalentity avatar Feb 09 '17 13:02 digitalentity

Yes, this should certainly be addressed by underclocking, not overclocking. Do we have any actual evidence of interference?

martinbudden avatar Feb 09 '17 14:02 martinbudden

No, not yet. I'll try collecting some using a spectrum analyzer.

digitalentity avatar Feb 09 '17 15:02 digitalentity

Why not allow slight overclock if people are using it with success?

My general impression is that these chips often can handle light overclock?

Could we have some steps to take to ensure checking that chip will handle the overclock?

oleost avatar Feb 09 '17 15:02 oleost

Violating the specs is generally a bad idea. Manufacturers spec the chips to 72MHz for a reason - while 90% might work on 84MHz just fine, the remaining 10% might exhibit random unexplainable failures.

digitalentity avatar Feb 09 '17 15:02 digitalentity

It's one thing overclocking something sitting on your desk. Overclocking something that is flying through the air is not a good idea at all. Even if the failure rate is only 1% I don't think it is acceptable.

martinbudden avatar Feb 09 '17 15:02 martinbudden

I really would like to know how realistic this scenario is. It's not like CPU or FC has something long enough to act as an antenna and radiate enough EM emissions to be able to interfere with something few centimeters from it (but more probably much further).

DzikuVx avatar Feb 09 '17 21:02 DzikuVx

@DzikuVx like you know I made some boards in the past with F1 and RFM22B on the board and have no problems with long range fly - max was 53km but the limit was battery not RC link (and 1W power on Tx side). But that board using 16Mhz quartz if this change something. Now have new board also with embedded RFM22b as RC link but based on F3 + 8Mhz quartz and everything seems to work fine with no tricks. For now tested only on 23km with stable RSSI > 70%, more test when weather will be better.

So I think it is not a big problem because this problem is mostly related with planes where you can put RX far away from FC.

marbalon avatar Feb 09 '17 21:02 marbalon

Well, this is my point. I'm really not sure we should care about that

DzikuVx avatar Feb 09 '17 21:02 DzikuVx

Ok, I took an OpenLRSng module and used it as a spektrum analyzer. This is the picture of ambient noise in my room when only PC and OpenLRS module are powered up: image

And this is the picture of ambient noise when I have a powered-up CC3D placed 5cm(!) away from OpenLRS antenna: image

There is a slight increase of noise level near 432MHz (precisely 6th harmonic of 72MHz), but that's negligible.

Here's the spectrum of ambient noise when I have OpenLRS module on the wing of my Z84 (AirHeroF3-controlled, powered-up and ready to go): image

Just for comparison - this is the spectrum of 433.92MHz remote garage door opener operating in the next room (hardly a few milliwat power, 10m distance and a brick wall between remote and OpenLRS): image

digitalentity avatar Feb 10 '17 02:02 digitalentity

Bottomline - FC hardly has any effect on 433MHz spectrum. Definitely not worth the effort implementing the underclocking feature.

For those who fear the RF noise - It's always best practice to put RC receiver as far from other electronics as possible.

digitalentity avatar Feb 10 '17 02:02 digitalentity

Sorry for re-opening, guess I saw this too late. If implementing underclocking is too much effort, it would be nice if you could atleast consider re-adding that overclocking feature.

The screenshot shows that the flightcontrol affects the 433MHz spectrum. If you switch the display to dbm, you can see that the flight control generates a signal that looks like something around 18db (!) above the noise floor. (One "20 point step" in the RSSI graph is 10db). 18db above noisefloor means you have 100x the energy in the "air".

Even when compared to the quite-high noisefloor in your area around 433MHz, this looks still like something around 3-6db. 6db means reduction to half range. Or to put it differently, to get the same range with the flightcontrol running, you need 4x the transmit power on your LRS transmitter to get the same range as without.

rodizio1 avatar Feb 11 '17 18:02 rodizio1

@rodizio1 What happens if you do the same test with overclock feature turned on ( Use and old version or Cleanflight )

oleost avatar Feb 11 '17 20:02 oleost

It behaves exactly as expected, the harmonic moves from 432Mhz to 504Mhz. Made these graphs with a DVB-T dongle with a cheap DVB-T antenna which is not really made for such low frequencies. So with a real 433Mhz antenna it would look even worse.

Cleanflight 1.13 on a Afroflight rev5 with emf_avoidance = OFF cleanflight-emf-avoidance-off-3

With emf_avoidance = ON cleanflight-emf-avoidance-on-3

rodizio1 avatar Feb 11 '17 21:02 rodizio1

@digitalentity ?

oleost avatar Feb 11 '17 21:02 oleost

@rodizio1 a question re your test - how far your FC was from receiver antenna? Was this a realistic test where your receiver is placed at least 30-40cm away from your flight control? What was connected to your FC?

This harmonic thing is interesting. Clock is essentially a square wave which should only have odd harmonics, so we shouldn't be seing 6-th harmonic at all - meaning we are seing interference caused by something else. @rodizio1 can you repeat your test with iNav on the same board and in the same environment?

digitalentity avatar Feb 12 '17 00:02 digitalentity

@digitalentity , we should probably just implement the underclocking option. It's not difficult and will allow users to experiment.

martinbudden avatar Feb 12 '17 09:02 martinbudden

To keep native USB operational we'll have to underclock from 72MHz down to 48MHz. USB controller operates on 48MHz and there's only 1 or 1.5 divisor possible for USB clock. If this is acceptable - let's do it.

digitalentity avatar Feb 12 '17 10:02 digitalentity

Yes, let's do it. 48MHz clock should work for some setups, if not all.

martinbudden avatar Feb 12 '17 12:02 martinbudden