LibrePilot Forum

Users => Applications - Autonomous Flight => Topic started by: sam028 on October 28, 2017, 05:31:58 pm

Title: Incorrect behavior with INS13
Post by: sam028 on October 28, 2017, 05:31:58 pm
Hello,

I'm trying the PositionHold mode so to do this I change my setup from Complementary to INS13.
But while the copter is flying very well in Complementary mode it's completely crazy with INS13, I barely can't take off (and destroyed a couple of props).
What could be wrong? The mags have been calibrated and are all "green".
I'm using a Revo board with an additional GY-511 mag and a N8N GPS (GPS on a 10 cm mast, GY-511 just above the Revo).

Thanks,
Sam
Title: Re: Incorrect behavior with INS13
Post by: f5soh on October 28, 2017, 07:52:57 pm
Hi,

Mags will be green in Attitude > Mag tab (this mean each Mag is correctly calibrated) and the three bars still at 0 while moving the frame, this will made sure the AuxMag orientation is correct.
Set Mag usage to AuxOnly.

Be sure the Mag alarm in SystemHealth still ok while applying power. Should be the case while using AuxMag, away from strong currents).

Take a look at video:
https://www.youtube.com/watch?v=vyTvMd5LfTk

Title: Re: Incorrect behavior with INS13
Post by: sam028 on October 28, 2017, 09:00:44 pm
Thanks for the answers.
I searched before posting and the only thing which was not done like your description is the "Mag usage to AuxOnly", I used "Both".
The auxiliary mag is not that far from strong current but on a ZMR250 it's tricky to be very far away. If needed I'll put the GPS somewhere else and will the GPS mast for the aux. mag.
I'll try and will update the thead.

Sam
Title: Re: Incorrect behavior with INS13
Post by: f5soh on October 28, 2017, 09:21:43 pm
You may need at least a mast around 8cm long for a 250 sized frame.

Take care about power wires, you can twist wires and remove loops for reduced magnetic fields.
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 15, 2017, 05:58:08 pm
So after a bunch of changes (new radio, SBUS receiver, calibrating the T° with the freezer trick, ...) it's much better with INS13 in stabilized modes.
It still have the "Toilet Bowl effect" but it's clearly because of the aux mag becoming red during the flight (I'll try again to fix the aux mag on the GPS mast).
Title: Re: Incorrect behavior with INS13
Post by: ldellus on November 16, 2017, 10:58:02 am
Hi,

I had the same problem. I solved it by using only one mag, the external one on the GPS receiver. There is a second mag in the Revo.

In the settings, select external instead of both and see if it solves your problem.

Laurent
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 16, 2017, 07:06:29 pm
Yes, thank you, I followed @f5soh advice and check other posts but my AuxMag seems to close from the motors which makes it go red in flight.

Hi,

I had the same problem. I solved it by using only one mag, the external one on the GPS receiver. There is a second mag in the Revo.

In the settings, select external instead of both and see if it solves your problem.

Laurent
Title: Re: Incorrect behavior with INS13
Post by: TheOtherCliff on November 16, 2017, 09:40:40 pm
High current wires (battery to PDB to ESC to motors) too close to aux mag is one cause, but another you didn't mention is that all these high current wires must be twisted.
Title: Re: Incorrect behavior with INS13
Post by: jdl on November 17, 2017, 11:58:39 am
Hi, sam028,

I'd like to share some photos of one of my ZMR250 builds, they may be helpful to you...
All GPS / INS13 functionality works fine, no toilet bowls, no oscillations.

I use this frame for short to mid-range fpv and sometimes have to rely on RTB if signal is bad/lost. PositionHold, AutoLand are ok.

Completely solved the problems with INS13 / AuxMag on my ZMR250 frame by carefully twisting ALL high current wires. TheOtherCliff and f5soh already pointed that.

Furthermore, I've mounted the battery plug, primary power wires to the PDB, current sensor, BECs, Filters, LED driver, etc. between the bottom two carbon-fibre plates of the frame. Just used additional 5mm & 8mm spacers (this build has 3mm motor arms) to reach 8mm separation between the bottom plates.

AuxMag is integrated with GPS module (Beitian BN-880) that is placed farthest possible from motors and their wirings (on the top of the HD camera heatsink / mounting plate). I found that using GPS mast is not necessary for this particular build. Just had to calibrate the AuxMag for each type/size of battery I use due to its proximity to the AuxMag sensor. No such a problem to upload specific AuxMag calibrations when changing battery type, as the PID settings and FlightBattery settings should also be changed in this case.

