Adding MAVLINK support

erskyTx runs on many radios and upgrade boards
ersky9x was a port of er9x for use on the sky9x board.
Post Reply
User avatar
RCHH
Posts: 465
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH » Sun Feb 14, 2016 6:56 pm

kaos - are you able to connect your 6M to the ublox u-center and see if that gives the same lat/long as MAVLink data?

On my MP it shows me within +/-2.5m of where the unit is (indoors with only 5 sats), but on Google Earth - somewhere in Belgium with the figures used from the new telemtry screen.
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: 16732
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB » Sun Feb 14, 2016 7:00 pm

A thought for a future enhancement. The openXsensor has code to read individual cell voltages. It may be possible to get the Arduino to monitor the individual cells.

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 » Sun Feb 14, 2016 7:06 pm

RCHH wrote:kaos - are you able to connect your 6M to the ublox u-center and see if that gives the same lat/long as MAVLink data?

On my MP it shows me within +/-2.5m of where the unit is (indoors with only 5 sats), but on Google Earth - somewhere in Belgium with the figures used from the new telemetry screen.
I can try, can you give me a link and brief procedure to connect to u-center? Never tried that.
I never get a sat lock in my house. :lol: That is why I got those 433mHz mavlink radio unit, so I can sit in the house and the quad in the yard to test it. ;)

User avatar
jhsa
Posts: 19211
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Adding MAVLINK support

Post by jhsa » Sun Feb 14, 2016 7:11 pm

MikeB wrote:A thought for a future enhancement. The openXsensor has code to read individual cell voltages. It may be possible to get the Arduino to monitor the individual cells.

Mike.
Brilliant idea.. :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

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

Re: Adding MAVLINK support

Post by MikeB » Sun Feb 14, 2016 7:29 pm

RCHH wrote:kaos - are you able to connect your 6M to the ublox u-center and see if that gives the same lat/long as MAVLink data?

On my MP it shows me within +/-2.5m of where the unit is (indoors with only 5 sats), but on Google Earth - somewhere in Belgium with the figures used from the new telemtry screen.
Have you got an East-West problem? I'd guess the Belgium position is about as far east of Greenwich as you are west!

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 » Sun Feb 14, 2016 8:13 pm

RCHH wrote:On my MP it shows me within +/-2.5m of where the unit is (indoors with only 5 sats), but on Google Earth - somewhere in Belgium with the figures used from the new telemtry screen.
I am non existent on Google Earth, because I can't find a position with that last 4 digits. I may be at the center of earth. :lol:

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

Re: Adding MAVLINK support

Post by RCHH » Sun Feb 14, 2016 8:27 pm

MikeB wrote:
RCHH wrote:kaos - are you able to connect your 6M to the ublox u-center and see if that gives the same lat/long as MAVLink data?

On my MP it shows me within +/-2.5m of where the unit is (indoors with only 5 sats), but on Google Earth - somewhere in Belgium with the figures used from the new telemtry screen.
Have you got an East-West problem? I'd guess the Belgium position is about as far east of Greenwich as you are west!

Mike.

It is the East West Mike. The North/South is on the nail. Will have a look at the actual place it says I am in Belgium and work out the distances involved.

Will be on this again once I have the brats off Minecraft and to bed! lol!

Edit:
Indeed it is as you say Mike - a simple '-' in front of my 'Lon' reading puts me in my back garden. 3m away. Perfecto!

50.426165, -04.142900 - mine has the 8 solar panels on't roof! Pretty good positioning for only 4 sat locks!
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
RCHH
Posts: 465
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH » Sun Feb 14, 2016 8:57 pm

kaos wrote:
RCHH wrote:kaos - are you able to connect your 6M to the ublox u-center and see if that gives the same lat/long as MAVLink data?

On my MP it shows me within +/-2.5m of where the unit is (indoors with only 5 sats), but on Google Earth - somewhere in Belgium with the figures used from the new telemetry screen.
I can try, can you give me a link and brief procedure to connect to u-center? Never tried that.
I never get a sat lock in my house. :lol: That is why I got those 433mHz mavlink radio unit, so I can sit in the house and the quad in the yard to test it. ;)

U-Center software: U-Center

Connection info: HERE

It is a pretty handy piece of kit - it helped solve the issues I had with an HK MultiWii Pro that worked perfectly, and then decided to totally not work with its MTK GPS at all. Tried it with a Neo-6M and it was still a no go, but the U-Center proved the Neo was working. Tracked it down to a voltage problem on the MultiWii board (only 3.2V on the connection that 'should' be 5V) that was easily fixed by soldering two pads!
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: 16732
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB » Sun Feb 14, 2016 9:14 pm

I've just posted some updates for both the Arduino and ersky9x.
Arduino:
Change the SPort physical ID - avoids a clash with the X8R2Analog device.
Link option on D3 - open = send Vfas (battery voltage), ground = do not send Vfas.
Link option on D4 - open - do not send CELLS, ground = send CELLS.
More data values sent over SPort.
Ersky9x:
Translate SPort values from Teensy converter.

