KV Team Multiwii OSD

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
ABL
Posts: 72
Joined: Tue Dec 25, 2012 12:12 pm
Location: Lithuania

Re: SW Development on Minim Osd

Post by ABL »

kataventos wrote:Wish you all the luck with your Multirotor gadget setup with the hope you can have it working 100% sometime soon.

Nah, tossed it away immediately after testing current sensors. Replaced with another OSD, feel great - there's no morons in dev team.

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

:D OK those are awesome news!

thanks anyway for passing by, your contribute was very important for the developments.

Bye Bye

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

hi guys, just away and cant run the code but browsing the repo's new amperage code and had a couple of questions:

Code: Select all

 amperage = analogRead(amperagePin)- Settings[S_AMPOFFSET] /2;

why you divide by 2 ?

Code: Select all

if (amperage >=999) amperage=999;

and why limit to 999 ?

regards,
Hayden.

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

Hey Hayden,

/2 is the same as subtract 512.
Because the sensors have their own sensitivity if you have a sensor with at zero 1v or 2v or even 2.5v you can just adjust the offset which is working just fine here.

NOTE that I am reduced to the hardware I have so, it would be nice to have some more feedback. I can perfectly tune it at power on 0.5 of consumption which is normal considering the FPV gear and up to 65amps on full throttle.

The code was always limited to 999, not only because the number of chars but because I do not think you have a current sensor reading more then 100Amps ;) this new line will spare you extreme inaccurate readings... 99.9Amps is the most reasonable value.

Cheers,
-KV

PS: About the /2... I can always change it for a new adjustment if this reveals not... let´s say "universal" ;) I am far from home but Carlo can eventually take a look and also test it this weekend as far as I know from last night emails.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

kataventos wrote:Hey Hayden,

/2 is the same as subtract 512.
Because the sensors have their own sensitivity if you have a sensor with at zero 1v or 2v or even 2.5v you can just adjust the offset which is working just fine here.

NOTE that I am reduced to the hardware I have so, it would be nice to have some more feedback. I can perfectly tune it at power on 0.5 of consumption which is normal considering the FPV gear and up to 65amps on full throttle.

The code was always limited to 999, not only because the number of chars but because I do not think you have a current sensor reading more then 100Amps ;) this new line will spare you extreme inaccurate readings... 99.9Amps is the most reasonable value.

Cheers,
-KV

PS: About the /2... I can always change it for a new adjustment if this reveals not... let´s say "universal" ;) I am far from home but Carlo can eventually take a look and also test it this weekend as far as I know from last night emails.


i am also away from home so no rush, i will look into it more when can actually test it, just bored so browsing it.

with 999 limit you are confusing 'amperage' variable with actual amperage value. in the case i point out 'amperage' variable is the arduino analog pin reading of between 0 and 1024, thus why i enquire about why you limit it to 999 ? it should have access to full range of analogread which will self limit between 0 and 1024 (or burn out :( ).

in regards to the /2 im still not sure what it does that you cant do by specifying a offset setting of half. what does it do that cant be done by the adjust-ability of the offset setting ?

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

confusing? no... look more thru the code and you will find out. Also you´r on screen.
Anyway, just test it and report it back if you please. Also this was tested with Witespy´s for the record... :mrgreen:

About news with your stuff thru MWii??? any??

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

sure i will have to test it, but im still sure that the analogread of the amperage pin should not be limited to 999

About news with your stuff thru MWii??? any??


sorry what do you mean about this ?

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

weren't you going to check and report if your MWii implemented "patch" is OK with latest dev?? I was waiting for that since you offered... 8-)

As for the other questions, please look carefully at the entire code regarding that particular case, I´m sure you will find answers. Besides it is good to spend some time around the real thing during the weekend...

In case you find a better solution you can always post it, we will thankful for it. I see you did not modified your clone of the KVTeam´s work, is it better that way? Maybe I have self introduced a bug on something that was working fine!? I am not sure at this time with so many questions... :mrgreen: Maybe those lines are working just on my gear.

I will fly some packs with my RCTimer mounted as soon as I got home on January 3. Than I will check with the amount of current needed to charge them again (just to be precise)... Also if some strange stuff happen like overflows, overruns, or even burn outs I will be right back to report ;)


Cheers,
-KV

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Currest sensors

Post by carlonb »

