Adding MAVLINK support

erskyTx runs on many radios and upgrade boards
ersky9x was a port of er9x for use on the sky9x board.
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

There is a problem with anything measuring current. The actual current is not smooth, but is pulsed. Differerent meters may 'average' this in different ways leading to slightly different readings.

Thanks for the testing.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Adding MAVLINK support

Post by kaos »

Mike:
Thank YOU for making this function possible!

Actually, while setting up this test in the past couple days I solved a few issues I was trying to figure out to run MP, Minim and FPV backup and recording on the laptop all at the same time for my Joystick panel. ;)
User avatar
RCHH
Posts: 467
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH »

And the same here. Found several things with APM that I never even knew existed - like the 'Drift' mode for starters! Of course that means I will now get lazy when flying, as rudder will be taken care of! lol!
The simpleton asked "Hows about ErSky9X for Horus???". And the Genius from Dorset replied "Why not indeed? I shall get right onto it!" And then there was light on Horus! And it was good!
User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: Adding MAVLINK support

Post by LTMNO »

See we've been needing Mavlink for a long time now. [emoji1]


Sent from my iPhone using Tapatalk
Custom 9x with M64/Telemetry Mod
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Adding MAVLINK support

Post by kaos »

LTMNO wrote:See we've been needing Mavlink for a long time now. [emoji1]
Yes!
RCHH wrote:And the same here. Found several things with APM that I never even knew existed - like the 'Drift' mode for starters! Of course that means I will now get lazy when flying, as rudder will be taken care of! lol!
read the last paragraph of this post: viewtopic.php?f=48&t=3240#p46862 :lol: :lol:

User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: Adding MAVLINK support

Post by LTMNO »

I confirm that all modes are working.. Thanks Mike...

Now to build out the Quad and start to add the other sensors to it once I get it flying...
I will be adding my UHF system ULRS and passing the FrSky SPort thru it to the Supported Firmware now... Sweet!
We might need to create another screen for some cooler sensors, like...
Photo-Optic Sensor (Show distance, activity, etc)
Lidar (Show activity, distance)
Pan/Tilt Camera (show camera angles, etc)
to name a few...
Custom 9x with M64/Telemetry Mod
tomismrkolj1
Posts: 58
Joined: Sun Jan 24, 2016 10:32 am
Country: -

Re: Adding MAVLINK support

Post by tomismrkolj1 »

Hi,

came home from skiing holiday.
My brother any I have tested mini pro 16k with newest firmware and it works OK!

It however shows unknown APM mode for manual, flyby wire A and flyby wire B modes, that are standard in arduplane (not arducopter), while in arducopter modes are recognised OK.

Is it possible to calibrate powermodule current with handheld voltage/amp/ohm meter, that has short term amp limit at 10A?

tomi
User avatar
RCHH
Posts: 467
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH »

Good point! Have not tried the system at all with Arduplane!

There is no reason you cannot use a multimeter to calibrate the relevant voltages/current for APM. I do just that. I calibrated my setup at 6.0Amps according to the meter I use.

Arduplane flight modes:

MANUAL
STABILIZE
FLY BY WIRE_A (FBWA)
FLY BY WIRE_B (FBWB)
AUTOTUNE
TRAINING
ACRO
CRUISE
AUTO
Return To Launch (RTL)
LOITER
CIRCLE
GUIDED

In addition, there are the following modes:

TAKEOFF
LAND


Might upload Arduplane and see how it goes in an AXN floaterjet. Looks like I won't even have to leave the house to fly anymore - the same as in the post you linked to kaos! lol!!!
The simpleton asked "Hows about ErSky9X for Horus???". And the Genius from Dorset replied "Why not indeed? I shall get right onto it!" And then there was light on Horus! And it was good!
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

For these Arduplane modes, could you tell me what number these names correspond to please?
The mode is sent as TEMP1, so you need to either put T1= on a custom telemetry screen or look on the built in one that shows T1 to see what the value is.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
RCHH
Posts: 467
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH »

Will do Mike. The only issue I can see is that if numbers for one mode in say Arduplane is the same number for a different mode in Arducopter it would not know which text to select?
The simpleton asked "Hows about ErSky9X for Horus???". And the Genius from Dorset replied "Why not indeed? I shall get right onto it!" And then there was light on Horus! And it was good!
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

