Welcome to Multi-Rotor UK. Please login or sign up.

Thursday,March 28, 2024, 13:34:48

Login with username, password and session length

Shoutbox

Bad Raven:
26 Mar 2024 08:41:05
 :(
Andy7:
25 Mar 2024 14:49:21
An excess of work and rain.  :thumbdown:
Bad Raven:
23 Mar 2024 18:12:38
Almost a personal Blog, it would seem. LOTS of members, but NO posts.  :-/   :shrug:
Gaza07:
06 Mar 2024 16:59:49
Anyone still here  :shrug:
ched:
24 Dec 2023 11:48:48
Hope you all have a Great Christmas and a happy New Year.
Bad Raven:
20 Dec 2023 06:17:47
 ~~   :beer2: 
Gaza07:
19 Dec 2023 22:20:27
Merry Christmas All  :beer2:
Bad Raven:
01 Dec 2023 06:59:57
New Simulator Section started!   :beer2:
Bad Raven:
17 Jun 2023 06:52:23
Yes, smaller, same as lots of things as time passes.
Andy7:
08 Jun 2023 22:49:18
 ~~
Members
Stats
  • Total Posts: 201,420
  • Total Topics: 20,260
  • Online today: 31
  • Online ever: 530
  • (Tuesday,June 26, 2012, 08:34:46 )
Users Online
Users: 1
Guests: 27
Total: 28

Theme Changer





3d - Printworx

Make your own Digital to Analogue converter

Started by teslahed, Wednesday,August 28, 2013, 22:44:11

Previous topic - Next topic

teslahed

You need a digital to analogue converter to turn a digital signal into an analogue signal.

Why would you want to do this? Many receivers (like the openLRSng system) can output a Received Signal Strength Indicator (RSSI) which is a value that shows the reception signal quality your multirotor is seeing. This is useful when flying FPV as it allows you take note when reception is getting poor and turn around and come home before it gets too bad to fly. RSSI is often output as a PWM digital signal but many On Screen Displays (OSDs) and some flight controllers can only take this signal in as an analogue input. I will be inputting this signal to a free analogue input pin on the crius all in one pro flight controller i currently use.

I copied this diagram;



The 10uF capacitor value i used above is 100 x too high . I am trying again with a 0.1uF (0.1uF = 100nF) capacitor as suggested in the most recent readme file;

https://github.com/openLRSng/openLRSng/blob/master/README.md

RSSI output at ';first'; port (marked as RSSI on OrangeRX / ch1 on Flytron) 32kHz PWM signal. To make this analog you can use a simple RC filter (R=10kOhm C=100nF). Ports 2-9 are parallel PWM outputs for channels 1-8 (50Hz).

keeping all the components as small and inline as possible to keep the end result compact and light. I don';t want to add too much weight to the fpx hexacopter if i can avoid it. I haven';t outputed the ground on both sides as i am running my system from 1 lipo so all the grounds are shared / common. I don';t think i run any risk of forming a ';ground loop'; doing things this way but i may have missed something...



Total weight - 5.8 grams. And i will probably be chopping a good half a gram of red wire off the thing before i use it :smiley:

More details coming tomorrow after test flying.

Components used;

1 x Standard 10k Resistor (avaiable from all good electronics stores).

http://www.bitsbox.co.uk/resistors/cfr.html

1 x 0.10uF Electrolytic Capacitor (same as above).

http://www.bitsbox.co.uk/capacitors/Low_ESR.html

Misc lengths and sizes of transparent heatshrink (or coloured stuff if you aren';t posing for the cameras like mine was above).

1 x Old servo wire cut to length (taken off a broken servo).

1 x torroid inductor (taken from an old broken ESC).

1 x length of awg 20 wire.

One circlip short of a quadcopter.
 1 lobe short of an antenna.

teslahed

#1
This circuit also functions as a low pass filter;

http://www.multi-rotor.co.uk/index.php?topic=2985.msg23936#msg23936

And similar circuits are used along with inductors to filter out high frequency interference from video signals to improve range and reception.

http://youtu.be/OBM5T5_kgdI?t=6m24s

This video explains why a low pass filter also works as a digital to analogue converter. I';ve linked to the relevent section but the whole thing is worth a watch.
One circlip short of a quadcopter.
 1 lobe short of an antenna.

teslahed

Just did a quick test of the RSSI on the hex indoors.

With the hex powered up and everything on (but disarmed) i get 74dBc stood directly besides the hexacopter.

With the hex powered up and me 2 floors down, directly underneeth the hex and the aerial pointing straight up to put the hexacopter in the dead zone - i get 65dBc.

The values were updating roughly once per second or second and a half.

Does this sound sensible to people that have used RSSI before?
One circlip short of a quadcopter.
 1 lobe short of an antenna.

teslahed

I have used a digital to analogue converter with these values;

Quote(R=10kOhm C=100nF)

https://github.com/openLRSng/openLRSng/blob/master/README.md

I have the output from the digital to analogue running into analogue pin 3 and enabled the parts in the multiwii config;

  /********************************************************************/
  /****                             RSSI                           ****/
  /********************************************************************/
    #define RX_RSSI
    #define RX_RSSI_PIN A3


I have used Multiwiii EZ-GUI on my phone via bluetooth to check the values i';m getting. It shows;

TxRSSI = 74dBc when everything is turned on and working and i have the radio in the same room as the hexacopter.

TxRSSI = 60dBc (or there abouts) when i walk down 2 flights of stairs and put some concrete in between myself and the hex (bluetooth was still connected:))

TxRSSI = 0dBc when i turn the radio off.

So this looks about right?

Hooking up my video system I see 0% when i turn the hex on before i turn my radio on, which then slowly starts climbing to 100% - which seems odd.

If i turn my radio on in the same room as the hex it stops climbing (or climbs faster if i';m quick) then stabalises at 65%

If i walk down two flights of stairs it drops down to 20% on the video display and  74dBc to 60dBc on the phone display as before.

It looks like i have something wrong with the scaling?

The one part of this process i do not understand very well is;



Can anyone offer any suggestions on improving my results? Thanks:)
One circlip short of a quadcopter.
 1 lobe short of an antenna.

The.Quadfather

chris

did you consider using a forward biased diode (eg 1N4148) instead of your resistor ?
this would have the advantage of a smoother dc output since it will stop the backwards flow of current when the Rx output is 0
would also mean you could use a much smaller capacitor <10uF

the diode will reduce the Rx output by a fixed voltage - typically 0.5v

teslahed

I didn';t consider that - i just used the basic circuit as outlined in the OpenLRSng readme file. I may try your suggestion next if you think it';s better though.

http://youtu.be/Iuc9Z8p_9QU

First test flight. My RSSI signal barely dips below 100% and when it does occasionally it looks more like a glitch than anything else. Maybe i need to fly further away?

I tested the RSSI indicator indoors using a resistive load on my transmitter instead of a proper aerial. I was getting a nice smooth reduction in RSSI signal strength from 100% down to 20% when walking from the top floor of my house to the bottom so perhaps i just haven';t flown far enough yet?
One circlip short of a quadcopter.
 1 lobe short of an antenna.

The.Quadfather

actually, come to think of it, I';m not sure a diode is a better option !

the RSSI output is I assume a PWM output, so using a diode will ignore the PWM hi/lo duty cycle always giving a constant voltage - so not what you';re wanting....

I havn';t checked RSSI levels much, what do you get if you turn your Tx off - removing props beforehand  ;)

teslahed

It goes down to zero (or actually 3% sometimes for some reason) as soon as i turn the transmitter off.
One circlip short of a quadcopter.
 1 lobe short of an antenna.