mobiDrone nano arduino OSD for MultiWii with PID config

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

Hello,

after a long time I'm back in multiwii scene.
I have had some health problems so my interresting about multiwii went out of me.

I developed serial OSD for MultiWii based on Atmega 328 + LM1881 (Video Sync Separator) OSD hasnt any sensor board, all data are readed over the serial port from MultiWii with the exception of RSSI and Battery 2. I am planning implemented i2c master to osd and read data from any sensors directly.

Image
Image

Informations displayed on the screen:

Line 1: startup time, mainbattery voltage (flashing at low voltage), video battery voltage (flashing at low voltage), RC RSSI value, GPS number of sats.

Line 2: GPS Latitude , AUX1,AUX3(if activated) , Sat FIX,AUX4, AUX2 (if activated) , GPS Longitude

Line 3: Sonar/Baro altitude, Compass (navigate to home pos), 'Throttle Level'

Line 4(Last): Distance to Home, Direction to Home, RTH if activate

OSD module including:
  • size 24 x 28mm
  • OpenSource arduino Hardware
  • HW based on Atmega 328 + LM1881
  • Arduino Bootloader
  • Ready to use
  • FW available for PAL & NTSC system for NOW

OSD module ports:
  • 1x voltage input up to 4s
  • 1x uart serial interface
  • 1x I2C bus
  • 1x RSSI input
  • 1x video input/output
  • 1x current sensor input (0 - 5V)
  • 1x free input

Software:

Last version 2.3 PRE RELEASE + MultiWii v2.0 patch can be downloaded in download page (https://code.google.com/p/mobidrone/downloads/list)

This program is free software, you can redistribute it and/or modify it under the terms of the Creative Commons NonCommercial?-ShareAlike? 3.0 Unported (CC BY-NC-SA 3.0)

Currently is implemented:

  • Internal OSD settings for RSSI calibration, Critical voltages
  • PID configuration
  • Functions to AUX channels mapping (LOW)(MID)(HIGH)
  • ACC, MAG calibration via OSD & option to manual resetting of GPS home position
  • Sensors status (presented/activated)
  • RC commands info
  • Current sensor

Hardware:

You can buy hardware with arduino bootloader on http://multicopter.toptel.sk/ - There is also schematic,pcb

Video of working system:

http://www.youtube.com/watch?v=zEtLeqRd7qQ
http://www.youtube.com/watch?v=JZYaUhGQuSw
Last edited by MichalM_sk on Tue Apr 17, 2012 11:04 pm, edited 3 times in total.

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: mobiDrone nano arduino OSD for MultiWii

Post by dramida »

Interesting project, can you explain how arduino can "write" on video image without max 74xx

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii

Post by MichalM_sk »

Hi,

LM1881 separate Hsync & Vsync of video signal for timing (line positioning), characters are stored in prog. memory of atmega. Pixel "injection" to video signal via spi interface of atmega.

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii

Post by MichalM_sk »

Today I make some changes in layout.
http://www.youtube.com/watch?v=D_2GH3AWg88

next I am planing implement Current sensor, NTSC support, I2C support, some changes in layout. Will be added gps speed, gps altitude.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: mobiDrone nano arduino OSD for MultiWii

Post by Alexinparis »

Hi Michal,

It would be interesting to have your feedback on the new serial protocol.
Just to check if you feel it easy or not to implement with your OSD.

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii

Post by MichalM_sk »

Hi Alex,

ok, I will try implement new serial protocol to OSD.

Best regards Michael

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii

Post by MichalM_sk »

mobiDrone OSD v 2.3 PRE Release 4 in code page

Changes:
+ Support for current sensor ACS758 100A BiDirectional, indicator for consumed capacity & actual current
+ NTSC support (for testing)
+ Layout cleared - you can disable not usable values
+ Baro shows relative value now (on the ground 0 meters)
+ Some bugs repaired

Video http://www.youtube.com/watch?v=ll3GSvc9lLc

Small bugs, that seen in the video already removed in actual version.
Baro shows relative value now (on the ground 0 meters).

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

mobiDrone OSD2.3 PRE 5 finished -

Will be released today on my codepage.

/- mobiDrone OSD v 2.3 PRE Release 5
+ new redesigned layout (new icons, block structure,customisable)
+ better RAM management
+ PITCH tilt reversed to normal

You can enable/disable parts of screen in config section by '#define'

Code: Select all

#define CURRENT_SENSOR          //support for ACS758 100A BiDirectional Current Sensor connected to port N1 (MobiDrone OSD)      
#define RSSISIGNAL              //to enable signal on screen
#define MODE                    //to enable mode panel L-level, B-baro, M-mag, G-gps, RTH
#define BAT1                    //to enable Battery 1 panel (multiwii voltage sensor) 
#define BAT2                    //to enable Battery 2 panel  (BAT input on mobiDrone OSD)
#define GPS                     //to enable GPS panel 
#define COMPASS                 //to enable Compass panel
/////////////////////////////////////////////////////////

Video
http://www.youtube.com/watch?v=vsljgPI3CQw

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by timecop »

This is so awesome, even for a tarduino. :D
Any objections to porting to stm32?

thebgrian
Posts: 47
Joined: Sun Mar 27, 2011 4:46 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by thebgrian »

Any chance to get this OSD supported by Naze32?
Michal, are you still considering the new serial protocol, and if you do will there still be need for an adding extra code?

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by copterrichie »

If the serial protocol is standardized, the Naze32 should work also providing it use the same protocol. At present, the Naze32 communicate with the existing GUI, so making the required charges if required, should be very easy.

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

thebgrian wrote:Any chance to get this OSD supported by Naze32?
Michal, are you still considering the new serial protocol, and if you do will there still be need for an adding extra code?


Hi,
when I implement new serial protocol so no extra code will be longer needed.

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

Hi,

I am working on PRE 6 version. I implemented 2D graphic.
Video of working version which presents new radar screen.

http://www.youtube.com/watch?v=er8A2sSyjOE

ankimo
Posts: 30
Joined: Fri Jan 20, 2012 7:31 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by ankimo »

Hi

It is the first test.

Question
- A pressure altitude does not display.
- A horizon indicator (ROLL axis) is more sensitive than an actual motion (PITCH axis is OK).

Request
- I want a ground speed display.
- latitude longitude display/undisplayed

My Spec
- Flyduino
- Drotek 10dof
- mobiDroneOSD v2.3 PRE RELEASE 5

http://youtu.be/ZxLtLzz_atQ

Best regards
Kazz

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by EOSBandi »

MichalM_sk wrote:Hi,

I am working on PRE 6 version. I implemented 2D graphic.
Video of working version which presents new radar screen.

http://www.youtube.com/watch?v=er8A2sSyjOE


Hi Michal,
Just one small recommendation, an enable/disable control signal could be very usefull, you can fix the osd wiring and let the ftdi connection disable it....
A

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

ankimo wrote:Hi

It is the first test.

Question
- A pressure altitude does not display.
- A horizon indicator (ROLL axis) is more sensitive than an actual motion (PITCH axis is OK).

Request
- I want a ground speed display.
- latitude longitude display/undisplayed

My Spec
- Flyduino
- Drotek 10dof
- mobiDroneOSD v2.3 PRE RELEASE 5

http://youtu.be/ZxLtLzz_atQ

Best regards
Kazz


Hi, Kazz

ok I will make some changes.
Baro altitude is working in PRE 5 FIXED version.
PRE 6 version with GPS ground speed, radar screen will be released to a few days.

EOSBandi wrote:Hi Michal,
Just one small recommendation, an enable/disable control signal could be very usefull, you can fix the osd wiring and let the ftdi connection disable it....
A


Hi, ok thanks



Some question: how logically solute switching between screens during flight without affecting the control(timer, combination of rc commands)?

thebgrian
Posts: 47
Joined: Sun Mar 27, 2011 4:46 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by thebgrian »

Hi, Michal
I think a user selectable combination of AUX values like for the MultiWii options should be a good option. How is the new version of the OSD going?

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

Hi.

Ok, PRE6 version will be released this week.

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

Hi,

there are still some small bugs :) but this is a preview of the new PRE 6 version.

