Ben

  • *
  • 12
Sensor Calibration
« on: August 04, 2017, 09:39:35 am »
Hello,

yesterday i've got my drone into the air for the first time. But I had some problems to handle it in attitude mode,  because it has been drifting to the front left.
When I've checked the software afterwards I did recognize that there is an sensor calibration in the software, which i didn't use because I've been thinking the sensors already had been calibrated by using the wizard.
I was wondering if I have to run the all the sensor calibration there, too. Is the wizard only calibrating the gyro ? Is the accelerometer calibration mandatory ? And do I have to remove the FC for the accelerometer calibration ?

Kind regards
Ben
« Last Edit: August 04, 2017, 03:24:32 pm by Ben »

Re: Sensor Calibration
« Reply #1 on: August 04, 2017, 03:31:29 pm »
Look at the Help tab on that page for some answers.  :)
For Accelerometer calibration it is recommended that the board be out of the aircraft so you can get more accurate registration to the edges of the board.  The others can or should be done with it in the aircraft.

BUT!!!

First of all, don't change the transmitter trims, ever, or if you do, after the flight set them back exactly as they were during transmitter wizard (when all sticks were centered) and adjust drift as below.  Rate mode should never drift at all or you have moved it during the power on or arming gyro calibrations (INS13 doesn't have this restriction).

Drift in Attitude mode should be adjusted with Attitude -> Settings -> RotateVirtual
  if it is drifting forward you subtract from pitch
  if it is drifting left you subtract from roll

Ben

  • *
  • 12
Re: Sensor Calibration
« Reply #2 on: August 04, 2017, 04:51:44 pm »
Thank you very much for helping a newbie :) ! So my intuition was right. I've missed some calibration and maybe it'll work much better afterwards :)

Ben

  • *
  • 12
Re: Sensor Calibration
« Reply #3 on: August 08, 2017, 11:22:17 pm »
I've tried to calibrate the Magnetometer, but it seems to me there is a problem with it.

As you can see in the 1st attachment Configuration => Attitude => Settings => Home location I did set the home location and calibrated the sensor.
The second attachment "no mag" shows the flight data tab with the grey field of the Mag and on the upper left it says "Mag used: invalid"
While attachment 3 shows the Mag settings where it says "Mag source invalid"

Is there something wrong about the settings ? Or is the Magnetometer defect ?



f5soh

  • *****
  • 4572
    • LibrePilot
Re: Sensor Calibration
« Reply #4 on: August 08, 2017, 11:34:41 pm »
The green "OnBoard" status with 3.6% error show a Onboard mag running and calibrated.

The systemHealth without Mag and the "Mag source invalid" are simply due to the Attitude Estimation Algorithm you choose : 'Basic - Complementary' not using the Mag at all.

Some notes:
- With a multirotor you cannot use the onboard Mag (in almost 99% cases) due to the strong currents and magnetic perturbations. You should use a external mag far away from power lines.
- Without GPS the Mag sensor is not needed.

Ben

  • *
  • 12
Re: Sensor Calibration
« Reply #5 on: August 08, 2017, 11:49:19 pm »
Thank you very much! I've thought I'd have to calibrate all sensors and that I would need them all working :).

So all I can do is change the values of "RotateVirtual" and hope that I'll find the values which stop the drifting of my drone.

At the moment anything I can do is thinking about what's wrong because some screws have been broken while testing ...

Re: Sensor Calibration
« Reply #6 on: August 09, 2017, 03:03:21 pm »
I suggest you do some research into "rotate virtual" to make sure you know what you are doing when putting those numbers in. I recommend this because one of the main functions of rotate virtual is when you install your flight controller upside-down or side ways  that is the fuction  to let the fireware know its upside-down yaw, roll, pitch (180 or -180) or sideways(-90or 90). Just be careful with the size of the numbers you test.

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Sensor Calibration
« Reply #7 on: August 09, 2017, 06:59:10 pm »
Trimming the rotate virtual values will not need 90° or 180° values i think :D

Ben

  • *
  • 12
Re: Sensor Calibration
« Reply #8 on: August 10, 2017, 01:13:43 pm »
I've changed the values just in small steps. It did work like suggested:

"Drift in Attitude mode should be adjusted with Attitude -> Settings -> RotateVirtual
  if it is drifting forward you subtract from pitch
  if it is drifting left you subtract from roll"

