HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jul 28, 2011, 04:45 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by vipix View Post
Is there easy way to move top line more up and bottom line more down, basicly on edges? My cam outputs wide screen, so i have black lines at top and bottom, so i want to use this lines as backgruond.
You just need to edit the line-number, should take a couple of seconds

On my screen the text is almost at the top. When using the video-grapper the pictures is quite different. You can change it yourself and make it match your googles/screen.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Sign up now
to remove ads between posts
Old Jul 28, 2011, 04:49 PM
Registered User
Sverige
Joined May 2009
74 Posts
Nice work there Dennis, and thanks for sharing it! I've ordered one of those Arduino nano´s + GPS from DE, so hopefully I will be able to try it out!

Are you planning to design a PCB for it also? A simple single layer PCB that is easy to DIY would be a nice addition! I might give it a try myself, but I'm not sure I have the skill.. I'm struggling to learn Eagle right now, so we'll see where it ends up.. So far I've started working on the schematic, would be nice to have your input. Does it look right to you?

Do you think it's a good idea to use the onboard regulator on the nano to power it + the GPS, or would it be better to use an external reg? The datasheet says it can handle 6-20V input but recommends 7-12V, so I guess powering it from a 3S LiPo would be ok but 4S would be pushing it?

As you can see I've also added RSSI input (A3), battery voltage input (A0) + one extra analog input (A2) for future development.. Do you think there is enough processing power left to add those things?

Warning! Please be advised that this schematic is just a draft. It has not been tested and verified to work!

Schematic removed to avoid confusion.


/Andreas
andreas77 is offline Find More Posts by andreas77
Last edited by andreas77; Aug 22, 2011 at 12:37 PM. Reason: Removed schematic to avoid confusion
Reply With Quote
Old Jul 28, 2011, 04:56 PM
Electronics slayer
SouthPawPaul's Avatar
Reading, UK
Joined Jul 2008
494 Posts
I've got the Arduino through the post today, but I'm struggling to get the current sensor from a supplier that doesn't want to charge 3 times the cost of the item to post it.

I wonder how far I can get without a current sensor and gps just to test the water?
SouthPawPaul is offline Find More Posts by SouthPawPaul
Reply With Quote
Old Jul 28, 2011, 05:44 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by andreas77 View Post
Nice work there Dennis, and thanks for sharing it! I've ordered one of those Arduino nano´s + GPS from DE, so hopefully I will be able to try it out!

Are you planning to design a PCB for it also? A simple single layer PCB that is easy to DIY would be a nice addition! I might give it a try myself, but I'm not sure I have the skill.. I'm struggling to learn Eagle right now, so we'll see where it ends up.. So far I've started working on the schematic, would be nice to have your input. Does it look right to you?

Do you think it's a good idea to use the onboard regulator on the nano to power it + the GPS, or would it be better to use an external reg? The datasheet says it can handle 6-20V input but recommends 7-12V, so I guess powering it from a 3S LiPo would be ok but 4S would be pushing it?

As you can see I've also added RSSI input (A3), battery voltage input (A0) + one extra analog input (A2) for future development.. Do you think there is enough processing power left to add those things?

Warning! Please be advised that this schematic is just a draft. It has not been tested and verified to work!



/Andreas
Hi Andreas
I will get back to you tomorrow with a new schematic and updated component values. RSSI, battery voltage etc. shouldn't be any problem.

My current solution with a little add-on board to Arduino is pretty simple. I don't think it's worth the extra work to create a PCB as long as you use an Arduino board.
If you just want to use a simple Atmega 328 microcontroller (it's cheaper. See picture in post 1), then it makes more sense to create a PCB.

Quote:
Originally Posted by SouthPawPaul View Post
I've got the Arduino through the post today, but I'm struggling to get the current sensor from a supplier that doesn't want to charge 3 times the cost of the item to post it.

I wonder how far I can get without a current sensor and gps just to test the water?
You should be fine just with the Arduino. Off course you want get any data, but you can check that it prints the text correct, you can check the current-reading (simulated with a voltage on the input) etc. So no worries.
Check my latest pictures - that's with no GPS or current-sensor attached.

I hope you guys are aware that it's (for now) only compatible with PAL. I don't have a NTSC camera, so I can't make the NTSC version.
And the code is not too pretty
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 28, 2011 at 06:32 PM.
Reply With Quote
Old Jul 29, 2011, 03:38 AM
Registered User
CheckSum's Avatar
Joined Jan 2011
512 Posts
Denis-
If you are willing, I can drop ship a NTSC camera from HK to you. PM me your address if you're interested.
CheckSum is offline Find More Posts by CheckSum
Reply With Quote
Old Jul 29, 2011, 07:38 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by CheckSum View Post
Denis-
If you are willing, I can drop ship a NTSC camera from HK to you. PM me your address if you're interested.
I was hoping someone else could take a quick look on a NTSC version - I might be wrong, but I think very few things needs to be changed.
It should be possible to add a NTSC/PAL option in the beginning of the code. No need to for a separate NTSC version.

I don't mind to make a NTSC option, but I'm going to Zermatt in 2 weeks and doubt the camera will arrive before that. But if you can wait like a month, sure thing
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 29, 2011, 07:58 AM
Registered FPVer :)
markus123456's Avatar
Switzerland, LU, Buchrain
Joined Aug 2006
2,825 Posts
Quote:
Originally Posted by Dennis Frie View Post
but I'm going to Zermatt in 2 weeks
Cool. I hope you enjoy it. Let me know if you pass by close to Lucerne! That's where I live.

Markus
markus123456 is offline Find More Posts by markus123456
Reply With Quote
Old Jul 29, 2011, 08:19 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by markus123456 View Post
Cool. I hope you enjoy it. Let me know if you pass by close to Lucerne! That's where I live.

Markus
Wow, nice place to live. So close to some of the most beautiful mountains in the world
You should be able to get some really nice FPV-pictures/videos
I bet you can get better pictures than me by just standing in your backyard.

Unfortunately we are going by plane and train with around 25-30 kg mountain equipment each, so we probably want take too many detours
It's a shame my FPV-gear can't be fitted in a little suitcase, it would have been amazing to fly FPV around the alps. Maybe next time..
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 29, 2011 at 08:37 AM.
Reply With Quote
Old Jul 29, 2011, 09:18 AM
Electronics slayer
SouthPawPaul's Avatar
Reading, UK
Joined Jul 2008
494 Posts
Hi Dennis. The new component values that you've mentioned a few posts up. Are quite different to your original design?

I'm off to get some parts to build this this afternoon and wanted to make sure I was building your latest design.
SouthPawPaul is offline Find More Posts by SouthPawPaul
Reply With Quote
Old Jul 29, 2011, 01:35 PM
Registered User
Joined Mar 2009
1,036 Posts
I come too late, but there are very cheap ntsc cameras on ebay :
http://cgi.befr.ebay.be/Mini-Wired-C...item1c1b9c6c7c
flipflap is online now Find More Posts by flipflap
Reply With Quote
Old Jul 30, 2011, 08:53 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Better late than never....

Here goes...
The normal hardware version is more or less the same as earlier.
With my cheap china cam I had to use a diode with a little higher forward voltage drop, or increase R3 to get a stable sync.
More or less the same as here
http://www.viennawireless.org/balloo...rlay/index.php
  • R1 - Controls brightness of the text. Around 100 - 300 ohm recommended.
  • R2 - Control dimming. Feel free to try whatever resistor-value you like.
  • C1 - 0.1 uF is the standard value used to AC-couple video, but other values should work fine. I have even used sround 25 uF capacitor
  • R3 - a part of the climping circuit. Around 10K should do it.
  • R4 - The diode (in this case D5) will always have a voltage drop of 0.6-0.7 V. R4 is just used to limit the current flowing from VCC. Values from a few thousand ohms to 100K should work.
  • R5 pot is used as a simple voltage-divider. The value is not very critical, but I wouldn't recommend very large (1M) and very low (100 ohm).


In this version the fast PWM is used to generate the DC-voltage used for bias and reference voltage.
  • R4 and C2 is used as lowpass-filter.


Simple version - I wouldn't recommend it, but I think it's a cool way to do it
I have been able to get a good sync, but it's a bit easier and more precise with a pot.



- off cource you can change the circuit as you want. You can also use the pot as voltage-divider for the biasing voltage and leave reference voltage at ground etc. Do whatever you prefer.

If any hardware-guys can improve the circuit - go ahead
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 30, 2011 at 09:13 AM.
Reply With Quote
Old Jul 30, 2011, 09:19 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Andreas77 - I would use a separate UBEC or something like that.
The regulator on the Arduino is very small and not very efficient. Let's say it has to deliver 5 volt 100 mAh with 15 volt input.
The energy wasted will be around 10 volt 100 mAh = 1 watt. The regulator is the size of.. well.. It's small. I feel pretty sure it will get so hot you can't touch it. I'm not saying it can't be done - but I wouldn't do it.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 30, 2011, 11:12 AM
Registered User
Sverige
Joined May 2009
74 Posts
Thanks again for all your work! You might be right about it being to much work to design a PCB, I just thought it would be nice to have one.. (quick and easy to make another OSD)

