Using FrSky RSSI & Battery Sensor for MultiWii & MinimOSD?

Post Reply
subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Using FrSky RSSI & Battery Sensor for MultiWii & MinimOSD?

Post by subaru4wd »

I just picked up a MinimOSD and im running the KV firmware. Everything is great, but I dont have RSSI or battery voltage on the OSD. But I do have them on my FrSky RX, and FrSky LCD. I am curious how I would send that data to my MW Controller so that the MinimOSD can see it?

I am already familiar with this guide: https://code.google.com/p/rush-osd-deve ... dware_Mods

But I would rather not solder to the tiny pins on my OSD if I do not have to.

Thanks in advance :D

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by QuadBow »

The question is: what Frsky receiver do you have?

subaru4wd wrote:I am already familiar with this guide: https://code.google.com/p/rush-osd-deve ... dware_Mods

This won't help you, if you own a receiver without rssi output pin.

There is an instruction for the D8RII-Plus in order to overcome the missing rssi pin.
Look at http://www.fpvhub.com/?topic=1955.0. But, you have to solder on the receiver.

I don't see the need to solder on the OSD board, since the rssi could be received by the flight controller board
and forwarded to the OSD board via serial USART (rssi is included in the related protocol).

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by subaru4wd »

Yes exactly what I needed to know.

Now i need to know how to get that RSSI through the flight controller.

And if I use CPPM doesnt the D8RII+ have a RSSI pin?

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by QuadBow »

subaru4wd wrote:And if I use CPPM doesnt the D8RII+ have a RSSI pin?


Frsky documentation is a bit poor, in particular for the cppm firmware which is seen as a beta version.
But, I remember having read that only the 8th channel is changed to CPPM, the other 7 channels remain PPM as before.
Unfortunately, there is no additional pin available for rssi.

Peter
Posts: 82
Joined: Mon Jun 11, 2012 2:09 pm

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by Peter »

Maybe you can flash the xp firmware:
http://www.youtube.com/watch?v=IHjJ1QHV32Y

I'm using the d4r-II receiver by the way. Light, 8 channel ppm and Rssi pin!

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by subaru4wd »

This is the RX i have and it says there's a RSSI output if i short some pins.
http://www.alofthobbies.com/frsky-d8r-xp.html

So are you saying that is incorrect and I will not get RSSI out? Any idea about the voltage sensor? I'd love to get MAH on my OSD.

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by QuadBow »

subaru4wd wrote:So are you saying that is incorrect and I will not get RSSI out? Any idea about the voltage sensor? I'd love to get MAH on my OSD.


No, I am talking about the D8RII-Plus. That was the reason why I asked which receiver do you own.
QuadBow wrote:The question is: what Frsky receiver do you have?


I can't say anything about the mentioned D8R-XP. Just try out whether Frsky documentation is clear and correct.

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by subaru4wd »

Im sorry quadbow, I should have clarified with my first post what RX I was using.

Do you know where on the MultiWii board I need to send the RSSI signal? Also, I found this current & voltage sensor and was wondering where on the MWC board I need to connect it. http://www.rctimer.com/index.php?gOo=go ... oductname=

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by subaru4wd »

Peter wrote:Maybe you can flash the xp firmware:
http://www.youtube.com/watch?v=IHjJ1QHV32Y

I'm using the d4r-II receiver by the way. Light, 8 channel ppm and Rssi pin!


Peter can you give me some details about your setup? I have a flying wing that only needs a 4ch receiver, and the D4R-II sounds like what i need. Thanks :)

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by QuadBow »

subaru4wd wrote: I should have clarified with my first post what RX I was using.

No problem ;-)

subaru4wd wrote:Do you know where on the MultiWii board I need to send the RSSI signal?

The related code is already implemented in the file multiwii.ino (at least in version 2.2):
#if defined(RX_RSSI)
static uint8_t sig = 0;
uint16_t rssiRaw = 0;
static uint16_t rssiRawArray[8];
rssiRawArray[(sig++)%8] = analogRead(RX_RSSI_PIN);
for (uint8_t i=0;i<8;i++) rssiRaw += rssiRawArray[i];
rssi = rssiRaw / 8;
#endif
This routine reads one analog input pin and filters its value.

In order to use it, you just have to uncomment the related definitions in config.h:
#define RX_RSSI
#define RX_RSSI_PIN A3
In this case you have to connect the rssi output of the receiver pin to the analog pin A3 of the multiwii flight controller.
(For security reasons with an 1k resistor in between.) The rssi value is forwarded by the multiwii protocol via serial
(serialize16(rssi) in serial.ino) and should be used by rushduino (at least in the current version).