Completely reworking already built frame is painful process so you may just try to twist the motor-to-ESC wires and the ESC-to-PDB wires, not touching the frame structure. If you put the AuxMag sensor on a mast, it should be sufficient.

You may submit some photos of your build here, this may help someone to give you more precise guidelines.
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 17, 2017, 07:45:22 pm
It's much better now with the AuxMag on the GPS mast, it doesn't seems to move more 1 meter or so (better than two days ago when it ended in a window and broker its glass :)).
In my case PDB to ESC are not twisted (the PDB is below just like @jdl), only ESC to motors, I'll do this too.
As I'm sure you won't laugh (or very silently) I'm attaching a couple of links for the pics (without the FPV system, without shrinking tubes for GPS/AuxMag cables, ...) https://www.screencast.com/t/xIjts22eul and https://www.screencast.com/t/VkA9Oddj4BP (original images seems o be too heavy for the forum).

But I may have a bad Revo board: it seems I have to calibrate the gyro after each battery pack, if not I have something like this:
 http://www.screencast.com/t/GHPqXoeNF (quad landed, not moving at all). I'll confirm after more tests but it seems I have the same behavior after few minutes of flight (after having calibrated the gyros before taking off), see http://www.screencast.com/t/CDohAcdP12c . And of course the PFD goes crazy.

Thanks for the information and the pics, to be continued!
Title: Re: Incorrect behavior with INS13
Post by: f5soh on November 17, 2017, 08:07:39 pm
Quote
But I may have a bad Revo board: it seems I have to calibrate the gyro after each battery pack, if not I have something like this:

Try Thermal calibration (https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058675/Sensor+calibration#Sensorcalibration-Thermalcalibration), you have clearly a thermal drift issue with Gyros and also Barometer.

Please add some bumpers to the bottom side :)
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 17, 2017, 10:50:06 pm
Quote
But I may have a bad Revo board: it seems I have to calibrate the gyro after each battery pack, if not I have something like this:

Try Thermal calibration (https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058675/Sensor+calibration#Sensorcalibration-Thermalcalibration), you have clearly a thermal drift issue with Gyros and also Barometer.

Please add some bumpers to the bottom side :)

Already done: thermal calibration from -16° Celsius to +20°C in a black bag with no light during calibration.
I'll get another Revo board sooner or later so I'll then see if my current board has a problem or not. Very smooth flights then gyros gets crazy, a bad board make sense IMHO.

edit: bumpers were there on day 1 but went off one by one after few emergency "landings" (more controlled crashes or uncontrolled crashes 8)).
Title: Re: Incorrect behavior with INS13
Post by: f5soh on November 17, 2017, 10:57:30 pm
This big drift with both sensors is strange. Is the flying temperature inside -16° Celsius to +20°C range ?

Be sure the thermal calibration is done correctly, don't move board and protect from light while calibrating.
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 18, 2017, 01:44:38 pm
This big drift with both sensors is strange. Is the flying temperature inside -16° Celsius to +20°C range ?
Yes, around 12°C.

Quote from: f5soh
Be sure the thermal calibration is done correctly, don't move board and protect from light while calibrating.
This is what I've done, no lights and no movement and a large sampled range: https://www.screencast.com/t/Ynulo8yDJCTL .
I'll do more tests, I'll try to find the correlation between the crazy gyros and "something".
Title: Re: Incorrect behavior with INS13
Post by: f5soh on November 18, 2017, 02:07:54 pm
Can you post your config file ?
File > Export UAV Settings
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 18, 2017, 05:33:37 pm
Can you post your config file ?
File > Export UAV Settings

Sure, here it is.

I did 3 flights today, after the last thermal calibration:
- same crazy gyros behavior with the first battery pack, then calibrate the gyros bias and the accelerometer: no changes
- calibrate (with OPLink) the gyros bias and the accelerometer: was much better with very stable flight and good position hold
- all good with the next two battery packs (10 minutes flights each time)
So that's a bit weird...

Thanks.



Title: Re: Incorrect behavior with INS13
Post by: f5soh on November 18, 2017, 08:49:55 pm
Gyro biases are really weird in your config file.

