jdl

  • ***
  • 196
It’s based on the original LP MinOPOSD code. I’ve been playing with it and adding or changing features for some time... The goal is to have in the OSD some vital kinds of information that would help me fly safer in FPV without distracting me during flight.
I believe the result had become useful enough to worth be shared. And I sincerely hope it to be of benefit to the LibrePilot project and community.


Because of program space limitations, I had to sacrifice some features in the original firmware that I’ve found not very useful to me in order to free code space and program new ones that I felt to be more beneficial. Like original MinOPOSD, the code can be compiled (compiler conditional defines) for different targets (CC3D or Revo, Multirotor or Plane) and features included or not.

New stuff:

  • Resettable OSD Home location. Initially set when GPS lock is obtained (like original MinOPOSD). Reset OSD (not FC!) Home Location by moving Radio Control (Mode2) right stick (Roll/Evelator) to upper right.
  • Time-In-Flight: Time passed in ARMED state after the first throttle burst (takeoff). Time spent while gliding without throttle (wings firmware) counts!
  • Flight-Time-Remaining: Estimated remaining time in the air, based on preset battery capacity, energy used (mAh) and time-in-flight (since takeoff). Does not count gliding without throttle (planes firmware).
  • GPS lock can be 2D, 3D and DGPS (differential corrections: WAAS, EGNOS, etc.)
  • 3D speed and Airspeed. Speed in the direction of flight (3d space; calculated from GPS speed and baro climb/descend rate). Airspeed (pitot tube) is displayed in planes firmware.
  • Stall speed warning and alarm for planes. Stall speed threshold can be set in the OSD_JDL_Config tool. Airspeed indicator starts blinking when airspeed is less than 4km/h above the preset stall speed threshold. STALL ALARM is activated when airspeed is below the threshold.
  • GPS altitude (ALT), Barometric Altitude-Above-Home (AAH) (BA) and GPS based Altitude-Above-Home (HA). BA & HA are reset in OSD automatically when OSD Home Location is set (or reset via RC right stick).
  • Battery type (LiPo or Li-ion) selectable. Automatic cells count detection and LiHV detection for LiPo type (Li-ion type is fixed in firmware to 4 cells). Battery type can be configured in the OSD_JDL_Config tool and in the OSD setup menu. To enter OSD setup menu, toggle the switch for channel 7 to Panel3 position while disarmed.
  • Configurable battery capacity in mAh. Setup it in the OSD_JDL_Config tool or in the OSD Setup menu. To enter OSD setup menu, toggle the switch for channel 7 to Panel3 position while disarmed.
  • Remaining energy indicators (percents) (battery voltage and consumed energy based). Empiric Voltage-to-Remaining Capacity correction curves (different for LiPo and LiHV) are applied to battery voltage to obtain more realistic estimates for remaining battery capacity based on voltage.
  • LTSR (LongTermSafetyRadius): Estimates how further (from the takeoff point) the pilot can fly before he has to turn back and return to takeoff location in stright line, with the remaining battery power. Uses the preset battery capacity, used energy (mAh) and total travelled distance since takeoff. Calculation is made with 20% battery capacity left in reserve.
  • STSR (ShortTermSafetyRadius): Similar to LTSR but based on short term energy consumption and flight efficiency.
  • Eff (Efficiency Estimation): Efficiency of motor flight (in milliWattHour/km). When throtte is off displays Estimated Gliding Distance before touching the ground (ground level is assumed to be the same as at the takeoff location; planes firmware). For Multirotors there is no glide distance estimation  and the efficiency is displayed in Wh/km.
  • Climb Rate. Multirotor firmwares display it in +/- m/s. Plane firmwares show it in m/min with different icons for climb or descend.
  • Combined COMPASS HEADING and ROSE. Slightly altered appearance, also.
  • HOME Direction and Distance are combined, too.
  • MOD/ASWA indicator: Displays flight mode (ST1, ST2, MAN, RTB, PH, AC, etc.). MOD label is replaced with ASWA label, if ASWA (Always-Stabilize-When-Armed) is enabled and activated.
  • Pre-arm and arming statuses: When not armed, OSD displays FC readiness to arm. DISARMED and icon “circle with ‘x’ inside reports “not ready to arm”, DISARMED and icon “circle with dot” inside signals the FC is ready to be armed, ARMING... appears while arming, obviously...  :)
  • WAYPOINT INFO (waypoint number, distance to it and Estimated-Time-Arrival) in RTB and PathPlan autonomous flight modes. In all other flight modes the waypoint info is hidden.
  • Various warnings and alarms:
    • Warning for low battery – when measured voltage falls below preset voltage (for a SINGLE CELL, eg. 3.55V) – can be configured in OSD_JDL_Config tool or through OSD setup menu.
    • Warning for GoHomeNow! (LTSR < 0) or (STSR < 0)
    • Warning for airspeed below stall speed threshold. STALL ALARM is displayed.
    • Warning for low RSSI, low LQ (Link Quality). Hardcoded thresholds are RSSI < -84 / LQ < 105. These apply when OPLINK is used for RC control. There is also option to have OSD firmware that gets RSSI on a (PWM) RC channel (#10). The hardcoded RSSI warning threshold is set to -71dBm there.
    • STAB and ATTI alarms, corresponding to the ones in GCS System Health. ATTI alarm display is supressed while FC is in armed state to avoid possible annoying announcement (during whole flight) of the erroneous ATTI alarm, caused by "THE BUG" in INS13.
    • CPU WARNING, CPU CRITICAL, MEMORY LOW, STACK OVERFLOW – displayed by CC3D dedicated OSD firmware.
    • OVERHEATING alarm, if external LM335z temperature sensors (connected to MinimOSD) are used to monitor ESC and Motor temperatures in the OSD. Hardcoded thresholds (in dedicated OSD firmware) are 60degC  for ESC and 75degC  for motor.
    • Warnings display behavior is altered: When a warning appears, OSD switches immediately to Panel 1 and warning message flashes there (like in original MinOPOSD). Unlike it, if warning condition persists for more than approx. 3 seconds, OSD switches back to the panel that was active before alarm and the warning text continues to flash there until the warning condition is cleared.

Video mode might be set to PAL or NTSC like with original MinOPOSD. This is configurable in OSD_JDL_Config tool. I’ve not tested NTSC (I use PAL cams only) but it should work.

GPS coordinates (LAT, LON values) are displayed in xx.xxxxx  format, no letters. This is enough for an approx.  a meter accuracy and saves space on the screen. Negative numbers for coordinates and these with three digits before decimal point are also displayed (can expand to the right).

Current and voltage sensors can be either connected to Revo FC (preferred!) or directly to MinimOSD board. Different precompiled OSD firmwares. If using voltage sensor only, connected to MinimOSD board, and NO current sensor, disable it by setting “Current Sensor Amps Per Volt” and “Current Sensor Amps Offset” to zero (in OSD_JDL_Config tool or in the OSD Setup menu).

To disable LINK QUALITY / RSSI LOW alarms when using OSD without RSSI, just uncheck the "RSSI & LinkQuality" fields on both Panel1 & Panel2 in OSD_JDL_Config tool!

There are some settings that are configurable in the original LP MinOPOSD but are hardcoded in this MinOPOSD JDL version, sorry for that...
  • OSD Toggle Channel is fixed to RC Channel 7 (Ch7)!
  • All values are in metric system: m, km, m/s, km, h, Wh/km, etc.
I run all my UAVs on LP “next” r735 based firmwares and the MinOPOSD JDL code has UAVObject IDs for r735 but I recall there are no changes in r782 that will affect it and it should match with r782 fine, too.
I’ve also included an option (compiler conditional define) to build the MinOPOSD JDL firmwares for LP 16.09, respective UAVO IDs are there. However, I’ve not tested it recently. It should work, though...


MinOPOSD JDL requires a dedicated matching charset version that comes with OSD_JDL_Config, it should be uploaded to the MinimOSD the same way as with original LP MinOPOSD (through the OSD_JDL_Config tool).

Different precompiled firmware HEX files for different FC targets (Revo or CC3D), UAV types (multirotors or planes) and / or features supported can be also uploaded to the MinimOSD board the same way as with original LP MinOPOSD (through the OSD_JDL_Config tool).

Because of space limitations, some firmwares are compiled WITHOUT the ability to update charset! In such a case, if charset update is necessary:
  • Upload any other firmware WITH update charset functionality.
  • Do the charset update using this firmware.
  • Finally, flash the desired firmware without charset update capability.
OSD can support up to three external LM335z temperature sensors (for ESC, Motor and Ambient air temperature monitoring), when battery voltage and current sensors are connected to Revo FC. Detailed how-to instructions shall be added later if there is interest.
Without extretnal LM335z sensors, the OSD displays baro sensor temperature.


All precompiled firmware HEX files, config tool and charset are available on github.
Some combinations were never tested in real as I don’t have such setups (like Multirotor + CC3D + Battery_on_OSD + Safety Radius&Eff), if you find any issues, let me know!

If anyone has interest in compiling the firmware himself, sources (OSD and Config tool) are there, too. OSD requires Arduino 1.0.5-r2; the Config tool – Microsoft Visual Studio 2010.

I’d like to emphasize that I had not made any efforts to make the changes to the source codes prettier, well commented and easier to read. It would be nice, but...  :D


Precomplied firmware (LP 16.09 & LP “next” r.735+) HEX files features matrix

FW#Multi rotorAir planeCC3D   Revo      Battery on OSDBattery on RevoOplink Radio ControlRSSI on Ch10Charset UploaderSafety Radius & EfficiencyGlide Est.WP InfoBatt Type SelectLiHV detectStall Alarm
01X-X-X--X-X---X-
02X-X-X--XX----X-
03-XX-X--XXX--X (noBattCrv)--
04X--XX--XX----X-
05X--XX--X-X (noEff)---X-
06X--XX-X--X---X-
07X--X-X-XXX---X-
08X--X-X-XXX-X-X-
09X--X-XX-XX-X-X-
10X--X-XX--X-X-X-
11-X-X-X-X-XXXX-X
12-X-X-XX-XXXX--X
13-X-X-XX--XXXXXX



Charset .mcm file is located in "/ConfigTool_minOPOSD JDL/OSD Charset/" folder.

HEX files are located in "/ConfigTool_minOPOSD JDL/OSD Firmwares/" folder: https://github.com/jdlilov/MinOPOSD-JDL/tree/main/ConfigTool_minOPOSD%20JDL/OSD%20Firmwares



Config Tool Panels:









OSD DVR Samples:









GitHub Link: https://github.com/jdlilov/MinOPOSD-JDL

Download ZIP: https://github.com/jdlilov/MinOPOSD-JDL/archive/main.zip



P.S. (02 Dec 2020) Updated sources and precompiled firmwares (incl. LP 16.09 compatible) to version 2.53.
« Last Edit: December 02, 2020, 04:24:15 pm by jdl »

Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #1 on: November 22, 2020, 05:45:46 am »
Wow!  Such a nice gift to the LP community!  Thanks!

jdl

  • ***
  • 196
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #2 on: November 22, 2020, 07:41:18 pm »
Thanks, Cliff!

Its quite insignificant if compared to what the community had given to me! :)
I'd really hope this can contribute to the LP project!
But I'd consider work done if and when I see reports of this OSD version being successfully used in others' builds.



