HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Oct 04, 2013, 04:41 PM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,479 Posts
Discussion
DJI Naza-M adapter for RemzibiOSD

Here is my DIY project that shall make it possible to connect DJI Naza-M (v1, v1 Lite, v2) with RemzibiOSD using either:
  • Arduino board (Pro Mini, 16Mhz, 5V) and serial connection (works with DJI Naza-M v1, v1 Lite and v2)
  • Teensy 3.1 board + CAN transciever and CAN connection (works with DJI Naza-M v1 and v2 with PMU, does not work with v1 Lite)
It provides the following parameters via the $GPGGA, $GPRMC, $A and $I commands:
  • latitude
  • longitude
  • altitude
  • speed over grounds
  • number of satellites
  • GPS COG (course over ground) or compass heading (not tilt compensated) - selectable with a #define
  • pitch and roll (for artificial horizon)
  • date and time
  • HDOP and fix type (including the DGPS fix) - not displayable by RemzibiOSD

It also tries to automatically save home position once 7 satellites are locked, but that may not work if the communication with OSD is not started before the lock happens (due to long autobaud detection process - 115200 is the last one tried).
For your safety always set home position manually!

Note that this adapter can also be used with other OSDs that expect the GGA and RMC NMEA messages via serial. You just need to connect it where the GPS would normally be connected.

Connection diagrams and Arduino sketches are attached.

For serial adapter you need the following library to compile this sketch:
- NazaDecoder (v20140628 or newer)

For CAN adapter you need the following libraries to compile this sketch:
- NazaCanDecoder (v20140628 or newer)
- FlexCAN (tested with v1.0)

There are follwoing configuration options in the sketch:
  • Selecting serial or CAN adater (default is serial). You need to uncomment/comment out proper #includes.

    For serial adapter use:
    Code:
    // Select the adapter type you are using (either serial or CAN) by commenting/uncommenting the right includes below
    // This line below shall be commented out when using the CAN adapter and uncommented when using serial adapter
    #include "NazaDecoderLib.h"
    // These TWO lines below shall be commented out when using the serial adapter CAN adapter and uncommented when using CAN adapter
    //#include "NazaCanDecoderLib.h"
    //#include "FlexCAN.h"
    For CAN adapter use:
    Code:
    // Select the adapter type you are using (either serial or CAN) by commenting/uncommenting the right includes below
    // This line below shall be commented out when using the CAN adapter and uncommented when using serial adapter
    //#include "NazaDecoderLib.h"
    // These TWO lines below shall be commented out when using the serial adapter CAN adapter and uncommented when using CAN adapter
    #include "NazaCanDecoderLib.h"
    #include "FlexCAN.h"
  • Selecting heading source. Default is GPS, uncomment the #define line to use compass (note it is not tilt compensated for serial adapter)
    Code:
    // By default the course over ground from GPS will be used. Uncomment the line below to use magnetometer heading instead (not recommended when using Serial adapter as it will not be tilt compensated).
    //#define USE_COMPASS_HEADING
  • Number of satellites used for automatic home setting (7 by default). Set the number in the following #define
    Code:
    // Define the number of satellites for auto home
    #define AUTOHOME_SAT_NUM 7

Make sure that the Arduino board is disconnected from the Flight Controller/GPS for programming.

This is not a ready to use product so don't expect any support. It is a DIY project and you need to have some understanding of electronics and Arduino (please don't ask me how it works or how to upload the sketch, there are many tutorials available online).

It is still in development stage so there may be errors.
Use at your own risk, try to not fry your Naza

Remzibi OSD adapter changelog
------------------------------
Version 20140629
[NEW] added support for NazaCanDecoder library. You can now select whether to use serial or CAN adapter
[NEW] requires NazaDecoder library v20180628 (or newer) when using with serial adapter
[NEW] requires NazaCDecoder library v20180628 (or newer) and FlexCAN library v0.1 beta (or newer if compatible) when usign with CAN adapter
[NEW] converting speed from m/s to knots (to match changes in the NazaDecoder library v20140628+)
[NEW] added delayed clearing of the screen after home position is set to get rid of some possible nasty artefacts on the OSD screen
[NEW] added wiring diagrams for CAN adapter

Version 20140118
[NEW] added date/time and hdop
[NEW] added flag to chose between GPS course over groung (default) or compass course
[NEW] added DGPS fix signaling
[NEW] requires NazaDecoder library v20180118 or newer which fixes some stability issues
[NEW] added this changelog file

Version 20131009
initial version of the library
pawelsky is offline Find More Posts by pawelsky
Last edited by pawelsky; Jul 19, 2014 at 03:49 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Oct 09, 2013, 05:57 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,479 Posts
The adapter sketch has been updated (v20131009) and it now sends both $GPGGA/$GPRMC and $A/$I messages so it should work with more variants of the RemzibiOSD firmware.