Try loading the file attached (for default Gyro values, without temp calibration) and switch to Complementary.
Reboot board, just to be sure.
See what happens and made a log file to be posted here : Tools > Start Logging and after a few minutes Tools > Stop Logging
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 19, 2017, 01:04:44 pm
Gyro biases are really weird in your config file.

Try loading the file attached (for default Gyro values, without temp calibration) and switch to Complementary.
Reboot board, just to be sure.
See what happens and made a log file to be posted here : Tools > Start Logging and after a few minutes Tools > Stop Logging

Here you go.

Thanks.
Title: Re: Incorrect behavior with INS13
Post by: f5soh on November 19, 2017, 01:31:33 pm
Looks good, you did a short flight, right ?
No big biases, gyro readings around zero and no drift.

I think the previous temperature calibration was messed for some reason.
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 19, 2017, 02:09:00 pm
Yes, it was a 2 or 3 minutes flight.
I'll keep this config and will get back to INS13 to see how it goes.

I was going to ask how to read logs but I finally found it! I'll add an how-to article about it, as it's obvious and logical to manage it with through the Connections combo box it's not extremely intuitive (as the "Start logging" is the menus I was searching for a sort of "Read logs" there too).

Title: Re: Incorrect behavior with INS13
Post by: f5soh on November 19, 2017, 02:58:38 pm
If you want to write something about logs, the best place is Wiki (https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/2818105/Welcome). Maybe a page around the Import/Export settings.
Title: Re: Incorrect behavior with INS13
Post by: jdl on November 19, 2017, 05:03:30 pm
Yes, it was a 2 or 3 minutes flight.
I'll keep this config and will get back to INS13 to see how it goes.


Just looked at the opl log. Maybe it's a good idea to sort the baro problem first and then try again autonomous modes. Logged altitude readings don't seem right to me...

Temperature readings of both sensors (Gyro and Baro) show values (28..21 deg.C) that are outside of the calibration range you cited above. You may wish to redo the thermal calibration with higher end temperature. I use the freezer and then the kitchen oven switched to minimum (it has no fan!), board placed on wooden plate. This gives a nice range of -13 .. 80 deg.C or similar.

Also, there is something weird with baro height readings. Recorded values start at height -116m, jump to -128m after takeoff (prop wash?! maybe the foam over the sensor I saw on your photos is not covering firmly the barosensor).

During flight height reading reaches -102m. You land at -106m (huge difference with the takeoff height) and till the end of log file the height creeps slowly to -112m.

I recall there was a thread, started by the TheOtherCliff, about "bad" Revo boards with problematic voltage regulators, that affect baro sensors.

https://forum.librepilot.org/index.php?topic=311.0 (https://forum.librepilot.org/index.php?topic=311.0)
Title: Re: Incorrect behavior with INS13
Post by: f5soh on November 19, 2017, 06:58:19 pm
Baro issue related to regulators give noise with instant spikes, sometimes a few meters. That's not the case here.

Drift is related to temperature change, baro and Acc give almost the same temperature.

