LibrePilot Forum

Users => Vehicles - MultiRotors => Topic started by: smayes on February 24, 2016, 11:40:48 pm

Title: REVO NANO GPS + MCU Setup
Post by: smayes on February 24, 2016, 11:40:48 pm
I have a Revo Nano with an OP V9 GPS and OPLink telemetry and have been trying to get GPS assist modes working for a few days now with no luck. When I connect the GPS to the FC using the GPS only connection on the V9 board I get good data from the GPS (7 + satellites), but when I try to use the GPS+MCU connection I get a red x GPS warning telling me the GPS has timed out. System panel says GPS is "UNKNOWN" and MAG is "Invalid". Yesterday I was able to get good data from the MAG, but now the MAG area of the system panel is black. GPS autoconfig Seems to run constantly switching between baudrates.

I have tried using flexi port and main port, neither makes a difference.

I have performed mag calibrations multiple times in multiple locations away from metal/magnetic objects.

I have tried erasing setting and updating firmware which had no effect.

GPS is powered through the board by the ESC and lights come on.

I really don't know where to go from here. One of the strangest things to me, is that today the board stopped using/recognizing the MAG.

If there are additional setup steps I need to take past default port assignments and speed/protocol settings and calibrations I would love to hear them. I am in serious need of help.
Title: Re: REVO NANO GPS + MCU Setup
Post by: f5soh on February 25, 2016, 12:10:07 am
If you don't get any Gps data using the GPS+MCU port, no luck for mag because data comes from a special UBX frame.

How is the orange led when Gps is powered ?

Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 25, 2016, 12:14:40 am
Using GPS+MCU port orange LED is blinking and green LED is solid. Even if I disable the GPS I don't get data from the on-board mag.
Title: Re: REVO NANO GPS + MCU Setup
Post by: f5soh on February 25, 2016, 12:26:34 am
Quote
port orange LED is blinking
So Mcu runs fine.

Mag appears only in SystemHealth if you use a INS13.

Double check the wiring, if you are using the rignt port, configured in Hardware Page.

(https://forum.librepilot.org/index.php?action=dlattach;topic=922.0;attach=1710)
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 25, 2016, 12:33:52 am
My wiring is as shown in the diagram, using supplied cables with tx/rx swaped as required. I have INS13 enabled and mag still does not appear
Title: Re: REVO NANO GPS + MCU Setup
Post by: f5soh on February 25, 2016, 12:39:12 am
INS13 need other data like GPS position that don't work in your setup, without GPS EKF13 cannot initialize.
If you can communicate with GPS using GPS+MCU port you can also retrieve the external mag data.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 25, 2016, 12:41:28 am
Understood. I'm not sure how to proceed at this point trying to get my FC to communicate with the GPS
Title: Re: REVO NANO GPS + MCU Setup
Post by: f5soh on February 25, 2016, 12:50:45 am
Double check if there is a blending pin inside connector.

GPSv9 has a fixed baudrate set to 57600bds.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 25, 2016, 12:56:25 am
I'm assuming this is in the connector on the GPS unit? What will that look like?
Title: Re: REVO NANO GPS + MCU Setup
Post by: f5soh on February 25, 2016, 12:58:24 am
Same as others :)
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 25, 2016, 01:00:26 am
Will you enlighten me on how to check for it?
Title: Re: REVO NANO GPS + MCU Setup
Post by: f5soh on February 25, 2016, 01:06:50 am
You take one eye (or two) and look inside the GPS+MCU port if some pin (there is 4 pins) is folded or something wrong inside connector.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 25, 2016, 01:08:20 am
Ah! I didn't understand you meant shorting pin when you said blending. All pins are present and accounted for in correct shape ;).
Title: Re: REVO NANO GPS + MCU Setup
Post by: f5soh on February 25, 2016, 01:14:50 am
If the GPS is recognized using the GPS port (and same cable) the Nano port works fine.
Looks like there is something wrong in Gps hardware if there is no data coming when you just swap from GPS port to GPS+MCU port.

MCU seems working because orange blinking, i'm sorry but i cannot do more for helping you.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 25, 2016, 01:20:56 am
I even get a blinking blue light with GPS+MCU connection, which I assume means the GPS is functioning properly?
Title: Re: REVO NANO GPS + MCU Setup
Post by: f5soh on February 25, 2016, 01:23:28 am
Blue led blinking means the ublox module receive at least one GPS sat with a valid time data.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 25, 2016, 05:20:36 am
If I connect with GPS only should I still be able to use the revo's on-board mag for INS13?
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 25, 2016, 07:27:07 am
EDIT: Found that I had AuxMagSettings Usage set to AuxOnly. Setting to "Both" has returned recognition of on-board mag.
Title: Re: REVO NANO GPS + MCU Setup
Post by: Mateusz on February 25, 2016, 09:10:40 am
If I connect with GPS only should I still be able to use the revo's on-board mag for INS13?

