brukutu

  • *
  • 22
M8N GPS with Revo
« on: March 24, 2016, 03:34:06 pm »
Hi All.

I have a very unusual issue.

I am using a M8N with Ext Mag.

GPS Show it gets a lock, however Revo board thinks no gps is connected. However Librepilot shows me the gps lock and number of sats. Also every now and then the GPS logo on the flight data page goes orange or green, the back to black with a cross.


I have tried cofig the M8N like it states for a cc3d board using ucenter, have tried with original config also.

Almost feels like the GPS is not sending the messages which Librepilot looks for in order to know there is a gps connected?




brukutu

  • *
  • 22
Re: M8N GPS with Revo
« Reply #1 on: March 24, 2016, 03:48:23 pm »
As I pulled usb cable out I noticed this.


But goes back to GPS not found almost straight away

f5soh

  • *****
  • 4572
    • LibrePilot
Re: M8N GPS with Revo
« Reply #2 on: March 24, 2016, 03:54:33 pm »
You don't need to configure GPS like the CC3D manual config page, with 8M the messages used are not the same also.

If you have issues, revert GPS to factory settings using Ucenter and just connect to Revo.
With default settings Revo uses the Autoconfig feature, keep UBX protocol @57600 in Hardware tab

Try using Wizard, at least config is know and works without adding any trouble.
If you lost GPS connection, double check cable/wires.

Please post you current config, just in case: File > Export UAV settings...

brukutu

  • *
  • 22
Re: M8N GPS with Revo
« Reply #3 on: March 24, 2016, 04:11:21 pm »
Thanks for the response.

I think I just came right :)

I believe the baud rate of 19 was to low, upped it to 56. Perhaps the update rate of 200ms was to much and it was leaving packets behind?

Disabled auto configure on the Revo.

I also looked at the code and did manually the following changes to the GPS with ucenter.

ubx_cfg_msg_t msg_config_ubx7[] = {
    // messages to disable
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_AOPSTATUS, .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_CLOCK,     .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_DGPS,      .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_POSECEF,   .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_SBAS,      .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_TIMEGPS,   .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_VELECEF,   .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_SOL,       .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_STATUS,    .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_VELNED,    .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_TIMEUTC,   .rate = 0  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_POSLLH,    .rate = 0  },

    { .msgClass = UBX_CLASS_MON, .msgID = UBX_ID_MON_HW,        .rate = 0  },
    { .msgClass = UBX_CLASS_MON, .msgID = UBX_ID_MON_HW2,       .rate = 0  },
    { .msgClass = UBX_CLASS_MON, .msgID = UBX_ID_MON_IO,        .rate = 0  },
    { .msgClass = UBX_CLASS_MON, .msgID = UBX_ID_MON_MSGPP,     .rate = 0  },
    { .msgClass = UBX_CLASS_MON, .msgID = UBX_ID_MON_RXBUFF,    .rate = 0  },
    { .msgClass = UBX_CLASS_MON, .msgID = UBX_ID_MON_RXR,       .rate = 0  },
    { .msgClass = UBX_CLASS_MON, .msgID = UBX_ID_MON_TXBUF,     .rate = 0  },

    { .msgClass = UBX_CLASS_RXM, .msgID = UBX_ID_RXM_SVSI,      .rate = 0  },

    // message to enable
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_PVT,       .rate = 1  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_DOP,       .rate = 1  },
    { .msgClass = UBX_CLASS_NAV, .msgID = UBX_ID_NAV_SVINFO,    .rate = 10 },
};


Plugged it in and working :)

Now, i have an external mag attached to the small flexi port where i saw the i2c mapping and options.

How do I use the external mag?

I recall to have read somewhere to use an external i2c mag you need the latest dev version?

See latest screenshots.

Also not I have not yet attached the mag to the UAV and also have not yet calibrated. I assume the mag status there is for the internal mag? as right now the external one is not connected.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: M8N GPS with Revo
« Reply #4 on: March 24, 2016, 04:35:19 pm »
You need the "next" branch
look here how to setup a build env:
https://librepilot.atlassian.net/wiki/display/LPDOC/Developer+Manual

The autoconfig works fine, no need manual config except for cc3d.
Yes, maybe baudrate too low.

Take a look here for autonomous/gps features:
https://librepilot.atlassian.net/wiki/display/LPDOC/Advanced+features