subaru4wd wrote:Also, I found this current & voltage sensor and was wondering where on the MWC board I need to connect it.

You also can enable the powermeter funcion which monitors the battery capacity by uncommenting
#define POWERMETER_HARD
in config.h.
The related pin is due to file def.h:
#define PSENSORPIN A2
But, you have to adapt some parameters in order to adjust the accuracy:
#define PLEVELSCALE 50 // if you change this value for other granularity, you must search for comments in code to change accordingly
/* larger PLEVELDIV will get you smaller value for power (mAh equivalent) */
#define PLEVELDIV 5000 // (*) default for soft - if you lower PLEVELDIV, beware of overrun in uint32 pMeter
#define PLEVELDIVSOFT PLEVELDIV // for soft always equal to PLEVELDIV; for hard set to 5000
#define PSENSORNULL 510 // (*) set to analogRead() value for zero current; for I=0A my sensor gives 1/2 Vss; that is approx 2.49Volt;
#define PINT2mA 13 // (*) for telemtry display: one integer step on arduino analog translates to mA (example 4.9 / 37 * 100

Have fun!

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by subaru4wd »

Image

Bummer, it doesnt look like my board has a A3 pin??

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by QuadBow »

Strange, a flight controller without A0...A7. It might be, that A0 is used internally for vbat measurement.
It seems that the first analog pins are not connected. I can not recognise any reason to build a board diverging from the multiwii standard.

Anyway, you can overcome this problem easily by defining
#define RX_RSSI_PIN A8
or whatever pin you like to connect to rssi instead of
#define RX_RSSI_PIN A3

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by subaru4wd »

Quadbow, thanks a million for helping me understand all of this. It is all very new to me, and I am trying my best not to sound like a complete and total Newb.

A8 through A11 are used for my stick inputs (pitch/roll/yaw/thr) and A12 through A15 are my aux input channels So I assume in order to get the RSSI, i will need to lose one of my Aux Inputs? Is there any further code I have to edit to avoid conflicts, if I were to say... use A15, and lose Aux4 (which is currently set to control the gimbal).

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by QuadBow »

subaru4wd wrote:A8 through A11 are used for my stick inputs (pitch/roll/yaw/thr) and A12 through A15 are my aux input channels


You are right, multiwii takes these analog pins as receiver pins-maybe my proposal was not that good.
#define THROTTLEPIN 0 //PIN 62 = PIN A8
#define ROLLPIN 1 //PIN 63 = PIN A9
#define PITCHPIN 2 //PIN 64 = PIN A10
#define YAWPIN 3 //PIN 65 = PIN A11
#define AUX1PIN 4 //PIN 66 = PIN A12
#define AUX2PIN 5 //PIN 67 = PIN A13
#define AUX3PIN 6 //PIN 68 = PIN A14
#define AUX4PIN 7 //PIN 69 = PIN A15

But there are always some ways around:
1. As you proposed forget AUX4. But, if you want to insert another device like a powermeter you are running out of spare AUX.
2. Solder the rssi-cable directly to the atmega-pin. (Don't take this proposal serious. Soldering these pins is no fun. The pitch is only 0.5mm.)
3. Use the CPPM mode of the D8R-XP which allows to tranfer all receiver information over just one line. <= This is the highly recommended solution!

Due to Frsky documentation http://www.frsky-rc.com/ShowProducts.asp?id=126 you can change to the CPPM mode as follows:
2) RSSI (PWM) and CPPM output - If CH3 and CH4 are connected by a jumper, CH1 will output CPPM for CH1~CH8, and CH2 will output RSSI (PWM);

Hardware cabling:
connect CH1 of the receiver (CPPM) to a serial port (the mega has 4, multiwii standard is RX1 (you need only the RX pin)) of your board
connect CH2 of the receiver (RSSI) to one of the 8 available input pins, which are free now

Software configuration in config.h:
uncomment #define SERIAL_SUM_PPM ROLL,PITCH,THROTTLE,YAW,AUX1,AUX2,AUX3,AUX4,8,9,10,11
for enabling the CPPM mode and define RX_RSSI_PIN A8 as explained before.

Additional hint:
You have 4 serial ports, that should be enough for the first like the following example explains
0: for PC or bluetooth connection
1: for receiver
2: for GPS
3: for Telemetry
But, if you want to free one serial port you can swap the receiver CPPM cable to A8 by uncommenting
#define PPM_ON_THROTTLE