So I've been just subtracting / adding values of about 5° trying it out and repeated it again with smaller values to get closer to the optimum values.
« Last Edit: August 10, 2017, 01:33:51 pm by Ben »

Re: Sensor Calibration
« Reply #9 on: August 10, 2017, 04:15:47 pm »
So after calibration of all the sensors your quad was still drifting? Even with no wind

Ben

  • *
  • 12
Re: Sensor Calibration
« Reply #10 on: August 10, 2017, 04:27:15 pm »
Yeah, it was. But I have optimized some other things yesterday, too:
The centre of mass had been a little elevated before, so i've used shorter spacers now to get the drone a little more flat.
Then I've checked the neutral point of the ESC calibration again and found out that there was a little potential, too.
After this the drone is now drifting into the other direction than before ... I'll set the virtual rotate back next time and I'll see if everything is in order now.

I'm really new to this ... I've even had nearly no flight experience before, so I do a lot of trial and error.
« Last Edit: August 10, 2017, 04:32:08 pm by Ben »

Re: Sensor Calibration
« Reply #11 on: August 10, 2017, 05:21:07 pm »
RotateVirtual must be test flown with zero wind.  The center of a large room indoors may work for you.

You should be able to notice a change with 1 degree of change.  I get it down to 0.2 degree.  With small changes like this, it takes several seconds to notice any consistent drift.

When you change between Basic and INS13, you will have to retrim RotateVirtual, or there is a procedure to get it close in both at the same time (but mag orientation is only integer degrees, so no 0.2 degree changes).
https://librepilot.atlassian.net/wiki/display/LPDOC/Aux+Mag+Setup+and+Calibration
(search the text for the section titled "Fine Tuning Your Hover To Stop Drift (Not Required)")

Ben

  • *
  • 12
Re: Sensor Calibration
« Reply #12 on: August 10, 2017, 09:06:35 pm »
Thank you very much again. I'm already close to it :) . But flying inside won't be possible for me. Even if I wouldn't mess up the whole furnishings and hurt myself with the drone, my girlfriend would kill me for flying with this "thing" inside  :D .

Btw.: the support is really great here and I like to soak up all the information like a sponge :)

Ps: I don't use GPS so it's  always Basic.
« Last Edit: August 10, 2017, 09:36:38 pm by Ben »

Re: Sensor Calibration
« Reply #13 on: August 11, 2017, 02:43:58 am »
Everyone goes through the  trial and error process to get a good flying craft. Some craft just takes more trial than error. Just be easy because it will be easier on your wallet

Mateusz

  • *
  • 808
Re: Sensor Calibration
« Reply #14 on: August 11, 2017, 09:27:55 am »
  • Basic complementary - Is using just accel and gyro in Attitude stabilized flight modes, and just gyro alone in Rate modes. Rattitude is Attitude that is changing to Rate at large deflection of the stick.
  • INS13 - Is the fusion algorithm to use for full autonomous flight modes, this is the one that requires all sensors functional without exception. You can't use it indoors.
  • There will always be a little bit of drift here and there due to imperfections of the build, external forces etc... but it should be possible to hover easily and it should stay 1-2s in place. If it's drifting too much that you can not control it or fly indoors, then some tuning discussed above is need.

If it's multi-rotor with propellers bigger than 5" you could try balancing them (unbalanced big props introduce vibrations). I feel big difference on 9" props whether they are balanced or not, with unbalanced completely unstable. You might also want to increase Accel and Gyro Tau (which is some sort of filtering), the higher you increase it I think the stronger the filtering, but it may help if you have a lot of vibrations, just don't overdo and try to keep it as close as possible to default if you don't see a difference when increasing it.
Fine tune your Board rotation (later if you decide to use external magnetometer you will need to account for these rotations on external mag as well, just keep that in mind, irrelevant now for Basic complementary). Finally if you are happy with it and there is almost no drift, tune the PIDs, try Autotune if you have F4 or F3 board, but check if PIDs are flyable and make sense, sometimes Autotune fails. If you have F1 (such as CC3D), you can't use Autotune due to RAM limitations, then use (recommended) Easytune is a bit longer than Autotune, but not as long as the standard Ziegler-Nichols method and Easytune works always.

What size of multi-rotor are you flying ? My gf would not allow anything bigger than 200 as well because of the furniture and walls ;)