On my setup I'm seeing a current measurement of around 8A, although I only have the APM board and the voltage/current board. This may be a setup problem.
Does the current display OK on yours?

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 » Sun Feb 14, 2016 9:24 pm

RCHH:
Thx, that looks pretty simple, I will try use the MP pass through method.
But it also aroused my curiosity. The 2nd method of using a FTDI cable. I wonder if I can just use my FTDI adapter for loading Arduino program to do it. like this one. this would be a easy way to check out GPS unit/update FW quickly.
http://www.ebay.com/itm/141724029351?_t ... EBIDX%3AIT
s-l1600.jpg

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

Re: Adding MAVLINK support

Post by RCHH » Sun Feb 14, 2016 9:34 pm

I used my FTDI to do it kaos. Same one I use to chuck code onto my Arduino and other magical things of an electronic nature. Only did it the once for the Neo - but it worked fine.
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
RCHH
Posts: 465
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH » Sun Feb 14, 2016 9:52 pm

MikeB wrote:I've just posted some updates for both the Arduino and ersky9x.
Arduino:
Change the SPort physical ID - avoids a clash with the X8R2Analog device.
Link option on D3 - open = send Vfas (battery voltage), ground = do not send Vfas.
Link option on D4 - open - do not send CELLS, ground = send CELLS.
More data values sent over SPort.
Ersky9x:
Translate SPort values from Teensy converter.

On my setup I'm seeing a current measurement of around 8A, although I only have the APM board and the voltage/current board. This may be a setup problem.
Does the current display OK on yours?

Mike.
Uploaded and working. Not tried the D3 options yet.

I get 0.0A on the Current (debug screen showing 0000), but I am not running anything. Hdop is now showing x.xx readings (at the moment I am getting 3D Fix, 4 sats with hdop 1.18 which is correct)

Not showing any cell voltages now on the Lat/Long screen to the left.
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: 16732
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB » Sun Feb 14, 2016 10:14 pm

Just spotted a typo, the second link option should read D4. I've edited my post and the one with the quote in it to correct this.

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

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

Re: Adding MAVLINK support

Post by RCHH » Sun Feb 14, 2016 10:34 pm

D4 to Open/Gnd working.

Not sure what the requirements for D3 are though - is a sensor needed?

Also, have wired up a couple of motors to the setup here to check current, and still see 0.00A when running. Debug screen still sows 0000.
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: 16732
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB » Sun Feb 14, 2016 11:03 pm

Re D3 no sensor is needed. It is just whether the battery voltage is sent as Vfas or not. I'm not sure if it is needed to allow a FLVSS to be used.

I seem to have a current of 0.0A now. I'm not sure whether I can hook up any motors, I'm just using the APM board 'loose' on the bench.

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

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

Re: Adding MAVLINK support

Post by RCHH » Sun Feb 14, 2016 11:20 pm

You can hook up any old ESC/Motor you have to hand to Output 1 on your board - that is basically what I have here at the moment, all in a biscuit tub! If you have loaded a basic setup on the APM for say, an 'X' quad and run the radio calibration, you will be hot to trot. Be aware though that on 'Arming' the motor will spin at idle by default. That can be disabled in the Mission Planner, as I have done.
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 » Sun Feb 14, 2016 11:27 pm

Just tried the new version. yep, hdop is matching MP now. ;) no showing of v1-3.
the GPS lat last 4 digit still is 6624 which does not exit on Google Earth. :P This is using the DDmm.mmmm format, but the DD.dddddd match perfectly with MP.

Mike: Is it possible to hook my FAS-100 amp sensor to one of the serial port of FC? If so, I can test the current as well. I am using all D series parts.
the mav screen, right bottom item Rc'q' is TSSI?

RCHH:
I forgot the GPS I have on the Multiwii board is a MTK-3329, not a Ublox. the label were all peeled off by previous taping. But I was playing with a AIO v1 board with a Ublox neo-6m. till I saw they are a little different. But I will set up the Crius AIO v1 board soon with Ublox GPS. thx for the info of u-center.

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

Re: Adding MAVLINK support

Post by MikeB » Sun Feb 14, 2016 11:44 pm

I'll see what I can do to add a load on the current sensor. I have a small board that connects to the battery and provides the 5V for the APM together with the voltage and current measurements.
Not sure I understand about th 6624. If this is after the decimal point, then it represents 0.6624 of a minute, which equals 39.744 seconds.
I have no idea if the FAS-100 can be handled by the APM, or what Rcq is!

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

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

Re: Adding MAVLINK support

Post by RCHH » Sun Feb 14, 2016 11:46 pm

Ah! I have a similar little prog and firmware updater for the MTK-3329 (same one as I have on my MultiWii Pro from HK) as well somewhere.

Google Media Tek Mini GPS Tool

If it is not showing up, drop me a not and I will upload a copy.
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
RCHH
Posts: 465
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: Adding MAVLINK support

Post by RCHH » Mon Feb 15, 2016 12:00 am

