HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Oct 10, 2013, 03:38 PM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,680 Posts
Discussion
DJI Naza-M adapter for MinimOSD

Here is my another DIY project that shall make it possible to connect DJI Naza-M (v1, v1 Lite, v2) with MinimOSD 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 + TeensyDuino (tested with version 1.20) + CAN transciever and CAN connection (works with DJI Naza-M v1 and v2 with PMU, does not work with v1 Lite).
I did not test in flight, all the tests were done on the ground.

It converts data from Naza GPS/FC data into Mavlink and provides the following information via the MAVLink GPS_RAW_INT, ATTITUDE, VFR_HUD, SYS_STATUS and RC_CHANNELS_RAW messages:
  • latitude
  • longitude
  • altitude (barometric for CAN adapter and from GPS for serial adapter)
  • speed over ground
  • number of satellites
  • GPS fix
  • compass heading (not tilt compensated with serial adapter) or course over groud (selectable)
  • pitch and roll (for artificial horizon)
  • VSI - Vertical Speed Indicator (barometric for CAN adapter and from GPS for serial adapter)
  • battery level/percentage (CAN adapter only)
  • RC channel values (CAN adapter only)
  • flight mode: MANUAL = ACRO, ATTI = STAB, GPS = POSI, failsafe = RETL (CAN adapter only)
In addition to that HEARTBEAT is also sent periodically.

Connection diagrams and Arduino sketches are attached.

For serial adapter you need the following libraries to compile this sketch:
- NazaDecoder (v20141109 or newer)
- AltSoftSerial (needed because adapter communicates at 115200 baud with Naza GPS and at 57600 baud with the OSD)