Another very important hint:
For the CPPM mode a firmware update is highly recommended. It avoids the channels to be mixed up at full amplitude of all channels
and makes the warning to use only 6 channels obsolent.
Go to http://www.frsky-rc.com/DownloadItem.asp , select your receiver and download the firmware to be found in the betatest section.

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by subaru4wd »

QUADBOW YOUR A FREAKING GENIOUS! Thanks for reminding me about CPPM! I will be forced to use CPPM in order to get RSSI output, so i should have plenty of spare A pins to use!

What a relief, thanks again. I want to update the firmware on my FrSky receivers but I do not have the FrSky update cable. Is it possible to update the FrSky receivers using a FTDI adapter?

Also, would I use a serial port for the Voltage & Current sensor??

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by QuadBow »

subaru4wd wrote: Is it possible to update the FrSky receivers using a FTDI adapter?


Frsky uses inverted signals. That's the reason you have to invert the signal again.
It's the same as for the telemetry connection, there a hardware inverter is required.

In your case, things are pretty easy:
Yes, you can use a FTDI adapter, you just have to configure it by
running the program FT_Prog.exe, parsing for devices, select hardware specifics and inverted signals.

subaru4wd wrote:Also, would I use a serial port for the Voltage & Current sensor??

No, those devices require analog pins like A8-a15, which are free because of the use of CPPM.
You just have to configure the related definitions.

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by subaru4wd »

So I have gathered all the pieces to get this job done.

I have my new FrSky receiver that supports CPPM and RSSI out, so no need to worry about any firmware upgrades. I also have my voltage & current sensor ( http://www.rctimer.com/index.php?gOo=go ... oductname= ) Now I am sorting through MultiWii 2.2 code. Im pretty sure I have the sketch setup the way I need it, but now I'm a little worried about where the V, I & GND on this voltage sensor need to connect to my flight controller? Do they use the spare A pins like the RSSI & CPPM will use?

QuadBow
Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by QuadBow »

subaru4wd wrote:Im pretty sure I have the sketch setup the way I need it, but now I'm a little worried about where the V, I & GND on this voltage sensor need to connect to my flight controller?


My guess would be:
The GND pin/cable must be connected to the board's GND,
V and I must be connected to a spare analog pin each.

In config.h you have to uncomment
#define POWERMETER_HARD
and to adapt the following parameters
#define PLEVELSCALE 50 // if you change this value for other granularity, you must search for comments in code to change accordingly
#define PLEVELDIV 1502 // (*) default for soft - if you lower PLEVELDIV, beware of overrun in uint32 pMeter
#define PLEVELDIVSOFT PLEVELDIV // for soft always equal to PLEVELDIV; for hard set to 5000
#define PSENSORNULL 0 // (*) set to analogRead() value for zero current; for I=0A my sensor gives 1/2 Vss; that is approx 2.49Volt;
#define PINT2mA 13 // (*) for telemtry display: one integer step on arduino analog translates to mA (example 4.9 / 37 * 100
(I will use the same adapter in the future, so, I have calculated the values already for preparation purposes.
My assumption is a cycle time of roughly 3000us. Finetuning of PLEVELDIV could be required.)

Furthermore, you have to change in def.h:
#define PSENSORPIN A2
to the analog pin you want to use for the current input.

So far for the current sensor, now the configuration of the voltage sensor:

In config.h you have to uncomment
#define VBAT // uncomment this line to activate the vbat code
and to adapt
#define VBATSCALE 21 // (*) change this value if readed Battery voltage is different than real voltage
(I will use the same adapter in the future, so, I have calculated the values already for preparation purposes.
My assumption is a voltage of a 3 cells accu pack. Finetuning of VBATSCALE could be required.)
and
#define BUZZER

Furthermore, you have to change in def.h:
#define V_BATPIN A0
to the analog pin you want to use for the voltage input.

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by subaru4wd »

Great, that is exactly what I needed to know. Thanks once again Quadbow!

Now back to editing code...

Commando
Posts: 6
Joined: Mon Jan 19, 2015 11:22 am

Re: Using FrSky RSSI & Battery Sensor for MultiWii & MinimOS

Post by Commando »

Hey guys, my RSSI values are 0-0.35V, how can I change the range from 0-5V that analog reads to 0-0,35V?
I changed the values of rssi code in multiwii.cpp but with no luck.
At KV OSD (minimosd serial connected) I changed the range values from 0-255 to 0-35 and works fine on OSD.
Also works fine at EZ GUI but shows 1-3% and the why I want to change the analog range.
At PC GUI doesn't shows anything at telemetry :(

Post Reply