Hi haydent,

About the apparent limit of current sensor to 999 (99.9A), this is a long story. But I think it's correct
because the sensors normally used here have 100A limit.

I will try to explain this long story:
The analog read, reads the voltage out from sensor and will change from 0V to max 5V due the current load, so
the result of analogic readings will be from 0 (zero) to 1023 "steps", they are steps NOT amperes.
To convert the steps to Amp we need a formula that depend of the type of Curr Sensor and its sensitivity.

The actual KV team OSD formula, i think, is specific for a current sensor with max 100A and unidirectional type
(means no matter about the current sign, or current versus) and the result is near to reality.
But for a proper calculation we need to do as follows:
The No-Load Vout from sensor will be 0V so 0 "Steps" (theoretically).
At 100A load, the sensor Vout will be 5V so 1023 "steps" (theoretically).
So to convert the steps to Amp we need to calculate the voltage and then, with the sensor
"sensitivity" in mV/A (for example 40mV/A), calculate the real Amperes.

After this, the result will be multiplied by 10 as we want one decimal digit after decimal point (999 -->99.9A)
and this is done by the print screen routine in OSD s/w.
Now here you can understand the "limit" question you asked.

Formula for unidir sensor with 0.040V/A sensitivity and max 100A:
Current [A*10]= (analogRead(pin1)*(5.00/1024))/0.040*10; (Not tested !)

With a bidirectional sensor (like mine with +/-45A and 0.017V/A) we have:
No load, the sensor Vout is 2.5V (512 steps)
45A (current flow positive related the sensor main +/- connection) the Vout=5V (1023 steps)
-45A (current flow negative related the sensor main +/- connection) the Vout=0V (0 steps)

I've installed the sensor in order to use the positive flow, so in this case I need to subtract
an offset of 2,5V (or 512 steps) theoretically.

Formula for bidir sensor with 0.017V/A sensitivity and max +/-45A:
Current [A*10]= ((analogRead(1)*(5.00/1024))- 2.5)/0.017*10
Current [A*10]= ((analogRead(1)-512)*(5.00/1024))/0.017*10 equivalent to the above formula. (Tested)

Now I'm working on this simulating and verifying in order to find a way to make the setup simple for
any type of sensors.

I'm sorry if I was not so clear, if you have any question you may ask.

Cheers
carlo

Stars112
Posts: 36
Joined: Wed Jan 30, 2013 9:29 pm

Re: SW Development on Minim Osd

Post by Stars112 »

Hi,
I found today a Little Bug in the GUi.
After Setting up 4S Battery i can't Set the Alarm to 13,2V.
Only 10,5v is possible.
On Tv, whith stick setup it is possible to Set the Alarm to 13,2.

Probertly we can Set a cell Voltage like 3,3v to configure the Alarm?


is it right that the rssi in the ppm Signal from a Jeti rx not in the seriell Signal is?
I can't display the rx Signal to the tv:-(

Greetings, Marc

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

@kat
modified your clone of the KVTeam´s work

it needs to be brought up to you current code, we will keep it the same, just with a few additions
"patch" is OK with latest dev??

if you mean my amperage in msp one, then yes, its in current stable.

@car
thanks for your detailed response, i understand how the sensor amperage is read and calculated.

but you too are missing my point. in the code you are limiting the analog read 'step' value to 999 before it can even be converted to an amperage value by multiplying it by the sensors mv/A value. if you want to limit your systems max amps to 99.9 then limit the calculated amperage, not the raw analogread value.

example, you have a 50A sensor 0-5V . 0 = 0A & 5V = 50A. or you could say 0 = 0A & 1024 = 50A (on the analogread scale)

now if you limit the analogRead value to 999 then the max reading you will get is (999 / 1024) * 50Amps = 48.78Amps

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: SW Development on Minim Osd

Post by carlonb »

haydent wrote:@car
thanks for your detailed response, i understand how the sensor amperage is read and calculated.

but you too are missing my point. in the code you are limiting the analog read 'step' value to 999 before it can even be converted to an amperage value by multiplying it by the sensors mv/A value. if you want to limit your systems max amps to 99.9 then limit the calculated amperage, not the raw analogread value.

example, you have a 50A sensor 0-5V . 0 = 0A & 5V = 50A. or you could say 0 = 0A & 1024 = 50A (on the analogread scale)