kaos wrote:Just tried the new version. yep, hdop is matching MP now. ;) no showing of v1-3.
the GPS lat last 4 digit still is 6624 which does not exit on Google Earth. :P This is using the DDmm.mmmm format, but the DD.dddddd match perfectly with MP
kaos - set your radio to the DD.mmmm format. Found in Radio Setup > General > GPS Format. Then you will see the XXX.XXXXXX LAT/LONG in the radio screen. Those work on Google Earth by removing the first '0' on the screen readings. As it is, you are seeing XXXX.XXXX yes?
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 » Mon Feb 15, 2016 1:06 am

Mike: you are right. My mistake, forgot google earth lat/lon setting is using the minute, second, once I set it to 'Degrees, Decimal points" then the xxxx.xxxx format matches. :P

The 'Rcq' is the item shown on the telemetry mav screen, the right side bottom item. It matches tssi, but don't know why the name 'Rcq'.

RCHH: Yes, I have tried both format in general setting and now both format matches either MP or Google Earth (with change in google setting). :)
Once you mentioned that name MediaTek mini GPS Tool, it darned on me, I had that software. Just now, digged out of my back up files. (had gone through a few PC changes/crashes in the past couple yrs) Got it. I think I already flashed it to the most recent fw 2 yrs ago.

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

Re: Adding MAVLINK support

Post by kaos » Mon Feb 15, 2016 3:03 am

Well, I found in my box I have a APM power cord which is for powering APM and current , voltage sensor. I think I got it cause it can be used on AIOP/multiwii board as well. but I can't find the documentation now.
If some one can tell me how to hook it up to the AIOP/multiwii board (may be serial port or I2C port) I will be able to the test the current and voltage.
I am searching for the doc right now.
APM power module pin out.jpg

User avatar
Kilrah
Posts: 10416
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Adding MAVLINK support

Post by Kilrah » Mon Feb 15, 2016 5:57 am

I believe they are just 2 analog outputs for voltage and current.

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

Re: Adding MAVLINK support

Post by kaos » Mon Feb 15, 2016 6:11 am

yes Kilrah, after all night search on the web, that is my impression too. the issue would be the voltage divider, it MAY need a divider. Have not found that info yet. Can't find the original purchase order. Here is a pic of mine. I am not sure it is a 90A or 50A module. May be you can tell what is it.;)
Do you think a direct connect from gnd,I,V to analog pin will do? (I don't need the 5V supply to FC board)
reviewing the MP set up for the voltage/current sensor, it may do an automatic conversion if divider is incorrect or not there.
This is the original 3dr site statement: https://store.3dr.com/products/apm-powe ... connectors
Attachments
DSC03959.JPG
DSC03957.JPG

User avatar
Kilrah
Posts: 10416
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Adding MAVLINK support

Post by Kilrah » Mon Feb 15, 2016 7:22 am

kaos wrote:the issue would be the voltage divider, it MAY need a divider.
Connect a battery to the main meads and measure the voltage on the V output, you'll know soon enough. The divider is likely on the board.
Voltage and current measurement configured for 5V ADC

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

Re: Adding MAVLINK support

Post by RCHH » Mon Feb 15, 2016 8:23 am

THIS MAY HELP

And this:

Image

right click image, open in new tab/window for bigger view ...
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: 16732
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adding MAVLINK support

Post by MikeB » Mon Feb 15, 2016 2:05 pm

There is some sort of configuration I need to get correct for the current measurement. I'm using a couple of power resistors to provide a current load. At one point I did have a current measurement that was just over double the actual current. I added a load of 1.9A and it changed to 4.3A, returning to 0 when I removed the load. I had the current scaling set to 100A per volt. When I changed this to a more correct figure, it stopped measuring the current!
I'm not convinced that mission planner is writing changes to some settings (like the battery monitor) when they change so I don't know exactly what settings I had when it sort of worked!

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 » Mon Feb 15, 2016 3:31 pm

Thx, Kilrah and RCHH.
That diagram is exactly what i was arriving as conclusion last night. Now confirmed, I will fire it up today.
Mike:
I saw a MP video last night, you may need to to get a 10A load to calibrate the current sensor in MP.

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

Re: Adding MAVLINK support

Post by kaos » Mon Feb 15, 2016 3:35 pm

Mike:
I ran across this last night. It may give some clue to you
http://diydrones.com/forum/topics/amp-t ... -converter


edit:
I also ran across this may help people using Taranis:
http://copter.ardupilot.com/wiki/common ... telemetry/
Last edited by kaos on Mon Feb 15, 2016 4:46 pm, edited 1 time in total.

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

Re: Adding MAVLINK support

Post by MikeB » Mon Feb 15, 2016 4:00 pm

kaos: Thanks, I've already got that code downloaded.
Mission planner seems to change some settings as it seems to like!
On Initial Setup!Battery monitor I selected APM2 - 2.5 non 3DR as the "APM Ver"
I then go to Config/Tuning and set the current sensing pin to A12 and the voltage sensing pin to A13 and write the parameters.
I go back to the Battery monitor and it has changed to APM2.5+ - 3DR Power module, and changes the voltage scaling.
Very frustrating as I did have the current apparantly being measured, just incorrectly scaled, but it wasn't clear what the settings were.

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


Post Reply

Return to “erskyTx (was ersky9x)”