karla

  • *****
  • 603
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #3 on: November 23, 2020, 03:32:04 am »
Nice!

Quote
   
  • Stall speed warning and alarm for planes. Stall speed threshold can be set in the OSD_JDL_Config tool.
I think this was hardcoded in the version you posted before, much appretiated :)

jdl

  • ***
  • 196
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #4 on: November 23, 2020, 07:25:01 am »
Nice!

Quote
   Stall speed warning and alarm for planes. Stall speed threshold can be set in the OSD_JDL_Config tool.

I think this was hardcoded in the version you posted before, much appretiated :)

I've managed to squeeze few more bytes and make the stall speed warning threshold configurable. :)

Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #5 on: November 23, 2020, 08:26:13 am »
I watched the videos and when I saw time/distance to waypoint I had a big smile on my face.  :)  After that I read all the features carefully!!!

Does the config tool run under Linux/Wine?  Wish list: Config tool source on a cross platform framework so it can be built under Windows, Linux, or MacOS.  Sorry.  Had to say it.  ;)

jdl

  • ***
  • 196
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #6 on: November 23, 2020, 12:15:50 pm »
I watched the videos and when I saw time/distance to waypoint I had a big smile on my face.  :)  After that I read all the features carefully!!!

Added this recently. WP info is calculated the same way as in the PFD (GCS).

