trust

  • ****
  • 301
Re: East west oscillation in VelocityRoam
« Reply #15 on: January 11, 2021, 07:23:53 am »
Well, I decided to try replacing the DJI/naz GPS with a Ublx GPS, and try to use the onboard mag. I had successfully got the OPLINK mini working, so I wouldn't have the cable interference problems I had before.
  But when I tried to reload the 16.09 (plain, not dirty) firmware, it now no longer boots. I tried loading the firmware shown in a reference here in the Forum, but it is a 15X version. I can load firmware, but after booting it doesn't communicate via USB.
  Where can I get the Revo 16.09 firmware? I hope I didn't somehow brick this FC. I swapped in another one I had and by the time I got most items functioning its too late to finish the calibration I need to do outside.
Also, which mag should I be selecting for the onboard mag type? Its a mini Revo.

Re: East west oscillation in VelocityRoam
« Reply #16 on: January 11, 2021, 11:15:03 am »
All firmware is built into the install program / GCS.  You can use that DJI dirty firmware for Ublox GPSs.  It is just normal firmware for Ublox.

Info: Each UAVO (group of settings like GPSSettings) / version (16.09 or next-###) is unique.  You can probably store a full 16.09 configuration and a different full next configuration at the same time on the same FC such that flashing one firmware will run one set and flashing the other firmware will run the other set.

Beware that having an I2C mag plugged in without a flight battery to power it will keep that I2C bus from running.  For instance in Sparky2, if you have a mag plugged into I2CPort with only USB power, it won't boot, even with default settings as I recall.

First try booting (USB power) with everything (especially mag) disconnected from the FC.  What do the LEDs look like?  About a 7 second long blink that repeats?  That is watchdog reboot and after about 3 of those it should boot up with default settings.  If so, you could Rescue / Erase Settings if your settings are not important.

Second try:
- unplug / no power
- Firmware page press Rescue
- plug it in and wait for it to connect up to a minute
- press Safe Boot, this starts it up with default settings, but without erasing settings

If that works and it comes up, then it looks like you have some settings that are recognized by your current firmware, but that are doing something you don't like.  It could be something as simple as having USB telemetry disabled.

If you don't have important settings stored on the FC, just do the Rescue again and do Erase Settings and it should all be fine.

Finally, make sure you don't have something shorted out like pins shorted together in a small FC connector or metal FC mounting hardware or FC touching metal or carbon underneath.

trust

  • ****
  • 301
Re: East west oscillation in VelocityRoam
« Reply #17 on: January 11, 2021, 03:14:19 pm »
It looks like I needed to erase settings. Once I did that, I was able to reboot, reload UAV settings and get it working again.
I always save the settings after every change so I can reload if needed.
Thanks.

trust

  • ****
  • 301
Re: East west oscillation in VelocityRoam
« Reply #18 on: January 11, 2021, 07:09:55 pm »
I was able to get the sk450 quad working with the Ublx GPS and the onboard mag. Atti & stab seems finicky - doesn't show movement. Will ATTI & STAB be red if all the GPS flags aren't there yet? GPS would be green, but these were red. I did some recalibrating, then it worked. Saved after each step. But brought it inside and now after reboot they're red again.
   At any rate, tested in a moderate wind. Hovers fine. When I went to VR mode, it shook with the fast oscillation - more so than previously with the other GPS.
   Also, I'm holding some tilt to keep it hovering in the wind. When I switch to VR mode it does try to stay in position. But I have to hold some stick tilt to keep it there. I'm using GPSassist so it has deadband - but what happens when you switch to VR mode with the sticks off center?
  The mass shouldn't have changed much at all with the different GPS. However the location of the GPS shifted from about 7 inches above the model FC to the same plane as the FC, just about 2 inches laterally.
  I may try turning down the gyro settings to soften the fast oscillation.

Re: East west oscillation in VelocityRoam
« Reply #19 on: January 11, 2021, 10:06:45 pm »
I'm assuming this is a Revo class FC.  :)

I was able to get the sk450 quad working with the Ublx GPS and the onboard mag. Atti & stab seems finicky - doesn't show movement. Will ATTI & STAB be red if all the GPS flags aren't there yet? GPS would be green, but these were red. I did some recalibrating, then it worked. Saved after each step. But brought it inside and now after reboot they're red again.
If you are using INS13, then GPS must be green (including 7+ sats), GPS must have less than 3.5 PDOP, and mags must be green (and HomeLocation set) for ATTI & STAB to go green.  After that, those sensors could get worse, but atti/stab will still stay green unless some sensors (mag) go really bad.

At any rate, tested in a moderate wind. Hovers fine. When I went to VR mode, it shook with the fast oscillation - more so than previously with the other GPS.
I believe that fast shake is bad sensor calibration.  In VR, stationary hover, low wind, hands off no drift, do a slow yaw pirouette.  Does it move around a lot?  That is another sign pointing to sensor cal issues.  Think of it sitting half way between where GPS wants it to be and where accel/mag leveling (unlevel) are trying to drive it.  Every time the GPS sends data (4 or 5 times a second depending on GPS and settings) the GPS kicks it back to where it wants it while the bad leveling constantly drives it away.

Recall that transmitter trims should always stay where they were when you did transmitter wizard.  You can test by looking at Input -> RC page with Tx on, and compare where Tx currently is vs where Neutrals are.

I do careful board and leveling cals (accels) and careful mag cal, then hover it in Basic (Complementary) Atti and trim for stationary hover (must be zero wind and even so, yaw 180 and test when pointed that way too).  Use Attitude -> Settings -> RotateVirtual to get it hovering stationary.  Then switch to INS13 with Atti and trim the level with Atti -> Mag -> AuxMagOrientation.  This has it hovering motionless in either Basic/Atti or INS13/Atti.
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/18382863/Aux+Mag+Setup+and+Calibration
Heading:Fine Tuning Your Hover To Stop Drift (Not Required)

Next has other GPS flight mode capable AttiEstAlgos besides INS13.  There is one which doesn't use mag for leveling.  I'm afraid I haven't used this and don't know much more.

Also, I'm holding some tilt to keep it hovering in the wind. When I switch to VR mode it does try to stay in position. But I have to hold some stick tilt to keep it there. I'm using GPSassist so it has deadband - but what happens when you switch to VR mode with the sticks off center?
If sticks are off center enough to get past deadband, then even with sticks helping a tiny amount into the wind it could drift downwind in a strong wind.  That is the second VR drift issue I talked about (where? maybe in the Jira?)

JDL says VR with GPSAssist should stay put so I am confused.  Maybe that is only true in next not 16.09?  Do you build your own GCS?  There is a trivial change to add a fixed deadband to VR.  My understanding is that with either GPSAssist or with that deadband tweak it might drift a little in the wind (a few meters?) but not keep drifting.

With GPSAssist, hands off the sticks it should stay there.  Touch the sticks and it could drift downwind.

  The mass shouldn't have changed much at all with the different GPS. However the location of the GPS shifted from about 7 inches above the model FC to the same plane as the FC, just about 2 inches laterally.
Shouldn't make a difference unless moving the GPS puts it too close to metal or magnets.

I may try turning down the gyro settings to soften the fast oscillation.
I don't expect that to help.  The full fix is recal board, level, and mags, then redo Basic/Atti trim with RotateVirtual and INS13/Atti trim with AuxMagOrientation.

trust

  • ****
  • 301
Re: East west oscillation in VelocityRoam
« Reply #20 on: January 11, 2021, 10:36:07 pm »
Is this issue fixed with the next revs? It sounds like a different approach was used. I tried cutting the gyro settings in half - it reduced the shaking but didn't eliminate it.
I had to recalibrate the mag again when I went to do the these last tests. Not sure why but it was WAY off before I did the recalibration - despite the fact I used the exact same spot and technique to calibrate. One possible issue is it's sitting on the sidewalk for the calibration - not ground but close to it.

Re: East west oscillation in VelocityRoam
« Reply #21 on: January 12, 2021, 01:48:13 am »
Mag calibration continues to gather data during the whole calibration.  Not just while the slider is moving each time after you press the button 6 times.

You can't put the drone on the ground or close to the ground or near metal or magnets at any time during the calibration.  My laptop even has a strong magnet (attempt at a good speaker?) I can feel when holding metal close.  Glad we aren't using floppy disks any more.

You can actually press the button 5 times, then do all 6 positions, then press the button the 6th time.

I actually do a different calibration dance.  I know my magnetic inclination is about 60 degrees here in Georgia USA.  Think of that being like the north pole looks like it is north, but 60 degrees downward as well.  Around the equator the field is generally level.  South of the equator, it points upward.  But it is a mess.  You need to look at the inclination map.  I press the button 5 times, then point / wiggle-around each of 6 drone directions (top, bottom, left, right, back, front) of the drone at the north-but-60-degrees-down direction, then press the button for the 6th time.

https://upload.wikimedia.org/wikipedia/commons/d/de/World_Magnetic_Inclination_2015.pdf

This procedure gives a good chance of pointing both directions of each of the 3, 1D sensors built into the magnetometer directly along the magnetic field line while only having a general idea of exactly where north is and where my 60 degrees is.

At the north magnetic pole, the magnetic field is straight down and useless for direction but perfect for "where is down".  Above the equator, the north magnetic field points downward at an angle that depends on location.  Below the equator, the north magnetic field lines point upward.  At the south mag pole the north field points straight up and is again worthless for direction, but perfect for "where is down".
« Last Edit: January 12, 2021, 08:06:39 am by TheOtherCliff »

trust

  • ****
  • 301
Re: East west oscillation in VelocityRoam
« Reply #22 on: January 12, 2021, 08:21:18 pm »
Ok. Today is fortunately zero wind, so a good chance to test.
I re ran the mag alignment, this time ensuring that it was well of the ground, and used your 5 clicks, rotate around then 6th click method. It seemed to accept this and stayed green.
  When the aircraft is on flat ground, the pitch and roll look correct - the turn/bank indicator looks flat and level.
But when I launch to hover, while craft is pointed west, I need about 10 degrees of roll to keep it level. If I point north, I need some pitch and roll. If I point east - it thinks it is level and hovers almost perfect.
   I tried climbing and putting in VR mode while pointed east - it was considerably more stable and not much fast oscillation - a little east-west but not much. But when I tried to yaw, it began to drift badly.
  See the enclosed video of this test flight.
   I went into the settings and tried changing the auxmag boardrot setting roll to ten degrees & uploading - it had no effect.
   I don't think the board level calibrations are off - the position sensors seem correct or close to it. I can't tell if the mag settings are reasonable or not.
I'm also enclosing the UAV settings.

Re: East west oscillation in VelocityRoam
« Reply #23 on: January 12, 2021, 11:58:32 pm »
If this is in INS13 / Attitude, it sounds like it is AuxMagOrientation wrong.  This must be 0,0,0 (DJI GPS or OP GPS Platinum) unless you use it specifically to tune out this kind of problem or have the aux mag mounted non-standard.  Do not try to get the sliders all to 0,0,0 by tweaking the AuxMagOrientation.

For Ublox GPS/mag it should be 0,180,0 or 180,0,180 (these are equivalent rotations.  try it.  :) ).