I know, I'll have to look into that if it happens!.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
RCHH
Posts: 467
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH »

ArduPlane flight mode numbers:

0 Manual
1 CIRCLE
2 STABILIZE
3 TRAINING
4 ACRO
5 FBWA
6 FBWB
7 CRUISE
8 AUTOTUNE
10 Auto
11 RTL
12 Loiter
15 Guided

Found here: http://plane.ardupilot.com/wiki/ardupla ... 2_protocol

Arducopter flight mode numbers:

0 Stabilize
1 Acro
2 AltHold
3 Auto
4 Guided
5 Loiter
6 RTL
7 Circle
9 Land
11 Drift
13 Sport
14 Flip
15 AutoTune
16 PosHold
17 Brake

Found here: http://copter.ardupilot.com/wiki/arduco ... erfltmode1
The simpleton asked "Hows about ErSky9X for Horus???". And the Genius from Dorset replied "Why not indeed? I shall get right onto it!" And then there was light on Horus! And it was good!
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

I think there might be a value in the heartbeat message to tell the type. I'll add something to investigate this.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
RCHH
Posts: 467
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH »

I think these do correspond to the heartbeat message - LTMNO has listed the same values for the drift mode etc. he posted a couple of days ago or so.
The simpleton asked "Hows about ErSky9X for Horus???". And the Genius from Dorset replied "Why not indeed? I shall get right onto it!" And then there was light on Horus! And it was good!
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Adding MAVLINK support

Post by kaos »

this may be worth tinkering around when the main functions are finished.
At this time we have mavlink data via FrSky telemetry already. Which means we know exactly the home coordinates and the model's real time coordinates. the current mavlink screen has a center graph showing the heading.
How difficult is it (or possible with current Tx MCU processing) to make that graph becomes a pointer of the model heading and in relationship to home? like this:
pointer.jpg
this would be much useful than a heading line as of now. The idea is if for any reason you loose the mavlink radio or FPV transmission, with stabilization mode engaged, you can fly the model back by looking at the heading (with Galt) and home (center dot) and bring the model back to visual range and land it safely. I know some OSD have this type of display. I know RTH will work the same way automatically, but being able to fly it back manually by just looking at the tx screen would be really cool!! 8-)
Hmmm, sounds like flying by instrument. :)
RCHH wrote: Looks like I won't even have to leave the house to fly anymore - the same as in the post you linked to kaos! lol!!!
that's the idea! :) I have been planning on making a Tx relay to put on top of the house/car, so I can fly a VTOL or Mulirotor from inside the house/car, sitting in my comfy sofa/seat with big cigar and beer/champagne on the side without being scorched by the summer sun or frozen by the winter blizzard. :lol: :lol:
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

This might be possible, as we have values for Home direction and Home distance I think.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: Adding MAVLINK support

Post by LTMNO »

That would be very cool indeed... native functionality without having to do LUA scripts... this is getting better and better...

Image

https://www.youtube.com/watch?v=PDXLjQBp0D0
Custom 9x with M64/Telemetry Mod
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Adding MAVLINK support

Post by kaos »

:lol: :lol: That is great video! :lol: :lol:

Yes, we can either set/store home GPS location of the model at the time of taking off in the Tx. Then we can use this even without MP when flying. Or may be getting this info from APM (which will require MP in the beginning)?
The DtH, Alt and Galt is already on the screen. A matter of calculation of the real time GPS location and heading in relation to home GPS local at the time of taking off to make this graph.
I believe if this works, we don't even need the MP at all for free hand flying (without way points or FPV, of course i prefer FPV). You can fly far out to you can't see the orientation or beyond your FPV link of the model and still able to bring it back without engaging RTH as long as we have the radio link. All needed is a Mavlink capable board and GPS.
stewwy
Posts: 36
Joined: Fri Oct 02, 2015 11:44 pm
Country: United Kingdom

Re: Adding MAVLINK support

Post by stewwy »

quick question, if you had an OSD on the telemetry port you are using would that not trigger the heartbeat on that port and obviate the need for the arduino if you can do the conversion in the 9x/taranis?
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

The Arduino is also converting the MavLink messages into FrSky telemetry messages so they may be carried to the Tx by the FrSky receiver and Tx module. They are not sent as raw MavLink messages.
MavLink messages are too long for the FrSky telemetry link to be able to send all the data, it only handles about 150 bytes per second.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
tomismrkolj1
Posts: 58
Joined: Sun Jan 24, 2016 10:32 am
Country: -

