TMGsi

  • ***
  • 133
Mini LongRange Revolution fc
« on: October 30, 2020, 08:55:49 pm »
After going through an avalanche of problems, now some details to fix

Guys, I recorded my flight and some details I need to correct.



First, when I'm in position hold the compass is in motion, see the video.
Second, in rtb, when he starts to descend, he is rocking in the roll, see also in the video.

there are other things, but urgent would be these
what more wrong could you help me improve?

it has the altitude too, the two altitudes showing the same information.

Thank you and good flights to all.

Re: Mini LongRange Revolution fc
« Reply #1 on: October 31, 2020, 12:55:17 am »
Even when it is sitting on the ground with motors stopped, I see the compass is moving all around.  If it happens even with motors stopped, then it is not a problem that will be fixed by twisting wires better.

I am trying to remember your setup:  Were you having problems with Attitude->Settings->AttitudeEstimationAlgorithm=GPS Nav (INS13) and you changed it to something else?  I think the fact that INS13 does not work for you is another symptom of your problem.

Attitude->Magnetometer->MagUsage must be set to AuxOnly if you have an aux mag (built into your GPS).

Mags must be calibrated well enough so that they are green in the FlightData->SystemHealth warning lights.  And when the motors (with props on) are running at flight speed, this should be green or yellow, but never red.

About the slow back and forth oscillation: Did you say that you have DJI/Naza GPS, but you are using the modified firmware that helps with the oscillation?

TMGsi

  • ***
  • 133
Re: Mini LongRange Revolution fc
« Reply #2 on: October 31, 2020, 11:04:34 am »
It is now configured with GPS (INS13). After I put the gps on the 20cm pole. But before without the gps pole, the drone would not take off with the INS13 (it would drop itself, it would be out of control)

is set to mag auxOnly, and it only turns green

The strange thing is that when I plug the drone into the pc and librepilot, the compass works perfectly, every movement I make on the yaw, librepilot shows exactly, the north shows right, the south, the east and the west. In librepilot the compass is accurate.

I'm using DJI / Naza GPS, but I haven't modified anything. everything original.


A new gps is about to arrive for another project, but I'm going to test this drone of mine. (GPS BN 880)

Another test I'm going to do is to take the INS13 out and test the "complementary + MAG + gpsoutdoor" and see the behavior of the compass.

depending on, i change the pdb to the nose of the drone and the gps backwards, now both are in the middle.

TMGsi

  • ***
  • 133
Re: Mini LongRange Revolution fc
« Reply #3 on: October 31, 2020, 01:40:02 pm »
I took a new test flight
now with "complementary + MAG + gpsoutdoor" and the compass behaves in the same way, even when the drone is stationary it keeps moving.

Now the video shows the compass moving with the drone stopped.



I'm wary of my gps. It has a compass, but it does not have the wires for the compass, it has only 4 wires for the gps and the compass.

The other gps that is yet to arrive (bn880) has 6 wires. 4 for the gps and 2 for the compass. (but until it arrives soon for me to test I am unable to say whether or not the problem is the GPS with a compass)

or can I solve this problem of the compass only in the settings?

Re: Mini LongRange Revolution fc
« Reply #4 on: November 01, 2020, 09:35:34 am »
I'm wary of my gps. It has a compass, but it does not have the wires for the compass, it has only 4 wires for the gps and the compass.
That is the good thing about DJI GPS.  GPS signal and compass signal both come out from the same 4 wire set.  This means that you only need one port on the FC.

6 wire GPS / compass needs 2 ports.  Compass must be connected to Flexiport.  It may not be possible to connect receiver, OSD, GPS, and compass to FC all at the same time unless you use DJI GPS/compass that only needs one connection to FC.

The other gps that is yet to arrive (bn880) has 6 wires. 4 for the gps and 2 for the compass. (but until it arrives soon for me to test I am unable to say whether or not the problem is the GPS with a compass)
I have never tried a BN880 GPS.  The 6 wire GPS / compass that I like best is this BD mini (good for small aircraft because it is only 36mm diameter instead of the usual 54mm).  I tested it and OpenPilot GPS Platinum v9 in my basement today (2 levels of house above me).  The BD got a lock of 8-10 satellites.  The OP never got a lock.  I moved both around and retested.  Same result.
https://www.ebay.com/itm/UBLOX-NEO-M8N-GPS-Module-Compass-Mini-Quadcopter-For-Pixhawk4-Flight-Controller/333770145748