Does the config tool run under Linux/Wine?  Wish list: Config tool source on a cross platform framework so it can be built under Windows, Linux, or MacOS.  Sorry.  Had to say it.  ;)

Config tool: Windows only, .NET 3.5

I'd like to but have no experience there... :(

trust

  • ***
  • 108
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #7 on: November 23, 2020, 10:31:32 pm »
Cool! So I tried this on the minOPOSD cards I just got. It seems to work with 16.09 as far as I've tested. I tried the 04 ucode version.
A few questions:
I'm setting for a multirotor and want to monitor battery voltage for a 4s battery. I have it currently plugged into the BAT1 pin, but I'm not seeing any voltage change.
I don't need to switch panes or manually initialize - I do that all through this setup. I don't have Ch7 in use for anything, so it seems to be giving me a telcom error message. Any way to turn this off?

trust

  • ***
  • 108
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #8 on: November 24, 2020, 05:29:33 am »
I did some more testing on the MinOPOSD board with the new code. Turns out with code 04 it now pulls the battery input from what was the current monitor pin on the PCB. It also does not seem to have a voltage divider - 0V reads 2.1V with the default settings and 1.1V is the max and reads as 16.6V - 1.1 V is the reference V on the A/D and max input V to the A/D. I'll try sticking a 14.7K resistor on it for my 4s batteries. Input to gnd measures 812ohm so may need to tweek the calibrate R divider values. Seems like there is an offset value that can be entered also in the setup - current offset?