trust

  • ****
  • 301
Re: East west oscillation in VelocityRoam
« Reply #24 on: January 13, 2021, 11:42:34 pm »
I decided to try the latest next rev. After a lot of loading GCS versions and firmware into all the devices (FC, OPLINK, OPOSD), then calibrating using the 5 press, swing around 6th press mag calibration, I tested with the generic quad settings in basic mode. Hovered fine and stable. Then I switched to INS13 mode and flew in lite wind (5ish) conditions. I was able to get a lot of sats (16). When I switched to VR mode, it did what I had been hoping for - no fast oscillation, stayed pretty much in place (swayed maybe 1-2 feet). No slow oscillation either.
  This am I tried it again. This time I was only able to get 8-9 sats. No wind. But when I switched to VR mode, it moved around a LOT - 10-20 feet. Not very stable. I tried several more times - same results.
  I also tried two other modes - complementary+mag+gpsoutdoor & INS13+CF. They both seemed to act identically - still moved around a lot.
   Just now (about 4 hours later) I tried again. Now some wind and thermally. At first I only got 9-10 sats, and again, when I switched to VR mode it moved around a lot - 10-20 feet.
  Then the 11th sat kicked in. I relaunched and this time it was very solid again. Held position - even with some wind and lite gusts - within 1-2 feet. No oscillations.
   I had been watching the PDOP values on the computer and they seemed all under 2.5 even with low sats. Not sure what they were when it went solid.
  I understand how the GPS system works - and its not just sats but the area of the sky they radiate from that determines precision.