Anyway, I'm trying to get your OSD working on a breadboard now. I don't have an arduino, so I'm just using a simple atmega328P MCU. I've connected everything as in the original schematic. I'm using a cheap Sony CCD PAL camera from HK and an easycap to display the picture on my computer. So far I'm not having any luck, without the OSD connected I get a clean picture but when it's connected I just get interferece.





I'm not sure if I need to change anything in the code to make it work on a single atmega328?

What I did was this:
1. Open code in Arduino IDE and select Sketch->Verify / Compile
2. Located the .hex file that was generated in %TEMP% directory.
3. Programmed the hex-file to the MCU using AVR Studio and AVRISP mk2 programmer. I don't get any errors, so the programming seems to work.

Do I need to set some fuses? I just left them as they were.

Any other suggestions?

Cheers,
Andreas
andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Jul 30, 2011, 03:31 PM
Registered User
Sverige
Joined May 2009
74 Posts
Ok, I think I found the problem.. (or at least one of them )

1. Fuse bit CKDIV8 needs to be cleared
2. Must use external clock @ 16 MHz (I was using internal clock)

I was effectively running it at 1 MHz when it needs to be run at 16 MHz.. Noob mistakes I guess.. I don't have a 16MHz crystal right now, so I'll have to order one..

Cheers,
Andreas
andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Jul 30, 2011, 04:26 PM
Registered User
Sverige
Joined May 2009
74 Posts
Got it up and running with a 20MHz clock! Well, it's almost working anyway.. the text is shifted a bit to the left, I guess it has to do with the MCU running to fast now and screwing up some delay routines.. But at least I'm on the right track now

andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Jul 30, 2011, 05:46 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by andreas77 View Post
Got it up and running with a 20MHz clock! Well, it's almost working anyway.. the text is shifted a bit to the left, I guess it has to do with the MCU running to fast now and screwing up some delay routines.. But at least I'm on the right track now

Hi Andreas
Seems like you fixed the problem yourself before I got to a computer.
Very nice to see, that you have been able to use the code without any major changes

I have made a test-print with a single Atmega328P MCU aswell, but decided to use an arduino bootloader for easy code-update (I use the same MPX plug for GPS and computer-connection to update code, works perfect, and updating code takes a few seconds)

I wouldn't recommend to use the internal clock or much less than 16 mhz clock speed. You should be fine with 20 mhz but you have to change a few things to fit the text etc. I will continue developing at 16 mhz clock speed, as all Arduino's run at 16 mhz. But I got a 20 mhz crystal if you need help with anything
Remember the Serial communication is set to 9600 baud at 16 mhz clock speed. You might want to change that.

Did you have any trouble getting a stable synch? And what circuit did you use?

I will upload an updated code-version soon. It should fix a few things, support dimming, use large numbers in the top and be a little "cleaner".
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 30, 2011, 06:16 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Andreas, please check this used for detecting if it's a new frame or just a new line.

if (TCNT2 > 75) {
line = 0;
}

The counter will count a bit faster with 20 mhz clock speed, so you might want to increase it a bit. If it works fine, no problem. But you might want to increase it to 90 or something like that.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 30, 2011, 06:50 PM
Registered User
The Netherlands, OV, Steenwijk
Joined Apr 2011
62 Posts
Hello Dennis,

Thanks for sharing this great idea. I already started with a very similar thing.
Here my first intermediate results.
I love this Arduino stuff.
VRquaeler is offline Find More Posts by VRquaeler
Reply With Quote
Old Jul 30, 2011, 06:59 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by VRquaeler View Post
Hello Dennis,

Thanks for sharing this great idea. I already started with a very similar thing.
Here my first intermediate results.
I love this Arduino stuff.
Looks good. But you are creating the entire video signal yourself, right? You should take a look at the Arduino tellymate, guess you can find some good inspiration
Do you use SPI or USART for pixels?

The pixel-blasting etc. is probably pretty close, but I add text to an existing video signal. It requires some timing from the original video signal (and therefor some extra hardware etc)- but I don't have to create the sync-pulses etc.
As the video-signal is used for FPV it's very important not to mess with the original picture - so I try to keep my distance from the sync pulse
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 30, 2011, 07:49 PM
Registered User
The Netherlands, OV, Steenwijk
Joined Apr 2011
62 Posts
Hi Dennis,

Thanks for responding. This is just a very simple "learning example" for myself. You are right, here I am generating the hole video signal including the sync pulse by my own.

At the moment I'm missing some components to reproduce your circuit.

Please go on with your great work.
VRquaeler is offline Find More Posts by VRquaeler
Reply With Quote
Old Jul 30, 2011, 08:18 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Here is the latest code-version.
Guess this will be the last version before further test-flights have been done

I might add number of satellites locked on GPS and INA139 example - but at the moment test-flights will be prioritized

Image is pretty blurry - but it does give an idea about the current version

Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 30, 2011 at 08:35 PM.
Reply With Quote
Old Jul 31, 2011, 07:16 AM
Registered User
Sverige
Joined May 2009
74 Posts
Quote:
Originally Posted by Dennis Frie View Post
I have made a test-print with a single Atmega328P MCU aswell, but decided to use an arduino bootloader for easy code-update (I use the same MPX plug for GPS and computer-connection to update code, works perfect, and updating code takes a few seconds)

I wouldn't recommend to use the internal clock or much less than 16 mhz clock speed. You should be fine with 20 mhz but you have to change a few things to fit the text etc. I will continue developing at 16 mhz clock speed, as all Arduino's run at 16 mhz. But I got a 20 mhz crystal if you need help with anything
I have an arduino nano on the way from DE so I will be using that one as soon as I get it. Right now I need to use three different programs to make a code update. Not very efficient!

Quote:
Originally Posted by Dennis Frie View Post
Did you have any trouble getting a stable synch? And what circuit did you use?
Yes, I have some trouble with the sync. I can get it stable by adjusting the pot, but when I move the camera around it will loose sync sometimes. Also when the picture is very dark / black it seems to loose sync completely (the text disapears). I can get it back again by adjusting the pot, but then it looses sync again when the picture is very bright and so forth. But I think maybe my camera is part of the problem, it gets very hot when it's been running for a while and that also makes the problem worse. I have'nt tried your suggestion about the TCNT2 counter yet, maybe that will fix it.

I use this circuit, except I did'nt connect R2 for dimming. I use a 10K pot for R5.


Thanks for the new code version, will try it out later. Right now the weather is too nice to be sitting behind a computer, think I will go out and fly with my tricopter instead.

/Andreas
andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Aug 01, 2011, 03:32 AM
Registered User
Joined Sep 2010
2,411 Posts
Is there an "easy way" in the code to modify the size of numbers? Would it be good to add simbols/drawings to different values?

Here are a few ideas for future developement..

Would it be possible to store some data on a SD card - http://www.seeedstudio.com/depot/sd-...v21-p-492.html ; for example flight data from to see later in Google Earth and/or maybe make a summary of flight characteristics (max speed,...). So basically extend it into a logger also.