And this video for AuxMag, using next branch:

brukutu

  • *
  • 22
Re: M8N GPS with Revo
« Reply #5 on: March 24, 2016, 09:54:30 pm »
I am in the process of installing the dev tools so that I can do i2c mag.

In the mean time i have been playing with current version. Why would the board do this? I have calibrated the accelerometer but it goes to that sideways thing.

If i try take off it obviously flips over straight away as it seems to think its at a 45 deg angle.

Mateusz

  • *
  • 808
Re: M8N GPS with Revo
« Reply #6 on: March 24, 2016, 10:14:29 pm »
Because LP uses 3D magnetometer, in other words it is not just used to determine heading but also whether aircraft is up-side down. If you have Mag not green all the time (jumps to orange) then you wont be able to fly in INS31. Mag must be calibrated outdoors, far from metallic elements, and it must be away from magnetic interference.
Also your GPS is orange, that also must be green to fly stable, and you should never use it indoors with INS31.

When you use INS31 it uses all sensors accel,gyro,mag,baro,gps fused/blended together with EKF. Of course EKF is designed to handle noisy signal, but there is a limit to that. If you feed algorithm with totally wrong measurements that deviate a lot, it won't handle that and will give crappy estimates/stabilization.

You should fly in Complementary, if you really want GPS mode using flight modes, you really need to have a good measurements from all sensors, that's why it is more difficult.
« Last Edit: March 24, 2016, 10:19:10 pm by Mateusz »

brukutu

  • *
  • 22
Re: M8N GPS with Revo
« Reply #7 on: March 31, 2016, 08:31:16 pm »
OK.

Got ext mag working and calibrated.

problem is the photo.

I have calibrated it level and so on. Now that is how it is when it is leveled. This only happens with gps instead of complimentary enabled.

brukutu

  • *
  • 22
Re: M8N GPS with Revo
« Reply #8 on: March 31, 2016, 09:52:15 pm »
More info

Also, when the GPS has no lock, it does not stay black. it goes red cross as in no gps detected. However GPS widget works and shows gps status. As soon as it has a part lock or full lock it goes orange or green

brukutu

  • *
  • 22
Re: M8N GPS with Revo
« Reply #9 on: April 02, 2016, 10:48:29 pm »
I think the problem is in this photo attached, I just dont know how to fix it?


Sorry, i edited your post :(

« Last Edit: April 02, 2016, 11:36:22 pm by f5soh »

f5soh

  • *****
  • 4572
    • LibrePilot
Re: M8N GPS with Revo
« Reply #10 on: April 02, 2016, 11:35:54 pm »
Read the text above bars.
Watch the video i posted above.

Adjust the AuxMag orientation.

brukutu

  • *
  • 22
Re: M8N GPS with Revo
« Reply #11 on: April 02, 2016, 11:39:41 pm »
I did read the text above.

I tried -180,-90,0-90,180 in each one in all conbinations. Still couldnt find one that would give me 0s.

Watching video again now. maybe i missed something.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: M8N GPS with Revo
« Reply #12 on: April 02, 2016, 11:45:42 pm »
If you search all combinations from 3 entries maybe you need more time to find the good one :)
Good orientation give 0 on all bars and also still at 0 whatever the orientation.

If mag chip is on the bottom face of GPs pcb, set Roll to 180°
Next play with Yaw orientation.

You can also check if mag chip is orientated at 45° or not...

f5soh

  • *****
  • 4572
    • LibrePilot
Re: M8N GPS with Revo
« Reply #13 on: April 03, 2016, 12:19:20 pm »
Why do you invent something about Accelerometers here ?

Here is the text above the bars:

Quote
The bargraphs show the difference between the onboard and auxiliary magnetometer measurements.
When the auxiliary magnetometer rotation is set correctly, all bargraphs should show all zero (bargraph centered) whatever the vehicle's orientation.
This assumes both magnetometers are calibrated and without alarm.

nuggetz

  • *
  • 32
Re: M8N GPS with Revo
« Reply #14 on: May 08, 2016, 03:31:18 am »
Does anyone know how I can physically look at my external mag to determine orientation? I need to have all the values in the mag setup page to be 0. I tried just looking at the compass in GCS but it just keeps spinning and never stops. If I could simply set the quad down and face south for example and the on screen compass points east then I'll know the offset.