APM 2.012 + REMZIBI OSD

 

 

 

With the APM together, it can display much information on the screen, e.g. the attitude of the plane, GPS data, NAV data, etc. The details of displayed information can be found in the web site of Remzibi OSD and the ARDUmV1_71.txt. Blake Krone has done great works to integrate the OSD and the APM. However, due to the fast development of the APM, some source codes are out of date, and thus a few modifications are needed to make them work properly. In this article, we give a detailed instruction of those modifications.

 

Our work is based on

1. APM 2.12 source code. Arduino-0022 IDE.

2. The firmware of OSD is ARDUmV1_71.hex

3. The serial port of the OSD is connected to serial port 3 of the APM (i.e. Telemetry port). Because the OSD does not send data to APM, the TX pin of the OSD is not required to be connected. You can also connect the Xbee to the serial port 3 of the APM in the meantime. In such case, the RX pins of the Xbee and the OSD are connected in parallel, and You MUST NOT connect the TX pin of the OSD. The Baud rate of the OSD is self-adaptive, and it is usually below 115200.

 

Here are the modifications:

First, download OSD_Remzibi.pde, and then modify some parameters according to the definitions in the code of APM:

1. In function print_osd_data(void)

Original:                    SendSer(GPS.date,DEC); //Date

Modified:       SendSer(g_gps->date,DEC); //Date

Comment:     This parameter is the GPS UTC date

 

Orignal:             SendSer(GPS.time,DEC); //Time

Modified:       SendSer(g_gps->time,DEC); //Time

Comment:     This parameter is the GPS UTC time

 

2. In function void print_osd_ahrs(void):

Original:         SendSer((pitch_sensor/100) * -1,DEC); //Pitch

Modified:       SendSer(dcm.pitch_sensor/100,DEC); //Pitch

Comment:   This parameter is the pitch of the plane.

 

Original:         SendSer(roll_sensor/100,DEC); //Roll

Modified:       SendSer(dcm.roll_sensor/100,DEC); //Roll

Comment:     This parameter is the roll of the plane.

 

Second, modify the source of APM (ver 2.12):

① In APM_Config.h :

Add following codes:

#define OSD_PROTOCOL OSD_PROTOCOL_REMZIBI

#define OSD_PORT 3

#define OSD_MODE_CHANNEL 7

 

These macros tell the APM to use the serial port 3 to connect to the OSD under the REMZIBI protocol. The channel 7 is used to control whether the OSD displays. You can change the serial port or control channel if it is needed.

 

② ArduPilotMega.pde :

In function medium_loop(), add following codes before the break statement in case 3:

#if OSD_PROTOCOL != OSD_PROTOCOL_NONE

print_osd_ahrs();

#endif

 

In function slow_loop (), add following code before the break statement in case 1:

#if OSD_PROTOCOL != OSD_PROTOCOL_NONE

print_osd_data();

#endif

// Read OSD Mode Switch

#if OSD_PROTOCOL == OSD_PROTOCOL_REMZIBI

read_osd_switch();

#endif

 

③ defines.h :

Add following codes after “//GPS type codes”:

// OSD type codes

#define OSD_PROTOCOL_NONE -1

#define OSD_PROTOCOL_REMZIBI 0

 

④ commands.pde :

In line 251, add following code at the end of function init_home():

// Save Home to OSD

// ----------------

#if OSD_PROTOCOL == OSD_PROTOCOL_REMZIBI

osd_init_home();

#endif

 

Now, all the modifications have been done. Copy the OSD_Remzibi.pde to the folder of the source code of the APM 2.12(APM Trunk\ArduPilotMega), start Arduino, build the sketch and upload to the APM.

 

3689404993?profile=original

 

 3689404945?profile=original

 

Uploads are not downloaded,Why?ArduPilotMega2.12+remzibi_osd.rar

 

 

OSD_RemzibiV2.pde

 

chineseV.pdf

 

Thank LEE,hazy,Blake Krone's

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • I left it at the default.

    int nMeters=0; //Change this to 1 for meters, 0 for feet
  • Did you set feet or meters in the osd_remzibi.pdt
  • Just tried with the MediaTek and I get the same thing. All data except altitude is correct.
  • Gave this a try this morning. Looks great except my altitude data is way off. Here's a recording of the OSD. Take note of the altitude on the right. I was using Ublox 5. I will try MediaTek tomorrow to see if there is a difference.

     

     

     

  • Great work! I've been waiting for this!
  • You are not using the telem port (port 3) ?
    port 0 is the usb, who did you manage to connect the osd to it?
    the osd might have a hard time parsing out the binary protocol that is already on the same port
  • Boutrate is max: 115200 (most of the time)

    Here is my apm_config.h

     
     // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-

    // This file is just a placeholder for your configuration file.  If you wish to change any of the setup parameters from
    // their default values, place the appropriate #define statements here.

    // For example if you wanted the Port 3 baud rate to be 38400 you would add a statement like the one below (uncommented)
    //#define SERIAL3_BAUD        38400
    //#define GCS_PROTOCOL        GCS_PROTOCOL_NONE


    // You may also put an include statement here to point at another configuration file.  This is convenient if you maintain
    // different configuration files for different aircraft or HIL simulation.  See the examples below
    //#include "APM_Config_mavlink_hil.h"
    //#include "Skywalker.h"

    // The following are the recommended settings for Xplane simulation. Remove the leading "/* and trailing "*/" to enable:

    /*
    #define HIL_PROTOCOL        HIL_PROTOCOL_MAVLINK
    #define HIL_MODE            HIL_MODE_ATTITUDE
    #define HIL_PORT            0
    #define GCS_PROTOCOL        GCS_PROTOCOL_MAVLINK
    #define GCS_PORT            3
    */
    #define OSD_PROTOCOL OSD_PROTOCOL_REMZIBI
    #define OSD_PORT 0
    #define OSD_MODE_CHANNEL 7

  • Developer

    I have a similar setup running in APM 2.1 with OSD on port 3 (57600) and GCS on port 0 (115200), both Work just fine. I added some messages based on flight mode and others to report pan and tilt angles. I also had issues with OSD not turning back "ON" and made similar changes. I find that data is sent to OSD Video link faster than down to HK_GCS over Mavlink, I am hoping to get Mavlink to send Ascii data to OSD mixed along with binary data to GCS.to free port 0. I think using debug type messages will work, but I have had no time to build and test. OSD should ignore binary, Mavlink will need to skip OSD Ascii messages. AH is faster than Mavlink attitude display.

    All based on Blake's original post.

  • At what speed does it sync for you?
    2.1 works fine for me.
    can you post you apm_config.h as well
  • Also the skybar is moving very slow and the timer stops from time to time.
This reply was deleted.