jdl

  • ***
  • 196
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #9 on: November 24, 2020, 10:02:45 am »
This (04) OSD firmware will not properly work with LP16.09, it has UAV Objects definitions matching current "next". This is most probably the reason you are getting "NO TEL COM" warnings!

Here I've compiled and attached the HEX file for firmware 04 that should work with LP16.09, please try it.

As for battery voltage, there is something strange, I've looked at the code and saw that it reads Atmega 328p analog pin 6 ?! The same is in the original LP MinOPOSD source, I've changed nothing here...

OSD_Config.h
Code: [Select]
// JRChange: Flight Batt on MinimOSD:
// #define FLIGHT_BATT_ON_MINIMOSD

// Add MicroOSD KV team mod
// #define MICRO_OSD_KVTEAM

// JRChange: Flight Batt on Revo:
//#define FLIGHT_BATT_ON_REVO

FlightBatt.h
Code: [Select]
#if defined MICRO_OSD_KVTEAM

#define VOLTAGE_PIN       0                       // Micro OSD KV team : Bat1
//#define VOLTAGE_PIN       2                       // Micro OSD KV team : Bat2
#define CURRENT_PIN       1

#else

#define VOLTAGE_PIN       6
#define CURRENT_PIN       7

#endif


I've only one UAV build that uses battery monitoring on OSD and it still works fine with my firmware (on pin 6). However, the MicroMinimOSD module on it is at least 5 years old. Cannot tell if it looks the same as nowadays ones as it is wrapped in thermofit but I suspect it differs...

I've traced the connections on a recently bought MicroMinimOSD and here is how the PCB pads and Atmega 328p analog inputs are matched on it:

CURR - A1
RSSI  - A3
Batt2  - A0
Batt1  - A2

Funny that Batt1 and Batt2 seem to are swapped on this particular board, compared to definitions in FlightBatt.h for MICRO_OSD_KVTEAM :)