Yes, but it is unlikely that on-board mag will give error-free measurements usually on quads <= 300mm this is hard.
Depends on your flight controller location, if it's far from power lines, and twisted wires can help a bit. Also ESC are switching components and they work like electromagnets.
Usually you can't shield from magnetic field, unless you use 3-4 meters concrete wall, like they do at Large Hydron Colider ;) what you can do best is redirect magnetic field by twisting wires to make it less severe. Any "shielding" around magnetometer is also bad idea, as it may distort static magnetic field and confuse magnetometer.
The best is to have mag on a pole and calibrated outdoors over OPlink far from metallic elements, but you can try of course.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 25, 2016, 04:31:21 pm
That would appear to be my only option until I can figure out what's wrong with my V9 or get it replaced
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on February 26, 2016, 01:16:27 am
Did some testing today and found that raising the FC to 1" off the frame is far enough away from the power wires to give good mag data even under full throttle. GPS Assist with V9 and the revo's mag performed reasonably well in windy conditions this evening.
Title: Re: REVO NANO GPS + MCU Setup
Post by: TheOtherCliff on March 03, 2016, 01:11:17 am
If using "Both" and aux is not working, then it is the same as using "onboard only"

Is GPS working through the GPS+MCU port?  If not try this:
- use GPS only port and run Revo one time in GPSSettings "autobaudconfigandstore" mode in case the GPS is set wrong somehow.  Then go back to GPS+MCU port at 57600 baud.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on March 03, 2016, 06:47:50 am
No change. I get absolutely nothing from the GPS+MCU port, but the onboard mag seems to be working well, so I have full functionality to experiment with now. It's a ~600mm frame, so I have some wiggle room with placement.
Title: Re: REVO NANO GPS + MCU Setup
Post by: TheOtherCliff on March 13, 2016, 06:46:01 pm
Has it been crashed and that caused this? :(
If it were mine I would look for broken connection between wires coming out GPS+MCU connector and circuit board traces, then I would flash 'next' version of firmware (which has an unrelated fix) using dev uploader tool (./build/uploader_release/OPUploadTool).
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on March 13, 2016, 07:40:27 pm
It had never even been plugged in and powered on
Title: Re: REVO NANO GPS + MCU Setup
Post by: TheOtherCliff on March 14, 2016, 04:48:04 am
Well then, what I said before :) , plus contact the seller if that is still reasonable.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on March 14, 2016, 04:50:46 am
I'll try that when I can get a debug tool. Since the Revo's mag is working for me this is low priority right now. I bought it from the OP store and have contacted them with no response.
Title: Re: REVO NANO GPS + MCU Setup
Post by: Gasmanakl on March 14, 2016, 10:38:47 am
I have exactly the same problem.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on August 17, 2018, 06:35:24 am
So I've decided to revisit this project and issue. From what I can tell the GPS and MAG are working fine in the GPS+MAG mode, but it isn't communicating with the Revo.

I tried examining the Tx output of the module with an oscilloscope and there's nothing on the Tx pin. I could maybe fix it if I had some kind of schematic, but that's nowhere to be found.

Is it worth trying to repair this V9 unit instead of just going and getting a NAZA GPS clone? I really like the unit, but I don't want to waste my time.
Title: Re: REVO NANO GPS + MCU Setup
Post by: TheOtherCliff on August 17, 2018, 09:09:53 am
Blue LED blinking means the GPS is working.  It is blue if it sees some GPS satellites.  Orange LED blinking means MCU is working.  It is orange as long as MCU firmware works and it has power.

You say it works if connected to GPS only.  What baud rate does it detect when connected to GPS only?  Look in System->DataObjects->GPSPositionSensor.  Also what is the AutoConfigStatus.  Remember you must typically have a flight battery plugged in to ESCs to get power to the GPS.

If GPS connector pins aren't bent, then the only thing I can think of that is simple to fix is that you have configured the GPS through the GPS only port and changed it so that the MCU can't read the GPS any more.  Maybe wrong baud rate.  Did you follow the "autobaudconfigandstore" instructions discussed here?  Must use "autobaudconfigandstore" mode with it connected to GPS only port.
https://forum.librepilot.org/index.php?topic=922.msg7105#msg7105

Otherwise I would re-flash GPS/MCU firmware using OPUploadTool.exe

If I knew I did these things correctly, I might start debugging a hardware problem or I might go to a DJI/Naza GPS.  In my experience, the OCDAY brand of DJI/Naza GPS didn't have some minor bugs that other clones had, but they may all be good or bad in that regard by now.
https://www.ebay.com/itm/OCDAY-NEO-M8N-GPS-Sensitive-for-DJI-NAZA-Lite-V1-V2-Flight-Controller-RC783/232878223095

If you see an approximately 4 second flight oscillation with DJI/Naza GPS in GPS flight modes, there is a work around FC firmware.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on August 17, 2018, 09:35:51 am
I did follow the "autobaudconfigandstore" instructions, but didn't seem to gain anything. I can confirm baud rate tomorrow, but I believe it's 57600.

Where can I find the OPUploadTool?

Even if the baud rate was wrong I should still see some data on the Tx line with the scope, but there's nothing there (GPS only mode does show data on the scope).