Another idea for future developement (although I think it would be hard to code) if it would be possible to connect two arduinos (possibly the same de nano's) one would be running multiwiicode for example to stabilize a flying wing, ailerons or multicopter, and the other "osd arduino" would be reading the info from the wiimotion plus&accelerometer and show the tilting on the screen or an artificial horizon of some sort...
msev is offline Find More Posts by msev
Reply With Quote
Old Aug 01, 2011, 05:11 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by msev View Post
Is there an "easy way" in the code to modify the size of numbers? Would it be good to add simbols/drawings to different values?

Here are a few ideas for future developement..

Would it be possible to store some data on a SD card - http://www.seeedstudio.com/depot/sd-...v21-p-492.html ; for example flight data from to see later in Google Earth and/or maybe make a summary of flight characteristics (max speed,...). So basically extend it into a logger also.

Another idea for future developement (although I think it would be hard to code) if it would be possible to connect two arduinos (possibly the same de nano's) one would be running multiwiicode for example to stabilize a flying wing, ailerons or multicopter, and the other "osd arduino" would be reading the info from the wiimotion plus&accelerometer and show the tilting on the screen or an artificial horizon of some sort...
The text-size is not very easy scalable. Do you want smaller text?
It uses the SPI-output (8 bit buffered) to show the text. that means a width of 8 bit, 16 bit, 24 bit (or pixels) etc. is by far the best. You can adjust the height as you want.

Adding symbols is easy. I can recommend to use Tobi's little tool
I actually think there is an array in the latest code called "Symbols" or something like that. I created a few batteri-symbols etc. They works perfect
You can also make a little animation etc. but remember timing is a bit critical.

The serial-tx is not used and can be used for whatever you want. You can add a downlink with data (use the audio-channel), SD-extension etc. But remember not to use any interrupt-driven transmission

Connecting 2 Arduinos is definitely an option, and it would give you time to do some "real calculations" on the Arduino not running as OSD. But at the moment I just want a simple OSD, on a single MCU/Arduino.
But feel free to modify all you want
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 01, 2011, 06:10 AM
Registered User
Joined Sep 2010
2,411 Posts
I'm just asking out of curiosity, the text size is already good as is...So you are saying the text height is easily changable? Does the text stay the same size relative to the screen size, for example using it on a 7" or 22" monitor?...If I would use a bigger monitor I would maybe like a bit smaller text size (adjusting only height would also be a good option what do you think?)..

Yeah sure that was just some ideas which would be interesting to do , although I'll need a few years probably to be able to write something that will work , I'll try to search for some useful bits of code ...Hope copy paste will work

When will you put your bird with the osd in the air , I want to see that arrow moving hehe...

Another idea, again very advanced coding probably this dakarosd has a rudder to home function (without stabilization, which is required so you have to use a stabilization solution with it), it senses when the plane goes to failsafe and starts turning around with rudder to home position...Do you think its doable with arduino?

This are just ideas I'm not pushing you into something, you have already done so much for what we code and electronics noncapable people were waiting

Edit: would this logger code be good - http://www.arduino.cc/cgi-bin/yabb2/...num=1240704102
msev is offline Find More Posts by msev
Last edited by msev; Aug 01, 2011 at 06:24 AM.
Reply With Quote
Old Aug 01, 2011, 06:23 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by msev View Post
I'm just asking out of curiosity, the text size is already good as is...So you are saying the text height is easily changable? Does the text stay the same size relative to the screen size, for example using it on a 7" or 22" monitor?...If I would use a bigger monitor I would maybe like a bit smaller text size (adjusting only height would also be a good option what do you think?)..

Yeah sure that was just some ideas which would be interesting to do , although I'll need a few years probably to be able to write something that will work , I'll try to search for some useful bits of code ...Hope copy paste will work

When will you put your bird with the osd in the air , I want to see that arrow moving hehe...

Another idea, again very advanced coding probably this dakarosd has a rudder to home function (without stabilization, which is required so you have to use a stabilization solution with it), it senses when the plane goes to failsafe and starts turning around with rudder to home position...Do you think its doable with arduino?

This are just ideas I'm not pushing you into something, you have already done so much for what we code and electronics noncapable people were waiting
Autopilot, return to home and stabilization can be done with an Arduino - but running the OSD-software takes a lot, so you will "almost for sure" need another Arduino. Detecting fail-safe etc. shouldn't be any problem.
Actually, it might be possible to detect fail-safe, stop the OSD-software and run stabilization and RTH, but that will require quite a bit of work.

The text is a "part of the image". If you use bigger screen you just re-size the image and the text as well. In version 0_02 I have used small text at the top. Feel free to replace it in the new version if you prefer small text (copy-paste should do the trick )

The OSD have been tested shortly in air - but unfortunately I don't have a recorder. I have bought one, but i doubt it will arrive this week.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 01, 2011, 09:49 AM
Registered User
evvaldis's Avatar
Lithuania
Joined Jan 2007
179 Posts

Here is my OSD All components except mega, pot, LED and xtal are SMD.

I have few questions about code:
Why you just don't use "analogRead(pin)" to read ADC instead of reading H and L bits?
I have no current sensor now, so I changed Current to Voltage: ADCreal2 = analogRead(A3)/6.8;

From where is this offset?
Code:
           // Removes offset.
          if (ADCreal2 <= 125) {
           ADCreal2=0;
          }             
          if (ADCreal2 > 125) {
           ADCreal2=ADCreal2-125;
          }
Also I missed "V" letter in array, is there any reason why there is no "V"?
Thanks
evvaldis is offline Find More Posts by evvaldis
Last edited by evvaldis; Aug 01, 2011 at 09:54 AM.
Reply With Quote
Old Aug 01, 2011, 10:57 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by evvaldis View Post

Here is my OSD All components except mega, pot, LED and xtal are SMD.

I have few questions about code:
Why you just don't use "analogRead(pin)" to read ADC instead of reading H and L bits?
I have no current sensor now, so I changed Current to Voltage: ADCreal2 = analogRead(A3)/6.8;

From where is this offset?
Code:
           // Removes offset.
          if (ADCreal2 <= 125) {
           ADCreal2=0;
          }             
          if (ADCreal2 > 125) {
           ADCreal2=ADCreal2-125;
          }
Also I missed "V" letter in array, is there any reason why there is no "V"?
Thanks
Very nice and clean hardware

All Arduino-commands "takes time". Actually quite a lot more than necessary. As an example, try to use digitalWrite(1,LOW) digitalWrite(1,HIGH) etc. and see what frequency you can get. Not very high. Then try to write directly to the register, and will be able to obtain a frequency many times higher. Serial.read() and Serial.print can't be used as it is interrupt-driven.
I'm not quite sure how the analogRead() command works, but as an analog reading can require more than 64 us (1 line) the conversion should be started a couple of lines before. You might be able to use the analogRead-command but in general, the use of Arduino-commands in a code like this is just way too slow.

Have you been able to get text on your video?

The offset is from my current-sensor. It starts at around 600 mv or something like that. You can just remove if you use another current-sensor or want to read voltage.

The 'V' letter in the array just haven't been made yet as I don't need it
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 01, 2011 at 11:04 AM.
Reply With Quote
Old Aug 01, 2011, 11:36 AM
Registered User
evvaldis's Avatar
Lithuania
Joined Jan 2007
179 Posts
Quote:
Originally Posted by Dennis Frie View Post
Have you been able to get text on your video?
Yes, OSD works.
Soon I will try to understand code better and will try to modify it for my needs.
evvaldis is offline Find More Posts by evvaldis
Reply With Quote
Old Aug 01, 2011, 11:40 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by evvaldis View Post
Yes, OSD works.
Soon I will try to understand code better and will try to modify it for my needs.
Beautiful
Please be aware that the GPS-code needs to be updated.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 01, 2011 at 01:46 PM.
Reply With Quote
Old Aug 01, 2011, 01:24 PM
Registered User
PA/DE/MD area (North East MD)
Joined Jul 2006
108 Posts
any plans for a "return to home" feature if TX signal is lost?
psi3000 is offline Find More Posts by psi3000
Reply With Quote
Old Aug 01, 2011, 01:45 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by psi3000 View Post
any plans for a "return to home" feature if TX signal is lost?
I will maybe make an autopilot in the future - but I don't plan to do anything official. It would be fun to make, but I feel pretty sure existing projects as Ardupilot will be a better choice if you don't want to code yourself.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 01, 2011, 02:23 PM
Registered User
Sverige
Joined May 2009
74 Posts
I've been doing some more testing but unfortunately I still can't get a good sync.. I've have increased TCNT2 to 94 but that did'nt help. However, I think I may have found the problem but I'm not sure. I looked at the signal with a scope, and I see that the voltage level of the sync pulse is around -180mV. It should be slightly above (positive) ground, right? Any suggestions of what I need to change?

/Andreas
andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Aug 01, 2011, 02:31 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by andreas77 View Post
I've been doing some more testing but unfortunately I still can't get a good sync.. I've have increased TCNT2 to 94 but that did'nt help. However, I think I may have found the problem but I'm not sure. I looked at the signal with a scope, and I see that the voltage level of the sync pulse is around -180mV. It should be slightly above (positive) ground, right? Any suggestions of what I need to change?

/Andreas
With the cheap HK camera I'm able to get almost 100% perfect sync. No problem with complete darkness, full light or sudden change.

The sync-pulse should ideally be more than 0 v. Try to replace R3 with a 50-100K resistor. Alternatively use a diode (D5) with 200 mw higher forward voltage drop. You can also use 2 diodes in series (instead of D5) if that's easier.

The solution with fast PWM to generate a constant voltage could also be a possibility. Just replace the diode with a lowpass filter and the fast PWM output.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 01, 2011 at 02:44 PM.
Reply With Quote
Old Aug 01, 2011, 02:35 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
See post #111
Quote:
Originally Posted by Dennis Frie View Post
Better late than never....

Here goes...
The normal hardware version is more or less the same as earlier.
With my cheap china cam I had to use a diode with a little higher forward voltage drop, or increase R3 to get a stable sync.

....
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 01, 2011, 03:19 PM
Registered User
Italia, Lombardia, Milano
Joined Jun 2010
146 Posts
Hi Dennis,
I am looking at your OSD S/W and I see that some time you use different delays (e.g. 12nop or 13 nop or 14nop) before updating SPI buffer.
Any reason for not use always the same delay ?

P.S. After holidays I will start with your OSD prototype.

Ciao, Carlo.
carlonb is offline Find More Posts by carlonb
Reply With Quote
Old Aug 01, 2011, 03:19 PM
Registered User
Joined Sep 2010
2,411 Posts
It think it would be good if the gps coordinates would also be displayed, so in case you would lose the plane you could input the coordinates into google earth and retrieve it.. (possibly small numbers like flight time you have displayed)..What do you think?
msev is offline Find More Posts by msev
Reply With Quote
Old Aug 01, 2011, 03:22 PM
Registered User
Joined Jun 2011
27 Posts
Also a nice feature would be antenna tracking with a second arduino on the ground. I think the cpu power should be enough for sending the GPS position over the audio channel 2 times a second ?
jflyer2 is offline Find More Posts by jflyer2
Reply With Quote
Old Aug 01, 2011, 03:29 PM
Registered User
Sverige
Joined May 2009
74 Posts
Quote:
Originally Posted by Dennis Frie View Post
With the cheap HK camera I'm able to get almost 100% perfect sync. No problem with complete darkness, full light or sudden change.

The sync-pulse should ideally be more than 0 v. Try to replace R3 with a 50-100K resistor. Alternatively use a diode (D5) with 200 mw higher forward voltage drop. You can also use 2 diodes in series (instead of D5) if that's easier.

The solution with fast PWM to generate a constant voltage could also be a possibility. Just replace the diode with a lowpass filter and the fast PWM output.
Thanks! Tried your suggestions and although the sync pulse was well above 0v with two diodes i series, I still could'nt get a stable sync with the cheap HK cam. So I switched to my gopro and the problem went away, it's pretty much rock solid now.
andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Aug 01, 2011, 03:31 PM
Registered User
Joined Sep 2010
2,411 Posts
Dennis please don't feel too overwhelmed by requests from us...you know we people are greedy
msev is offline Find More Posts by msev
Reply With Quote
Old Aug 01, 2011, 03:41 PM
RC Farmer
Farmer_Joe's Avatar
Joined Aug 2011
419 Posts
Relay great project! It is nice to see simple and affordable osd. I think that actual coordinates are no useful because if you land far away you wont have signal at the ground level. I always disengage coordinates on my OSD.
Farmer_Joe is offline Find More Posts by Farmer_Joe
Reply With Quote
Old Aug 01, 2011, 03:58 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Wow, out for a little flight and already 6 new replies
http://www.rcgroups.com/forums/showp...postcount=1011 (Just a couple of pictures from flight )

Quote:
Originally Posted by carlonb View Post
Hi Dennis,
I am looking at your OSD S/W and I see that some time you use different delays (e.g. 12nop or 13 nop or 14nop) before updating SPI buffer.
Any reason for not use always the same delay ?

P.S. After holidays I will start with your OSD prototype.

Ciao, Carlo.
The different delays are really a pain in the ass
It would be more flexible to put it all in a buffer and run them with the same delay. The problem is, that it all takes time. To make all this on a single MCU I have tried to make it as efficient as possible. Reading the register and see if the SPI is empty is also too slow.

If you notice;
SPDR = LargeNumbers[buffer2[4]+2*temp];
DimOn;
delay15

SPDR = LargeNumbers[buffer2[4]+2*temp+1];
delay8


SPDR = LargeNumbers[buffer2[5]+2*temp];
delay15

SPDR = LargeNumbers[buffer2[5]+2*temp+1];
delay8


SPDR = LargeNumbers[buffer2[6]+2*temp];
delay15

SPDR = LargeNumbers[buffer2[6]+2*temp+1];
delay8

When it has already read buffer2[x] it needs less time to read it next time. So the delays when writing large numbers like this will be 8 and 15 all the time.

You should have seen the code before i replaced all the nops with delay8 etc :P

Quote:
Originally Posted by msev View Post
It think it would be good if the gps coordinates would also be displayed, so in case you would lose the plane you could input the coordinates into google earth and retrieve it.. (possibly small numbers like flight time you have displayed)..What do you think?
You can easy show the GPS-coordinates if you want. Just read directly from the string containing the latitude and longitude and print. But as I don't have a recorder I want have much use of GPS coordinates on screen.

Quote:
Originally Posted by jflyer2 View Post
Also a nice feature would be antenna tracking with a second arduino on the ground. I think the cpu power should be enough for sending the GPS position over the audio channel 2 times a second ?
With 9600 baud you should be able to connect it to the audio-channel without problems. It shouldn't take much to create the tracking software, but I don't really feel the need for a tracker.

Quote:
Originally Posted by andreas77 View Post
Thanks! Tried your suggestions and although the sync pulse was well above 0v with two diodes i series, I still could'nt get a stable sync with the cheap HK cam. So I switched to my gopro and the problem went away, it's pretty much rock solid now.
Good to hear the GoPro works at least. With 2 diodes, remember the reference-voltage also has to be around 600 mv higher.
I also noticed the HK camera needs a lot more dimming than my FatShark camera. The 50 ohm resistor works fine on the HK camera, but on my fatshark camera i found that it dimmed more than necessary.

Quote:
Originally Posted by msev View Post
Dennis please don't feel too overwhelmed by requests from us...you know we people are greedy
Year :P
No it's fine. At the moment I will more or less leave it as it is, and get a couple of hours in air. If everything works perfect, I will maybe implement some of your "wishes".
Showing GPS-coordinates is quickly done, and code for antenna-trakcer should be fun
Unfortunately, the GPS-reading still needs some work. It works fine here in DK, but it's a quick fix for now. Guess that has higher priority than antenna-tracker :P
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 01, 2011 at 04:11 PM.
Reply With Quote
Old Aug 01, 2011, 07:03 PM
throw new IOPilotException();
IceWind's Avatar
Ireland, County Dublin, Dublin
Joined Feb 2005
2,650 Posts
Quote:
Originally Posted by Dennis Frie View Post

With 9600 baud you should be able to connect it to the audio-channel without problems. It shouldn't take much to create the tracking software, but I don't really feel the need for a tracker.
I was thinking about that, at least just GPS.
Some ideas would be to use the zmodem protocol... but can it really fit all that in the time intervals. :S
IceWind is offline Find More Posts by IceWind
Reply With Quote
Old Aug 02, 2011, 12:16 AM
Registered User
Joined Sep 2010
2,411 Posts
Dennis can you display also the voltage of the battery? What about with a second current sensor capacity/voltage of the video battery? Exactly how much "free pins" we have now for connecting different things?

I've found another suitable cheapo gps module (although I'm not sure if I'll go with a cheapo, since I can buy a more expensive one and swap it between different planes if i'll have more than one osds..). Here it is: http://www.dealextreme.com/p/usb-gps...le-black-58695

This particular design has been used with Dakarosd (i don't know can you extract the rth code from the hex?) - http://www.aeromodelismovirtual.com/...ead.php?t=1137
Here is how it is connected with the osd: http://lh4.ggpht.com/__ZcRjrd7hg0/TO...o%2001_800.jpg

Mark
msev is offline Find More Posts by msev
Last edited by msev; Aug 02, 2011 at 12:26 AM.
Reply With Quote
Old Aug 02, 2011, 05:33 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by msev View Post
Dennis can you display also the voltage of the battery? What about with a second current sensor capacity/voltage of the video battery? Exactly how much "free pins" we have now for connecting different things?

I've found another suitable cheapo gps module (although I'm not sure if I'll go with a cheapo, since I can buy a more expensive one and swap it between different planes if i'll have more than one osds..). Here it is: http://www.dealextreme.com/p/usb-gps...le-black-58695

This particular design has been used with Dakarosd (i don't know can you extract the rth code from the hex?) - http://www.aeromodelismovirtual.com/...ead.php?t=1137
Here is how it is connected with the osd: http://lh4.ggpht.com/__ZcRjrd7hg0/TO...o%2001_800.jpg

Mark
Year you can display the battery-voltage if you want. Just use one of the spare ADC's. I think there is like 8 in total (can't remember exactly, more than I need atm).
Bu sure to add a voltage-divider (2 resistors) to make sure the MCU doesn't get > 5 volt on input.
(See post 102, Andreas added the 2 resistors for voltage reading in hos schematic. Is you use 3S batteries you can just make it 1/3 or something like that)

Sensing the current of the tx-battery wouldn't make sense. It uses the same current all the time. You will be better of using a timer
Measuring the voltage from the tx-battery would make more sense
Luckily I don't have those problems, I just use 1 battery-pack for everything

GPS module - choose what ever you prefer. Just be sure to pick a GPS module where you can change the strings send and get a descent update-rate. I use the RMC and GGA GPS strings.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 02, 2011, 08:27 AM
Electronics slayer
SouthPawPaul's Avatar
Reading, UK
Joined Jul 2008
494 Posts
Dumb ass question alert!

I started throwing some components on a breadboard last night and I got all confused.

I assumed that there would be a video in and video out section to the schematics so that it could be wired thus.



However, all I see on all the wiring schematics is Video In/Out? I'm obviously being a klutz, but this suggests to me that video goes in this connection *and* comes out of there which isn't possible; hence my post.

Can some please clarify?
SouthPawPaul is offline Find More Posts by SouthPawPaul
Reply With Quote
Old Aug 02, 2011, 10:04 AM
FPV from Lithuania
vipix's Avatar
Lithuania
Joined Mar 2007
128 Posts
I have this gps module in gps gsm tracker - http://www.globalsat.com.tw/globalsa...Load&Pval=1762
can i use this with yours osd? it 1hz.
Can this gps module share same tx pin with gsm module and your osd without problems?

Thanks.
vipix is offline Find More Posts by vipix
Reply With Quote
Old Aug 02, 2011, 03:01 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by SouthPawPaul View Post
I started throwing some components on a breadboard last night and I got all confused.

I assumed that there would be a video in and video out section to the schematics so that it could be wired thus.



However, all I see on all the wiring schematics is Video In/Out? I'm obviously being a klutz, but this suggests to me that video goes in this connection *and* comes out of there which isn't possible; hence my post.

Can some please clarify?
Video in and out is the same
You don't have to connect it "between" your camera and video-tx. You can just split the video-signal and connect a separate wire to the OSD.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 02, 2011, 03:04 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by vipix View Post
I have this gps module in gps gsm tracker - http://www.globalsat.com.tw/globalsa...Load&Pval=1762
can i use this with yours osd? it 1hz.
Can this gps module share same tx pin with gsm module and your osd without problems?

Thanks.
Year that should work, but it's preferable if you can configure the baud-rate and NMEA output settings.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 02, 2011, 03:05 PM
Electronics slayer
SouthPawPaul's Avatar
Reading, UK
Joined Jul 2008
494 Posts
Thanks for the reply, but it's all over for me for a while. I just reverse connected the video out to the video in on my 2.4ghz Tx and some magic smoke fizzed out of the back of my DX-201.

Really bummed right now. You'd have thought these things have reverse polarity protection built in.
SouthPawPaul is offline Find More Posts by SouthPawPaul
Reply With Quote
Old Aug 02, 2011, 03:52 PM
Registered User
Joined Sep 2010
2,411 Posts
Quote:
Originally Posted by Dennis Frie View Post
Video in and out is the same
You don't have to connect it "between" your camera and video-tx. You can just split the video-signal and connect a separate wire to the OSD.
I don't understand this, so if the signal is split before it arrives into the arduino there wouldn't be any overlay transmitted, so it's split as it goes out of the video out,...could you maybe draw a sketch to clarify?

Also there is a lot of schematics around in the thread, which one do you use (and which is best)? What is the purpuse of other schematics - in simple terms?

I plan to use that dealextreme nano, and the same gps you use so probably no problems in that area, current sensor probably also the same since I won't know how to modify the code if I use the flytron 50A sensor..

Everyone has it's own expertise, I'm a student of pharmacy so I'm good with molecules but bad with circuits
msev is offline Find More Posts by msev
Last edited by msev; Aug 02, 2011 at 03:57 PM.
Reply With Quote
Old Aug 02, 2011, 04:02 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by SouthPawPaul View Post
Thanks for the reply, but it's all over for me for a while. I just reverse connected the video out to the video in on my 2.4ghz Tx and some magic smoke fizzed out of the back of my DX-201.

Really bummed right now. You'd have thought these things have reverse polarity protection built in.
Auch, sorry to hear that. You can't identify the "smoked component" and replace it?
Was it only the video-out you connected wrong? My cheap HK camera output have been connected directly to ground, VCC and randomly pulsed with SPI output, constant high SPI output etc. without taking damage.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 02, 2011 at 04:34 PM.
Reply With Quote
Old Aug 02, 2011, 04:15 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by msev View Post
I don't understand this, so if the signal is split before it arrives into the arduino there wouldn't be any overlay transmitted, so it's split as it goes out of the video out,...could you maybe draw a sketch to clarify?

Also there is a lot of schematics around in the thread, which one do you use (and which is best)? What is the purpuse of other schematics - in simple terms?

I plan to use that dealextreme nano, and the same gps you use so probably no problems in that area, current sensor probably also the same since I won't know how to modify the code if I use the flytron 50A sensor..

Everyone has it's own expertise, I'm a student of pharmacy so I'm good with molecules but bad with circuits
Let's just forget the "splitting of video-signal" for a moment. I will get back to that.
The hardware-design is not completely perfect. If you take a look at commercial products used to detect video-sync, the circuit is far more sophisticated. This is an easy and pretty good way to do it, but it might not be perfect.

The main problem is, that some cameras will need more than 600 mv bias to get the sync-pulse raised above ground. Preferably I would have used a 0.7-0.8 volt zener-diode, but I also wanted to make it as simple as possible - and with standard components. Using a single 4148 diode gives you around 0.6-0.7 volt. While this should be fine for normal cameras, it's not quite enough if you use for example the cheap HK camera. Replacing R3 with a 100K ohm resistor will do the trick, but i'm not a big fan of a pull-down resistor that high. The trick with the PWM signal was just another way to create the voltage that could have been obtained with a zener-diode.

So, the short version. If don't want to "test", I would either recommend Schematic 1 and use a 0.8 volt zener-diode instead of D5, or just use the schematic on page 1.

Be aware that the 50 ohm dimming resistor might be too small. Better give like 100 ohm a shot.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 02, 2011, 04:18 PM
throw new IOPilotException();
IceWind's Avatar
Ireland, County Dublin, Dublin
Joined Feb 2005
2,650 Posts
Quote:
Originally Posted by msev View Post
I don't understand this, so if the signal is split before it arrives into the arduino there wouldn't be any overlay transmitted, so it's split as it goes out of the video out,...could you maybe draw a sketch to clarify?

Also there is a lot of schematics around in the thread, which one do you use (and which is best)? What is the purpuse of other schematics - in simple terms?

I plan to use that dealextreme nano, and the same gps you use so probably no problems in that area, current sensor probably also the same since I won't know how to modify the code if I use the flytron 50A sensor..

Everyone has it's own expertise, I'm a student of pharmacy so I'm good with molecules but bad with circuits
The way these OSD work is different from many other seen in the market.
That's what make them simpler to built.
They detect the video "pulses" and simply inject signal when needed. Kinda writing on top of the existing signal. That is why there is no need to a in/out video line.
IceWind is offline Find More Posts by IceWind
Reply With Quote
Old Aug 02, 2011, 04:21 PM
RC Farmer
Farmer_Joe's Avatar
Joined Aug 2011
419 Posts
I think that flytron simpleosd works the same.
Farmer_Joe is offline Find More Posts by Farmer_Joe
Reply With Quote
Old Aug 02, 2011, 04:28 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by msev View Post
I plan to use that dealextreme nano, and the same gps you use so probably no problems in that area, current sensor probably also the same since I won't know how to modify the code if I use the flytron 50A sensor..
I will change the current-sensor code sooner or later. Right now it's a mess. I have a flytron 25A current sensor that I will test aswell, so no problem if you wan't to use flytron 50A sensor (just write *2 in the code )
I also have a couple of 100A sensor I might test sooner or later (not flytron).
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 02, 2011 at 04:34 PM.
Reply With Quote
Old Aug 02, 2011, 04:32 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by Farmer_Joe View Post
I think that flytron simpleosd works the same.
Year, quite a few OSD's work this way. I like that you don't have to run the entire video-signal through your DIY circuit. Worst case - if a connection get's loose you should only loose the text (unless you make a short-circuit).
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 02, 2011, 04:33 PM
Registered User
Joined Sep 2010
2,411 Posts
Thanks Dennis, hope I'll be able to make it ....Btw I plan to use Sony Bloggie pm-5. Now you'll have some time off from me I'm going for a few days on the seaside, when I come back I'll probably have lots to read since this is such a fast growing thread ..
msev is offline Find More Posts by msev
Reply With Quote
Old Aug 02, 2011, 04:41 PM
Registered User
jalves's Avatar
Portugal
Joined Mar 2004
2,637 Posts
Quote:
Originally Posted by Dennis Frie View Post
Be aware that the 50 ohm dimming resistor might be too small. Better give like 100 ohm a shot.
I mount my first prototype today (schematic of post # 1) and it worked in the first try.

Well done Dennis, thanks!

Now, two "complaints".

1. the dimming provided by the 50ohm resistor is to dark for my liking. I replace it for a 100ohm, still to much darker, I'll try bigger resistances to see if I can get a light grey dim.

2. the characters are to BIG and FAT, is it possible to slim it a bit trough the code?

The arrow works very well pointing home, again, well done Dennis.

Time to play with the hardware and the software
jalves is offline Find More Posts by jalves
Reply With Quote
Old Aug 02, 2011, 04:47 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by jalves View Post
I mount my first prototype today (schematic of post # 1) and it worked in the first try.

Well done Dennis, thanks!

Now, two "complaints".

1. the dimming provided by the 50ohm resistor is to dark for my liking. I replace it for a 100ohm, still to much darker, I'll try bigger resistances to see if I can get a light grey dim.

2. the characters are to BIG and FAT, is it possible to slim it a bit trough the code?

The arrow works very well pointing home, again, well done Dennis.

Time to play with the hardware and the software
Well, as mentioned earlier the GPS-code needs a little update to support more than "around Denmark"
As you live in portugal you can just change a single number to make it calculate LOS correct.

1) The 50 ohm dimming-resistor - year definitely, on my fatshark camera I almost got complete black background. Apparently the HK camera's behave quite different.

2) There is no simple way to adjust/scale the text-size, but it's easy to replace the text with the small font as used for time and text.
I think you can copy at least topline directly from code version 2.

a picture of your project would be great

Did you mounted it in a plane?
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 02, 2011 at 04:57 PM.
Reply With Quote
Old Aug 02, 2011, 04:53 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by jalves View Post
I mount my first prototype today (schematic of post # 1) and it worked in the first try.

Well done Dennis, thanks!

Now, two "complaints".

1. the dimming provided by the 50ohm resistor is to dark for my liking. I replace it for a 100ohm, still to much darker, I'll try bigger resistances to see if I can get a light grey dim.

2. the characters are to BIG and FAT, is it possible to slim it a bit trough the code?

The arrow works very well pointing home, again, well done Dennis.

Time to play with the hardware and the software
This is small text/numbers;


From one of the first versions. Unfortunately I found it very hard to read in my fatshark googles.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 02, 2011, 05:26 PM
Registered User
jalves's Avatar
Portugal
Joined Mar 2004
2,637 Posts
I use a breadboard and an arduino with atmega328, full of patches, not a beautiful pic to show

I am using a gps simulation program doing a path with local coordinates (in fact coordinates of the rc field I usually use) .

I'll check the LOS calculation trough comparison with other osd.
jalves is offline Find More Posts by jalves
Reply With Quote
Old Aug 02, 2011, 05:40 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by jalves View Post
I use a breadboard and an arduino with atmega328, full of patches, not a beautiful pic to show

I am using a gps simulation program doing a path with local coordinates (in fact coordinates of the rc field I usually use) .

I'll check the LOS calculation trough comparison with other osd.
Can I ask if you are at west or east latitude coordinates? It's made for North / East coordinates at the moment.
I guess the distance calculation on the longitude is too large, a factor 1.4
For now you can just multiply/divide by 1.4 until a more "global" code have been made
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 03, 2011 at 07:53 AM.
Reply With Quote
Old Aug 02, 2011, 11:18 PM
Registered User
PA/DE/MD area (North East MD)
Joined Jul 2006
108 Posts
Quote:
Originally Posted by Dennis Frie View Post
I will maybe make an autopilot in the future - but I don't plan to do anything official. It would be fun to make, but I feel pretty sure existing projects as Ardupilot will be a better choice if you don't want to code yourself.
I did not know this existed. THANKS SOO MUCH!
psi3000 is offline Find More Posts by psi3000
Reply With Quote
Old Aug 03, 2011, 01:03 AM
Registered User
Joined Sep 2010
2,411 Posts
So if I'm north and east hemisphere- Slovenia, its pretty good..do i change just one number if i want Slovenia in the center instead of Denmark.. Just how large is the error and which values are affected by it?
msev is offline Find More Posts by msev
Last edited by msev; Aug 03, 2011 at 02:07 AM.
Reply With Quote
Old Aug 03, 2011, 06:58 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by msev View Post
So if I'm north and east hemisphere- Slovenia, its pretty good..do i change just one number if i want Slovenia in the center instead of Denmark.. Just how large is the error and which values are affected by it?
Then it should be easy - you just have to change a single number to match Slovenia (I think you have to multiply the longitude LOS calculation with 1.35 (replace with 130, see buttom) or something like that

I know it's not an optimal solution - but I never really figured that many people would be interested in the project. I also wanted to check that everything works before I use more time coding.

Edit; Please see line 2092 and 2093
losy = ((lathome - lats)*185)/1000;
losx = ((lonhome - lons)*104)/1000;

"losy" should be fine - but you probably want to change 104 in the losx calculation. Here in DK a change of 1 (minute/degree?) equals 1.04 km, written as 104 in this case.

Just checked, in Slovenia it seems to be 1.3 km. If you replace 104 with 130 you should be good
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 03, 2011 at 08:08 AM.
Reply With Quote
Old Aug 04, 2011, 03:59 PM
Registered User
Joined Mar 2009
1,036 Posts
Do you know the formula is almost correct, the only thing is that
-there is a constant ratio between latitude and meters (ie. 1° of latitude is always equivalent to a distance of 111120 meters)
-a contrario, the ratio between longitude and meters is proportional to the cosinus of latitude (not longitude) ( ie. 111120 meters * cosinus(latitude))

If I'm right you don't use this cosinus factor, and so for each different latitude you need to provide a different ratio.

These are simplified formulas, but OK for FPV.
flipflap is online now Find More Posts by flipflap
Reply With Quote
Old Aug 04, 2011, 05:47 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by flipflap View Post
Do you know the formula is almost correct, the only thing is that
-there is a constant ratio between latitude and meters (ie. 1° of latitude is always equivalent to a distance of 111120 meters)
-a contrario, the ratio between longitude and meters is proportional to the cosinus of latitude (not longitude) ( ie. 111120 meters * cosinus(latitude))

If I'm right you don't use this cosinus factor, and so for each different latitude you need to provide a different ratio.

These are simplified formulas, but OK for FPV.
Year, adding a cosinus might do the trick, but that's still assuming you use the same north, west etc. coordinates.
The current solution is a quick fix, but I wanted to check that everything works, before spending more time coding.
All the serial-reading, extracting information from gps-string etc. works fine

I will later add a check to see if you are in north, south, east or west coordinates and calculate the longitude distance correct. It shouldn't be too difficult, but for now testing is first.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 05, 2011, 06:35 AM
Hamburger
hamburger's Avatar
Joined Jan 2010
834 Posts
Quote:
Originally Posted by Dennis Frie View Post
I will later add a check to see if you are in north, south, east or west coordinates and calculate the longitude distance correct. It shouldn't be too difficult, but for now testing is first.
imho, a very reasonable approach.
We keep watching ya.
Good luck, Hamburger
hamburger is online now Find More Posts by hamburger
Reply With Quote
Old Aug 05, 2011, 10:24 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quick fix to show speed in km/h instead of knot/h done.
Just change scaling to use feet, miles or whatever you want to use.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 05, 2011 at 11:09 AM.
Reply With Quote
Old Aug 05, 2011, 12:53 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Little update (it's raining outside )
  • Speed changed to km/h
  • Number of satellites added
  • Now only "active numbers" will show. This means 5.5 meter altitude will show as 5.5 and not 0005.5. Speed will show as 10.5 instead of 010.5 etc. Done with speed, LOS, altitude, current and mah consumed.
  • Altitudes higher than 999 meters will now show as xxxx.x instead of xxxx.

Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 05, 2011 at 02:46 PM.
Reply With Quote
Old Aug 05, 2011, 03:18 PM
SX_
.........lost..........
Zambia, Lusaka, Lusaka
Joined Jun 2005
325 Posts
Dennis

Good work dude! really enjoying this thread!!

Willie
SX_ is offline Find More Posts by SX_
Reply With Quote
Old Aug 05, 2011, 03:26 PM
Registered User
Santo Domingo, Dominican Republic
Joined Mar 2007
278 Posts
Is anyone trying to port this to NTSC? I was looking at the code, but the PAL stuff is all over the place and many parts are not documented. I will look at it in the weekend to see if there's anything I can do. I currently have 2 Arduino pro minis in my bin, but I'm waiting for the vertical headers to test it on my breadboard.

Thanks for this amazing project Dennis! Pretty impressive what you've done with so little and such a short time.
OrlandoP is offline Find More Posts by OrlandoP
Reply With Quote
Old Aug 05, 2011, 03:41 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by SX_ View Post
Dennis

Good work dude! really enjoying this thread!!

Willie
Thanks

Quote:
Originally Posted by OrlandoP View Post
Is anyone trying to port this to NTSC? I was looking at the code, but the PAL stuff is all over the place and many parts are not documented. I will look at it in the weekend to see if there's anything I can do. I currently have 2 Arduino pro minis in my bin, but I'm waiting for the vertical headers to test it on my breadboard.

Thanks for this amazing project Dennis! Pretty impressive what you've done with so little and such a short time.
"Many parts are not documented"
Narh, with around 2000-2500 lines of code I thinks it's pretty well documented/commented compared to other code-projects I have seen. But yes, it's always a challenge to read other peoples code. I still think NTSC only needs minor changes.
Feel free to ask if you need help with anything
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 05, 2011, 04:05 PM
Registered User
Santo Domingo, Dominican Republic
Joined Mar 2007
278 Posts
Quote:
Originally Posted by Dennis Frie View Post
Thanks



"Many parts are not documented"
Narh, with around 2000-2500 lines of code I thinks it's pretty well documented/commented compared to other code-projects I have seen. But yes, it's always a challenge to read other peoples code. I still think NTSC only needs minor changes.
Feel free to ask if you need help with anything
Dennis, I think that came out wrong from me. I know it is a lot more documented than most projects, it was just greedy me wanting more As a coder, it always happens when reading other peoples code. Heck, it even happens when reading my code!

I'll start reading and see what I can do. I find it really clever the way you are injecting the data into the video.
OrlandoP is offline Find More Posts by OrlandoP
Reply With Quote
Old Aug 06, 2011, 03:24 AM
Electronics slayer
SouthPawPaul's Avatar
Reading, UK
Joined Jul 2008
494 Posts
Well, I'm a very happy bunny.

Not only did I get one of the super skilled guys at work to fix my DX201 that I smoked earlier in the week, I also got the prototype breadboard DIY OSD working too. I'm still using the original schematic that was posted and haven't tried any of the later ones yet.

All I need now is a good cheap current sensor and GPS.

Thanks again Dennis for this wonderful project and your time spent tweaking and perfecting it.
SouthPawPaul is offline Find More Posts by SouthPawPaul
Last edited by SouthPawPaul; Aug 06, 2011 at 03:29 AM.
Reply With Quote
Old Aug 06, 2011, 06:30 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by SouthPawPaul View Post
Well, I'm a very happy bunny.

Not only did I get one of the super skilled guys at work to fix my DX201 that I smoked earlier in the week, I also got the prototype breadboard DIY OSD working too. I'm still using the original schematic that was posted and haven't tried any of the later ones yet.

All I need now is a good cheap current sensor and GPS.

Thanks again Dennis for this wonderful project and your time spent tweaking and perfecting it.
That's great. I'm impressed you already gave it another try -thumbs up.
What component did you burn on the camera?

The schematic haven't changed much. The 2 schematics with fast pwm is more prove of concept. At the moment I use the schematic from page 1 as well, works well with both my cheap HK camera and my fatshark (only changed to smaller resistor on SPI out and added dimming).
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 06, 2011, 06:43 AM
Registered User
Sverige
Joined May 2009
74 Posts
Dennis, I'm trying to understand how the code works. Can you help me with this bit?

Quote:
// Writes SPEED, which is the first 5 characters in the toptext array
buffer[0]=(toptext[0])<<3;
.
.
.
// Updates SPDR (SPI buffer)
SPDR = letters[(buffer[0])+(temp)];
I understand that this code retrives the "pixel row" of the character and puts it in the tx buffer, but I don't quite understand how.

This is how I'm thinking:
First line: buffer[0]=(toptext[0])<<3;
toptext[0] = 'S' = 83 (ascii), right? Then bitshift 83 three positions to the left and you get 664? So buffer[0] is now = 664

Second line: SPDR = letters[(buffer[0])+(temp)];
Temp = 0 on first line => (buffer[0])+(temp) = 664 => letters[664] which doesnt make any sense. letters[160] is where the first pixel row of 'S' is, right?

Where do I go wrong?

/Andreas
andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Aug 06, 2011, 06:52 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by andreas77 View Post
Dennis, I'm trying to understand how the code works. Can you help me with this bit?



I understand that this code retrives the "pixel row" of the character and puts it in the tx buffer, but I don't quite understand how.

This is how I'm thinking:
First line: buffer[0]=(toptext[0])<<3;
toptext[0] = 'S' = 83 (ascii), right? Then bitshift 83 three positions to the left and you get 664? So buffer[0] is now = 664

Second line: SPDR = letters[(buffer[0])+(temp)];
Temp = 0 on first line => (buffer[0])+(temp) = 664 => letters[664] which doesnt make any sense. letters[160] is where the first pixel row of 'S' is, right?

Where do I go wrong?

/Andreas
Hi Andreas
Nice catch, not many comments on that neat trick
Using the normal ASCII-table would require S to be 83 (as you have written). The problem is, that 664 (83 * 8) can't be expressed as unsigned char. If you change to an integer it will require two times as much time. So, I just ignore the overflow - but if you check you will see that it's a perfect match
It does give some limitations as you can't go higher than letter 31 (255 / 8), but 31 letters should do it

Unsigned char can store 256 numbers (from 0 to 255).
Using the ASCII table '@' is just before A, and has the number 64. 64 * 8 = 512. That means 2 times overflow on the unsigned char - so 64 * 8 will show as 0. A (65) will then be 1 (8) etc.
Does it make any sense?
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 06, 2011 at 07:12 AM.
Reply With Quote
Old Aug 06, 2011, 07:15 AM
Registered User
Sverige
Joined May 2009
74 Posts
Oh, thats clever! Missed the fact that buffer was unsigned char. Also made the classic off-by-one error. S = index 19 (152) in the array, not 20 (160). Now it all makes sense again, thanks!

/Andreas
andreas77 is offline Find More Posts by andreas77
Last edited by andreas77; Aug 06, 2011 at 07:23 AM.
Reply With Quote
Old Aug 06, 2011, 10:48 AM
Registered User
Sverige
Joined May 2009
74 Posts
Well, NTSC version was easy enough.

Just change these two lines:
Quote:
#define butlinenumbers 261
#define butlinetext 279
to something like this:
Quote:
#define butlinenumbers 212
#define butlinetext 230
I also moved the top text up a bit to get it inside the black area of the gopro video out signal. Here is the numbers I use:
Quote:
#define toplinetext 5
#define toplinenumbers 15
#define butlinenumbers 212
#define butlinetext 230


Cheers,
Andreas
andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Aug 06, 2011, 10:53 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by andreas77 View Post
Well, NTSC version was easy enough.

Just change these two lines:

to something like this:


I also moved the top text up a bit to get it inside the black area of the gopro video out signal. Here is the numbers I use:




Cheers,
Andreas
Nice
That was even easier than I expected

If you use the black background from the GoPro you can remove the dimming by changing;
#define DimOn DDRB |= 0b00000001;
#define DimOff DDRB &= 0b11111110;

to:

#define DimOn DDRB &= 0b11111110;
#define DimOff DDRB &= 0b11111110;
(removing it will mess the timing a bit, but you can also replace it with a nop)
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 06, 2011 at 11:00 AM.
Reply With Quote
Old Aug 06, 2011, 11:13 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
By the way, Jalves PM'ed me a link to 2 programs to simulate GPS

http://www.flywithce.com/gpssim.html
http://homepage2.nifty.com/k8/gps/file/nmeagen.htm

I have used the last one and it works perfect.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 06, 2011, 11:19 AM
Registered User
Basingstoke, UK
Joined Aug 2010
1,292 Posts
Wow - looks nice.

I am trying to get Super OSD to work without an LMH1980 (sync sep) and you seem to have cracked it, good work. The clamper circuit - I have heard of it before, but never successfully implemented it.

A question - does your OSD store all the video data in memory, or generate it on demand? Super OSD has the OSD data buffered in about 12KB of memory. Can yours draw graphics or is it text only?
tom66 is offline Find More Posts by tom66
Reply With Quote
Old Aug 06, 2011, 11:25 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by tom66 View Post
Wow - looks nice.

I am trying to get Super OSD to work without an LMH1980 (sync sep) and you seem to have cracked it, good work. The clamper circuit - I have heard of it before, but never successfully implemented it.

A question - does your OSD store all the video data in memory, or generate it on demand? Super OSD has the OSD data buffered in about 12KB of memory. Can yours draw graphics or is it text only?
All the characters etc. is stored like this;
0b00000000,0b00000000,
0b00000001,0b11000000,
0b00000111,0b11000000,
0b00001111,0b11000000,
0b00011111,0b11000000,
0b00011111,0b11000000,
0b00000011,0b11000000,
0b00000011,0b11000000,
0b00000011,0b11000000,
0b00000011,0b11000000,
0b00000011,0b11000000,
0b00000011,0b11000000,
0b00000011,0b11000000,
0b00011111,0b11111000,
0b00111111,0b11111100,
0b00011111,0b11111000,

Small number;
0b00000000,
0b00010000,
0b00110000,
0b01010000,
0b00010000,
0b00010000,
0b00010000,
0b01111110,

- so year, you can add graphic the same way. Here is a battery-icon test:
0b00011111,0b11000000,
0b00011111,0b11000000,
0b11111111,0b11111000,
0b11111111,0b11111000,
0b11000000,0b00011000,
0b11000000,0b00011000,
0b11000000,0b00111000,
0b11000000,0b01111000,
0b11000000,0b11011000,
0b11000001,0b10011000,
0b11000011,0b00011000,
0b11000110,0b00011000,
0b11001100,0b00011000,
0b11011000,0b00011000,
0b11111111,0b11111000,
0b11111111,0b11111000,

You can also make animations etc. The main problem is processor-power. If you draw on every line there is no time left to process GPS-data etc (I only use one microcontroller).
So year, you can add simple graphic, but it's not meant to be a gaphic-heavy OSD. It's designed with a simple layout in mind.

The biased clamping circuit is not perfect, but it works pretty well. The pot should make it possible to get a good sync with all cameras - also cheap chinese cameras

The text is stored "in pieces". If you want to store everything in one buffer, then you will need a huge buffer, and a slow integer to access it. You probably also need another microcontroller to do all the calculations from GPS etc. The way I have done it should be pretty efficient, but it's not very flexible.

And Arduino as platfrom allows a lot of people to "join". A 14 dollar Arduino board (or something like that) with a simple IDE, a few normal components and you are ready to go.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 06, 2011 at 12:16 PM.
Reply With Quote
Old Aug 06, 2011, 03:45 PM
Registered User
Basingstoke, UK
Joined Aug 2010
1,292 Posts
The potentiometer is okay for ground testing, but you will find that unless you glue the potentiometer up, it will drift due to in flight vibration. A better idea might be a digital potentiometer (use the atmega for controlling one over i2c) or a circuit which adjusts its level automatically (I saw a circuit using two transistors which automatically adjusted the sync clamp level. I'll try and dig it up.) This is the main reason I went with the expensive LMH1980 although I'm sure it is possible to perfect the circuit you have posted without a potentiometer.

With two MCUs performance is improved on Super OSD, as one can be tasked with a drawing operation while GPS data is being processed, however the cost increases because of this.
tom66 is offline Find More Posts by tom66
Reply With Quote
Old Aug 06, 2011, 08:37 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by tom66 View Post
The potentiometer is okay for ground testing, but you will find that unless you glue the potentiometer up, it will drift due to in flight vibration. A better idea might be a digital potentiometer (use the atmega for controlling one over i2c) or a circuit which adjusts its level automatically (I saw a circuit using two transistors which automatically adjusted the sync clamp level. I'll try and dig it up.) This is the main reason I went with the expensive LMH1980 although I'm sure it is possible to perfect the circuit you have posted without a potentiometer.

With two MCUs performance is improved on Super OSD, as one can be tasked with a drawing operation while GPS data is being processed, however the cost increases because of this.
The main idea of this project is to keep it as simple (hardware) and cheap as possible. As I don't plan to do any fancy graphic I actually prefer the simplicity of one controller and no extra chips. I can show all the data I need, handle GPS data, current reading etc. with a single processor. But yes, time/processing power, is a bit more critical
On the Super OSD project you seem to prioritize a lot of features. That can be neat as well, but I prefer just to show the most basic info.

The pot needs to be turned quite a lot before I loose sync. I can actually turn it like 1-2 turns before loosing sync on my fatshark camera. I might replace it with a resistor, but I don't think it will be necessary.
I feel pretty confident it's possible to make the circuit work well without adjustable components (e-osd is a fine example). But for now the pot works great.

Are you done with the GPS part (set home position, calculate LOS and point home) and current sensor?
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 06, 2011 at 09:11 PM.
Reply With Quote
Old Aug 06, 2011, 08:44 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
I will maybe write a flight-summary later, anything I have forgot?
  • Total flight time
  • Max speed
  • Max Altitude
  • Max LOS
  • mAh used
  • Total distance traveled (this will need a little codework)

I'm also thinking about replacing the time with flight-time. I don't really need the time for anything.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 06, 2011 at 09:12 PM.
Reply With Quote
Old Aug 07, 2011, 02:56 AM
Registered User
Joined Sep 2010
2,411 Posts
What about some parameter about current? What abot coordinates of the landing spot? Altough again I don't know if one would receive the video signal from the ground if he lost the plane far away..How will you initiate the "summary screen"? Adding time back is just a matter of copy paste right, if i would want to put it back ...
msev is offline Find More Posts by msev
Last edited by msev; Aug 07, 2011 at 03:10 AM.
Reply With Quote
Old Aug 07, 2011, 04:01 AM
Registered User
jalves's Avatar
Portugal
Joined Mar 2004
2,637 Posts
Dennis,

I may add to your list the gps coordinates if the receiver enters failsafe, the receiver (trough a channel) could "trigger" an input in the diyosd to show in the screen the gps coordinates.

Then in case of a proper failsafe (no motor or slow motor and coordinate turn to a gentle spiral) we could narrow the down spot of our model.
jalves is offline Find More Posts by jalves
Reply With Quote
Old Aug 07, 2011, 07:05 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by msev View Post
What about some parameter about current? What abot coordinates of the landing spot? Altough again I don't know if one would receive the video signal from the ground if he lost the plane far away..How will you initiate the "summary screen"? Adding time back is just a matter of copy paste right, if i would want to put it back ...
Max and avg current added to list

I haven't really decided if I want to show GPS-coordinates all the time or not. It can help find a lost plane, but if you fly without recorder it's just more annoying text
Adding GPS coordinates of the landing spot might be a good idea, that will require signal after landing/crash.

I plan just to show the info when the speed is below like 2 km/h - but not before take off

And yes, if I replace the time with a timer it's just a copy-paste problem if you want to show time
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 07, 2011, 07:10 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by jalves View Post
Dennis,

I may add to your list the gps coordinates if the receiver enters failsafe, the receiver (trough a channel) could "trigger" an input in the diyosd to show in the screen the gps coordinates.

Then in case of a proper failsafe (no motor or slow motor and coordinate turn to a gentle spiral) we could narrow the down spot of our model.
Detecting failsafe would require more wires and preferable an interrupt to detect the servo pulse. For now I will keep it as a simple OSD without connection to the receiver, extra sensors etc.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 07, 2011 at 07:25 AM.
Reply With Quote
Old Aug 07, 2011, 10:15 AM
Registered User
Sverige
Joined May 2009
74 Posts
I have another question, this time about the PAL signal. I know there are 625 lines in each PAL frame and that the signal is interlaced, but how is the interlaced signal transmitted?

Is it like this?
Line 1-313 = first field = all odd lines in the picture.
Line 314-625 = second field = all even lines in the picture.

In that case, I guess your code only uses the first field to display the text? Not that it matters, it works great and looks great, I'm just trying to understand.

/Andreas
andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Aug 07, 2011, 02:37 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by andreas77 View Post
I have another question, this time about the PAL signal. I know there are 625 lines in each PAL frame and that the signal is interlaced, but how is the interlaced signal transmitted?

Is it like this?
Line 1-313 = first field = all odd lines in the picture.
Line 314-625 = second field = all even lines in the picture.

In that case, I guess your code only uses the first field to display the text? Not that it matters, it works great and looks great, I'm just trying to understand.

/Andreas
To be honest, I actually haven't done anything about that. With a normal pal-signal the code will count around 315 lines (around 625 lines / 2) before resetting line-count. You might be able to get a better text-resolution in the height by detecting odd/even, but I'm pretty happy with the resolution as it is. The code use/writes on both odd and even lines, but it doesn't distinguish between the two.
You can make a quick change in the code and see what happens if you only use odd or even
The code will see the picture as 50 frames per second with something like 314 lines.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 07, 2011 at 03:46 PM.
Reply With Quote
Old Aug 07, 2011, 04:17 PM
Registered User
Sverige
Joined May 2009
74 Posts
Quote:
Originally Posted by Dennis Frie View Post
With a normal pal-signal the code will count around 315 lines (around 625 lines / 2) before resetting line-count.
I think that was the answer I was looking for, thanks!

So it works like this:

frame sync => ~314 odd lines => frame sync => ~314 even lines

not like this (like I thought)

frame sync => 625 lines (half odd / half even)

I also think the resolution is good enough as it is, I'm just trying to understand how it works.
andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Aug 07, 2011, 04:21 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by andreas77 View Post
I think that was the answer I was looking for, thanks!

So it works like this:

frame sync => ~314 odd lines => frame sync => ~314 even lines

not like this (like I thought)

frame sync => 625 lines (half odd / half even)

I also think the resolution is good enough as it is, I'm just trying to understand how it works.
Jep, the controller will see;
frame sync => ~314 odd lines => frame sync => ~314 even lines
or 50 frames per second with something like 314 lines.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 07, 2011, 05:18 PM
Registered User
Sverige
Joined May 2009
74 Posts
Quote:
Originally Posted by Dennis Frie View Post
Jep, the controller will see;
frame sync => ~314 odd lines => frame sync => ~314 even lines
or 50 frames per second with something like 314 lines.
Great, but when I think about it some more, wouldn't that make every character twice as tall? For example, the small letters are 8 rows tall. If all 8 rows of the character are written to all frames, the character would end up being 16 rows tall in the complete picture, wouldn't it? Again, obviously everything looks and works great and the characters doesn't look stretched either. I should probably just accept the fact that it works, but it annoys me when I don't fully understand how..
andreas77 is offline Find More Posts by andreas77
Reply With Quote
Old Aug 07, 2011, 05:20 PM
Registered User
Joined Sep 2010
2,411 Posts
I have another idea - alarms (blinking text), but I guess one would have to be code literate to modify them to one's liking...
msev is offline Find More Posts by msev
Reply With Quote
Old Aug 07, 2011, 06:51 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by andreas77 View Post
Great, but when I think about it some more, wouldn't that make every character twice as tall? For example, the small letters are 8 rows tall. If all 8 rows of the character are written to all frames, the character would end up being 16 rows tall in the complete picture, wouldn't it? Again, obviously everything looks and works great and the characters doesn't look stretched either. I should probably just accept the fact that it works, but it annoys me when I don't fully understand how..
Year, but only twice as tall compared to the use of 8 lines instead of 16
The width of the letters (or the width of 8 bit) is defined by the clock-rate and SPI-settings. The height is only defined by the lines. If you use single line (only even or odd) the height of 1 "pixel" will result in a "long" pixel. Using 2 lines as height and max SPI speed seem to give an pretty good pixel-form
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Aug 07, 2011, 06:56 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
815 Posts
Quote:
Originally Posted by msev View Post
I have another idea - alarms (blinking text), but I guess one would have to be code literate to modify them to one's liking...
Can be done pretty easy, and the "limits" can just be defined at the top like this;
#define altitude_limit 150

I don't mind to implement it if anybody is gonna use it, but I don't really feel the need myself

EDIT; quick implementation done on altitude limit, works fine

By the way. Ideas for improvement are welcome, but support for extra sensors etc. will not be added now.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Aug 07, 2011 at 07:55 PM.
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Diy osd karl k FPV Talk 2 May 03, 2011 12:31 AM
Idea New DIY OSD? atari7202 FPV Talk 1 Mar 25, 2011 12:08 AM
Discussion see my own diy OSD video Passion Aerial Photography 7 May 27, 2010 01:28 AM
Discussion REAL homebrew DIY OSD - Check it out! jafoca FPV Talk 8 Jun 29, 2009 06:52 PM
Discussion picoOSD DIY PIC12F683 based OSD in C kbosak FPV Talk 6 Jan 31, 2008 07:47 AM