HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jan 06, 2012, 12:06 AM
Registered User
yzguy's Avatar
Florida
Joined Mar 2007
906 Posts
also in text.h, I added this to only print rssi level if that sensor is enabled.

#ifdef SENSOR_RSSI_ENABLED
return printNumberWithUnit(str, pos, rssiLevel, "%");
#endif //SENSOR_RSSI_ENABLED
return pos;
yzguy is offline Find More Posts by yzguy
RCG Plus Member
Latest blog entry: wing wing z-84 fpv setup
Reply With Quote
Sign up now
to remove ads between posts
Old Jan 06, 2012, 12:33 AM
Registered User
yzguy's Avatar
Florida
Joined Mar 2007
906 Posts
I got the LOS angle thing and low angle alarm working!! (well I think anyway, I have tried driving around, but not flying yet)

in alarms.h
added definition :
Quote:
static uint16_t gAlarmLOSRatioLow = 0;
and set variable:
Quote:
#ifdef ALARM_LOS_RATIO_LOW
gAlarmLOSRatioLow = gGpsLastValidData.losRatio < ALARM_LOS_RATIO_LOW;
#endif
in cl-osd.c in updateSensorsAndScreen right after call to calcHome add:
Quote:
gGpsLastValidData.losAngle = 0;
gGpsLastValidData.losRatio = 0;
#ifdef GPS_MIN_LOS_ANGLE_DISTANCE
////only try to calculate the angle if greater than a preset distance from home
if (gHomeDistance > GPS_MIN_LOS_ANGLE_DISTANCE)
{
gGpsLastValidData.losRatio = ((gGpsLastValidData.pos.altitude - gHomePos.altitude)*1000)/gHomeDistance;
gGpsLastValidData.losAngle = getLOSAngle(gGpsLastValidData.losRatio);
}
#endif
in Config.h add definition for minimum home distance to calculate angle:
Quote:
#define GPS_MIN_LOS_ANGLE_DISTANCE 300 // min distance the los angle and alarm are calculated
also add minimum LOS angle ratio (basically a ratio will equate to an angle)
Quote:
#define ALARM_LOS_RATIO_LOW 268 //This number is (height * 1000)/distance, select the number that equates the angle you want to alarm on
//176 = 10 degrees, 268 = 15 degrees, 364 = 20 degrees, 466 = 25 degrees
//this is more accurate than using just the displayed angle.
in gpsutils.h, added losAngle and losRatio to TGpsData structure
Quote:
typedef struct {
TGpsPos pos;
uint32_t gTime;
uint8_t fix;
uint8_t sats;
uint16_t speed;
uint16_t angle;
uint32_t date;
uint8_t checksumValid;
uint16_t losAngle;
uint16_t losRatio;
} TGpsData;
also added getLOSAngle function:
Quote:
static uint16_t getLOSAngle( uint8_t losRatio) {
uint16_t retval = 1;
//this should also handle negative angles, maybe for someone flying from a cliff??
if (losRatio < 0)
{
losRatio = -losRatio;
retval = -1;
}
if(losRatio < 44) retval = 0;
else if (losRatio >= 44 && losRatio < 132) retval = retval * 5;
else if (losRatio >= 132 && losRatio < 222) retval = retval * 10;
else if (losRatio >= 222 && losRatio < 315) retval = retval * 15;
else if (losRatio >= 315 && losRatio < 414) retval = retval * 20;
else if (losRatio >= 414 && losRatio < 521) retval = retval * 25;
else if (losRatio >= 521 && losRatio < 637) retval = retval * 30;
else if (losRatio >= 637 && losRatio < 767) retval = retval * 35;
else if (losRatio >= 767 && losRatio < 916) retval = retval * 40;
else if (losRatio >= 916 && losRatio < 1091) retval = retval * 45;
else if (losRatio >= 1091 && losRatio < 1303) retval = retval * 50;
else if (losRatio >= 1303 && losRatio < 1570) retval = retval * 55;
else if (losRatio >= 1570 && losRatio < 1921) retval = retval * 60;
else if (losRatio >= 1921 && losRatio < 2414) retval = retval * 65;
else if (losRatio >= 2414 && losRatio < 3172) retval = retval * 70;
else if (losRatio >= 3172 && losRatio < 4511) retval = retval * 75;
else if (losRatio >= 4511 && losRatio < 7596) retval = retval * 80;
else if (losRatio >= 7596 && losRatio < 22904) retval = retval * 85;
else retval = retval * 90;

return retval;

}
in layout.h, after printing the home distance add:
Quote:
if (gHomePosSet && gGpsLastValidData.losRatio != 0)
{
if (!gAlarmLOSRatioLow || gBlink1Hz)
pos = printNumber(gText[textId], 10, gGpsLastValidData.losAngle);
}
then add label for the angle (and I also changed the lable from LOS to DIS)
Quote:
pos = printText(gText[textId], 0, "SPD");
pos = printText(gText[textId], 5, "DIS");
pos = printText(gText[textId], 10, "ANG");
yzguy is offline Find More Posts by yzguy
RCG Plus Member
Latest blog entry: wing wing z-84 fpv setup
Reply With Quote
Old Jan 08, 2012, 04:44 AM
Suspended Account
United States, FL, Maitland
Joined Apr 2011
2,109 Posts
I have firmware from code compiled on december 6th. Is there a reason to flash to newer revision? So far it has been working fine, so that's why I ask.
chatch15117 is offline Find More Posts by chatch15117
Reply With Quote  (Disabled)
Old Jan 08, 2012, 02:27 PM
CL-OSD developer
Sverige, Östergötlands Län, Linköping
Joined Apr 2011
279 Posts
Have a look here for the latest commits:
http://code.google.com/p/cl-osd/source/list