now if you limit the analogRead value to 999 then the max reading you will get is (999 / 1024) * 50Amps = 48.78Amps


Hi haydent,
Yes I've understood your question, the actual formula in OSD is defined as the calculation of the current and after the calculation the resulted amperes are limited to 999 (only for this reason may be conceptually correct).
The point is (as you understood) the actual formula do not calculate the amperes, but is only the analog read of sensor.

I agreed with you, your first example is correct:
"example, you have a 50A sensor 0-5V . 0 = 0A & 5V = 50A. or you could say 0 = 0A & 1024 = 50A (on the analogread scale)"

So, as I explained in my previous post, the first step is the analog reading without limiting the readings, the second step is converting the analog readings to amperes, the last step is limiting the resulting amperes (multiplied by 10) to 999 (99.9A)

cheers
Carlo

int77
Posts: 14
Joined: Sun Dec 29, 2013 11:13 am

Re: SW Development on Minim Osd

Post by int77 »

Hi,

First of all, thanks for all the work done with minimOSD code. I’m flying with KV_Team_OSD starting from r345, and now decided to register on this forum and provide some feedback about new version.

Hereafter are some comments about r2.2:
1. I’m using MWii data for RSSI / amperage / pMeterSum / Vbat. As far as no analog read by minimOSD board expected in my case, I’ve set S_ENABLEADC switch OFF in GUI. With this configuration I’m getting correctly displayed values for RSSI, Vbat and pMeterSum, but amperage is displayed as 0. Activating S_ENABLEADC allows getting correct amperage values. There is no big issue with that, but for consistency it might be reasonable to move “amperage=MWAmperage/100;” line outside of the if (Settings[S_ENABLEADC]){ } block in KV_Team-OSD.ino @ line 149, as for other analog inputs from MWii.

2. In current KV_Team-OSD implementation, MAX7456 video-buffer update is asynchronous. This results in some intermittent video artifacts (affected characters or parasitic lines) as shown on the attached pictures. Please note this behavior is observed on previous versions as well.
According to max7456 datasheet (page 12) this issue can be avoided by writing to the video-buffer during vertical blanking interval. It can be achieved by implementing interrupt-driven (using VSYNC signal) update of the video-buffer. There are some implementations for minimOSD already available on the internet, see for example next post on rcdesign.ru forum and included zip file: http://forum.rcdesign.ru/f123/thread296241-6.html#post4486584
I’ve tested MAX7456.ino file from this link with KV_Team_OSD r2.2 and it is working without video artifacts. From other hand, they have increased SPI frequency for video-buffer update, getting faster video output.

Regards,
Attachments
video artifacts
video artifacts

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: SW Development on Minim Osd

Post by carlonb »

int77 wrote:Hi,

First of all, thanks for all the work done with minimOSD code. I’m flying with KV_Team_OSD starting from r345, and now decided to register on this forum and provide some feedback about new version.

Hereafter are some comments about r2.2:
1. I’m using MWii data for RSSI / amperage / pMeterSum / Vbat. As far as no analog read by minimOSD board expected in my case, I’ve set S_ENABLEADC switch OFF in GUI. With this configuration I’m getting correctly displayed values for RSSI, Vbat and pMeterSum, but amperage is displayed as 0. Activating S_ENABLEADC allows getting correct amperage values. There is no big issue with that, but for consistency it might be reasonable to move “amperage=MWAmperage/100;” line outside of the if (Settings[S_ENABLEADC]){ } block in KV_Team-OSD.ino @ line 149, as for other analog inputs from MWii.

2. In current KV_Team-OSD implementation, MAX7456 video-buffer update is asynchronous. This results in some intermittent video artifacts (affected characters or parasitic lines) as shown on the attached pictures. Please note this behavior is observed on previous versions as well.
According to max7456 datasheet (page 12) this issue can be avoided by writing to the video-buffer during vertical blanking interval. It can be achieved by implementing interrupt-driven (using VSYNC signal) update of the video-buffer. There are some implementations for minimOSD already available on the internet, see for example next post on rcdesign.ru forum and included zip file: http://forum.rcdesign.ru/f123/thread296241-6.html#post4486584
I’ve tested MAX7456.ino file from this link with KV_Team_OSD r2.2 and it is working without video artifacts. From other hand, they have increased SPI frequency for video-buffer update, getting faster video output.

