Page 7 of 20

Re: Adding MAVLINK support

Posted: Wed Feb 17, 2016 10:37 pm
by RCHH
MultiWii has pretty much everything now. My other HK Pro is configured with full GPS missions (EosBandi to thank for that), RTH, 'Follow Me' via Bluetooth and a mobile, headefree mode, sonar, OLED display of parameters and telemetry and some other stuff. I was playing about with OpticalFlow but never got round to fully sorting it. May do just for the hell of it!

The HK Pro board was the first go I had at a multicopter, and I have to say I really enjoyed the experience of learning about the whole process etc. and to configure things to suit myself. Once I figured out what was what with it though! And ... that copter has never crashed to this day! And I fully intend keeping it!

Re: Adding MAVLINK support

Posted: Wed Feb 17, 2016 11:59 pm
by kaos
Wooooooo, if Multiwii is fully functional, does that mean the next add on would be multiwii protocol to erky9x. :mrgreen:

SONAR!!!, the MPNG does not support sonar. May be I should set up my HK AIOP V2 ~ Crius V1 with Muliwii ;)
I wonder if my 915 Mhz radio link can be used with the new multiwii ?

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 12:49 am
by RCHH
kaos wrote:Wooooooo, if Multiwii is fully functional, does that mean the next add on would be multiwii protocol to erky9x. :mrgreen:

SONAR!!!, the MPNG does not support sonar. May be I should set up my HK AIOP V2 ~ Crius V1 with Muliwii ;)
I wonder if my 915 Mhz radio link can be used with the new multiwii ?

I wonder .... MultiWii to ErSky9X via FrSky? Here will be of use then! LOL!!!

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 1:14 am
by kaos
Wow, looks like the code for Multiwii via FrSky D series is already there for OpenTx. That means it would be like eating peannuts for Mike to port to ersky9x? :lol:

RCHH: Thx for the info, I need to look into detail for latest Multiwii now. ;)

now back to Minim to see what is on the screen for MPNG. ;)

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 2:08 am
by RCHH
It would be good to see MultiWii telem on the ol' ErSky9x! Hint hint to the Genius man ... lol!

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 7:14 am
by jhsa
Hmm, maybe he should stop adding new features and make the firmware stable and bug free? That is what a couple users suggested a while ago right? ;) :D :mrgreen:

João

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 10:04 am
by RCHH
Just wondering if it is possible to have voice announcements for the telemetry? For instance, the TX shouting out 'GPS fix lost' in that situation would be a very handy indeed...

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 10:07 am
by MikeB
To save me time searching/asking, is there a clear document for the MultiWii code detailing which FrSky IDs are used to transfer what data values?

Mike.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 10:10 am
by MikeB
RCHH wrote:Just wondering if it is possible to have voice announcements for the telemetry? For instance, the TX shouting out 'GPS fix lost' in that situation would be a very handy indeed...
The GPS status is sent as temperature 2, but includes the number of sats, so it is a bit tricky to extract the GPS status directly. I'll need to think about it.

Mike.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 10:25 am
by jhsa
Can't you just program a voice alarm? It doesn't need to be hardcoded, right?

João

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 10:29 am
by RCHH
Oh gawd ... I already though you had been thinking! What will you come up with when you do start thinking about things? lol!!!

Would it be practical/possible to extrapolate a warning triggered at the point where the display shows 'No GPS' ? I really want to use a sound bite from Monty Python's Life of Brian when he tells the assembled crowd to 'go away' unpolitely when I lose GPS lock and the copter decided to fly itself back to Shenzen ... lol!!!

One more little thing - what does the Rcq value mean? Have had a look about and cannot find an answer to that one.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 10:34 am
by jhsa
RCHH wrote: I really want to use a sound bite from Monty Python's Life of Brian when he tells the assembled crowd to 'go away' unpolitely when I lose GPS lock and the copter decided to fly itself back to Shenzen ... lol!!!
:mrgreen: :mrgreen: :mrgreen: :mrgreen:

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 2:07 pm
by LTMNO
Morning..
@Mike....
I am home again and have time today to get on this... is this the latest to be testing?

APM_Mavlink_to_FrSky.zip
14-Feb-2016 21:07
Make Teensy compatible
Link options for Vfas and Cells
Arduino Mini/Pro mini Mavlink code
(210.75 KiB)

ersky9xProvR219f.zip
14-Feb-2016 21:07
Make Teensy compatible
(926.38 KiB)

I am going to test the Teensy and the ProMini. Ironically, I was getting somewhere with the Nano.

