SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Mar 03, 2012, 09:42 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,043 Posts
Quote:
Originally Posted by msev View Post
Well so I did my first look into the code, and it seems its easy to configure since you documented so well ..I'll just post here what I'm doing just for you to double check.
Since I'll first try my luck with the lm1881:
Code:
//Arduino = 0, SimpleOSD = 1
#define controller 1
Since I'm planning in the future to use a 50A current sensor:
Code:
// Current-sensor
#define offset 0
#define current_cal 0.49
What's the purpose of the voltage divider?

// As default configured for standard plane -> I'll use it on a plane. Do I have to put // infront of #define below // Quad/helicopter example...If I once put it on a quad how do I enable it to quad settings?

Hmmm altitude less then 999 , that means if I go above 999 it will show me summary, do you guys use higher values?

// Hide GPS-coordinates when altitude is more than x meter, can I put higher values? (not that I'm going to go that high )

Regarding the button for config, are we talking that button that's on the arduino?

That display of degrees in which one is flying, that you said is only for your country is very important for me, when I'll be flying with a narrow beam helical..can you modify it also for my country? Please PM me with additional details

For a 3S lipo 10V for voltage alarm or should I go higher/lower?

// END SETUP
Yes, if you use LM1881 you should select SimpleOSD as controller

The current_cal 0.49 should match a 50A current sensor with linear output from 0-5 volts.

The purpose of the voltage divider is simply to lower the voltage to make the controller able to read it. The controller can't read higher voltage than 5 volt. If you use 3S li-po it would make sense to use a voltage-divider - where 15 volts gives 5 volt output from the voltage-divider.

The parameters you mention for plane/quad etc. is only to define when to show flight-summary. If you fly a multirotor or heli it's easy just to measure the amps. If they are below, say 2A, chances are you have just landed. For a plane, it makes more sense to watch the speed. If the speed of your plane is below 5 km/h, chances are your plane is on the ground.
The "summary altitude" is just another parameter to make sure flight summary only show when you want it to. If you write say 50, it should only show flight summary when your altitude is less than 50 meters, speed is less than summary_speed, los is less than summary_los etc.

The "hide GPS coordinates" or only show GPS-coordinates every x second was mainly a test. I don't use it myself, but you can config it to only show gps coordinates every 5 second or so if you want.

10 volt for 3S is fine. You will notice that you drop below 10 volt pretty quickly if you really pull a lot of amps.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Mar 03, 2012 at 09:48 AM.
Reply With Quote
Sign up now
to remove ads between posts
Old Mar 03, 2012, 10:01 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,043 Posts
The function that shows the planes position in degrees relative to yourself can probably also be used, even though you are not in Denmark, but the degrees probably want match those on a map. It might work just fine, but as i was just a "test-function" I haven't tested it for anything but my own coordinates.

You can test it pretty easy with a GPS simulation program - or just by flying around yourself and see if it shows the degrees right all the time
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Mar 03, 2012, 01:00 PM
Registered User
Joined Sep 2010
2,419 Posts
Quote:
Originally Posted by Dennis Frie View Post
The function that shows the planes position in degrees relative to yourself can probably also be used, even though you are not in Denmark, but the degrees probably want match those on a map. It might work just fine, but as i was just a "test-function" I haven't tested it for anything but my own coordinates.

You can test it pretty easy with a GPS simulation program - or just by flying around yourself and see if it shows the degrees right all the time
Can you point me to the relevant part of code and maybe explain it to me about, also could you point me to a suitable gps sim.program...I would very much like to use this functions, even if its a few degress off...
msev is online now Find More Posts by msev
Reply With Quote
Old Mar 03, 2012, 01:06 PM
Registered User
Joined Sep 2010
2,419 Posts
Quote:
Originally Posted by Dennis Frie View Post
The current_cal 0.49 should match a 50A current sensor with linear output from 0-5 volts.

The purpose of the voltage divider is simply to lower the voltage to make the controller able to read it. The controller can't read higher voltage than 5 volt. If you use 3S li-po it would make sense to use a voltage-divider - where 15 volts gives 5 volt output from the voltage-divider.
Aha, so voltage divider must be used if I want to use the current sensor with a lipo larger than 1S...I'll try to figure it out myself, if I'll need help I'll ask .

Quote:
The parameters you mention for plane/quad etc. ...
Yes I know, I have configured my own values....But I'm confused if I should put // before the defines of the quad parameters (like to undefine them) . So that the plane parameters would only be defined?

What about in the case I would want to use defines under quad, I would put // before plane defines? Hope you get me..
msev is online now Find More Posts by msev
Reply With Quote
Old Mar 03, 2012, 01:16 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,043 Posts
Quote:
Originally Posted by msev View Post
Can you point me to the relevant part of code and maybe explain it to me about, also could you point me to a suitable gps sim.program...I would very much like to use this functions, even if its a few degress off...
I just checked the code, and I think the plane-position should work - also for other locations than Denmark. I have only tested for Denmark, but it should be programmed to work for the entire world.

This is what you wanna look for in the code:
if (latitude_dir == 'S') {
losy=losy*(-1);
}