Regards,

Hi int77 and welcome to the forum,
We are hapy that your are on our OSD with fun.

About the amperage readings from MWii FC, I will look deeply in it, but I think your suggestion it's correct (I never used amperage from MWii and I never tested it).

About the asynchronous buffer write of MAX, yes I agree with you as I already seen and described in my previus posts, but unfortunately I'm non so skilled to solve it.
If you have any raw/test code to address me and other developers to solve it, please send it us and we look at and implement it.

Cheers
Carlo

vvk
Posts: 3
Joined: Tue Nov 26, 2013 9:02 am

Re: SW Development on Minim Osd

Post by vvk »

Carlo,

there is a zip file with the code on this page - http://forum.rcdesign.ru/f123/thread296 ... ost4486584
post #221 by okan_vitaliy

Double SPI speed and sequential output work really good, as a result the buffer output loop in MAX7456_DrawScreen() is more than 4 times faster. Here's before and after pics, blue graph is the duration of the screen buffer output.

Image

Image

Before - 6.4ms, after - 1.44ms

I'm using a slightly modified version of okan_vitaliy's code, here's the patch with the changes - https://github.com/vbabich/rush-osd/com ... ba3e1ce98b

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: SW Development on Minim Osd

Post by carlonb »

vvk wrote:Carlo,

there is a zip file with the code on this page - http://forum.rcdesign.ru/f123/thread296 ... ost4486584
post #221 by okan_vitaliy

Double SPI speed and sequential output work really good, as a result the buffer output loop in MAX7456_DrawScreen() is more than 4 times faster. Here's before and after pics, blue graph is the duration of the screen buffer output.

Image

Image

Before - 6.4ms, after - 1.44ms

I'm using a slightly modified version of okan_vitaliy's code, here's the patch with the changes - https://github.com/vbabich/rush-osd/com ... ba3e1ce98b

Thanks vvk,
Just after my reply to int77 I downloaded the S/W and sobstituted the max7456.ino file in the actual 2.2 version and wow... :lol: all is running very well.
Now we need to ask the RC guy (may be okan_vitaliy as Russian is not my second language to read the whole tread) the permission to use this mod.

Cheers
Carlo

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

int77 wrote:Hi,

First of all, thanks for all the work done with minimOSD code. I’m flying with KV_Team_OSD starting from r345, and now decided to register on this forum and provide some feedback about new version.

Hereafter are some comments about r2.2:
1. I’m using MWii data for RSSI / amperage / pMeterSum / Vbat. As far as no analog read by minimOSD board expected in my case, I’ve set S_ENABLEADC switch OFF in GUI. With this configuration I’m getting correctly displayed values for RSSI, Vbat and pMeterSum, but amperage is displayed as 0. Activating S_ENABLEADC allows getting correct amperage values. There is no big issue with that, but for consistency it might be reasonable to move “amperage=MWAmperage/100;” line outside of the if (Settings[S_ENABLEADC]){ } block in KV_Team-OSD.ino @ line 149, as for other analog inputs from MWii.

2. In current KV_Team-OSD implementation, MAX7456 video-buffer update is asynchronous. This results in some intermittent video artifacts (affected characters or parasitic lines) as shown on the attached pictures. Please note this behavior is observed on previous versions as well.
According to max7456 datasheet (page 12) this issue can be avoided by writing to the video-buffer during vertical blanking interval. It can be achieved by implementing interrupt-driven (using VSYNC signal) update of the video-buffer. There are some implementations for minimOSD already available on the internet, see for example next post on rcdesign.ru forum and included zip file: http://forum.rcdesign.ru/f123/thread296241-6.html#post4486584
I’ve tested MAX7456.ino file from this link with KV_Team_OSD r2.2 and it is working without video artifacts. From other hand, they have increased SPI frequency for video-buffer update, getting faster video output.

Regards,



Hi Int77,

welcome to this work thread and thank you very much for your registering and help on developments. I have been lately asked about this issue on the repository discuss forum and promised to get answers about it, since we have not discovered yet the solution. This issue seemed to be a little random regarding hardware used and amount of chars on screen, I will although look at the max7456 datasheet (page 12) as you mentioned to really get the start point on this.