Is PDOP in meters or dimensionless?

Re: East west oscillation in VelocityRoam
« Reply #25 on: January 14, 2021, 05:51:35 am »
*DOP's are dimensionless but can somewhat be tied to distances with formulas you would have to research.  Understand that DOP is simply the factor that comes from satellite positions and is the same even for different brands of GPS's at the same location, if they are using the same satellites.
https://www.gps-forums.com/threads/roughtly-converting-dop-to-metric-error.40105/

I don't see anything but coincidence or GPS shielding location (or weather for a poor GPS) in your descriptions of it working good or bad.  Clear and cold (low moisture) should be best GPS, but I don't ever worry about that.

Are you between / next to buildings.  I fly to within 10 feet or so of my house with 1 or 2 stories blocking GPS without much problem, but metal roofs or buildings or city streets with several stories on both sides can be bad.

I can also generally get GPS lock in the basement with 2 stories above (after a long time like 30 minutes sometimes).  Can you get GPS lock even green sometimes anywhere indoors?  That would help understand the sensitivity of your GPS and GPS penetration of your house and roof.  It appears that the GPS's I use can somewhat see through my house.

Were you flying in the same place each time?

Most GPS's have a super capacitor that acts like a battery to store the GPS almanac for say 6 hours after power off.  It's wise (but not required if sat count and PDOP are good) to wait 15 minutes after power on for GPS to download this before first flight of the day.  If the GPS has a low sat count and adds or deletes a sat, it can move the calculated position a bit.  Some cheap GPS's don't save the almanac this way.