if (longitude_dir == 'W') {
losx=losx*(-1);
}

if (losy > 0) {
if (losx > 0) {
// Arrow right up
// (57 = from radians to degrees)
homehead = 90-asin(losy/(double(los)))*57;
}
if (losx <= 0) {
// Arrow left up
homehead = 270+asin(losy/(double(los)))*57;
}
}

if (losy <= 0) {
if (losx > 0) {
// Arrow right down
homehead = 90+acos(losx/(double(los)))*57;
}
if (losx <= 0) {
// Arrow left down
homehead = 270-acos(abs(losx)/(double(los)))*57;
}
}

if (show_plane_pos == 1) {
homehead_r[0] = ((homehead/100)+3)<<5;
homehead_r[1] = ((homehead%100/10)+3)<<5;
homehead_r[2] = ((homehead%100%10)+3)<<5;
}
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Mar 03, 2012, 01:21 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,043 Posts
Quote:
Originally Posted by msev View Post
Aha, so voltage divider must be used if I want to use the current sensor with a lipo larger than 1S...I'll try to figure it out myself, if I'll need help I'll ask .



Yes I know, I have configured my own values....But I'm confused if I should put // before the defines of the quad parameters (like to undefine them) . So that the plane parameters would only be defined?

What about in the case I would want to use defines under quad, I would put // before plane defines? Hope you get me..
No, the current-sensor can be used with more or less any battery. Flytron's current-sensors is rated 2.7 - 40 volts (I believe that's the limit for the INA139).

The voltage-divider is only used to read the battery-voltage. I think the complete schematic can be found somewhere - not posted by me.

You have this:
// As default configured for standard plane
///*
#define summary_speed 5 // Speed less than (in km/h)
#define summary_los 100 // LOS less than (in meters)
#define summary_current 99 // Current less than (in amps)
#define summary_time 0 // Flight time more than (in seconds)
#define summary_altitude 999 // altitude less than (in meters)
//*/

/*
// Quad/helicopter example
#define summary_speed 99 // Speed less than (in km/h)
#define summary_los 9999 // LOS less than (in meters)
#define summary_current 3 // Current less than (in amps)
#define summary_time 0 // Flight time more than (in seconds)
#define summary_altitude 999 // altitude less than (in meters)
*/

You only need these 5 lines:

#define summary_speed 99 // Speed less than (in km/h)
#define summary_los 9999 // LOS less than (in meters)
#define summary_current 3 // Current less than (in amps)
#define summary_time 0 // Flight time more than (in seconds)
#define summary_altitude 999 // altitude less than (in meters)

Just delete everything else if that's easier.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Mar 03, 2012, 04:32 PM
Registered User
Joined Sep 2010
2,419 Posts
Quote:
Originally Posted by Dennis Frie View Post
I just checked the code, and I think the plane-position should work - also for other locations than Denmark. I have only tested for Denmark, but it should be programmed to work for the entire world.
Would you mind showing where on your display you show this angle on the osd,...Where can I find in the config part of the code to enable this?

Is it this:

// Show plane pos
#define show_plane_pos_ 1
msev is online now Find More Posts by msev
Reply With Quote
Old Mar 03, 2012, 04:43 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,043 Posts
Quote:
Originally Posted by msev View Post
Would you mind showing where on your display you show this angle on the osd,...Where can I find in the config part of the code to enable this?

Is it this:

// Show plane pos
#define show_plane_pos_ 1
Yup, that's the right place in the config-file.

The degrees can be seen here:


I have enjoyed the feature - works pretty well.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Feb 04, 2013 at 05:34 PM.
Reply With Quote
Old Mar 03, 2012, 05:00 PM
Registered User
Joined Sep 2010
2,419 Posts
Thanks! That's that big lake close to that gps position from the last picture right ...Nice lake, it has lots of curves

Yep this feature should be a winner ...I also found relevant info about the voltage divider, got it now, its clear and easy ..No probs. Thanks again! Now I just have to wait for my ubec ..
msev is online now Find More Posts by msev
Reply With Quote
Old Mar 03, 2012, 05:07 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,043 Posts
Quote:
Originally Posted by msev View Post
Thanks! That's that big lake close to that gps position from the last picture right ...Nice lake, it has lots of curves

Yep this feature should be a winner ...I also found relevant info about the voltage divider, got it now, its clear and easy ..No probs. Thanks again! Now I just have to wait for my ubec ..
Yes, it's the same place
I guess you actually checked the GPS-coordinates from previous post
It's a pretty good place to fly. Nice view, pretty far from cities, close to the ocean and the lake etc.

Good luck with the project, just ask if you have problems.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Mar 04, 2012, 10:23 AM
Registered User
Joined Sep 2010
2,419 Posts
Btw I'm modifying the this file: DIY_OSD_v0_17.doc I think I found it in the first post. Is it meant for arduino 1.0 or arduino 0023?

How do I know if I look at the code for which version it is meant .