I will report back with screenshots today... after confirming the latest.

Thanks.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 4:35 pm
by MikeB
Yes, those are the latest test versions.

Mike.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 4:40 pm
by LTMNO
Started off with this Version

Image

I quickly got some information being sent via Arduino Pro Mini (Actually its a Funduino from HK)

Image

I was not getting any Voltage/Current, I had to configure the APM via the Tower App Live with Radio Link 915mhz on my Tablet.
Once the params were configured, I was getting Voltage...

Image

Image

Image

Here is what you get on Tower App

Image

You can fly the quad without the radio if you really wanted to. ;-)

I am not sure if I am suppose to enable something.. but nothing shows up in Debug?
EDIT: noticed i can change that in the INO now that I can compile ;-)
Image

Image

GPS comes in nicely...
Notice Cell Count/Voltage does not come in though.. When the FVLS is connected, this will populate.

Some things I noticed that didn't display correctly...
Modes on the Main screen don't come in for ;
Drift
PosHold
Sport
They all defaulting to STAB
I assume this is something simple to fix in the Arduino files for noticing which Mode is enabled and display the right Text.

Also,
'alt', 'gAl' work along with Compass/Radar pointer.
'dth' does not display anything
'Fuel' is always 100% and that is what shows up on the Battery Percentage. I know my Batt is not 99% at 11.6V

Thanks Mike for all the great work... let me know if I can test further with my setup.

Authentic APM 2.5+
Arduino Pro Mini (Funduino)
X8R
XJT
9xTreme

Image

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 5:13 pm
by MikeB
Nice test of SPort operating.
The mode only has text for the following at present:
0 "STAB"
1 "ACRO"
2 "A-Hold"
3 "AUTO"
4 "GUIDED"
5 "LOITER"
6 "RTL"
7 "CIRCLE"
8 "MODE8"
9 "LAND"
I'll need to find out the text that matches other values. This text is in ersky9x.

Fuel is, I believe, a value calculated on the APM based on the current, time and battery capacity, nothing to do with the battery voltage.
dth is distance to home, as sent by the APM.

The debug is only displayed on SKY/PRO/AR9X, I'll enable it for the 9Xtreme.

The code in the Arduino now supports three link options.
D2 - open = hub, ground = SPort
D3 - open = send voltage as VFas, ground = don't send voltage
D4 - open = don't send pseudo cells, ground = send pseudo cells.

Looks like it is just about working.

Mike.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 5:24 pm
by MikeB
RCHH wrote:Would it be practical/possible to extrapolate a warning triggered at the point where the display shows 'No GPS' ?
One more little thing - what does the Rcq value mean?
Rcq is TSSI I think, so it is a measure of the strength of the telemetry signal received by the Tx module. On an XJT, it is SWR.
It may not be useful. Maybe we can replace it with something else more useful?

Regarding GPS, this is a bit tricky but is possible. The information is sent as temperature2, coded as 10 times the number of sats + the type of fix:
0 "No GPS"
1 "No Fix"
2 "2D Fix"
3 "3D Fix"
so a value of 52 is 5 satellites and a 2D fix.
A method of detecting the fix is as follows:
Use scalers:
SC1 source = temp2, multiplier 1, divider 10
SC2 source = SC1, multiplier = 10, divider = 1, offset = 2, offset at last
Then a logical switch:
L1 v1<v2 temp2 SC2
SC1 works out the number of sats.
SC2 is therefore the value in temp2 if you have at least a 2D fix.
L1 is ON if temp2 is x0 or x1 where x is the number of sats.

It may be possible to improve on this if I hard code something.

Mike.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 5:47 pm
by LTMNO
Hi Mike,
thanks for the feedback, I tested the D4-GND, that did not work... the pseudo cells did not change? still at 0.
As for the modes... that is fine... PosHold is more common that Drift.
Strange about Fuel though... I will test further on that...

Thanks again.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 6:46 pm
by MikeB
Are you drawing any current? If not, then the FUEL will stay at 100% (or 99%).
The flight mode is sent in the TEMP1 value. If you configure a custom telemetry field to display T1=, you should be able to see what number corresponds to DRIFT, SPORT and POSHOLD. I also see a "OF_LOITER" in mission planner!

I forgot that the psuedo cells are only sent when the hub protocol is selected, I still need to add them to the SPort version.