(https://forum.librepilot.org/index.php?action=dlattach;topic=3921.0;attach=6931)

The thermal calibration is dedicated to correct this behavior.
Of course this behavior can be reduced physically by simply using a case around the board.
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 19, 2017, 07:33:24 pm
Not sure for the baro (I'll remove this C9 capacitor sooner or later) but something looks wrong with my board.
With INS13 it was impossible to arm the copter, ATTI and STAB were red and the gyros data not correct (see my short log file, with the board not moving). Things were fine when I get back to Complementary mode.
I just ordered another Revo board (from HK this time) so hopefully I'll be able to compare both boards.
Title: Re: Incorrect behavior with INS13
Post by: f5soh on November 19, 2017, 07:49:00 pm
Removing the capacitor will not change something for you, altitude still within less than one meter.
Bad regulator can give 5m spikes, look scopes and scale to the left in Wiki page (https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058671/Altitude+Hold#AltitudeHold-Hardwareissues).

Here is what you recorded with latest log:
(https://forum.librepilot.org/index.php?action=dlattach;topic=3921.0;attach=6936)

You may try to do a thermal calibration (https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058675/Sensor+calibration#Sensorcalibration-Thermalcalibration) again. No light, no vibrations or bumps while calibrating.
You can put the board inside a piece of tissue so it warm a little more.

Quote
With INS13 it was impossible to arm the copter, ATTI and STAB were red and the gyros data not correct (see my short log file, with the board not moving). Things were fine when I get back to Complementary mode.

Previous Gyro biases comes from bad thermal calibration, my Revo give the same jitter and erratic STAB initialization here with your settings.
When you arm the board, frame will be perfectly steady.
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 23, 2017, 04:55:23 pm
New revo board received and plugged in. I did a quick flight in Complementary mode and so far so good. The baro on the previous board was good but this one looks better.

But now I'm stuck with the OPLink configuration, no communication... Here my setup:
- copter side: https://www.screencast.com/t/1toFEzfBQ
- ground station side: https://www.screencast.com/t/QJ9m3qT0LK
And yes, the antennas are plugged on each side.

Any idea of what could be wrong?

Title: Re: Incorrect behavior with INS13
Post by: TheOtherCliff on November 23, 2017, 10:35:31 pm
Any time you make changes to RF settings, you must have that board directly plugged into USB.  This means that you should use USB to change Reve RF (OpLink) settings.  Start from there.

GCS set to OpLinkCoordinator
Revo set to OpLinkReceiver

Leave DeviceID set to AutoGen on both sides.

Copy DeviceID from coordinator side and put it into CoordinatorID field on Revo side.

I suggest you use 57600 for CommSpeed (both sides).

Both set to "data only" and all other settings matching.  For this initial testing, set power low on both, like 1.25mw
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 24, 2017, 05:04:11 pm
Thanks @TheOtherCliff, I already did all this but no joy (I also try after an Upgrade & Erase firmware).

I think the OPLinkMini board has a problem (while it worked well for more than a month) and here is something I don't understand:
- screenshot from the OPLink coordinator (plugged in USB on machine A): no RX and good TX, link state "Enabled".
- screenshot from the Revo board (plugged in USB on machine B): some RX but no TX, RX level not null, link state "Connected".

It looks like the OPLinkMini can't receive anything but on the other hand RadioComBridgeStats has TelemetryTxBytes and TelemetryRxBytes > 0.  :o

Any clues/ideas?

Title: Re: Incorrect behavior with INS13
Post by: TheOtherCliff on November 25, 2017, 05:39:35 pm
Lately the cheap clones from China are sometimes off frequency.  I haven't got any bad ones.  The latest LP unreleased code has a tuner slider in the OpLink settings.

You start with a set of OpLinks that work well together and adjust your new bad ones to work well with the working set.  Adjust for best received signal levels.
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 28, 2017, 02:44:52 pm
Lately the cheap clones from China are sometimes off frequency.  I haven't got any bad ones.  The latest LP unreleased code has a tuner slider in the OpLink settings.

You start with a set of OpLinks that work well together and adjust your new bad ones to work well with the working set.  Adjust for best received signal levels.

I have now 3 Revo boards but only 1 OPLink mini, so I'll get some to continue the investigations.

Is there a way to use a Revo board as an OPLink coordinator in LP? I bound 2 Revos, one on the ground side acting as coordinator but LP see it as a "normal" board, it's not acting as a simple OPLink.

Thanks.
Title: Re: Incorrect behavior with INS13
Post by: TheOtherCliff on November 28, 2017, 06:17:49 pm
I've actually asked the same thing.  It's my understanding that it requires a different firmware at least, and maybe a new GCS depending on how the firmware is written.

So two ways:
- quick and dirty to make a Revo firmware that acts like an OpLink
  it may even have to announce itself on USB as OpLink depending on how the GCS is written
- add "OpLink emulation" to USB HID device function list in Hardware tab

I started looking at the quick and dirty firmware a couple weeks ago but got side tracked.  I don't know when I will get back to it...  :(

I ordered one of these for stock (USD $14.50 shipped) but it hasn't arrived yet.  At that price it I reserve judgement until I've tested it.
https://www.ebay.com/itm/OPLINK-MINI-CC3D-REVO-Universal-Transceiver-TX-RX-Module-Remote-PPM-input/121779927980
Title: Re: Incorrect behavior with INS13
Post by: sam028 on November 28, 2017, 07:12:14 pm
This might be a bit tricky for me to modify a Revo firmware but I'll take a look.
$16 from HK with shipping: https://hobbyking.com/en_us/openpilot-oplink-mini-ground-station-433-mhz.html . I'll go with HK for mine(s), I never had bad surprises with them.