Developer

OSD with vector graphics compatible with MinimOSD

Hi,

Have been working on an OSD compatible with MinimOSD, but based on a STM32F4. The OSD can do vector graphics and also can send data to the ground station using the unused frames after the Vsync pulses ( like teletext).( I use this to send data to my antenna tracker.) The OSD is desigtned to be a drop in replacement for MinimOSD and accepts Mavlink data.  Also has 2 audio channels ( so can be used e.g fo vario) and various peripherals ( serial port, i2C, SPI and PWM capture etc,) broken out on headers.

Here is a video of the prototype working

regards

Andy

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

          • Developer

            It certainly needs some thought!. I think the key to "the aircraft structure" for Ardupilot firmware may be MAVLInk. The alpha version of the firmware hides the MAVLINK messaging/ aircraft structure , but on reflection I dont see why it needs to be hidden and it makes it tricky for the user to customise.

            But whatever...  this really is  Alpha  firmware , so obviously we just need to get *something* up and running and then get feedback from pioneer users and testers as to how it should really work.

            One thing though.. it's a great little board with loads of potential and I see no reason why it cant have different firmware flavours running on it.

            regards

            Andy

        • Developer

          Still working away at the API, but now have something to show displaying on the OSD on the pcb itself.

          The plan is to make it easy to write your own cutom displays. The source code for the display  in the video  is at https://github.com/kwikius/quantracker/tree/master/examples/osd_exa...

          The source code was first compiled as a shared library( or DLL) for the PC. The resulting shared library is then be called by the OSD_maker application (detailed in the video higher in the thread), which also supplies the bitmap and font resources which the shared library uses to construct an accurate sim of the finished OSD. Once happy with the sim, the osd_maker app also then compiles the bitmap and font resources into a suitable format for the finished board. The same source code is then compiled using the microcontroller version of gcc and uploaded to the board.

          The rotation of the compass is pretty jumpy in the video. I am pretty sure that is due to the MAVLink data refresh rates I have set (The STM32F4 I dont believe is being stretched yet).  Anyway its early days so plenty of time to tinker with this.

          Have put the osd_maker Alpha in my github repo at https://github.com/kwikius/osd_maker. Its an Alpha so would need some tweaking to get it running. (Not done a Makefile yet) Also will need to get down to some docs and porting to Windows /Mac..

          Anyway I hope it shows that the OSD has some potential..

          regards

          Andy

          YouTube
          • nice, keep up the good work :)

            • Developer

              Thanks for the encouragement.. :)

              I'm pleased to report that The osd_maker app is now working in Microsoft Windows...

              Its working but needs a bit of work to get it presentable, but hope to get it up on github within the next few days..

              regards

              Andy

              YouTube
  • Developer

    Thanks for the feedback.

    Yes, it is an Open Source project. I hope to put the source on my Github account soon.

    As for the PCB, I would like to Open Source Hardware it, but with all its components being small smd, I dont see I would get too many takers for a kit. I would certainly welcome advice, links and ideas on how to get the board ( or rather a MK11 version) manufactured though as I am pretty clueless about that. I got the originals done at OSHPark and a very nice job too. They were populated by hand, but I dont recommend that unless you are a masochist :)

    Before proceeding, I should provide some attributions. This is far from being all my own work. The driver code is based on work by Sami Korbonen who did a prototype using an STM32F4 for Openpilot. That code was then taken up by TauLabs and the BrainFPV project. Sami Korbonen in turn built on the work of Thomas Oldbury ( SuperOSD) mainly for the prototype display design.

    The OSD was started because I wanted to use the video signal for sending telemetry data to my antenna tracker. I have been using the Frsky telemetry link and more recently FSK via a video audio channel, but the commercial antenna trackers are all moving to this method because (at least as teletext) it is meant to give better range.. see here for details

    The processor used is the STM32F4. The OSD uses 2 bits per display pixel and is capable of outputting Black, Grey and White as well as transparent. The display can be interlaced or non-interlaced. The display size is adjustable within constraints. The size of a pixel in x is adjustable, by adjusting the pixel clock. The Hardware uses 2 SPI ports which are set up in slave mode so the MISO pins are outputs. The SPI's are both clocked by the same pixel clock. The SPI's are loaded by DMA and the data outputs are used to address a 4:1 analog multiplexer whose inputs are the display colours. The code departs from previous work AFAIK in using software to deduce the vsync pulse and odd/even frame. This was done to save money and board space on a dedicated sync sep IC, as I coulnt find any under SOIC8 size.

    The board bases its I/O on the MinimOSD, so it's designed to be possible to replace MinimOSD with this board
    without changing connectors. There are a couple of minor differences. The 6 pin header used on MinimOSD for the MAVlink Serial port has all the active pins of the MinimOSD but, on this board, the unused pins are used to provide a second bi-di serial port on which the Tx pin can be optionally inverted. (This is used in the prototype to send data down a FrSky Receiver telemetry link). Another difference is that the serial ports on the 6 pin header are completely electrically isolated from the rest of the board using the equivalent of an opto-isolator. This is done so that the video circuitry is insulated from the noise of the FC, servos etc and avoids "ground loops" which so often cause interference on the display. You need to provide 5v on this connection but this is available on the original comnnector so shouldnt cause major problems. Jumpers are provided so you can join the two parts if you wish... but not recommended!

    At the other end of the pcb, as with MinimOSD, lies the video I/O, the pins are arranged as on MinimOSD, except that 2 extra audio outputs ( Left and right) are provided. These are connected via buffer amps and decouple caps to the STM32 DAC outputs. On the prototype the audio output is used to provide FSK telemetry data ( Though this is redundant with the new use of the video frame to convey data).

    The use of DMA coupled with the high performance of the STM32F4 means that there is ample processor
    bandwidth available for other tasks. To that end all unused pins are broken out on headers.  As well as the above mentioned video, audio and serial port ports the following peripherals are also available as raw header pins.
     
     1 serial port ( so total 3)
     2 I2C ports
     1 SPI port
     6 Analog inputs
     4 pwm/capture/compare I/O
     1 CAN interface
     
     There are also various other general I/O for switches/LEDS etc.  In fact the  BrainFPV board uses the same MCU to power a complete FC, so I am sure this board will be able to do that too. One long term goal is a port of PixHawk/ APM to the board.

     Finally, as well as Display, the OSD is designed to act as either a Transmitter or Receiver of data, using unused  parts of the Video signal. The Data rate is adjustable. Currently using around 60k bits per sec ( ie continous throughput but much higher instantaneous bitrate at about 2 MHz in the video line), though it should be possible to go to nearly 3x that ( with possible a trade off between range and data rate), but it should be possible to send raw MAVLink (or any other) data at a a good rate through the link.
     
     Because it involves no extra hardware connectors antennas and cables, airborne or ground, the use of the video signal to convey data is very attractive, however for redundancy, on the prototype there are 3 simultaneous ways to communicate telemetry data; via the audio, the video and the RC link. You can add a further dedicated telemetry link too of course..
     
     During the design of the electonics, I have also tried to keep in the spirit of MinimOSD, so
     I have used a switching regulator to provide a 5V output, though I worked to an output of 200 mA only ( MinimOSD appears to be designed for 1A?) and also provided extra filtering at the inputs and outputs to pass EMC testing which is quite strict here in UK an also to avoid interference to the various other rf parts of the aircraft. Overall, I have worked to avoid too many expensive components to try to keep the costs down.
     
    Software wise the main ingredient is the use of OpenRTOS, so it is relatively easy to provide your own custom tasks.

    In order to customise the display I am looking at various options.  but initially the idea is to provide the declaration of an "OnDraw" function that you write your own implementation of ( or use one predone), but which insulates you entirely from having to worry about low level details of the Display driver.

    There will be a suitable API eg to draw lines circles, text etc, as well as variables providing the system state , e.g battery level, yaw, pitch roll, gps etc etc. , which I am now working on. Currently you would write the function in C or C++, but another option is to enable scripting the OnDraw function using for example micropython.

    I am also currently writing a PC app so that you can design fonts and bitmaps which can be uploaded to the board, in fact there is much work to do overall so from being a simple telemetry option for my tracker, the project has spiralled !

    Anyway all comments, suggestions and ideas very welcome....

    regards
    Andy


     
     
     
     
     
     
     




    kwikius/quantracker
    FPV antenna tracker based on a STM32F4 Discovery board and a pololu style servo motor - kwikius/quantracker
    • Developer

      Hi again,

      I'm pleased to announce that all the source for both software and hardware for the OSD is up on Github. Its all in my quantracker repository.

      The firmware for the board is in https://github.com/kwikius/quantracker/tree/master/air/osd. To build the finished board firmware do  'make board_type4' in that directory. If you try the Makefile, I have no doubt there will be issues so please report and I'll try to fix. The schematic and pcb design which is done in KiCad is available in https://github.com/kwikius/quantracker/blob/master/air/osd/hardware...

      If you are feeling adventurous you can send the board to OSHpark. The zip for the board shown is here

      Please note there is very liitle of the higher level API yet, but the low level stuff is there. Also note that the board is a worki in progress as everything else. The finished board will have some changes, though this one works as drawn without any issues..


      regards
      Andy

      kwikius/quantracker
      FPV antenna tracker based on a STM32F4 Discovery board and a pololu style servo motor - kwikius/quantracker
      • Thank you Andy.

        Ordered three PCB from OSHpark today. That part was painless - soldering those 0603 parts will be more of a challenge.

        • Developer

          That is great news :)

          I have put up the bill of materials so you can get a flavour of what you need. (In OpenOffice/LibreOffice format Air OSD board bill of mateials

          I live in UK and used various supplies, including Farnell, Mouser and Digikey.  I reckon that I could have saved on the resistors and capacitors by going to Farnell, but if you live elsewhere it may be the reverse.

          Anyway I hope the part numbers will save some time and I will have a look and check for any errors in the next day or so, as it was only roughly done to get my parts.

          I will look into making a goody bag of resistors and caps that I can find for you ( or ones you dont already have), if you are interested, as I should have spares? Will also try to get some documentation up, re how to program the board etc.

          As to soldering, I can do a HowTO, if you wish, but dont want to teach my grandma to suck eggs! The 0603's arent that hard.. its the MSOP8's, and SC-70's on the board that are tricky :)

          Seriously it's not too hard, but does require practise, so if you want some tips, I'll happily provide mine.. 

          regards

          Andy

          kwikius/quantracker
          FPV antenna tracker based on a STM32F4 Discovery board and a pololu style servo motor - kwikius/quantracker
          • Thank you Andy. The BOM will save time. I started to get one out of Kicad, but it will be easier with yours. Probably won't have the PCB until mid to late February so I will get an order in to digikey before then. Should be OK for the resistors and capacitors, but will need to order the rest. Not a lot of experience with SMT but am working on my technIque.  Hints on get the code loaded would definitely help.

            For anyone else interested,  it was US $22 for three PCB and free (I assume slow) shipping.

            • Developer

              Just as a heads up, if anyone wants to get the board at OSHPark, its a 4 layer board rather than a 2 layer one. The $22 price sounds about right for that.

              The main issue with smd soldering I find, is not to panic if you get solder bridges. In that case, I find Its best to get all the component pins down and then use some fine desolder braid ( say 1 mm or 1.5 mm), primed with a flux pen, to remove the excess. Just be very gentle as the fine pins can bend if you swipe solder braid across them. My eyesight isnt that good and so I also use a desk magnifier, but the most useful tool is a USB microscope so you can really see what you have done. They just plug in to your PC lijke a webcam. Also great if you have children!

              Anyway, soldering the board by hand will take a while. Might also be worth experimenting on some old SMD boards before you start if you have any!

              I will write up more about how to program the boards, but in brief, its not complicated:

              As far as uploading firmware there are a couple of methods; If you have a Discovery board (This should also work with Nucleo boards) of pretty well any flavour, then you can use that as a programmer. You just need to remove a couple of jumpers and connect some wires to the board. For Linux you will need texane/ST-Link  . For Windows ST-Link (N.B you dont need to buy anything if you have a Discovery board, it has the programmer built in. You just need the software at foot of the page)

              In Linux, once you have built the osd source, then do a 'make upload' with the Discovery connected. I will write up the full details about how to do that, but its pretty simple. For Windows I think there is pretty good help file with the S-Link utility.

              The other programming method is to set a jumper on the board, to put the board in programming mode and use the Serial Port on the board and connect, via a USB to serial, to the PC and use an application called stm32flash

              I confess I havent done that on this board yet, though I have on other boards so I had better try it out and check it actually works, (especially over the isolated digital link), before recommending it !

              I will get down to writing some basic docs about this..

              regards

              Andy

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @knightsautoteam: Hi @diyrobocars, we are Orlando's first Autonomous racing club and would love your support. We are hosting our first K…
Friday
DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #14 - #ParkingLotNerds join us January 15th for #AutonomousRacing #RoboRace ⁦@DAVGtec…
Jan 16
DIY Robocars via Twitter
RT @chr1sa: And after that came our races, 50 in all. This battle between these two Russians was the best we've ever seen -- incredible fig…
Jan 16
DIY Robocars via Twitter
RT @chr1sa: Before our @DIYRobocars virtual race this weekend, we had a presentation from the team that won the Indy Autonomous Challenge i…
Jan 16
DIY Drones via Twitter
Dec 12, 2021
DIY Robocars via Twitter
Dec 12, 2021
DIY Robocars via Twitter
RT @chr1sa: Just a week to go before our next @DIYRobocars race at @circuitlaunch, complete with famous Brazilian BBQ. It's free, fun for k…
Dec 4, 2021
DIY Robocars via Twitter
How to use the new @donkey_car graphical UI to edit driving data for better training https://www.youtube.com/watch?v=J5-zHNeNebQ
Nov 28, 2021
DIY Robocars via Twitter
RT @SmallpixelCar: Wrote a program to find the light positions at @circuitlaunch. Here is the hypothesis of the light locations updating ba…
Nov 26, 2021
DIY Robocars via Twitter
RT @SmallpixelCar: Broke my @HokuyoUsa Lidar today. Luckily the non-cone localization, based on @a1k0n LightSLAM idea, works. It will help…
Nov 25, 2021
DIY Robocars via Twitter
@gclue_akira CC @NVIDIAEmbedded
Nov 23, 2021
DIY Robocars via Twitter
RT @luxonis: OAK-D PoE Autonomous Vehicle (Courtesy of zonyl in our Discord: https://discord.gg/EPsZHkg9Nx) https://t.co/PNDewvJdrb
Nov 23, 2021
DIY Robocars via Twitter
RT @f1tenth: It is getting dark and rainy on the F1TENTH racetrack in the @LGSVLSimulator. Testing out the new flood lights for the racetra…
Nov 23, 2021
DIY Robocars via Twitter
RT @JoeSpeeds: Live Now! Alex of @IndyAChallenge winning @TU_Muenchen team talking about their racing strategy and open source @OpenRobotic…
Nov 20, 2021
DIY Robocars via Twitter
RT @DAVGtech: Live NOW! Alexander Wischnewski of Indy Autonomous Challenge winning TUM team talking racing @diyrobocars @Heavy02011 @Ottawa…
Nov 20, 2021
DIY Robocars via Twitter
Incredible training performance with Donkeycar https://www.youtube.com/watch?v=9yy7ASttw04
Nov 9, 2021
More…