Hello and welcome to our community! Is this your first visit?
Register

OSD On-Screen-Display

This page is a chapter in 'Introduction to additional features'

OSD History

Original release with flight software version 2.4.1 written by alamo, modified by Mikro. For v3 it was mostly redone by kha.
Discussion for how this code was developed can be found here.

General Information

On-Screen-Display (OSD) overlays text or graphics directly on the video stream in real time and provides important information about the quadcopter.
Currently, it can display battery information (voltage, capacity), altitude, compass heading, a flight timer, GPS-based information (distance and direction to home point, number of satellites, lat/lon, speed), RSSI, a center reticle and a basic attitude indicator, using horizontal lines. Here's a video of it in action (v3.1 / v3.2 flight software):

Configuration

Hardware

To get the most out of your OSD, it is recommended to solder all of the wires to the appropriate places instead of using connectors. When using connectors, the vibrations in flight are often enough to cause intermittent connections. With most components this isn't too important, but the OSD is sensitive to a loss of sync with the flight controller - if sync is lost, a full OSD reset is required which on AQ v3.2 software can only be done by resetting the flight controller.

Note:
Do not use long wires between your flight controller and the MAX7456. The high frequency SPI data will lose signal integrity the longer the wires get, so keep your SPI (MOSI, MISO, SCK) lines as short as possible.

AeroQuad shield v2.x

To use the OSD, you'll need a MAX7456 (AeroQuad store) attached to the appropriate pins - marked 'OSD' on the AeroQuad v2.x shield.





If you experience random resets, you'll probably need to add a 10kOhm pullup resistor between 5V and the RESET pin. There isn't an explicit pin for the RESET pin on the v2 shield for the OSD. There are plenty of +5V outputs on the v2 shield, so it's OK to connect a +5V output to the reset pin permanently.
You could also add the resistor on the breakout board, just connect an 10K resistor from +5 to RST:



It's recommended to mount the MAX7456 as far as possible away from the processor to avoid interferences, e.g. at the bottom of your AeroQuad like in these pictures (click for higher resolution).





For the video signal, you need the output from your camera to go through the MAX7456, then into your video Tx. Here's a diagram showing how it should be connected. The grey line represents your video signal wire, usually white. 'Vin/Vout centre' refers to the centre of the RCA jack on the Sparkfun MAX7456 breakout board, not to any pad on the PCB.

AeroQuad32

To use the OSD, you'll need a MAX7456 (AeroQuad store) attached to the appropriate pins on the AeroQuad32 board.

AeroQuad32 v2

The AeroQuad32 v2 board already provides a JST SH connector (marked "OSD" on the board) with all needed pins for the MAX7456. Below you'll find a diagram of how to connect the "OSD" connector cables to the MAX7456.

MAX7456 pinOSD Connector Pin
5V5V (power is taken from BEC of ESC No.3)
C_OUTN/A
CSSVR0 (CS)
DINOSI2 (MOSI)
SCKSCK2 (SCK)
DOUTISO2 (MISO)
LOSN/A
RST+5V (directly or via 1k resistor)
HSYNCN/A
VSYNCN/A
GNDGND



Below the connection between the AeroQuad32 v2 board and the MAX7456 is shown.

AeroQuad32 v1

MAX7456 pinConnect to pin
+5VESC: +5V (do not power from AQ32 v1, connect to the BEC of one of the ESCs)
C_OUTN/A
CSAQ32 v1: SVR0
DINAQ32 v1: MOSI
SCKAQ32 v1: SCK
DOUTAQ32 v1: MISO
LOSN/A
RST+5V (directly or via 1k resistor)
HSYNCN/A
VSYNCN/A
GNDAQ32 v1: GND

Below is a diagram showing again how to connect the OSD to the AeroQuad32 board (click here for higher resolution):

Uploading fonts

Moreover you'll also need to update the character memory for the MAX7456. The MAX7456 has an onboard EEPROM which stores up to 256 12x18 pixel characters. To print the battery, compass, clock icons etc, you need to have these icons in the character memory.

This is a screen grab of the font set being displayed AFTER the new font was downloaded to the MAX7456 (v3.0 Flight Software):

AeroQuad shield v2.x

To upload the needed font to the MAX7456 flash use the "MAX7456_Font_Uploader" sketch distributed with the AeroQuad flight software (v3 onwards). Open the Arduino IDE, click on "File" --> "Open" and within the flight software folder navigate to the "MAX7456_Font_Updater" folder and select "MAX7456_Font_Updater.ino".