The common decoding functions have been moved into a separate library (called NazaDecoder)
pawelsky is offline Find More Posts by pawelsky
Last edited by pawelsky; Oct 09, 2013 at 11:40 AM.
Reply With Quote
Old Nov 15, 2013, 07:39 AM
Registered User
Joined Mar 2009
39 Posts
Hi,
thanks for your sharing and hard work.
ASAP I'll try to do this setup and will post the flight result.
vadda is offline Find More Posts by vadda
Reply With Quote
Old Nov 15, 2013, 08:01 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,479 Posts
Quote:
Originally Posted by vadda View Post
Hi,
thanks for your sharing and hard work.
ASAP I'll try to do this setup and will post the flight result.
Glad you like it, please share the results once you have it all set up.
pawelsky is offline Find More Posts by pawelsky
Reply With Quote
Old Nov 16, 2013, 09:35 AM
Registered User
Joined Mar 2009
39 Posts
Today I've tried in flight.
It work but there are strange things, distance from home sometimes show very big number , also speed and latitude.
Seem like buffer overflow.
When pass the CLR command the layout return to ordinary values.
The phrase on Remzibi site will be usefull ?

"All data transmitted to OSD are buffered , however buffer is 110 chars so strings longer than 110 are not allowed , string of data is terminated by <CRLF>."

ASAP I'll try to record a video.
vadda is offline Find More Posts by vadda
Reply With Quote
Old Nov 16, 2013, 04:41 PM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,479 Posts
Quote:
Originally Posted by vadda View Post
Today I've tried in flight.
It work but there are strange things, distance from home sometimes show very big number , also speed and latitude.
Seem like buffer overflow.
When pass the CLR command the layout return to ordinary values.
The phrase on Remzibi site will be usefull ?

"All data transmitted to OSD are buffered , however buffer is 110 chars so strings longer than 110 are not allowed , string of data is terminated by <CRLF>."

ASAP I'll try to record a video.
Try saving the home position with the OSD button press.
pawelsky is offline Find More Posts by pawelsky
Reply With Quote
Old Nov 20, 2013, 03:44 AM
Registered User
Joined Mar 2009
39 Posts
This is the recording session :

Remzibi adapter DJI (7 min 6 sec)


Another session with native Remzibi GPS is ok.
vadda is offline Find More Posts by vadda
Reply With Quote
Old Nov 20, 2013, 04:10 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,479 Posts
Quote:
Originally Posted by vadda View Post
This is the recording session :

http://youtu.be/FCjH9Ccr2x0

Another session with native Remzibi GPS is ok.
Thanks for the video.

Would you be able to log data coming from the adapter (e.g. using the OpenLog or something similar)? Maybe there are some overflows or something?
pawelsky is offline Find More Posts by pawelsky
Reply With Quote
Old Nov 20, 2013, 04:32 AM
Registered User
Joined Mar 2009
39 Posts
Sadly no
I dont have any serial logger but I can try to modify your sketch, add the softserial library and log via PC
Only cant record during flight....
You think its possible ?
Why in your code send command via $A an also native NMEA ?

Another question (maybe out of topic here):
the altitude data came fro GPS or from BARO ?
Maybe in the protocol there is a different code, with V2 PMU and iOSD the data about altitude seem real, not problematic as GPS
Any idea ?

Thanks for your support
vadda is offline Find More Posts by vadda
Reply With Quote
Old Nov 20, 2013, 04:38 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,479 Posts
Quote:
Originally Posted by vadda View Post
Sadly no
I dont have any serial logger but I can try to modify your sketch, add the softserial library and log via PC
Only cant record during flight....
You think its possible ?
To log on PC you don't need to modify the sketch, connect only the TX/GND lines from Arduino to the serial-to-USB adapter (you can have them connected to the OSD at the same time).

Quote:
Originally Posted by vadda View Post
Why in your code send command via $A an also native NMEA ?
To support more RemzibiOSD firmwares

Quote:
Originally Posted by vadda View Post
Another question (maybe out of topic here):
the altitude data came fro GPS or from BARO ?
GPS

Quote:
Originally Posted by vadda View Post
Maybe in the protocol there is a different code, with V2 PMU and iOSD the data about altitude seem real, not problematic as GPS
Any idea ?
In v2 the data comes from CAN bus, where you have more than just the GPS/compass data.
pawelsky is offline Find More Posts by pawelsky
Reply With Quote
Old Nov 20, 2013, 05:49 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,479 Posts
I've found a moment, when the GPS data changes for a split second to some rubbish (see attached picture) causing all the invalid reading. The question is whether that is what the adapter transmits, or the OSD has problems receiving/parsing data. I'll try to reproduce it with logging.
pawelsky is offline Find More Posts by pawelsky
Reply With Quote
Old Nov 20, 2013, 07:26 AM
Registered User
Joined Mar 2009
39 Posts
On my OSD there is version 1.80 loaded.
Maybe the double command ($A and NMEA) will interfere ?
The serial buffer limit may be problematic ?
vadda is offline Find More Posts by vadda
Reply With Quote
Old Nov 20, 2013, 05:14 PM
Registered User
Joined Mar 2009
39 Posts
I've found this two "glitch" in the tx logging :

-------------------------------------------------------------------------------------