If you don't yaw at all (edit: in Velocity Roam mode), does it stay put?  My worst test ship moves a lot if I rotate even less than 90 degrees (in VR).  If I do it quickly at 1m high it almost crashes.  (I want to keep it this way until I completely understand the issue, and I have been lazy.  :) )
« Last Edit: January 14, 2021, 10:41:57 pm by TheOtherCliff »

trust

  • ****
  • 301
Re: East west oscillation in VelocityRoam
« Reply #26 on: January 14, 2021, 07:12:28 pm »
The poorer GPS results were with a cloudy morning. I can get GPS reception inside in select locations, but generally much poorer.
These last tests were all done in the same location - starting from curbside and hovering above a street. Houses here are single or two story, but there are some tall (60-80') trees (only a few). I try to raise to about 10' at least to try VR mode, and when it's not too gusty, will go up above the treetops (about 60') to test.
   I tried again later in the day - again, when I had 10 sats I had very poor stability. At 11 it was much more stable.
 This unit has a battery which I suspect saves information.
  I don't know if 11 is the magic number for that day/sat positions or if it's this particular GPS Ublx M8.
I did try a yaw test in VR mode when it was stable with 11 sats. It rotated pretty much within a 1m circle - although at the end of 360 degrees rotation it dropped one sat, it was still reasonably stable.

Re: East west oscillation in VelocityRoam
« Reply #27 on: January 14, 2021, 09:12:58 pm »
You might sit it out at the curb and watch the GPS track wander on the GCS while the aircraft is known to be in one place.