All wiki changes will show in that list as well, don't know why...
callelj is offline Find More Posts by callelj
Reply With Quote
Old Jan 08, 2012, 03:03 PM
Registered User
Joern's Avatar
Joined Dec 2011
27 Posts
@callelj - Is it possible to print black letters or white letters with a black border or is the hardware the limiting factor?

Regards
Joern
Joern is offline Find More Posts by Joern
Reply With Quote
Old Jan 08, 2012, 03:05 PM
CL-OSD developer
Sverige, Östergötlands Län, Linköping
Joined Apr 2011
279 Posts
Joern: No it's not possible. At least not without significantly changing the hardware.
callelj is offline Find More Posts by callelj
Reply With Quote
Old Jan 08, 2012, 03:15 PM
Registered User
Joern's Avatar
Joined Dec 2011
27 Posts
Quote:
Originally Posted by callelj View Post
Joern: No it's not possible. At least not without significantly changing the hardware.
Thanks for your quick answers. Is it possible to heighten the darkness of the grey field under the white letters and numbers? I read something about to change the value of one resistor. Is this also possible due to a software change?

Regards
Joern
Joern is offline Find More Posts by Joern
Reply With Quote
Old Jan 08, 2012, 03:39 PM
Registered User
Joined Sep 2011
45 Posts
Quote:
Is this also possible due to a software change?
No it's not.
superjelli is offline Find More Posts by superjelli
Reply With Quote
Old Jan 09, 2012, 12:46 AM
Expert
Joined Mar 2007
83 Posts
all real
but speed in statistics is wrong
redsonic is offline Find More Posts by redsonic
Reply With Quote
Old Jan 09, 2012, 02:10 AM
Suspended Account
United States, FL, Maitland
Joined Apr 2011
2,109 Posts
Quote:
Originally Posted by redsonic View Post
all real
but speed in statistics is wrong
yes thats from gps glitch. sometimes it will get a location that isnt accurate, making a fake speed
chatch15117 is offline Find More Posts by chatch15117
Reply With Quote  (Disabled)
Old Jan 09, 2012, 02:12 AM
Suspended Account
United States, FL, Maitland
Joined Apr 2011
2,109 Posts
Ponce Inlet FPV compilation (7 min 27 sec)
chatch15117 is offline Find More Posts by chatch15117
Reply With Quote  (Disabled)
Old Jan 09, 2012, 02:34 AM
Opt
Registered User
New Zealand, Auckland
Joined Oct 2010
401 Posts
Thats looking and working well, what release/version is that?
im still on r72, working well but the faster upate speed you have is motivation to reflash
Opt is offline Find More Posts by Opt
Reply With Quote
Old Jan 09, 2012, 02:38 AM
Suspended Account
United States, FL, Maitland
Joined Apr 2011
2,109 Posts
december 6th not sure what build but my config.h is from 12/6/2011 7:38pm. i lost all my files so my osd folder went bye bye

but i did have a backup of my config.h because i really really didn't want to remeasure 100% and 0% rssi voltages from my receiver again. actually just so i dont lose it i'll type it here so I can go to this post if needed haha

#define SENSOR_RSSI_MAX_VOLTAGE 2.0 //(Max two digits after the dot)
#define SENSOR_RSSI_MIN_VOLTAGE 0.20
//use 100-result for grssivalue
chatch15117 is offline Find More Posts by chatch15117
Reply With Quote  (Disabled)
Old Jan 09, 2012, 11:11 AM
Suspended Account
Joined Jan 2011
255 Posts
Just followed the Compiling and Programming, and i thought it was easier than i thought but when i tested it i just found out that i didnt touch anything on the board and theres no changes on the display, here are the pictures of the connections and a video of what i did.

CL-OSD compling and programming (2 min 44 sec)

Zombee is offline Find More Posts by Zombee
Reply With Quote
Old Jan 09, 2012, 12:51 PM
Registered User
Joern's Avatar
Joined Dec 2011
27 Posts
Quote:
Originally Posted by Zombee View Post
Just followed the Compiling and Programming, and i thought it was easier than i thought but when i tested it i just found out that i didnt touch anything on the board and theres no changes on the display, here are the pictures of the connections and a video of what i did.

http://www.youtube.com/watch?v=Rej45Y9LIAQ
Use this command line:

avrdude.exe -p m88p -c usbasp -U flash:w:"cl-osd.hex" -U eeprom:w:"cl-osd.eep

The "m88p" make the difference...

Regards
Joern
Joern is offline Find More Posts by Joern
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Build Log Super OSD ($90): Open Source Graphic OSD: Vario, 6xADC, Games, Datalog, Dual Video tom66 FPV Equipment 1928 May 24, 2014 11:07 AM
Discussion Open Source Remote Control System (OSRC) Gizmoman31 Radios 152 Apr 24, 2012 06:01 PM
Discussion Open source OSD for FPV UFO_MAN FPV Talk 75 Sep 07, 2011 02:03 PM
Question Open Source Octo Design Available...Looking for someonw who can cut a copy for me... Schatham421 Multirotor Talk 14 Apr 12, 2011 05:22 PM