After uploading the sketch to the Arduino board, open the serial monitor window from within the Arduino software and make sure the baud is set to 9600. You will be prompted then to download the font to the MAX7456. Sending "D" on serial will start the font flashing process. You can also display the font through the MAX7456's video out to a TV etc. Make sure you disconnect the power / USB cable from the Arduino Mega before hooking up the MAX7456 to the shield.

AeroQuad32

Note:
The method described below is only available with flight software version 3.2 or greater.

To upload the needed font to the MAX7456 flash using the AeroQuad32 board you'll have to uncomment "#define OSD_LOADFONT" in "UserConfiguration.h" and upload the software again. Afterwards open the AeroQuad Configurator, connect to your AeroQuad32 board and select the "Serial Monitor" screen. Enter "&" (without quotes) in the text box and click on "Send" which will start the update process.

After the upload has been finished you may reload the software this time with "#define OSD_LOADFONT" commented.

Software

After that load the AeroQuad flight software version 2.4.1 or greater in the Arduino IDE. In UserConfiguration.h, find the following lines and uncomment #define OSD together with other options you may want to use:

Code:
//
// *******************************************************************************************************************************
// On screen display implementation using MAX7456 chip. See MAX7456.h in libraries for more info and configuration.
// For more information on how to setup OSD please refer to [URL="http://aeroquad.com/showwiki.php?title=On-Screen-Display"]http://aeroquad.com/showwiki.php?tit...Screen-Display[/URL]
// *************************************************************.******************************************************************
#define OSD
//#define ShowRSSI // This REQUIRES a RSSI reader
#define PAL // uncomment this to default to PAL video
//#define AUTODETECT_VIDEO_STANDARD // detect automatically, signal must be present at Arduino powerup!
//#define CALLSIGN "KF7YRK" // Show (optional) callsign
#define ShowAttitudeIndicator // Display the attitude indicator calculated by the AHRS
//#define USUnits // Enable for US units (feet,miles,mph), leave uncommented for metric units (meter,kilometer,km/h)
//#define OSD_LOADFONT // Include MAX7456 font into binary, give & on serial to upload

//#define OSD_SYSTEM_MENU // Menu system, currently only usable with OSD or SERIAL_LCD
Now customize the software according to this page and then upload the software to your flight controller board. After that it should be working!


Finally this is a screen grab of the OSD with live output from a GoPro (v3.2 Flight Software):




OSD layout (v3.2 Flight Software):

Code:
Note that edge rows/cols (indicated by dots) are not used as they are hidden on most displays.

PAL (30x16)
012345678901234567890123456789
------------------------------
0|..............................
1|.#1.1m#1.5m o210 04:12. // altitude | compass | timer
2|.#10.1V 15A 3000m AeroQD. // battery info[1] | callsign
3|. a a a a a a #100%. // (bat2) | (AI) | RSSI
4|. a a a a a a .
5|. a a a a a a .
6|. a a a a a a .
7|. a a a rr a a a . // (AI) | reticle | (AI)
8|. a a a @@ a a a . // (AI) | wpt arrow | (AI)
9|. a a a123ma a a . // (AI) | dist to wpt | (AI)
10|. a a aL90 a a a . // (AI) | course correction | (AI)
11|. a a a a a a .
12|. .
13|.mmmmmmmmmmmmmmmmmmmmmmmmmmmm. // line used by menu
14|.N60.12345 E024.12345 15k. // GPS coords and speed
15|..............................

NOTE: AI collides with second battery if current sensor used.
Code:
Note that edge rows/cols (indicated by dots) are not used as they are hidden on most displays.

NTSC (30x13)
012345678901234567890123456789
------------------------------
0|..............................
1|.#1.1m#1.5m o210 04:12. // altitude | compass | timer
2|.#10.1Va15A 1234ma a aAeroQD. // (bat1 | (AI) | callsign
3|. a a a a a a #100%. // (bat2 | (AI) | RSSI
4|. a a a a a a .
5|. a a a a a a .
6|. a a a rr a a a . // (AI) | reticle | (AI)
7|. a a a @@ a a a . // (AI) | wpt arrow | (AI)
8|. a a a123ma a a . // (AI) | dist to wpt | (AI)
9|. a a aL90 a a a . // (AI) | course correction | (AI)
10|.mmmmmmammamammmmamammammmmmm. // line used by menu
11|.N60.12345 E024.12345 15k. // GPS coords and speed
12|..............................

NOTE: AI collides with battery if current sensor enabled.
This will cause some flicker on extreme attitudes.

NOTE: AI collides with menuline.
This should not cause problems as menu is only usable while not armed.

Additional information


Tags:

This page has been seen 31,421 times.

    • Created by on
      Last updated by on