I would try to diagnose a hardware issue, but I can't really do that without a schematic or net-list. Is there a chance that information is floating around?
Title: Re: REVO NANO GPS + MCU Setup
Post by: TheOtherCliff on August 17, 2018, 11:04:43 am
Where can I find the OPUploadTool?
Good question.  I recall there is a build problem with it, but maybe not back in 16.09

Even if the baud rate was wrong I should still see some data on the Tx line with the scope, but there's nothing there (GPS only mode does show data on the scope).
Well, I think that leaves out the baud rate as an issue, the mag data should be there at least.  Last hope would be reflashing the MCU.

I would try to diagnose a hardware issue, but I can't really do that without a schematic or net-list. Is there a chance that information is floating around?
A schematic was apparently never released.  There are one or two people who make them (for like $100).

First trace the TxD line back to the MCU and see if you see data there, but not on the connector pin.  That might be a simple fix.  I think that SBL running puts data on TxD without being prompted from RxD, but it's just a guess.  You could put a solder blob across SBL (system boot loader) and see if you then see output (using the scope) on the MCU pin with the SBL active.  If so, you can try flashing firmware.  If not, best hope might be replacing the MCU then flashing.
Title: Re: REVO NANO GPS + MCU Setup
Post by: f5soh on August 17, 2018, 01:21:34 pm
Quote
I did follow the "autobaudconfigandstore" instructions, but didn't seem to gain anything.
As expected, GPS is connected to the MCU using I2C.

Quote
A schematic was apparently never released.
https://forum.librepilot.org/index.php?topic=4274.msg29087#msg29087

If orange led is blinking, MCU works fine. Issue will be between MCU and GPS+MCU port and will cause problems also for flashing.
Anyway, stm32flash can be used for flashing. (https://forum.librepilot.org/index.php?topic=1189.msg8682#msg8682)
As well as Uploadtool, using next branch.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on August 17, 2018, 04:09:10 pm
Thank you! That's what I needed.

There's definitely a signal coming off the MCU (not as clean as I was expecting, but I'm also not using the best measurement setup) and that signal is getting to the filter, but there's nothing on the output pin of the filter. I'll see if I can order a new one and swap it out?
Title: Re: REVO NANO GPS + MCU Setup
Post by: TheOtherCliff on August 17, 2018, 05:06:19 pm
I think these filters are mainly to keep high voltages from the port.

I would be tempted to bypass the filter for the TxD line or (better yet in case the filter chip is shorted) remove filter chip and short input to output where the chip was mounted (both for TxD and again for RxD).  CC3D doesn't even use a filter there (Revo does, so you have a filter already).  GPS, mag, Revo ports all are 3.3V.  Maybe be careful about using a 5V FTDI to program the GPS MCU though.  I think the MCU RxD pin is 5V tolerant, but I'm not 100% certain, I just go by what Google says.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on August 17, 2018, 06:43:18 pm
After removing and bypassing the filter the aux mag was actually recognized and seemed to be working, but the GPS was still inop, so I decided to try to flash the firmware. I can't seem to get the UplaodTool to work.

The attached image shows the output I get each time I run the UploadTool with the GPS+MCU port being connected immediately after hitting return.
Title: Re: REVO NANO GPS + MCU Setup
Post by: TheOtherCliff on August 17, 2018, 08:44:35 pm
The filter chip has a separate filter for TxD and another for RxD, so you must make two jumpers in place of the chip.  I guess you did that?

The FTDI (USB to serial converter) needs to stay plugged in.  You plug and unplug the FTDI to GPS+MCU connection.

Try different timing, for instance maybe plugging it in just before hitting return.

There is another way to flash, using SBL.  I think instructions would be the same as for CC3D (but not Revo).
This:
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/29622291/Recover+board+using+DFU
Points to this for CC3D:
http://www.southquay3d.com/index.php?route=news/article&news_id=9
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on August 17, 2018, 09:30:19 pm
Yes I added jumpers to both. I was using the Revo ComBridge to communicate with the GPS (I have a FTDI coming soon), but I was plugging/un-plugging the GPS to Revo connection in different timing combinations.

Not sure if DFU should work over ComBridge, but I tried it without success according to the CC3D instructions. The green LED is solid with the SBL pads jumped so it looks like it's in the right mode.
Title: Re: REVO NANO GPS + MCU Setup
Post by: TheOtherCliff on August 17, 2018, 10:23:52 pm
You have to set the ComBridge baud rate with the GCS.  If the program talking to the ComBridge tries to change the baud rate, the baud rate change gets ignored as I recall.

I work with Linux.  I recall some permission issues.  It may not have been with ComBridge.
Title: Re: REVO NANO GPS + MCU Setup
Post by: smayes on August 18, 2018, 04:13:38 am
Turns out bypassing the filter was the whole fix. I just had to set the autoconfig while connected with GPS+MCU port connected and now it's working! I'll probably still have some questions about getting the firmware to flash. I'd like to get rid of the dropped packet bug.