Its okay to upload the code once everything is wired up (gps, sensors, circuit)..Since all components tolerate 5V right...When uploading code to the nano via usb, which is 5V I guess does the current flow through the entire circuit,gps etc?

EDIT: Got it, version 17 is 0023, version 18 which I've missed is arduino 1.0.
msev is online now Find More Posts by msev
Last edited by msev; Mar 05, 2012 at 09:22 AM.
Reply With Quote
Old Mar 04, 2012, 10:30 AM
Chilled and served
Henry.'s Avatar
Sweden
Joined Mar 2005
287 Posts
Dennis Frie Thanks for the reply before however i dont know pretty much anything about the programming world but i would survive without the function i mentioned.

Bwt, what does the numbers above the mAh reading on the ODS mean?

-----


I have now looked through the entire code (very good commented, even i understood it ) but i pretty much only miss one thing which i guess have been discussed before in this thread since i saw some of it way back: How about a RTH function in the simplest of ways? Tracking would be good as well but for me RTH would be much more prioritized to have.


Dont know how well the thought about RTH would work in the simplest of ways i could think of below but it would probably work.


In the simplest way if program space was an issue no matter type of aircraft it shouldnt be needed to use more then 3 outputs: Motor, Pitch and Yaw.

For Quad or Heli the Motor output should ofcourse be on all the time as well as Pitch forward. These should then be user definable how many degrees a servo arm or so should be able to move as max and be held at these points all the time when the RTH kicked in and only Yaw movement were controlled by the Arduino but the same there max movement be controllable. Guess that should work?

On a plane i guess it would be enough with 2 outputs; Motor and Yaw. Motor on all the time ofcourse and if the motor rpm is high enough the plane should climb even without pitch but i guess it would not harm to maybe even have a very small amount off Pitch as well, and then only Yaw controlled by the Arduino. Max travel on the Yaw servo arm had to be user definable as well so the plane wont do something that it shouldnt if it had to do a long turn with full Yaw or so but if the travel was kept quite low i guess it could work or maybe even pulsed perhaps so the plane hade time to level between or so.


The outputs should just be connected in parallel to the same cables as the right type of servo but any failsafe in the receiver and transmitter would ofcourse be needed to turn off. The signal to the Arduino could be taken either from the receiver if it had an LED that come on when it lost the signal that some have or any outputs that would change it state if it lost the signal. If RSSI was used this should maybe be the best to use for when RTH should kick in and if so at what % should be user definable.

Couldnt this more or less work as a KISS solution?



Dont 100% know how the expensive RTH system works if they control all servos or so but im quite sure they more or less do. Some even have leveling and so on which would be really good to have before RTH kicks in but i guess this require gyros and stuff so you better have the plane, quad or heli at a right course to the horizon if you loose the signal or force the RTH to kick in by just switch off the transmitter.

Maybe some diodes could be needed as well when connecting the servo leads depending on how the outputs from the receiver were built so the outputs from the cpu wont for example wont be shorted so the RTH wouldnt work. But i guess this would be very different between receivers.
Henry. is online now Find More Posts by Henry.
Reply With Quote
Old Mar 04, 2012, 11:33 AM
Registered User
Joined Sep 2010
2,419 Posts
Before you have RTH, you need stabilization and autolevelling for a plane.. You need a suitable gyro and suitable accelerometer...And since computing time on the arduino running the diyosd code is taken up, you'll need an additional arduino..

Controlling just the direction of the yaw servo without stabilizing the plane would lead into loss of the plane in my opinion..
msev is online now Find More Posts by msev
Reply With Quote
Old Mar 04, 2012, 12:21 PM
Chilled and served
Henry.'s Avatar
Sweden
Joined Mar 2005
287 Posts
Not necessarily since as i guess it would highly depend on the weather and the angle of the rudder but a quad it would work much better on. A plane that is good balanced and good made should level it self without any inputs as far as the engine is on and if it was not to far out from level or if it was not to windy.

But as said if it was badly out of level when the RTH kicked in so no it wouldnt end well. But since it maybe have to be a kiss solution to be able to fit in the in the code so could any RTH maybe be under the term "use of own risk, it only work under these circumstances:" could then maybe have been in place because it needs a lot of electronics involved if it should be 100% ok and these could cost quite a bit.
Henry. is online now Find More Posts by Henry.
Reply With Quote
Old Mar 05, 2012, 09:25 AM
Registered User
Joined Sep 2010
2,419 Posts
Quote:
Originally Posted by Dennis Frie View Post
LM1881 circuit done by JayPi (I'm only to blame for the colors )

Where is battery - and video - connected in the whole circuit?
msev is online now Find More Posts by msev
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 01:31 AM
Idea New DIY OSD? atari7202 FPV Talk 1 Mar 25, 2011 01:08 AM
Discussion see my own diy OSD video Passion Aerial Photography 7 May 27, 2010 02:28 AM
Discussion REAL homebrew DIY OSD - Check it out! jafoca FPV Talk 8 Jun 29, 2009 07:52 PM
Discussion picoOSD DIY PIC12F683 based OSD in C kbosak FPV Talk 6 Jan 31, 2008 08:47 AM