You just went dip and come out with the solution. We are very thankful.
I have not yet tried because I am far from home at this moment but for me counts the accurate description issue/solution you´v made together with Carlo test :mrgreen:

As for your first pointed issue with current sensing:
int77 wrote:1. I’m using MWii data for RSSI / amperage / pMeterSum / Vbat. As far as no analog read by minimOSD board expected in my case, I’ve set S_ENABLEADC switch OFF in GUI. With this configuration I’m getting correctly displayed values for RSSI, Vbat and pMeterSum, but amperage is displayed as 0. Activating S_ENABLEADC allows getting correct amperage values. There is no big issue with that, but for consistency it might be reasonable to move “amperage=MWAmperage/100;” line outside of the if (Settings[S_ENABLEADC]){ } block in KV_Team-OSD.ino @ line 149, as for other analog inputs from MWii.
Understood! It will be fixed ASAP.

Thanks again, hope you get the chance to stay around with us.

Have fun,
-KV

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

vvk wrote:...

there is a zip file with the code on this page - http://forum.rcdesign.ru/f123/thread296 ... ost4486584
post #221 by okan_vitaliy...

...I'm using a slightly modified version of okan_vitaliy's code, here's the patch with the changes - https://github.com/vbabich/rush-osd/com ... ba3e1ce98b


Hi vvk,

also welcome and thanks for the performed tests. Effectively 1.44ms is some huge difference, we will also look on your lines ASAP.

Cheers and thanks.

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

Stars112 wrote:Hi,
I found today a Little Bug in the GUi.
After Setting up 4S Battery i can't Set the Alarm to 13,2V.
Only 10,5v is possible.
On Tv, whith stick setup it is possible to Set the Alarm to 13,2.

Probertly we can Set a cell Voltage like 3,3v to configure the Alarm?


is it right that the rssi in the ppm Signal from a Jeti rx not in the seriell Signal is?
I can't display the rx Signal to the tv:-(

Greetings, Marc


Hi Marc,

I was not aware of that and will look ASAP. I have made many modifications to the switches on GUI and probably something went wrong with that one. Thank you for pointing it.

Cheers

EDIT: To your Cell question: not at this time in current GUI only the total voltage (I think it is more intuitive and objective this way).

RSSI: I don´t understand your question... Can you please be more specific?

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

Haydent,

we are limiting to 999=(99.9A) the print screen, that´s why I told you "you´r on screen" on my last post about it.
This does not influence the real values or taken into account for previous calculations.

About your answer: no, what I meant was that I thought you were going to check if it is working with current OSD code implementation, not if is stable on MWii... don´t bother now ;)

Cheers

Stars112
Posts: 36
Joined: Wed Jan 30, 2013 9:29 pm

Re: SW Development on Minim Osd

Post by Stars112 »

kataventos wrote:Hi Marc,

I was not aware of that and will look ASAP. I have made many modifications to the switches on GUI and probably something went wrong with that one. Thank you for pointing it.

Cheers

EDIT: To your Cell question: not at this time in current GUI only the total voltage (I think it is more intuitive and objective this way).

RSSI: I don´t understand your question... Can you please be more specific?


Hi Kataventos,
tanks for your responce.
I can Not display the rx rssi from the jeti rx which is connected at ppm.
I have everytime 0% in the osd.
So i suppose the rssi is Not in the serial Signal from multiwii. Or Not in the ppm Signal.
Is this correct or is there another error in my config?

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

I didn't think mw could take ppm rssi as input

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

haydent wrote:I didn't think mw could take ppm rssi as input


Hey Marc,

yep, Hayden is right you can´t.

You probably wanted to say PWM and not PPM, am I right?.

you have two options:

1- Using a small filter as follows (both MWii or OSD ADC):

Image Image


I Use this scheme without R2:

Image

2- The OSD PWM input (MISO), it sure would be nice to see some feedback on the new dev...

Cheers,
-KV

int77
Posts: 14
Joined: Sun Dec 29, 2013 11:13 am

Re: SW Development on Minim Osd

Post by int77 »

vvk wrote:I'm using a slightly modified version of okan_vitaliy's code, here's the patch with the changes - https://github.com/vbabich/rush-osd/com ... ba3e1ce98b

I like your implementation; it’s better optimized and cleaner as compared to initial version from rcdesign.