Mike.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 7:05 pm
by LTMNO
Quick test shows...
Drift 11
PosHold 16
Sport 13
I have my motors spinning... no props... but they should still draw some Amps... I will correlate with MP and see what it says there.
I don't use AMPS anyway.. so I am not concerned with Current as much.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 10:51 pm
by kaos
LTMNO:
my 450 only draws <4A max without the prop, if you can put the prop reversed and move clockwisely one position it will generate a down thrust and be able to test the amp draw. I am curious if the voltage is reported incorrectly with higher current on my AIOP board with MPNG (a bug in MPNG). You have a genuine APM 2.5 board it should report correct voltage with higher amp draw.
My voltage starts to deviate when A > 2.6~ 2.8A at >30A, it will be ~ 2V higher than actual voltage from my watt meter.

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 11:28 pm
by RCHH
Bear in mind your 'no load' current draw on those motors will be extremely low - on the quad I tested this telemetry system on, all four 3110 470kv motors running without props draw only 1.2Amp ... Props on obviously got the figures moving - and to within 0.1A accuracy and in agreement with MP and my watt meter for both volts and Amps. The 'fuel' bar does drop, but I have not had chance to run the battery (10400mAh) down much to see how accurate it is. Next playtime for me with this will be Saturday - weather permitting

Re: Adding MAVLINK support

Posted: Thu Feb 18, 2016 11:41 pm
by LTMNO
Alrighty then, I will give it a go, I have to finish printing out a Battery Tray and then i can test the prop setup... too much in the way at the moment to make it safe. ;-)
I will report back tomorrow.

Thanks.

Re: Adding MAVLINK support

Posted: Fri Feb 19, 2016 12:30 am
by MikeB
I've posted an update for the Arduino. This sends more values over SPort, including the pseudo cells if enabled.
Also an update to ersky9x that has extra names on the MavLink modes, including "UNKNOWN" anything not known!

Mike.

Re: Adding MAVLINK support

Posted: Fri Feb 19, 2016 1:59 pm
by LTMNO
;-)
Thank Mike, I will test that out as well today.

Cheers!

Re: Adding MAVLINK support

Posted: Fri Feb 19, 2016 10:22 pm
by RCHH
MikeB wrote:I've posted an update for the Arduino. This sends more values over SPort, including the pseudo cells if enabled.
Also an update to ersky9x that has extra names on the MavLink modes, including "UNKNOWN" anything not known!

Mike.
Tested and confirmed working on D series RX. Will test all on S.Port when I find the buggers! Put them in a box somewhere 'safe'! Ahem!

Edit: Did you resize the 'compass' box on the screen Mike? Looks like it will now accommodate Amps readings above X.X (as in sat 20.9 Amps) without impinging on the 'Cur' text. :D

I also get Flight modes correctly displayed - ACRO, STAB, DRIFT, A-HOLD, LOITER & RTH in my case. :D

Re: Adding MAVLINK support

Posted: Sat Feb 20, 2016 11:25 pm
by kaos
Got my Minim hooked up. Here are two short video for you to judge how all 4 (watt meter, ersky9x mavlink, MP mavlink and Minim) comparatively.
There is some inconsistency, but this could be the different timing for each one displaying the data. I can't really control that well on a live model for voltage and amp draw. ;) This is done with ersky9x and arduino code one before the latest version. I guess that should not make too much difference for Hub protocol ??
Hard to get all 4 displays showing clearly on the video, that is why two clips here.
https://youtu.be/veMqvwvTQ9E
https://youtu.be/9f4y9Z0EIoQ
view them at 1080P will show better.

Re: Adding MAVLINK support

Posted: Sat Feb 20, 2016 11:28 pm
by RCHH
Tested with X8R S.Port - all working as with the D series. Will reconfig the APM for the other flight modes available to check that bit. So far so excellent!

Re: Adding MAVLINK support

Posted: Sat Feb 20, 2016 11:34 pm
by RCHH
as the ancient Chinese electricians proverb goes:

""Man with one meter always know correct reading. Man with two meters never know correct reading ..."

I have the same watt meter as in your video kaos - it is 'reasonably' accurate at best, and does not tally fully with the calibrated Fluke meter I use for just such tests 'concurrently' as you are seeing. I reckon it is near enough for flying purposes though.

Re: Adding MAVLINK support

Posted: Sun Feb 21, 2016 12:39 am
by kaos
RCHH wrote:I reckon it is near enough for flying purposes though.
No doubt about that! :)
I just feel it is interesting to see all these things going on at the same time but show a little variation. Who says light/electrons/radio wave travel equally fast! :lol: