Saga40

  • *
  • 11
Rev3 Position Hold
« on: August 20, 2017, 04:08:29 pm »
I have just bought a rev3 (https://www.banggood.com/OpenPilot-CC3D-Revolution-Revo-10DOF-STM32F4-Flight-Controller-Staight-Pin-p-1000068.html?rmmds=search/?p=1511203511683201601F) and I wish to use it to enable my quad to hold position. However, I run into some trouble when, following the Librepilot documentation, I set the altitude estimation algorithm to "GPS Navigation INS13", the quadcopter seems to stop sensing any movement at all, getting that red X box around the Attitude UI. Is there a way to change the altitude estimation algorithm for each flight mode? Or what am I missing here? Thanks!

utoedter

  • ***
  • 170
    • Frickeln und mehr
Re: Rev3 Position Hold
« Reply #1 on: August 20, 2017, 05:11:16 pm »
Did you you ran all needed calibrating procedures? Thats mandantory, your magnetometer (external one preferred) needs to provide good magnetometer readings. If the internal one is near to high current wires, move them away and twists them whenever possible.

Got my 250 quad not with the internal mag running, bought a GPS with Magnetometer instead.

Udo

Re: Rev3 Position Hold
« Reply #2 on: August 20, 2017, 06:25:58 pm »
twist all high current wire cables
install and configure it to use an external mag ("aux only")
usually the external mag will be inside a GPS
if using I2C aux mag set mag rotation to 0,180,0 or 180,0,180 is the same)
get it flying in BASIC with Attitude mode
set to INS13
set home location
calibrate mag
it only will arm with everything green
get it flying in INS13 with Attitude mode
always keep an Attitude mode on the flight mode switch
take off in Attitude mode
switch to some new GPS flight mode, VelocityRoam is probably better than PositionHold and VR is the same as PH if the sticks are centered.

Saga40

  • *
  • 11