$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 0.98,M,,M,,*60
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.33, 302.51,000000,,*08
$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 1.00,M,,M,,*60
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.40, 302.79,000000,,*06
$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 1.05,M,,M,,*65
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.37, 302.57,000000,,*0A
$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 1.11,M,,M,,*60
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.27, 302.70,000000,,*0E
$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 1.11,M,,M,,*60
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.27, 302.50,000000,,*0C
$GPGGA,000000.000,9521.9415,N,06602.6097,E,1,05,,5 39021.00,M,,M,,*69
$GPRMC,000000.000,A,9521.9415,N,06602.6097,E,14816 820.00,302.73,000000,,*3A
$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 1.20,M,,M,,*62
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.29, 302.45,000000,,*06
$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 1.25,M,,M,,*67
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.17, 302.54,000000,,*0B
$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 1.23,M,,M,,*61
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.08, 302.54,000000,,*05
$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 1.23,M,,M,,*61
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.08, 302.54,000000,,*05
$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 1.29,M,,M,,*6B
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.01, 302.57,000000,,*0F
$GPGGA,000000.000,4153.2493,N,01233.9182,E,1,05,,6 1.30,M,,M,,*63
$GPRMC,000000.000,A,4153.2493,N,01233.9182,E,0.27, 302.61,000000,,*0E

-----------------------------------------------------------------------------

$GPGGA,000000.000,4153.2493,N,01233.9197,E,1,05,,6 3.00,M,,M,,*66
$GPRMC,000000.000,A,4153.2493,N,01233.9197,E,0.23, 302.50,000000,,*0C
$GPGGA,000000.000,4153.2493,N,01233.9197,E,1,05,,6 3.00,M,,M,,*66
$GPRMC,000000.000,A,4153.2493,N,01233.9197,E,0.23, 302.70,000000,,*0E
$GPGGA,000000.000,12153.7538,N,14615.4037,E,1,214, ,1347462.62,M,,M,,*54
$GPRMC,000000.000,A,12153.7538,N,14615.4037,E,3704 2052.00,302.82,000000,,*07
$SH
$CLS
$GPGGA,000000.000,4153.2493,N,01233.9196,E,1,05,,6 2.79,M,,M,,*68
$GPRMC,000000.000,A,4153.2493,N,01233.9196,E,0.17, 302.63,000000,,*0A
$GPGGA,000000.000,4153.2493,N,01233.9196,E,1,05,,6 2.68,M,,M,,*68
$GPRMC,000000.000,A,4153.2493,N,01233.9196,E,0.11, 303.08,000000,,*00
$GPGGA,000000.000,4153.2493,N,01233.9196,E,1,05,,6 2.56,M,,M,,*65
$GPRMC,000000.000,A,4153.2493,N,01233.9196,E,0.09, 302.82,000000,,*0A

---------------------------------------
vadda is offline Find More Posts by vadda
Reply With Quote
Old Nov 20, 2013, 05:19 PM
Registered User
Joined Mar 2009
39 Posts
.... and this :

-------------------------------------

$GPGGA,000000.000,4153.2759,N,01233.9147,E,1,04,,8 0.95,M,,M,,*6E
$GPRMC,000000.000,A,4153.2759,N,01233.9147,E,0.02, 302.54,000000,,*03
$GPGGA,000000.000,8700.6248,S,07423.1596,W,1,170,,-724178.87,M,,M,,*76
$GPRMC,000000.000,A,8700.6248,S,07423.1596,W,19910 102.00,302.60,000000,,*36

$SH
$CLS
$GPGGA,000000.000,4153.2759,N,01233.9147,E,1,04,,8 1.13,M,,M,,*61
$GPRMC,000000.000,A,4153.2759,N,01233.9147,E,0.08, 302.70,000000,,*0F
$GPGGA,000000.000,4153.2761,N,01233.9147,E,1,04,,8 1.22,M,,M,,*68
$GPRMC,000000.000,A,4153.2761,N,01233.9147,E,0.08, 302.57,000000,,*01

------------------------------------------
vadda is offline Find More Posts by vadda
Reply With Quote
Old Nov 20, 2013, 06:08 PM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,479 Posts
Quote:
Originally Posted by vadda View Post
I've found this two "glitch" in the tx logging
OK, thanks a lot, looks like I need to start checking checksums for the incoming data. I'll enable cheksums and send you an updated library for testing some time tomorrow.
pawelsky is offline Find More Posts by pawelsky
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion New Firmware of DJI IOSD Supports Naza-M/Naza-M V2 Now! DJI INNOVATIONS Aerial Photography 3 Feb 08, 2014 11:10 AM
Discussion DJI Naza vs DJI WK-M - What do you get for the extra $860?? brianshell Multirotor Talk 96 Jul 19, 2013 08:15 AM
Help! Alternative to a DJI Naza-M with RTH for a quad / hexa? NoISv Multirotor Electronics 8 Feb 24, 2013 07:50 AM
Discussion DJI OSD for NAZA GPS and WK-M ? Velociraptor73 Multirotor Electronics 31 Oct 12, 2012 10:00 PM
Found DJI NAZA GPS Upgrade Module for the DJI Naza Flight Controller skyhulk Aircraft - Electric - Multirotor (FS/W) 10 Jul 20, 2012 08:47 PM