You might play with the GpsSettings -> UbxGnssMode.  I recall that GPS location was more stable when using just GPS.  Also look at the System page.  On the right side, Ublox GPSs will tell you how many are GPS, how many are Glonass, and BeiDou.  Perhaps try to correlate good/bad with that?

When Using a Ublox GPS that accepts any of the 3 satellites, I recall that 10 or 11 is a rather low count and may have less than 7 of the USA GPS sats.  In the old days, 7 or more of USA GPS satellites was the standard.  If you can get 8 or 9 of those with the others turned off, you should wander less?


trust

  • ****
  • 301
Re: East west oscillation in VelocityRoam
« Reply #28 on: January 16, 2021, 07:17:09 pm »
Ok. I'll check those options. Are you referring to settings on the GCS or in Ucenter?
 Update on field tests - I set out in a large field yesterday to test. Here too, 10 sats was relatively unstable, but I did eventually get 12, and this seemed fine, with caveats. I noticed when parked 90 degrees to the wind, there was more of a tendency to sway left/right in the direction of the wind (5-10mph). Pointed into the wind it remained quite steady.
  I also tested RTB. On returning with RTB, if it was traveling cross to the wind, it would tend to meander as the wind would push it one way, then it would wander back. Into the wind, it was a pretty much straight shot.
   Also, once returning over base, it tended to rock quite a bit, especially once it first reached target. The swaying tended to increase, so I stopped it.
  I suspect these are at least partially due to the rotational inertia of the craft being higher front/back due to the camera mount on front and long 4000mah battery position to offset. I don't have different roll vs pitch values for these first tests - autotune did a good job of finding the difference.
  Last, I made a big mistake in dealing with an issue with the motors. The cheap motors/frame I got on sale from Hobbyking had all the motors with the same thread direction - so one half had a much stronger tendency to "unscrew" than the other. I had lost one already and replaced with a nylock nut.
  But in the middle of the last test, one unscrewed, lost a prop, and tumbled to crash - frame pretty toast. It appears all the electronics are ok after some initial tests. Building a frame now in carbon rods and CF laminates. Should be lighter and stronger anyway.

Re: East west oscillation in VelocityRoam
« Reply #29 on: January 17, 2021, 12:00:16 am »

Are you referring to settings on the GCS or in Ucenter?
GCS

I noticed when parked 90 degrees to the wind, there was more of a tendency to sway left/right in the direction of the wind (5-10mph). Pointed into the wind it remained quite steady.
Could this also be called a slow oscillation east-west?

On returning with RTB, if it was traveling cross to the wind, it would tend to meander as the wind would push it one way, then it would wander back. Into the wind, it was a pretty much straight shot.
This is at least somewhat to be expected in gusty wind.  It should pretty much track straight in constant wind.  I suspect that it can be tuned better by doing a full tune: regular PIDs (Autotune) then VtolPF PIDs (HorizontalVelPID?)

Also, once returning over base, it tended to rock quite a bit, especially once it first reached target. The swaying tended to increase, so I stopped it.
This sounds like the slow east-west oscillation.  I haven't gotten to the  bottom of that, but I intend to try tweaking:
VelocityPostProcessingLowPassAlpha and maybe BaroGPSOffsetCorrectionAlpha
as described previously:
https://forum.librepilot.org/index.php?topic=4941.msg33322#msg33322
https://forum.librepilot.org/index.php?topic=4941.msg33301#msg33301

The cheap motors/frame I got on sale from Hobbyking had all the motors with the same thread direction - so one half had a much stronger tendency to "unscrew" than the other. I had lost one already and replaced with a nylock nut.  But in the middle of the last test, one unscrewed, lost a prop, and tumbled to crash - frame pretty toast.
Sorry to hear that.  :(  As a point of reference, the cheap eBay motors I use only come with "normal thread" prop adapters and although I have stripped out some loose prop adapters, I don't recall a prop coming off in the air.  I mostly use the 2212/2830 size motor or one size larger.  I would guess that as you suggested, a nylock nut would cure your problems?