carlonb wrote:Just after my reply to int77 I downloaded the S/W and sobstituted the max7456.ino file in the actual 2.2 version and wow... all is running very well.
Now we need to ask the RC guy (may be okan_vitaliy as Russian is not my second language to read the whole tread) the permission to use this mod.

The gay proposed this mod is Okan Vitaliy. According to the discussion in the thread on rcdesign.ru forum, he’s OK if KV dvpt team incudes these modifications in official release. However, will be nice to point out his contribution in release notes.

kataventos wrote:Thanks again, hope you get the chance to stay around with us.

You're welcome, I'm happy to help as I can to improve the OSD I'm using extensively :)

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

yes pwm is correct, im home now so can resume testing and dev. with the osd pwm, when you say "MISO" do you mean it uses a different pin to the standard analog input one ? ie SPI ?

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: SW Development on Minim Osd

Post by carlonb »

PWM RSSI question....

Hi all, I worked at this creating a PWM generator at 500 Hz freq., so the PWM pulses are from zero uS to 2000uS.
Using the same pin A3 (the same for analogic RSSI of KV OSD) I can read and set perfectly the PWM RSSI percentage.
The true question is: How is the real RC rx PWM frequency used by various our RC Rx ?

Cheers
Carlo

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

carlonb wrote:PWM RSSI question....

Hi all, I worked at this creating a PWM generator at 500 Hz freq., so the PWM pulses are from zero uS to 2000uS.
Using the same pin A3 (the same for analogic RSSI of KV OSD) I can read and set perfectly the PWM RSSI percentage.
The true question is: How is the real RC rx PWM frequency used by various our RC Rx ?

Cheers
Carlo


it varies between manufacturers, but some is the same as servo signal, others ive heard are different though. that code you made sounds great , and something i was interested in doing myself, but first i wanted to look into KV's work as he has been working on it too i believe.

i just bought a cheap arduino basd open source oscilloscope to measure this sort of thing, though ive even used my sound card to do it before.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

carlonb wrote:PWM RSSI question....

Hi all, I worked at this creating a PWM generator at 500 Hz freq., so the PWM pulses are from zero uS to 2000uS.
Using the same pin A3 (the same for analogic RSSI of KV OSD) I can read and set perfectly the PWM RSSI percentage.
The true question is: How is the real RC rx PWM frequency used by various our RC Rx ?

Cheers
Carlo


this is what i was going to do using the same method for reading a pwm signal as is used in mwc for the rx channels, mind sharing the code with me and i can test it ?

2- The OSD PWM input (MISO), it sure would be nice to see some feedback on the new dev...


thing with this is it is a blocking command (pulsein) and everything pauses while it happens, but maybe not an issue in osd as it would be in flight controller

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

the example im thinking of in x8r rx, its pwm signal is 1ms or 1khz with duty ranging between 10% and 90%

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: Currest sensors

Post by haydent »

carlonb wrote:...

So to convert the steps to Amp we need to calculate the voltage and then, with the sensor
"sensitivity" in mV/A (for example 40mV/A)
, calculate the real Amperes.

Formula for unidir sensor with 0.040V/A sensitivity and max 100A:
Current [A*10]= (analogRead(pin1)*(5.00/1024))/0.040*10; (Not tested !)

...
Cheers
carlo


with the sensor "sensitivity" in mV/A (for example 40mV/A)

sorry to bring this up again but i think you have missed something important in your recent transition from amperage callibration settings being stored in config.h into the eeprom and gui

basically you forgot them
, prove me wrong but i just went over your new code and there is nowhere to specify your amperage sensors "sensitivity" as you call it, ie 40mv/A

this is your only code for calculating amperage from the arduino's analog pin: it is not enough

Code: Select all

    if (!Settings[S_MWAMPERAGE]) {
    amperage = analogRead(amperagePin)- Settings[S_AMPOFFSET] /2;
    if (amperage >=999) amperage=999;
    }


ive created a issue ticket to not take up any more space in this ever growing thread:
http://code.google.com/p/rush-osd-devel ... tail?id=12

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: Currest sensors

Post by kataventos »

haydent wrote:
carlonb wrote:...

So to convert the steps to Amp we need to calculate the voltage and then, with the sensor
"sensitivity" in mV/A (for example 40mV/A)
, calculate the real Amperes.