Re: Rev3 Position Hold
« Reply #3 on: August 20, 2017, 10:02:32 pm »
Thanks for your replies. So I have bought an external GPS module with compass (https://www.aliexpress.com/store/product/UBLOX-NEO-7M-NEO-7M-GPS-w-Compass-Stand-Holder-for-APM-ArduPilot-Mega-2-6/727847_32366818254.html). However, I am struggling to connect it. I have Connected it through an FTDI board, per the documentation online, and changed it according to the Specs. Yet it still does not recognize connection to the board. I am powering the board externally when I test this. 
I have callibrated the sensors (Attitude panel under configuration). It could be high current wires interfering. Ill take a look. If I could get my external GPS and compass working, thatd be the best.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Rev3 Position Hold
« Reply #4 on: August 20, 2017, 10:30:17 pm »
Quote
However, I am struggling to connect it. I have Connected it through an FTDI board, per the documentation online, and changed it according to the Specs.

There is no need to configure the GPS using Ucenter+FTDI, except if you want to test if your GPS is really working.
A Ublox GPS is configured by the Revo, at power up or after config changes, in live.

Your GPS/external mag need to be wired like here :
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058679/GPS+setup#GPSsetup-GPS+I2C

Saga40

  • *
  • 11
Re: Rev3 Position Hold
« Reply #5 on: August 20, 2017, 10:53:41 pm »
Alright so since I have already changed some of the settings, how could I get the GPS back to the original settings?

Re: Rev3 Position Hold
« Reply #6 on: August 20, 2017, 11:21:31 pm »
The default for LP firmware is to temporarily program the GPS with LP settings every time you plug a battery in.

The idea is that the GPS can have permanent settings that are used for some other firmware, and it temporarily gets loaded with the settings that are correct for LP each time LP is run.

So just connect the GPS correctly to a port and configure it (UBX protocol and 57600 baud) (Hardware page) and the defaults will automatically configure the rest for you.

... But because it does not erase every GPS setting to start with, if you make some strange settings to the GPS this might fail.  If that is the case go to System -> Settings -> GPSSettings and change UBXAutoConfig to AutoBaudConfigureAndStore (which actually resets all GPS internal settings too) and click the green up arrow (Send) a the top of the page.  This does a "one time" reprogramming of the GPS to LP default values and it will be back to AutoBaudAndConfigure the next time you boot the FC.

... Of course there are things that even that cannot fix.  If you disable the GPS serial port with uCenter, it simply wont even talk to serial again until you find a way to fix it.

Saga40

  • *
  • 11
Re: Rev3 Position Hold
« Reply #7 on: August 21, 2017, 12:17:16 am »
Ok Great! The GPS is now working. So Im assuming the GPS I have has a magnetometer since its documentation says "with compass". How would I use this mag instead of the on board one? I see how the current is interfering with the onboard mag's precision.

Re: Rev3 Position Hold
« Reply #8 on: August 21, 2017, 01:31:51 am »
You still must twist all high current cables.

It is an I2C mag and must be connected to FlexiPort and configured that way on Hardware page and on Attitude -> Magnetometer page

Remember what I said about mag rotation needing to be 0,180,0 also on Attitude -> Magnetometer page

Edit: Beware that some I2C mags need some pullups soldered to work right.  I recommend that you run it overnight connected to a 12v power supply instead of batteries, and check Firmware -> FlightTime (number of seconds since boot) to make sure it didn't reboot during the night.
« Last Edit: August 21, 2017, 01:42:51 am by TheOtherCliff »

Saga40

  • *
  • 11
Re: Rev3 Position Hold
« Reply #9 on: August 21, 2017, 05:43:59 am »
Ohh ok it looks like the GPS I bought does not have the mag chip in it. Thats why its not working. Well, I have been able to get Velocity roam working (with some shakiness I imagine is coming from the mag)! One more question, since my GPS doesn't have a mag, could I buy a mag breakout separately and wire it in?

Re: Rev3 Position Hold
« Reply #10 on: August 21, 2017, 06:06:40 am »
Maybe take the GPS case apart and look.  Mag chip is sometimes labeled L883.  It is a small square chip with 16 pins, 4 each side if I recall...

Maybe take a picture of the GPS board with all the chips (and places for missing chips).

You could buy a mag board on ebay for about $5 or $6 or an old version (Neo6) GPS+mag for $7 shipped.

This GPS/mag looks like the mini style that several of us have bought and used successfully for $18
http://www.ebay.com/itm/Ublox-NEO-M8N-Flight-Controller-GPS-with-Protective-Shell-for-PIX-PX4-Pixhawk-/122355418969

or maybe try something that I haven't tried and get one of these minis for $14
http://www.ebay.com/itm/Mini-GPS-Module-w-Compass-for-APM-Flight-Control-V3-1-Standard-Interface-O5S9-/352008323729
« Last Edit: August 21, 2017, 06:12:36 am by TheOtherCliff »

Saga40

  • *
  • 11
Re: Rev3 Position Hold
« Reply #11 on: August 21, 2017, 06:09:56 am »
Yeah it looks like my GPS doesn't have that chip. Well, at least they're not too expensive! Great thanks for your help!

Re: Rev3 Position Hold
« Reply #12 on: August 21, 2017, 06:16:24 am »
How many wires in the connectors?  Six is required for GPS with this type of mag.  Four is just GPS.  It is still possible that you have 6 wires, but 2 are not connected.

This is why I buy from eBay.  If it is not as advertised, you get your money back and if they want the item back, they pay for return shipping...

Saga40

  • *
  • 11
Re: Rev3 Position Hold
« Reply #13 on: August 21, 2017, 06:24:44 am »
There where four wires externally, but i did take it apart, and I happened to have an extra connector to plug into the Flexi port. So I soldered two onto the SDA and SCL, but it looks like the device just diddnt have the mag soldered to the board. Yes I am quickly learning the benefits of ebay in times like these.

Re: Rev3 Position Hold
« Reply #14 on: August 21, 2017, 08:00:24 am »
If the board has SDA and SCL then the board almost certainly has a place for a mag chip.  Tiny, square.  Either the chip is there or the place to solder one is there but with no chip.

Is there an unpopulated place where a tiny square 16 pin chip goes?  Maybe marked with some up and left arrows or L883 or 5883 or 5983.