or can I solve this problem of the compass only in the settings?
If LibrePilot works correctly, then it would seem to be something with the OSD.  I am guessing that the OSD gets data only from FC and does not get data directly from GPS.  It might be that you need to reduce the telemetry baud rate or reduce the telemetry packet rate.  Try putting your telemetry back to 250ms (205ms = 4 times a second instead of 100ms = 10 times a second) and see if that fixes the OSD compass display.

I don't use OSD very much and don't know what more to tell you.  :(  Maybe someone else can help you.

TMGsi

  • ***
  • 133
Re: Mini LongRange Revolution fc
« Reply #5 on: November 01, 2020, 12:46:35 pm »
see how strange

The compass works perfectly when no satellites are found. The compass changes perfectly from one degree to the next with precision. Both with the gps compass (auxiliary) and the fc compass.

But when the gps finds satellites, the compass is not accurate, it changes the degrees even with the drone stopped.

So, I think the problem cannot be the gps as I was thinking.

Another observation, I started the drone pointing to the west, but the fc thought it was the north. (I have another FC for a wing and when I turn it on pointing west it recognizes it as west.)

Very strange that the compass loses its orientation when the gps finds satellites.

Where do I change the telemetry speed to 4 times per second?
(but I don't think that's the problem, because before finding the satellites, the degree changes happen perfectly from one to one as shown in the video.)

Re: Mini LongRange Revolution fc
« Reply #6 on: November 01, 2020, 07:24:43 pm »
I don't know how you have OSD set up.  I am guessing that OSD gets data from FC, not straight from GPS.

Connect the LibrePilot GCS and watch the GCS compass during the time that the OSD compass goes crazy.  If LP is OK, then it really seems some bug at least related to OSD?

When OSD goes crazy do all the active FlightData health meter boxes show green or are some yellow or red?

TMGsi

  • ***
  • 133
Re: Mini LongRange Revolution fc
« Reply #7 on: November 01, 2020, 10:41:20 pm »
this test showed something revealing.
 :o :o

the librepilot compass on the flightdata tab showed very accurate however in my fpv glasses it was totally in motion when satellets were found. 

the compass light is always green. 

the gps and fc are working perfectly, the problem then is osd.

 had not done this test on librepilot and showed where the problem is.  this tip is very good. 


now, would you have a new firmware version for osd to fix this problem?  do you use any osd?  had this problem? 

another observation, when there are no satellites found, the osd does not have a crazy compass

Re: Mini LongRange Revolution fc
« Reply #8 on: November 02, 2020, 05:05:41 am »
If I recall correctly, when there are no satellites, it does not send the GPS information to the OSD.

Just some guesses...

This may be a matter of baud rate from FC to OSD is too high.  It may be that it sends data packets too frequently.  Either of these may cause OSD (or maybe even FC) to drop some data.

If you reduce the telemetry baud rate or configure it to not send so many packets so quickly (maybe GPS packets), it may work better.  Did you change any of this type of setting from the default values?

TMGsi

  • ***
  • 133
Re: Mini LongRange Revolution fc
« Reply #9 on: November 02, 2020, 11:44:58 am »
I haven't changed anything, everything is standard.

 that is, 57,600 for GPS and telemetry.  I took the opportunity to change these speeds, tested them all. 

with telemetry it only works at 57,600.  below that or above it shows how "no tel com"

with GPS, all worked but when it finds satellites the compass goes crazy.

  I tested the speeds 2,400 4,800 9,600 19,200 38,400 115,200 and 230,400.  all the GPS worked, but when finding a satellite the compass goes crazy. 

would it be those speed you mention?  if there is another place to change I don't know and I haven't changed.

TMGsi

  • ***
  • 133
Re: Mini LongRange Revolution fc
« Reply #10 on: November 02, 2020, 11:54:45 am »
in the hardware tab it is like this:

 GPS - flexi port. 

s.bus - main port. 

Osd - receiver port ( ppm + telemetry)
Speed: 57.600
USB hid funcional : usb telemetry
USB vcp function: disable

Re: Mini LongRange Revolution fc
« Reply #11 on: November 03, 2020, 05:57:12 am »
For telemetry baud rate change to work, you would need to change it on both ends (FC and OSD).  Lets try something else.

This is just a guess of a thing I would try.  Maybe someone who uses OSD more than I do can help. The main thing I can think of that changes when you get GPS satellite lock is that it starts sending GPS telemetry then.  I don't see that you are even using GPS stuff on your OSD.  This test will temporarily disable GPS telemetry to see if that makes the problem go away.

- Get it running with GPS satellite lock and connected to GCS.  Compass should be going crazy in OSD.
- In GCS go to System page
- Click on the eyeball at the top of the window and click the box to "Show Metadata"
- Close that "View Options" box
- Go to System->DataObjects->GPSPositionSensor, you should see GPSPositionSensor turn pink once every second, every time it turns pink, the GCS is seeing GPS telemetry that was sent by the FC.
- Go to System->DataObjects->GPSPositionSensor->MetaData->Modes and set FlightUpdatePeriodic to 0
- Click the green "up arrow" (Send) at the top of the window to temporarily send this to the FC
- You have stopped the GPS updates from being sent
- Does the OSD compass work correctly now?  If so, you can repeat this, but click the red up arrow (Save) and it will disable GPS telemetry permanently (until you Erase Settings or set this setting back to 1).

Note that for the arrows at the top of the page to work, the line you want to send/save/etc must be highlighted.  Click the line to highlight it.

TMGsi

  • ***
  • 133
Re: Mini LongRange Revolution fc
« Reply #12 on: November 03, 2020, 10:49:27 am »
making this change has left the freezer frozen, locked, does not move.

  if i rotate the drone on the yaw the compass is now locked.

 I decreased the value to 250ms and the disorientation of the compass became faster

jdl

  • ***
  • 246
Re: Mini LongRange Revolution fc
« Reply #13 on: November 03, 2020, 12:20:52 pm »
The original Librepilot MinOpOSD code has some issues (imperfections) and this seems to be one of them...

If we look in the source code here:
https://bitbucket.org/f5soh/minoposd/src/master/ArduCAM_OSD/OSD_Panels.ino

Code: [Select]
void panHeading(int first_col, int first_line)
{
    osd.setPanel(first_col, first_line);
    osd.openPanel();
#ifdef JR_SPECIALS // show heading with compass point
    osd.printf("%4.0f%c%s", (double)osd_heading, 0xb0, CompassPoint);
#else
    osd.printf("%4.0f%c", (double)osd_heading, 0xb0);
#endif
    osd.closePanel();
}


and here:
https://bitbucket.org/f5soh/minoposd/src/master/ArduCAM_OSD/UAVTalk.ino

Code: [Select]
case ATTITUDEACTUAL_OBJID:
            case ATTITUDESTATE_OBJID:
#ifdef VERSION_ADDITIONAL_UAVOBJID
            case ATTITUDESTATE_OBJID_001:
#endif               
                last_flighttelemetry_connect = millis();
#ifndef SEND_GCSTELEMETRYSTATS
                gcstelemetrystatus = TELEMETRYSTATS_STATE_CONNECTED;
#endif /* SEND_GCSTELEMETRYSTATS */
                show_prio_info     = 1;
                osd_roll  = (int16_t)uavtalk_get_float(&msg, ATTITUDEACTUAL_OBJ_ROLL);
                osd_pitch = (int16_t)uavtalk_get_float(&msg, ATTITUDEACTUAL_OBJ_PITCH);
                osd_yaw   = (int16_t)uavtalk_get_float(&msg, ATTITUDEACTUAL_OBJ_YAW);
                // if we don't have a GPS, use Yaw for heading
                if (osd_lat == 0) {
                    osd_heading = osd_yaw;
                }
             break;
            case FLIGHTSTATUS_OBJID:
#ifdef VERSION_ADDITIONAL_UAVOBJID
            case FLIGHTSTATUS_OBJID_001:
            case FLIGHTSTATUS_OBJID_002:
            case FLIGHTSTATUS_OBJID_003:
            case FLIGHTSTATUS_OBJID_004:
            case FLIGHTSTATUS_OBJID_005:
            case FLIGHTSTATUS_OBJID_006:
            case FLIGHTSTATUS_OBJID_007:
            case FLIGHTSTATUS_OBJID_008:
            case FLIGHTSTATUS_OBJID_009:
#endif
                osd_armed = uavtalk_get_int8(&msg, FLIGHTSTATUS_OBJ_ARMED);
                osd_mode  = uavtalk_get_int8(&msg, FLIGHTSTATUS_OBJ_FLIGHTMODE);
                break;
            case MANUALCONTROLCOMMAND_OBJID:
#ifdef VERSION_ADDITIONAL_UAVOBJID
            case MANUALCONTROLCOMMAND_OBJID_001:
            case MANUALCONTROLCOMMAND_OBJID_002:
            case MANUALCONTROLCOMMAND_OBJID_003:
            case MANUALCONTROLCOMMAND_OBJID_004:
               
#endif
                osd_throttle = (int16_t)(100.0 * uavtalk_get_float(&msg, MANUALCONTROLCOMMAND_OBJ_THROTTLE));
                if (osd_throttle < 0 || osd_throttle > 200) {
                    osd_throttle = 0;
                }
                // Channel mapping:
                // 0   is Throttle
                // 1-2 are Roll / Pitch
                // 3   is Yaw
                // 4   is Mode
                // 5   is Collective (Heli - constant 65536 otherwhise)
                // 6-8 are Accessory 0-2
                // In OPOSD:
                // chanx_raw     used for menu navigation (Roll/pitch)
                // osd_chanx_raw used for panel navigation (Accessory)
                chan1_raw     = uavtalk_get_int16(&msg, MANUALCONTROLCOMMAND_OBJ_CHANNEL_1);
                chan2_raw     = uavtalk_get_int16(&msg, MANUALCONTROLCOMMAND_OBJ_CHANNEL_2);
                osd_chan5_raw = uavtalk_get_int16(&msg, MANUALCONTROLCOMMAND_OBJ_CHANNEL_4);
                osd_chan6_raw = uavtalk_get_int16(&msg, MANUALCONTROLCOMMAND_OBJ_CHANNEL_6);
                osd_chan7_raw = uavtalk_get_int16(&msg, MANUALCONTROLCOMMAND_OBJ_CHANNEL_7);
                osd_chan8_raw = uavtalk_get_int16(&msg, MANUALCONTROLCOMMAND_OBJ_CHANNEL_8);
                break;
#ifndef GPS_SIMULATION
            case GPSPOSITION_OBJID:
            case GPSPOSITIONSENSOR_OBJID:
#ifdef VERSION_ADDITIONAL_UAVOBJID
            case GPSPOSITIONSENSOR_OBJID_001:
            case GPSPOSITIONSENSOR_OBJID_002:
            case GPSPOSITIONSENSOR_OBJID_003:
            case GPSPOSITIONSENSOR_OBJID_004:
#endif
                osd_lat         = uavtalk_get_int32(&msg, GPSPOSITION_OBJ_LAT) / 10000000.0;
                osd_lon         = uavtalk_get_int32(&msg, GPSPOSITION_OBJ_LON) / 10000000.0;
                osd_satellites_visible = uavtalk_get_int8(&msg, GPSPOSITION_OBJ_SATELLITES);
                osd_fix_type    = uavtalk_get_int8(&msg, GPSPOSITION_OBJ_STATUS) > 3 ? 3 : uavtalk_get_int8(&msg, GPSPOSITION_OBJ_STATUS);
                osd_heading     = uavtalk_get_float(&msg, GPSPOSITION_OBJ_HEADING);
                osd_alt         = uavtalk_get_float(&msg, GPSPOSITION_OBJ_ALTITUDE);
                osd_groundspeed = uavtalk_get_float(&msg, GPSPOSITION_OBJ_GROUNDSPEED);
                break;
#endif

Code: [Select]
..........
                osd_yaw   = (int16_t)uavtalk_get_float(&msg, ATTITUDEACTUAL_OBJ_YAW);
                // if we don't have a GPS, use Yaw for heading
                if (osd_lat == 0) {
                    osd_heading = osd_yaw;
                }
...........
                osd_heading     = uavtalk_get_float(&msg, GPSPOSITION_OBJ_HEADING);
...........


the stable readings for heading with no GPS lock and the chaotic ones with GPS locked get explained.

OSD uses for heading the FC attitude yaw value (the same we see in GCS) when there is no GPS lock.

Once GPS is locked, OSD displays the heading taken from the GPS data, which is inaccurate and jumpy when the UAV (and GPS) is stationary of moving too slow.

This approach makes sense when the FC is CC3D (+ GPS) as it lacks compass (MAG).
Not optimal for Revo FC using INS13...

TMGsi

  • ***
  • 133
Re: Mini LongRange Revolution fc
« Reply #14 on: November 03, 2020, 03:47:38 pm »
The original Librepilot MinOpOSD code has some issues (imperfections) and this seems to be one of them...

This approach makes sense when the FC is CC3D (+ GPS) as it lacks compass (MAG).
Not optimal for Revo FC using INS13...

has how to solve this error? if possible.
does everybody have this same problem?
some do not realize that there is.

how to change the code so he doesn't get the gps information?