http://www.youtube.com/watch?edit=vd&v=NaUoa6KANVY

User avatar
djrm
Posts: 40
Joined: Wed Feb 15, 2012 11:32 pm
Location: North Yorkshire, UK

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by djrm »

Greetings Michal, the display preview looks good.

I have added a 50 Amp current sensor to my OSD board.
The settings were changed as follows:

// ACS758LCB-050U-PFF-T 50 Amp unidirectional, 60 mV per Amp sensitivity, 600 mV offset
volatile uint16_t offset = 123; //default value 0.6V for single sensor ACS758
currentValue = (currentValue - offset) * 0.061;
Although I have not checked the calibration accuracy it seems to be approximately right.

The sensor output voltage is being fed into both the OSD board and the MWC with no problem.
hth David.

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

djrm wrote:Greetings Michal, the display preview looks good.

I have added a 50 Amp current sensor to my OSD board.
The settings were changed as follows:

// ACS758LCB-050U-PFF-T 50 Amp unidirectional, 60 mV per Amp sensitivity, 600 mV offset
volatile uint16_t offset = 123; //default value 0.6V for single sensor ACS758
currentValue = (currentValue - offset) * 0.061;
Although I have not checked the calibration accuracy it seems to be approximately right.

The sensor output voltage is being fed into both the OSD board and the MWC with no problem.
hth David.


Hi, thanks
I will implement it.

ankimo
Posts: 30
Joined: Fri Jan 20, 2012 7:31 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by ankimo »

The second test