Formula for unidir sensor with 0.040V/A sensitivity and max 100A:
Current [A*10]= (analogRead(pin1)*(5.00/1024))/0.040*10; (Not tested !)

...
Cheers
carlo


with the sensor "sensitivity" in mV/A (for example 40mV/A)

sorry to bring this up again but i think you have missed something important in your recent transition from amperage callibration settings being stored in config.h into the eeprom and gui

basically you forgot them
, prove me wrong but i just went over your new code and there is nowhere to specify your amperage sensors "sensitivity" as you call it, ie 40mv/A

this is your only code for calculating amperage from the arduino's analog pin: it is not enough

Code: Select all

    if (!Settings[S_MWAMPERAGE]) {
    amperage = analogRead(amperagePin)- Settings[S_AMPOFFSET] /2;
    if (amperage >=999) amperage=999;
    }


ive created a issue ticket to not take up any more space in this ever growing thread:
http://code.google.com/p/rush-osd-devel ... tail?id=12



Hi,
I saw the issue. This have not been reviewed yet, it will during this week after the new year.
I also have a issue report about the code on the PWM new line. It still does not work properly but I will go dip on it as soon as I get back home... This PWM issue is now getting me bored, need to be fixed at once for good :(

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

if you notice i did comment on that issue. i suspect it should work it theory your code. i will test it now for you as i have everything to do that here. though i think you should still go with carl's approch.

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

haydent wrote:if you notice i did comment on that issue. i suspect it should work it theory your code. i will test it now for you as i have everything to do that here. though i think you should still go with carl's approch.


Of course, nothing more to do with it! Carlo´s thoughts and research are 100% correct he or me will upload it soon. Mean time you already have the formula for testing proposes.
I will obviously add the new adjustment parameters on GUI.

EDIT: OK I saw it now. Can you please test it with your new RX? With current formula i mean... Just to discard the pulsein on this and try to go on a different path.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

btw i like the finer font

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

kataventos wrote:
haydent wrote:EDIT: OK I saw it now. Can you please test it with your new RX? With current formula i mean... Just to discard the pulsein on this and try to go on a different path.


i just tested latest dev with x8r rx and your pulsein code, there is some value and it is changing but it is not correct.

your formula is: rssiADC = pulseIn(12, HIGH,1000)/4;

x8r creates pulse with length between 100 microsecond and 900 microsecond

thus rssiADC would be 25 to 225

i put this into gui for max and min

as mentioned there is value shown but it fluctuates up and down with no correlation to tx position

i suspect the pulse in is not working accurately

also i couldnt get the rssi simulator slider in the gui to have any effect even though the others worked.

i will wait for carlo to post his code rather than reinvent the wheel on this

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

OK, it is the same as the reported issue on the repo using D8R-II (I think)

Are you talking about the current sensor formula? if yes he did posted it already some posts back. If not and you meant RSSI, the test was performed using the analogue input. Can you try that also?

To simulate with the GUI slider you would need to go back and select (RSSI MWii input) and save before use, it will not work if you miss this step.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

OK, it is the same as the reported issue on the repo using D8R-II (I think)

i dont think, i would like to measure that rx's signal but from several posts ive read of others who have it is too fast to be read by arduino

Are you talking about the current sensor formula? if yes he did posted it already some posts back. If not and you meant RSSI, the test was performed using the analogue input. Can you try that also?

it is confusing ! ive been talking about rssi AND amperage, rssi most recently, since post #44899
when you say test rssi on analog, do you mean normal pin or miso pin ? i tried miso (12) as it is coded that way. can you read pulsein on a analog pin ?


To simulate with the GUI slider you would need to go back and select (RSSI MWii input) and save before use, it will not work if you miss this step.

ok, it works now, but PWM rssi must be off as well as rssi = mwii (it should not have to be though, as rssi from mwii setting should overide pwm sub setting)

kataventos
Posts: 702
Joined: Sun Aug 28, 2011 8:14 pm
Contact:

Re: SW Development on Minim Osd

Post by kataventos »

haydent wrote:it is confusing ! ive been talking about rssi AND amperage, rssi most recently, since post #44899
when you say test rssi on analog, do you mean normal pin or miso pin ? i tried miso (12) as it is coded that way. can you read pulsein on a analog pin ?


carlonb wrote:PWM RSSI question....

...I worked at this creating a PWM generator at 500 Hz freq., so the PWM pulses are from zero uS to 2000uS.
Using the same pin A3 (the same for analogic RSSI of KV OSD) I can read and set perfectly the PWM RSSI percentage...


It seems so, also don´t know if it will work without the generator/using normal RX... It was a surprise also for me :!: probably because of the smooth reading on current RSSI code... to be honest don´t know how...


ok, it works now, but PWM rssi must be off as well as rssi = mwii (it should not have to be though, as rssi from mwii setting should overide pwm sub setting)

Affirmative and correct ;) will take care of that.