Re: Adding MAVLINK support

Post by tomismrkolj1 »

Hello,

Mike, have you had any progress on correct arduplane apm modes naming on ersky9x(r) display?

tomi
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

Not yet, I haven't had time!

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

I've just posted new test versions of the Arduino code and ersky9x. The Mavlink display is now supported on the Taranis.
When you select "ArduP" for the telemetry protocol, you will now find another option "ArduC". Actually ArduC replaces the original and ArduP is the new one.
ArduC is for ArduCopter, ArduP is for ArduPlane. The mode names should adjust for the one selected.
In addition, I'm sending from the Arduino extra data that should tell the radio what it should be using. If that works, I'll remove the C/P option and use what I'm sent.
This however needs testing. I'm sending the type code in the high byte of the TEMP1 field. This is ignored by the normal processing to display the Mavlink data, but does appear on the debug display, it is the only entry on the bottom line of data.
I'm seeing 02xx, where xx is the mode code. I think the 02 means ArduCopter. Could someone testing with ArduPlane let me know what value they are seeing please?
The debug screen is UP LONG from the main screen, then RIGHT 5 times from there, it is titled "DEBUG".

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
tomismrkolj1
Posts: 58
Joined: Sun Jan 24, 2016 10:32 am
Country: -

Re: Adding MAVLINK support

Post by tomismrkolj1 »

Hi,

Mike, I have tested new firmware on 9xr pro and arduino mini pro 16k, frsky xjt/x8r combo, amp 2.6 clone.
I confirm six modes that I have programed in arduplane are recognised and displayed correctly:auto, manual, fbwa, fbwb, loiter and rtl.

On debug screen (6/10) in the last row there is only one number and its value is 0106. So I guess you are correct about that.

tomi
User avatar
MikeB
9x Developer
Posts: 17979
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB »

Thanks, looks like I can switch the names as 01 for ArduPlane and 02 for ArduCopter without needing two different protocol entries.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
RCHH
Posts: 467
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH »

Confirmed. Works as above. Tested with DHT/DJT D series and X8R on S.Port. :D :D :D :D :D :D :D :D :D :D :D :D :D :D :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:
The simpleton asked "Hows about ErSky9X for Horus???". And the Genius from Dorset replied "Why not indeed? I shall get right onto it!" And then there was light on Horus! And it was good!
Brodziek
Posts: 15
Joined: Thu Mar 20, 2014 5:55 pm
Country: Poland

Re: Adding MAVLINK support

Post by Brodziek »

HI Mike,
I test the version er9x with its own converter telemetry protocol FrSky Hub.
Confirm. Everything works.
Unfortunately, now I have no way to check the protocol S-port.
Mike, Good job.
How do you find free time, please add new features to er9x.
Maybe it's time to release the official version?
Using Tapatalk
User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: Adding MAVLINK support

Post by LTMNO »

Great work Mike. Thx.


Sent from my iPhone using Tapatalk
Custom 9x with M64/Telemetry Mod
User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Adding MAVLINK support

Post by kaos »

Indeed.
This type of function is what makes er9x so great.
conicio
Posts: 11
Joined: Tue Feb 23, 2016 5:03 pm
Country: -

Re: Adding MAVLINK support

Post by conicio »

I'm trying this with an Arduino Nano that I have.
It's not working for me.
I connect the +5V to Vin, Gnd to Gnd Tx to Rx and Rx to Tx (APM to Nano) also connect D5 to Signal and Gnd to Gnd on the SPort of the X8R
On my 9XRPro I select ArduC-Met under UsrProto. It's loaded with the pr219 firmware.
Does this need more config? Do I have to connect the SPort from the XJT to the Futaba trainer Jack?
Another question: Does this code run on teensy 3.1?
Thanks a lot
Andrés

edit: I can upload the sketch on the Nano without errors, but I can't see the tx or rx leds blink when connected to the APM. Do I need to enable the telemetry on the APM?
Last edited by conicio on Tue Mar 01, 2016 12:33 am, edited 1 time in total.
F-450 Clon - APM 2.5 - X8R - XJT - 9XR Pro
S-500 - HKMicro APM - FS6R - FS T6

Post Reply

Return to “erskyTx (was ersky9x)”