A result is good! :)

mobiDroneOSD v2.3 PRE RELEASE 5 SENSITIVITY FIX

http://youtu.be/1akSAxpe8iA

winds:5m/s
1:39 ph
1.55 rth

Kazz

jpeti29
Posts: 22
Joined: Wed Mar 07, 2012 9:19 am
Location: Hungary

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by jpeti29 »

I think that a variometer will be very useful, if you fly in fpv without baro to keep altitude.

And there will be another good thing to display somehow (for example like the 2D level meter, "o" charactre in a circle) the real orientation of movement (from gps data). for example if i try to hover, but the wind swept away some direction. it could help to awoid collision to something which is behind the copter.


What do you thing?

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

jpeti29 wrote:I think that a variometer will be very useful, if you fly in fpv without baro to keep altitude.

And there will be another good thing to display somehow (for example like the 2D level meter, "o" charactre in a circle) the real orientation of movement (from gps data). for example if i try to hover, but the wind swept away some direction. it could help to awoid collision to something which is behind the copter.


What do you thing?

Hi,

Variometer is a good idea.
2D level meter - This is basically something like a radar screen.

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by nhadrian »

I understand you, jPeti, you mean something like radar screen.
For this, GPS_speed and direction should used, and the mark should be as far from centre of circle as much the speed is, and the mark direction points towards to direction, but viewed from heading.
So basically, if you see that the mark is left away from centre point means that the copter is moving to left with some speed. So, you should be careful on left direction if there is something collision.....
sounds really useful, but, because of GPS it would be just some m-s accurate!!! But again, good idea, should try!

BR
Adrian

Y.Mita
Posts: 46
Joined: Thu Sep 15, 2011 11:25 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by Y.Mita »

Mr.MichalM_sk, please transfer mobiDroneOSD to MultiWii 20120504 Dev version.
It's serial.ino inside changes too much, and I can't follow it by myself.

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

Hi,

good news, PRE 6 version is out on my codepage , and now I will start work on a new serial protocol (PRE 7 version)

Y.Mita wrote:Mr.MichalM_sk, please transfer mobiDroneOSD to MultiWii 20120504 Dev version.
It's serial.ino inside changes too much, and I can't follow it by myself.


Hi, Yoshifumi
in Dev 20120504 is new serial protocol implemented, mobiDrone osd PRE7 will be compatible with all news multiwii softwares without patchs.

Y.Mita
Posts: 46
Joined: Thu Sep 15, 2011 11:25 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by Y.Mita »

MichalM_sk wrote:Hi,
Hi, Yoshifumi
in Dev 20120504 is new serial protocol implemented, mobiDrone osd PRE7 will be compatible with all news multiwii softwares without patchs.


Thank you, Mr. MichalM_sk!

I was tried to implement mobiDrone to MultiWii 20120504 because I was trying Mr.EOSBandi's GPS implement. It's good data of OSD to know working well or not of GPS integration.

But my try failed, just like todays video, not communicate with MultiWii first and sometime it was start communicate but data error, like 1:09.
http://youtu.be/YeFFGBkIE8E

I was debugging by serial communication log tool.

And just now, I found my mistake! I used mobiDrone Release 5 with MultiWii for mobiDrone Pre 6!
Becase Pre6 released 5 days before, I used it to implement to 20120504.
Release 6 required little bit more data!
(still have some ploblem. GPS coordinates upper digits goes 0!)

It's hard to me. I'll waiting your release!

Y.Mita
Posts: 46
Joined: Thu Sep 15, 2011 11:25 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by Y.Mita »

Mr.MichalM_sk

Tonight, I fight with mobiDrone implement to MultiWii20120504. And I found big difference of v2.0 to 20120504.
The digits of GPS_latitude and GPS_longitude was changed.
old code for communicate with mobiDrone is

Code: Select all