Free_Bird
Posts: 8
Joined: Tue Dec 31, 2013 6:36 am

Re: SW Development on Minim Osd

Post by Free_Bird »

Hello all first time poster here... please be nice :D

I spent a good part of the afternoon reading up on the KV OSD and then wiring it up on the bench to verify functionality. I understand that the code is new and was curious how to turn certain features off.

OSD.JPG


I would like to remove the items circled in "red" to help clean up the screen a little. I will have to fly with the artificial horizon but I may even want to remove that too. Mostly all I want is RSSI, battery voltage, armed state, flight mode (maybe) and time,

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

some things can be turned off/on or moved around in the GUI or in with the OSD stick controlled menu

the other option is to get into the code and disable the bit you want specifically

Free_Bird
Posts: 8
Joined: Tue Dec 31, 2013 6:36 am

Re: SW Development on Minim Osd

Post by Free_Bird »

haydent wrote:some things can be turned off/on or moved around in the GUI or in with the OSD stick controlled menu

the other option is to get into the code and disable the bit you want specifically


Can you point me to the section of code that I need to remove? I am familiar with Arduino code, just not the inner workings of the KV OSD. I'm not sure what can be deleted and how it affects the rest of the code functionality. As a talking point I would like to remove the current and mAh items what variables and section of code am I looking for?

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

this is the hack way:

amperage (the bit in middle bottom) KV tab - comment line 283, displayAmperage();
time symbol (on mn): Screen tab - comment out line 353 & 357, screenBuffer[0] = SYM_FLY_M; & screenBuffer[0] = SYM_FLY_H;
flight mode icons (top right): KV tab - comment line 281, displayMode();

as i said the first and last can be turned off via the 'in-game' osd menu instead as well

carlonb
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: SW Development on Minim Osd

Post by carlonb »

Happy New Year and have a long fun FPV flying year.
Carlo

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

thanks same too you and all, looking forward to what new things happen this year!

Free_Bird
Posts: 8
Joined: Tue Dec 31, 2013 6:36 am

Re: SW Development on Minim Osd

Post by Free_Bird »

haydent wrote:this is the hack way:

amperage (the bit in middle bottom) KV tab - comment line 283, displayAmperage();
time symbol (on mn): Screen tab - comment out line 353 & 357, screenBuffer[0] = SYM_FLY_M; & screenBuffer[0] = SYM_FLY_H;
flight mode icons (top right): KV tab - comment line 281, displayMode();

as i said the first and last can be turned off via the 'in-game' osd menu instead as well


Thank you for the reply this is very helpful... you said that some of these can be removed via the OSD GUI, I am able to access it however I don't see the option for those.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

i dont know as ive never tried or looked at it, just thought i saw in the code that you could do it, but maybe not

cofl1001
Posts: 16
Joined: Sun Dec 29, 2013 3:31 pm

Re: SW Development on Minim Osd

Post by cofl1001 »

Hi Guys,
I'm new to Multiwii...I have a minim osd compatible board from GLB website that worked well under MPNG 2.8 which I used before on my Crius AIOP V2.
What mods I need to make to my config_h to enable the osd board ?
Any hints are appreciated :)
Thanks

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

If you mean the osd configuration. Not much as nearly everything is in the gui

cofl1001
Posts: 16
Joined: Sun Dec 29, 2013 3:31 pm

Re: SW Development on Minim Osd

Post by cofl1001 »

I have it connected, worked before on MPNG but since I switched to MWII 2.3 all I got is awaiting heartbeats message... So I guess I must enable or define it, but not really sure how ...
Any help is appreciated.
Thanks

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: SW Development on Minim Osd

Post by haydent »

Silly question. But have you installed latest kv rush osd sketch on your osd board?

Post Reply