CURR pad is not suitable for monitoring voltage, unless you make the voltage divider yourself (one 1k resistor from the CURR pad to the GND and one 15k resistor from the CURR pad to the battery terminal.

Anyway, please try the firmware I've attached here with battery connected to Batt1 (right-most pad). If still not getting plausible voltage readings, try connectiong the battery to Batt2 pad (the one to the left).

trust

  • ***
  • 108
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #10 on: November 24, 2020, 11:08:09 pm »
Ok! Tested this and checked the batt1 input pin R to gnd (15.5k, so it does have the divider). I had to change the divider ratio to 18.9 to get it to match the battery voltage (divided by 4). But it now reads an average cell voltage.
Everything else I checked seems to work fine now! GPS is showing num of satellites, mag is showing direction properly (my previous versions didn't work at all on this).
All good! Thanks!
Attached is image of unit as I have it wired.

jdl

  • ***
  • 196
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #11 on: November 24, 2020, 11:32:49 pm »
Glad to hear it works for you :), I've never tested this exact configuration (Revo FC + Batt on OSD).

But I'm little puzzled about what you said about "reading an average cell voltage"!? OSD should display number of cells detected and total battery voltage, not the averaged voltage per single cell. If a single cell voltage is displayed, this is not right and I'll fix it!

Here is a screenshot of what is expected to get in OSD about battery voltage when using Batt-On-OSD firmware. Do you see it this way in your OSD?

I'd appreciate if you can share a screenshot showing how is the battery voltage displayed.

trust

  • ***
  • 108
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #12 on: November 25, 2020, 12:35:19 am »
Weird. Here's a pix - I have a different layout, but the V going to the input IS 4S, but I'm only seeing one cell appearing. So I get a Battery Low alarm, plus I still get a link alarm.

jdl

  • ***
  • 196
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #13 on: November 25, 2020, 09:28:34 am »
Weird. Here's a pix - I have a different layout, but the V going to the input IS 4S, but I'm only seeing one cell appearing. So I get a Battery Low alarm, plus I still get a link alarm.

Weird indeed! The OSD reads Batt1 voltage below 5V and detects it as s single cell battery. I've briefly checked the code and could not find issue there... Analog reference is being correctly set to INTERNAL (1.1V), I had a doubt about that but it seems right.

About LINK QUALITY alarm - this was expected as OSD is compiled with RSSI monitoring on Ch10. I've added an extra check to NOT display RSSI warnings at all when there is not RSSI field set on either of OSD panels.

Here is a fresh HEX file that should not monitor RSSI on Ch10 and not issue LINK QUALITY warnings at all. Again, you must check in Config tool that RSSI & Link Quality field is disabled / not checked in both Panel1 & Panel2.

When I get back home, I'll flash the same HEX on my CC3D quad (battery voltage is also read in OSD there) to see if it displays correctly the battery cells count and total voltage.

Can you do one more check: please, measure again (with multimeter) the 4S voltage coming to OSD board, with probes touching directly the Batt1 and GND pads on MicroMinimOSD board.

What is the value set in Config tool for Battery (Single Cell) Warning Level (V) ?
« Last Edit: November 25, 2020, 09:34:27 am by jdl »

trust

  • ***
  • 108
Re: Alternative LibrePilot MinOPOSD with a matching Config tool and Charset
« Reply #14 on: November 25, 2020, 07:40:23 pm »
That fixed the Link error.
I think I've got a lead for you on the battery problem. On my system, I have separated the power going to the FC,OPOSD,escs,rcvr,OPLINK and the camera,vidxmtr - which includes the 4s power lead that goes to the OSD to measure battery voltage. Sometimes I don't want to bother with all the video stuff and just fly the plane.
I normally plug the FC combo in first, then the cam/xmtr.
If I reverse the order and plug in the cam/xmtr FIRST then the number of cells come up correctly, and the V starts OUT at the right value, then decreases steadily until it gets to a one cell value. The cell count stays correct at 4s. The battery percent keeps decreasing after the bat V stabilizes.
I checked the voltage and it is definitely 15+ volts. Cell warning is set at 3.0V

I looked at your code - seems ok. I gather batt_type is force set to 1 or lipo. I get the sampling filter(s) and the num_cell calculator. Does num_cell get locked in somehow?