void sendStandardData() {
 
      //start of frame
      serialize8('S');
      //1. Battery voltage
      serialize8(vbat);
           
      uint8_t part1;
      uint32_t part2;
     
      //2. Latitude
      part1 = abs(GPS_latitude)/100000;
      part2 = abs(GPS_latitude) - (part1 * 100000);
     
      serialize8(part1 / 100);
      serialize8(part1 / 10 - (part1 / 100) * 10);
      serialize8(part1 - (part1 / 10) * 10);
      /////////////////////////////////////////////////////
      serialize8(part2 / 10000);
      serialize8(part2 / 1000 - (part2/10000) * 10);
      serialize8(part2 / 100 - (part2/1000) * 10);
      serialize8(part2 / 10 - (part2/100) * 10);
      serialize8(part2  - (part2/10) * 10);
     
      //3. Longitude
      part1 = abs(GPS_longitude)/100000;
      part2 = abs(GPS_longitude) - (part1 * 100000);
 
      serialize8(part1 / 100);
      serialize8(part1 / 10 - (part1 / 100) * 10);
      serialize8(part1 - (part1 / 10) * 10);
      ////////////////////////////////////////////////////
      serialize8(part2 / 10000);
      serialize8(part2 / 1000 - (part2/10000) * 10);
      serialize8(part2 / 100 - (part2/1000) * 10);
      serialize8(part2 / 10 - (part2/100) * 10);
      serialize8(part2  - (part2/10) * 10);
 :
 :

but new code must be

Code: Select all

void sendStandardData() {
 
      //start of frame
      serialize8('S');
      //1. Battery voltage
      serialize8(vbat);
           
      uint8_t part1;
      uint32_t part2;
     
      //2. Latitude
      part1 = GPS_latitude/10000000;
      part2 = (GPS_latitude - (part1 * 10000000))/100;
     
      serialize8(part1 / 100);
      serialize8(part1 / 10 - (part1 / 100) * 10);
      serialize8(part1 - (part1 / 10) * 10);
      /////////////////////////////////////////////////////
      serialize8(part2 / 10000);
      serialize8(part2 / 1000 - (part2/10000) * 10);
      serialize8(part2 / 100 - (part2/1000) * 10);
      serialize8(part2 / 10 - (part2/100) * 10);
      serialize8(part2  - (part2/10) * 10);
     
      //3. Longitude
      part1 = GPS_longitude/10000000;
      part2 = (GPS_longitude - (part1 * 10000000))/100;
 
      serialize8(part1 / 100);
      serialize8(part1 / 10 - (part1 / 100) * 10);
      serialize8(part1 - (part1 / 10) * 10);
      ////////////////////////////////////////////////////
      serialize8(part2 / 10000);
      serialize8(part2 / 1000 - (part2/10000) * 10);
      serialize8(part2 / 100 - (part2/1000) * 10);
      serialize8(part2 / 10 - (part2/100) * 10);
      serialize8(part2  - (part2/10) * 10);
 :
 :


the digits powered 100, and it cause error to abs().

I think you already realize this problem, but if not, little advice.

I took 2 days for this modify... I am not a coder, bad source modifier !

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by copterrichie »

I modified the lasted PRE 6 to work on a MultiWiiCopter version 2.0 running on a Mega 1280/2560. It use Serial port 3 to communicate with the OSD, GPS on Serial 2 and PPM on serial 1. Everything appears to be working however, when the GUI and the OSD connected simultaneously , there is some buffering problems that I am trying to debug. I figured it will be best to wait until the new protocol is fulling implemented in the mobiDrone OSD before placing to much time trying to debug this but it would be extremely nice to have these changes incorporated into PRE 7. Maybe someone here can assist with this implementation?

Thank you.

Config.h

Code: Select all

#define SERIAL_OSD
#define TELEMERY_SERIAL 3
#define TELEMERY_BAUD 115200


The main file under Setup:

Code: Select all

#if defined(TELEMERY_SERIAL)
   SerialOpen(TELEMERY_SERIAL,TELEMERY_BAUD);
  #endif


And the Attached Serial.ino file.
Attachments
Serial_Mega.zip
(4.32 KiB) Downloaded 298 times

ankimo
Posts: 30
Joined: Fri Jan 20, 2012 7:31 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by ankimo »

Hi Mr.MichalM_sk

In the following combination, serial communication is impossible.
-mobiDrone_2.3_pre6
-multiwii_2.0 for mobiDrone_2.3_pre6
-CRIUS SE

In the following combination, it is satisfactory.
-mobiDrone_2.3_pre5_sensitivity FIX
-multiwii_2.0 for mobiDrone_2.3_pre5
-CRIUS SE

What is the cause considered?

Kazz

Y.Mita
Posts: 46
Joined: Thu Sep 15, 2011 11:25 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by Y.Mita »

Mr.MichalM_sk,
Thank you mobiDroneOSD! Its cheap but powerfull OSD!

I'm still waiting your implementation, but I think I finished implementation mobiDroneOSD to Mr.EOSbandi's GPS integration.
Also I fix some bugs of compass and radar.

Here is some my sample source of mobiDroneOSD with MultiWii GPS integrarion.

The attached files are based on Mr.EOSBandi's GPS integration R33.
http://www.multiwii.com/forum/viewtopic.php?f=8&t=649&start=730
http://code.google.com/p/i2c-gps-nav/downloads/detail?name=I2C_GPS_NAV-MultiwiiDev-NAVr33.rar&can=2&q=
But cut off MultiWiiConf and I2C_GPS_NAV directory. If you want it, download from original.

And attached file include mobiDroneOSD for R33 which based on Mr.MichalM_sk's mobiDroneOSD v2.3 PRE RELEASE 6.
https://code.google.com/p/mobidrone/downloads/detail?name=mobiDroneOSD%20v2.3%20PRE%20RELEASE%206.rar&can=2&q=

I only implement PID setting of GPS position hold (POS) and position hold rate (PSR), Navigation rate (NVR), and delete some old PID and RATE.

I fixed 2 bugs below. But this two bugs are debug on desktop only.
1.Compass moving and direction is wrong. Bug is heading north, turn right seems heading west, and W mark coming from left side.
2.Radar moving counter clock wise when copter turning clock wise.

The attach files was only tested at my copter, which controller was Flyduino Mega, DroTek DOF10 MS, MTK3329 10Hz serial connection GPS, Hexa copter.


If you only have interesting of bug fix, please modify mobiDroneOSD file only.

compass bug, modify around line number 4798
Original

Code: Select all

//print compass data 
static void printCompass(int16_t heading){

  int8_t deg = (heading / 15) + 5;
  if(heading <= - 173 || heading >= 173)
     deg = 17;
 
  for(uint8_t i = 0; i < 11; i++){

    buffering(COMPASSBAR_START, i, 63);

    if(deg == i)   
      buffering(COMPASSBAR_START, i, 'N' - 54);

    if((deg - 6 >= 0) && (deg - 6 == i))
      buffering(COMPASSBAR_START, i, 'W' - 54);

    if((deg + 6 < 11) && (deg + 6 == i))
      buffering(COMPASSBAR_START, i, 'E' - 54);

    if((deg + 12 < 11) && (deg + 12 == i))
      buffering(COMPASSBAR_START, i, 'S' - 54);

    if((deg - 12 >= 0) && (deg - 12 == i))
      buffering(COMPASSBAR_START, i, 'S' - 54); 
  }
}


bug fix (including my modified comment)

Code: Select all

//print compass data 
static void printCompass(int16_t heading){

  int8_t deg = (heading / 15) + 5;
  if(heading <= - 173 || heading >= 173)
     deg = 17;
 
  for(uint8_t i = 0; i < 11; i++){

//    buffering(COMPASSBAR_START, i, 63);            // 2012.05.27 Y.Mita compass bug fix start
    buffering(COMPASSBAR_START, 10-i, 63);

    if(deg == i)   
//      buffering(COMPASSBAR_START, i, 'N' - 54);
      buffering(COMPASSBAR_START, 10-i, 'N' - 54);

    if((deg - 6 >= 0) && (deg - 6 == i))
//      buffering(COMPASSBAR_START, i, 'W' - 54);
      buffering(COMPASSBAR_START, 10-i, 'E' - 54);

    if((deg + 6 < 11) && (deg + 6 == i))
//      buffering(COMPASSBAR_START, i, 'E' - 54);
      buffering(COMPASSBAR_START, 10-i, 'W' - 54);

    if((deg + 12 < 11) && (deg + 12 == i))
//      buffering(COMPASSBAR_START, i, 'S' - 54);
      buffering(COMPASSBAR_START, 10-i, 'S' - 54);

    if((deg - 12 >= 0) && (deg - 12 == i))
//      buffering(COMPASSBAR_START, i, 'S' - 54); 
      buffering(COMPASSBAR_START, 10-i, 'S' - 54); 
                                                     // 2012.05.27 Y.Mita compass bug fix end
  }
}


radar bug, modify line number 4165
Original

Code: Select all

    rad = -(readedHeading*0.0174533f);   //N - S, E - W


bug fix (including my modified comment)

Code: Select all

//    rad = -(readedHeading*0.0174533f);   //N - S, E - W
    rad = (readedHeading*0.0174533f);   //N - S, E - W //2012.05.28 Y.Mita


MultiWiiR33WithmobiDroneOSD2.3_pre6.rar
(130.66 KiB) Downloaded 290 times

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by copterrichie »

Y.Mita, Just added and tested your bug fix and it works great. Thank you.

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

ankimo wrote:Hi Mr.MichalM_sk

In the following combination, serial communication is impossible.
-mobiDrone_2.3_pre6
-multiwii_2.0 for mobiDrone_2.3_pre6
-CRIUS SE

In the following combination, it is satisfactory.
-mobiDrone_2.3_pre5_sensitivity FIX
-multiwii_2.0 for mobiDrone_2.3_pre5
-CRIUS SE

What is the cause considered?

Kazz


Hi, could you try disable telemetry and other stuff in multiwii and try it again? Thanks. I will check it.

Y.Mita wrote:Mr.MichalM_sk,
Thank you mobiDroneOSD! Its cheap but powerfull OSD!

I'm still waiting your implementation, but I think I finished implementation mobiDroneOSD to Mr.EOSbandi's GPS integration.
Also I fix some bugs of compass and radar.

Here is some my sample source of mobiDroneOSD with MultiWii GPS integrarion.

The attached files are based on Mr.EOSBandi's GPS integration R33.
http://www.multiwii.com/forum/viewtopic.php?f=8&t=649&start=730
http://code.google.com/p/i2c-gps-nav/downloads/detail?name=I2C_GPS_NAV-MultiwiiDev-NAVr33.rar&can=2&q=
But cut off MultiWiiConf and I2C_GPS_NAV directory. If you want it, download from original.

And attached file include mobiDroneOSD for R33 which based on Mr.MichalM_sk's mobiDroneOSD v2.3 PRE RELEASE 6.
https://code.google.com/p/mobidrone/downloads/detail?name=mobiDroneOSD%20v2.3%20PRE%20RELEASE%206.rar&can=2&q=

I only implement PID setting of GPS position hold (POS) and position hold rate (PSR), Navigation rate (NVR), and delete some old PID and RATE.

I fixed 2 bugs below. But this two bugs are debug on desktop only.
1.Compass moving and direction is wrong. Bug is heading north, turn right seems heading west, and W mark coming from left side.
2.Radar moving counter clock wise when copter turning clock wise.

The attach files was only tested at my copter, which controller was Flyduino Mega, DroTek DOF10 MS, MTK3329 10Hz serial connection GPS, Hexa copter.


If you only have interesting of bug fix, please modify mobiDroneOSD file only.

compass bug, modify around line number 4798
Original

Code: Select all

//print compass data 
static void printCompass(int16_t heading){

  int8_t deg = (heading / 15) + 5;
  if(heading <= - 173 || heading >= 173)
     deg = 17;
 
  for(uint8_t i = 0; i < 11; i++){

    buffering(COMPASSBAR_START, i, 63);

    if(deg == i)   
      buffering(COMPASSBAR_START, i, 'N' - 54);

    if((deg - 6 >= 0) && (deg - 6 == i))
      buffering(COMPASSBAR_START, i, 'W' - 54);

    if((deg + 6 < 11) && (deg + 6 == i))
      buffering(COMPASSBAR_START, i, 'E' - 54);

    if((deg + 12 < 11) && (deg + 12 == i))
      buffering(COMPASSBAR_START, i, 'S' - 54);

    if((deg - 12 >= 0) && (deg - 12 == i))
      buffering(COMPASSBAR_START, i, 'S' - 54); 
  }
}


bug fix (including my modified comment)

Code: Select all

//print compass data 
static void printCompass(int16_t heading){

  int8_t deg = (heading / 15) + 5;
  if(heading <= - 173 || heading >= 173)
     deg = 17;
 
  for(uint8_t i = 0; i < 11; i++){

//    buffering(COMPASSBAR_START, i, 63);            // 2012.05.27 Y.Mita compass bug fix start
    buffering(COMPASSBAR_START, 10-i, 63);

    if(deg == i)   
//      buffering(COMPASSBAR_START, i, 'N' - 54);
      buffering(COMPASSBAR_START, 10-i, 'N' - 54);

    if((deg - 6 >= 0) && (deg - 6 == i))
//      buffering(COMPASSBAR_START, i, 'W' - 54);
      buffering(COMPASSBAR_START, 10-i, 'E' - 54);

    if((deg + 6 < 11) && (deg + 6 == i))
//      buffering(COMPASSBAR_START, i, 'E' - 54);
      buffering(COMPASSBAR_START, 10-i, 'W' - 54);

    if((deg + 12 < 11) && (deg + 12 == i))
//      buffering(COMPASSBAR_START, i, 'S' - 54);
      buffering(COMPASSBAR_START, 10-i, 'S' - 54);

    if((deg - 12 >= 0) && (deg - 12 == i))
//      buffering(COMPASSBAR_START, i, 'S' - 54); 
      buffering(COMPASSBAR_START, 10-i, 'S' - 54); 
                                                     // 2012.05.27 Y.Mita compass bug fix end
  }
}


radar bug, modify line number 4165
Original

Code: Select all

    rad = -(readedHeading*0.0174533f);   //N - S, E - W


bug fix (including my modified comment)

Code: Select all

//    rad = -(readedHeading*0.0174533f);   //N - S, E - W
    rad = (readedHeading*0.0174533f);   //N - S, E - W //2012.05.28 Y.Mita


MultiWiiR33WithmobiDroneOSD2.3_pre6.rar


Thank you for your cooperation in mobidrone osd project. I am still working on version pre7 but I have very little time these days. (exams and master degree examinations :( ) so it goes slower.

BR
Michal M.

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by nhadrian »

Dear Y.Mita!

Could you please tell the instructions for modifying the latest dev 20120528 for Mobidrone?

Br
Adrian

Y.Mita
Posts: 46
Joined: Thu Sep 15, 2011 11:25 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by Y.Mita »

nhadrian wrote:Dear Y.Mita!

Could you please tell the instructions for modifying the latest dev 20120528 for Mobidrone?

Br
Adrian


Mr. Adrain and Mr.Kazz,

Thank you for waiting!

Now I release sample files of mobiDroneOSD for MultiWii_dev_20120528 with some bug fix.

This time, you don't need to install libraries.

Attached file only include MultiWii_dev_20120528 for mobiDroneOSD, and mobiDroneOSD based 2.3_pre6.
You must flash MultiWii and mobiDroneOSD.
If you want to use GUI, download original MultiWii_dev_20120528 and use MultiWiiConf_dev_20120528.

Bug fix below
1.Can't save parameter change after 2.3_pre6. It's very hard job to fix!
2.Can't calibrate Acc and Mag from OSD. I missed at last release "MultiWiiR33WithmobiDroneOSD2.3_pre6.rar"

Still not work GPS FIX from OSD! I'm not work yet.

Warning! I don't have time to do field test. Only desktop debug. Maybe field test tomorrow.
MultiWii_dev_20120528WithmobiDroneOSD2.3_pre6.rar
(125.35 KiB) Downloaded 280 times
Last edited by Y.Mita on Fri Jun 01, 2012 10:41 pm, edited 1 time in total.

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by nhadrian »

Dear Y.Mita!

I have just tested your latest code, all things works just fine! (I'm not using the PID tuning part so I'm talking just about the OSD functions), even radar screen!
It also works with the MultiwiiConf, once I disconnect the OSD from serial port.
I'm using the 50A current sensor from flytron:
http://www.flytron.com/osd-headtrackers ... ensor.html

It works well with the following modification in OSD code:

1. set #define CURRENT_SENSOR 2
2. find this in code

Code: Select all

#if (CURRENT_SENSOR == 2)
  currentValue = (currentValue - offset) * 0.061;
#endif


3. replace

Code: Select all

currentValue = (currentValue - offset) * 0.061
with this code

Code: Select all

 currentValue *= 0.049


But I'd have a question. I'm using a 4:3 camera with a 16:9 screen, so there is some deformation in ratio. Because of this, the artificial horizon looks oversensitive on roll and undersensitive on pitch.
Could you add a definable parameter into the OSD code for roll/pitch sensitivity? Than it'd be easy for everyone to fine-tune the sensitivity of the horizon.

I'll try to make some video and post of working OSD.... :D

BR
Adrian

Y.Mita
Posts: 46
Joined: Thu Sep 15, 2011 11:25 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by Y.Mita »

nhadrian wrote:Dear Y.Mita!

I have just tested your latest code, all things works just fine! (I'm not using the PID tuning part so I'm talking just about the OSD functions), even radar screen!
It also works with the MultiwiiConf, once I disconnect the OSD from serial port.

Thank you for testing. Using of MultiWiiConf, I'm doing the same thing as you.

nhadrian wrote:I'm using the 50A current sensor from flytron:
http://www.flytron.com/osd-headtrackers ... ensor.html

It works well with the following modification in OSD code:

1. set #define CURRENT_SENSOR 2
2. find this in code

Code: Select all

#if (CURRENT_SENSOR == 2)
  currentValue = (currentValue - offset) * 0.061;
#endif


3. replace

Code: Select all

currentValue = (currentValue - offset) * 0.061
with this code

Code: Select all

 currentValue *= 0.049


Thank you good information. I think I have same current sensor, but bulk parts. I'll try it later.

nhadrian wrote:But I'd have a question. I'm using a 4:3 camera with a 16:9 screen, so there is some deformation in ratio. Because of this, the artificial horizon looks oversensitive on roll and undersensitive on pitch.
Could you add a definable parameter into the OSD code for roll/pitch sensitivity? Than it'd be easy for everyone to fine-tune the sensitivity of the horizon.

I'm not real coder of mobiDroneOSD, then adding definable parameter is over work to me.
But I think the sensitive parameter which you want is below, around line number 4147.The number like "0.017...".

Code: Select all

    //roll 
    #ifdef ROLL_TILT_REVERSED
      rad =  readedRollAngle*0.0174533f;   //horizont roll
    #else
      rad =-(readedRollAngle*0.0174533f);   //horizont roll
    #endif
   
    posArray[0] = (sin(rad) * (RADAR_RADIUSM10));     
    posArray[1] = (cos(rad) * (RADAR_RADIUSM10));   
   
    //pitch
    #ifdef PITCH_TILT_REVERSED
      rad = -(readedPitchAngle*0.0174533f);
    #else
      rad = readedPitchAngle*0.0174533f;
    #endif

nhadrian wrote:I'll try to make some video and post of working OSD.... :D

I'll be happy to watching your video! Thanks!

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

nhadrian wrote:
But I'd have a question. I'm using a 4:3 camera with a 16:9 screen, so there is some deformation in ratio. Because of this, the artificial horizon looks oversensitive on roll and undersensitive on pitch.
Could you add a definable parameter into the OSD code for roll/pitch sensitivity? Than it'd be easy for everyone to fine-tune the sensitivity of the horizon.



Hi, I am glad that the project goes forward.

I have still some school duties but PRE7 will support the new PID parameters
and in the OSD menu will be added:

- BAT2 voltage adjusting
- Current sensor sellection
- Roll Pitch sensitivity
- Selection of AUX channel to switch screen (normal / radar)
- Vertical resolution adjusting

BR
Michal M.

nhadrian
Posts: 421
Joined: Tue Oct 25, 2011 9:25 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by nhadrian »

Hi,

till PRE7 arrives, here is my solution on Sensitivity:

1, define these:

Code: Select all

#define ROLL_SENS      7   // default sensitive is 10
#define PITCH_SENS      16   // default sensitive is 10


2, replace this:

Code: Select all

 readedRollAngle = min((int)readedRollAngle/10, 40);    //value  -40 to 40 deg
    readedPitchAngle = min((int)readedPitchAngle/10, 40);    //value  -40 to 40 deg


to this:

Code: Select all

 readedRollAngle = min((int)readedRollAngle/10, 40)*ROLL_SENS/10;    //value  -40 to 40 deg
    readedPitchAngle = min((int)readedPitchAngle/10, 40)*PITCH_SENS/10;    //value  -40 to 40 deg


so then, sensitivity could be fine-tuned.

BR
Adrian

ankimo
Posts: 30
Joined: Fri Jan 20, 2012 7:31 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by ankimo »

Hi Mr.MichalM_sk

What should I do for displaying GPS Speed correctly in pre6?
Speed is not correctly displayed as well as Video of Mr.Y.Mita.

Kazz

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

ankimo wrote:Hi Mr.MichalM_sk

What should I do for displaying GPS Speed correctly in pre6?
Speed is not correctly displayed as well as Video of Mr.Y.Mita.

Kazz


Hi Kazz,
displaying GPS speed is in dm/s.

For units m/s:

find this line:

Code: Select all

uint16_t speedTemp = (int) (RS232_TX_Buffer[45] << 8) | RS232_TX_Buffer[44];

and add the line

Code: Select all

speedTemp /= 10;

This week I will have degree examinations, and then finally be enough time for further development ;)
so please be patient.

ankimo
Posts: 30
Joined: Fri Jan 20, 2012 7:31 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by ankimo »

Hi Mr.MichalM_sk

Is it dm/s?
It overflowed with the usual movement speed (about 30 km/h).
It is over 999.

Kazz

ankimo
Posts: 30
Joined: Fri Jan 20, 2012 7:31 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by ankimo »

GPS Speed has improved. :)

Code: Select all

speedTemp /= 100;

http://www.youtube.com/watch?v=QD9vHDfwUxc

Kazz

BasTijs
Posts: 5
Joined: Thu Jun 21, 2012 7:39 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by BasTijs »

Hi there,

I'm looking for a OSD that I can use to read my board + additional sensors so I dont need all double sensors. But I'm new to all of this so here is a newb question:

I ordered a quadrino zoom (http://flyingeinstein.com/index.php/tutorials/knowit) + I2C GPS (http://flytron.com/sensors/180-i2c-g...nd-others.html)

Is it possible to add this OSD and read all the data from the board?

Regards,
Bas

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

BasTijs wrote:Hi there,

I'm looking for a OSD that I can use to read my board + additional sensors so I dont need all double sensors. But I'm new to all of this so here is a newb question:

I ordered a quadrino zoom (http://flyingeinstein.com/index.php/tutorials/knowit) + I2C GPS (http://flytron.com/sensors/180-i2c-g...nd-others.html)

Is it possible to add this OSD and read all the data from the board?

Regards,
Bas


Hi, yes it will work just fine.

Final examination successfully completed and I am now engineer of Applied Informatics :)
At the moment I've had more time for development. PRE7 will be released until the end of next week.

BasTijs
Posts: 5
Joined: Thu Jun 21, 2012 7:39 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by BasTijs »

Gratz on making the exam and getting the job!

How do I add both the GPS + OSD? Just parallel solder it? I only got 1 set of pins on the board.

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by msev »

Congratulations!

Y.Mita
Posts: 46
Joined: Thu Sep 15, 2011 11:25 pm

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by Y.Mita »

MichalM_sk wrote:Final examination successfully completed and I am now engineer of Applied Informatics :)
At the moment I've had more time for development. PRE7 will be released until the end of next week.

Mr. MichalM, Congratulations!

And I hope Pre7 release with new multiwii serial protocol. Porting to mobiDrone the new communication protocol is too difficult for me!

MichalM_sk
Posts: 89
Joined: Wed Jun 15, 2011 5:04 pm
Location: Slovakia

Re: mobiDrone nano arduino OSD for MultiWii with PID config

Post by MichalM_sk »

Thanks :)

BasTijs wrote:Gratz on making the exam and getting the job!

How do I add both the GPS + OSD? Just parallel solder it? I only got 1 set of pins on the board.

Hi, it is not possible to connect two devices to one serial port. You need i2c gps board to solute it.

Post Reply