For CAN adapter you need the following libraries to compile this sketch:
- NazaCanDecoder (v20140921 or newer)
- FlexCAN library (included in Teensyduino since v1.20 - see http://www.rcgroups.com/forums/showp...&postcount=481, you can also download it separately from here)


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
    // These two lines below shall be commented out when using the CAN adapter and uncommented when using serial adapter
    #include "NazaDecoderLib.h"
    #include "AltSoftSerial.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
    // These two lines below shall be commented out when using the CAN adapter and uncommented when using serial adapter
    //#include "NazaDecoderLib.h"
    //#include "AltSoftSerial.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 bettery cells needed for correct battery percentage calculation (3 by default). Set the number matching your battery in the following #define
    Code:
    // Number of battery cells (only needed for CAN adapter to show proper battery percentage)
    #define BATTERY_CELL_NUM 3

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

Note that you can also connect it to QGroundControl to have telemetry. The connection can be done directly or remotely (e.g. via XBee or 3DR radios).

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

MinimOSD adapter changelog
------------------------------
Version 20140630
[NEW] added support for NazaCanDecoder library. You can now select whether to use serial or CAN adapter
[NEW] requires NazaDecoder library v20180628 (or newer) and AltSoftSerial library 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 flag to chose between GPS course over groung (default) or compass course
[NEW] when using CAN addapter flight mode, battery voltage/percentage and stick positions are reported to OSD, added a define to set the number of battery cells for correct percentage reporting
[NEW] added VSI reporting
[NEW] added wiring diagrams for CAN adapter
[NEW] added this changelog file

Version 20131010
initial version of the library
pawelsky is online now Find More Posts by pawelsky
Last edited by pawelsky; Nov 09, 2014 at 05:53 AM.
Reply With Quote
Sign up now
to remove ads between posts
Old Oct 10, 2013, 09:41 PM
Registered User
thach's Avatar
South Korea
Joined Oct 2012
206 Posts
Great!!! I will test it very soon!
thach is offline Find More Posts by thach
Reply With Quote
Old Oct 11, 2013, 05:00 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,680 Posts
Quote:
Originally Posted by thach View Post
Great!!! I will test it very soon!
Please share your test results. Note that you can connect it also to QGroundControl to verify if it works.
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Old Oct 18, 2013, 02:53 AM
Registered User
albx's Avatar
Italy
Joined Jun 2007
414 Posts
Quote:
Originally Posted by pawelsky View Post
Please share your test results. Note that you can connect it also to QGroundControl to verify if it works.
what are the best settings, in the naza gimbal gains, to display a correct attitude indicator? with my naza light I found 14 for both, and output frequency of 50hz, tried 200hz but it's not working. Any better suggestion?

anyway great work, later I'll connect the gps and try it
albx is online now Find More Posts by albx
Reply With Quote
Old Oct 18, 2013, 04:05 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,680 Posts
Quote:
Originally Posted by albx View Post
what are the best settings, in the naza gimbal gains, to display a correct attitude indicator? with my naza light I found 14 for both, and output frequency of 50hz, tried 200hz but it's not working. Any better suggestion?
50Hz is correct. As for the gains - whichever works best for you.
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Old Oct 18, 2013, 06:21 AM
On a holiday?
boopidoo's Avatar
Uppsala, Sweden
Joined Sep 2008
3,621 Posts
Does this work for all MinimOSD, for example these cheap ones sold on eBay?
http://www.ebay.com/itm/On-Screen-Di...item4172db2c11

Also it should work well on any arduino right? I have an Arduino Nano intended for a head tracker that never got built.
boopidoo is online now Find More Posts by boopidoo
Reply With Quote
Old Oct 18, 2013, 06:35 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,680 Posts
Quote:
Originally Posted by boopidoo View Post
Does this work for all MinimOSD, for example these cheap ones sold on eBay?
http://www.ebay.com/itm/On-Screen-Di...item4172db2c11
If it runs the same FW, then yes. I'm using the HobbyKing one and it works fine.

Quote:
Originally Posted by boopidoo View Post
Also it should work well on any arduino right? I have an Arduino Nano intended for a head tracker that never got built.
On any 328P based. I'm developing on Nano (it is easier thanks to the built in USB port). Remember to unplug the GPS while uploading the sketch.
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Old Oct 18, 2013, 06:40 AM
Registered User
albx's Avatar
Italy
Joined Jun 2007
414 Posts
Quote:
Originally Posted by boopidoo View Post
Does this work for all MinimOSD, for example these cheap ones sold on eBay?
http://www.ebay.com/itm/On-Screen-Di...item4172db2c11

Also it should work well on any arduino right? I have an Arduino Nano intended for a head tracker that never got built.
I bought this

http://www.ebay.it/itm/130920057212?...84.m1439.l2649

but what i received is this with extra pins
albx is online now Find More Posts by albx
Reply With Quote
Old Oct 18, 2013, 06:47 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,680 Posts
Quote:
Originally Posted by albx View Post
I bought this

http://www.ebay.it/itm/130920057212?...84.m1439.l2649

but what i received is this with extra pins
And how are these pin labelled? I'm guessing they are connected to Arduino's analog lines.
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Old Oct 18, 2013, 07:01 AM
Registered User
albx's Avatar
Italy
Joined Jun 2007
414 Posts
Quote:
Originally Posted by pawelsky View Post
And how are these pin labelled? I'm guessing they are connected to Arduino's analog lines.
here it is...
albx is online now Find More Posts by albx
Reply With Quote
Old Oct 18, 2013, 07:11 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,680 Posts
Quote:
Originally Posted by albx View Post
here it is...
Yep, it looks like it has these mods built in. Useful if you use it for MultiWii.
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Old Oct 19, 2013, 04:18 PM
On a holiday?
boopidoo's Avatar
Uppsala, Sweden
Joined Sep 2008
3,621 Posts
@pawelsky
Do you have a video of it? I still haven't received my parts but will put it together ASAP.
boopidoo is online now Find More Posts by boopidoo
Reply With Quote
Old Oct 19, 2013, 04:52 PM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,680 Posts
Quote:
Originally Posted by boopidoo View Post
@pawelsky
Do you have a video of it? I still haven't received my parts but will put it together ASAP.
No, I did not make any video.
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Old Nov 04, 2013, 08:52 PM
Registered User
Brazil
Joined Jul 2007
18 Posts
Pawelsky, why do not you implement the code directly on the board minimosd?
diegostf is offline Find More Posts by diegostf
Reply With Quote
Old Nov 05, 2013, 02:54 AM
Registered User
pawelsky's Avatar
Polska
Joined Jan 2012
1,680 Posts
Quote:
Originally Posted by diegostf View Post
Pawelsky, why do not you implement the code directly on the board minimosd?
It doesn't have pins for pitch and roll sensing exposed.
pawelsky is online now Find More Posts by pawelsky
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion DJI Naza-M adapter for RemzibiOSD pawelsky FPV Equipment 57 Nov 09, 2014 05:56 AM
Discussion DJI Naza vs DJI WK-M - What do you get for the extra $860?? brianshell Multirotor Talk 96 Jul 19, 2013 09:15 AM
Help! Alternative to a DJI Naza-M with RTH for a quad / hexa? NoISv Multirotor Electronics 8 Feb 24, 2013 08:50 AM
Discussion DJI OSD for NAZA GPS and WK-M ? Velociraptor73 Multirotor Electronics 31 Oct 12, 2012 11:00 PM
Found DJI NAZA GPS Upgrade Module for the DJI Naza Flight Controller skyhulk Aircraft - Electric - Multirotor (FS/W) 10 Jul 20, 2012 09:47 PM