LibrePilot Forum

Users => Applications - Autonomous Flight => Topic started by: supermax on March 16, 2019, 08:38:05 pm

Title: attitude configuration
Post by: supermax on March 16, 2019, 08:38:05 pm
I'm trying to configure mu Revo for autonomous flight.
I wonder how to set "Attitude ---> Settings ---> Attitude Estimation Algorithm". Any gps set give configuration error when i choose "GPS assist" in "Input ---> Flight Mode Switch Settings ---> Assisted control".
I need assisted control flight and automatic waypoint flight to take photo on for vegetation inspections.
 

Thank you in advance.


My hardware and software:

Linux Debian 9
Librepilot Sep 29 2018 15:42

Frame: Realacc (zmr250)
FC: Open pilot revo
Oplink 433Mhz
Distributor: happymodel
Esc: Racestar 30A
Motors: Racestar BR2307s 2200KV Green Edition
Gps: GPS Module Ublox NEO - M8N
Battery: 3S 1350
Radio: no radio https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/14221378/Control+vehicle+using+joystick
  usb joypad



Title: Re: attitude configuration
Post by: TheOtherCliff on March 17, 2019, 12:26:07 am
Should be "GPS Navigation (INS13)" to use the GPS for any flight modes or flight assist.
Title: Re: attitude configuration
Post by: supermax on March 18, 2019, 05:50:33 pm
Thank you for th answer!
Using "GPS Navigation (INS13)" even if Attitude --> flight mode switch settings --> assisted control --> none
the system ealth atti, stab, magn, are red
What behaviour shuold i expect using this configuration?

I would like a manul flight by which moving the quadcopter without taking care of the head position and a position for flight plan
 
         
Title: Re: attitude configuration
Post by: TheOtherCliff on March 19, 2019, 03:25:03 am
For those flight modes (head (headless?) position and flight plan) you need GPS flight modes.  For that you need INS13.  INS13 needs GPS and mag for all flight modes, even for flight modes that you would think do not need it.

It sounds like you have alarms.  In particular, INS13 won't arm until:
- you have GPS and mag installed correctly, configured correctly, and running correctly
- you have set home location
- mag is calibrated and green
- GPS has enough satellites to be green
- there are some flight modes it will not arm in, you must arm in other modes and switch to these
- there may be others I have forgotten...

You say that your mag is red.  That is at least one thing that will keep it from arming and flying.
Atti and Stab turn green after everything else is correct.
When Atti and Stab turn green you can arm.

You must also twist and carefully route your high current motor power wires (battery to connector, connector to PDB, PDB to ESC, ESC to motor) to avoid mag problems that only happen when motors are running with flight load (with props on).  Also, some PDB are not mag friendly.
Title: Re: attitude configuration
Post by: supermax on March 21, 2019, 09:19:17 pm
This afternoon i tryed to make it fly
GPS received the signal of 14 satellites and become green.
Magnetometer lowly turned even if the quadcopter was steady on the ground; so i calibrated accelerometer, magnetometer, board level and gyro bias twice.
The magnetometer remained red so i raised the warning/error level to 0.08 and it became green even if the aux magnetometer is still grey.
The "INPUT" system health  was orange and i couldn't arm the drone.
I didn't find what to correct. Can you help me?
I post the photo of the error
Thank you in advance. I'm still on the ground.
 
Title: Re: attitude configuration
Post by: TheOtherCliff on March 21, 2019, 09:58:10 pm
Input orange means it isn't seeing a receiver signal.  I wouldn't change mag warning level.
Title: Re: attitude configuration
Post by: f5soh on March 21, 2019, 10:11:56 pm
Orange Input is normal since you are using Joystick.

Is the Config > Input > arming setting set as Accessory0
and Throttle at minimum when you check the Arm Switch checkbox in Controller Widget ?

Also the flightmode used for arming will be a something basic using Attitude, without GPS mode or altitudeVario/Hold
Title: Re: attitude configuration
Post by: supermax on March 22, 2019, 11:57:40 am
Trying without gps i set arming setting "roll left" because otherwise it didn't arm the motors.
The compass is very unstable and i raised the warning level just to make a first flight.

Title: Re: attitude configuration
Post by: supermax on March 23, 2019, 07:04:54 pm
I post configuration files
I'm sure you can understand what's wrong.
Title: Re: attitude configuration
Post by: f5soh on March 23, 2019, 07:50:13 pm
If you want to share config files you will need to save UAV settings while the board is connected to GCS.
Seems the above config file is all defaults.

No need to post the GCS configuration file, only uav settings.
Title: Re: attitude configuration
Post by: supermax on April 03, 2019, 07:27:52 pm
Last sunday afternoon i made a new attempt. I didn't manage to make the config tag green.
I attach the .uav file and two screenshot.
Can you suggest me how can i correct it?
Thank you in advance.

Title: Re: attitude configuration
Post by: f5soh on April 03, 2019, 08:28:44 pm
Try removing the "CruiseControl" in Stabilized3 with Rate for Roll, Pitch and Yaw.

Also the GPSAssist option will be only added to basic stabilization modes like Stabilized1, 2...

Title: Re: attitude configuration
Post by: supermax on April 09, 2019, 11:40:27 am
I tied to apply the coorrections you suggested but config botton remained red and gcs did not respond to the quadcopter movement any more.
I made many attempts to restore it aslo loading old functional .uav without gps but gcs was not restored.
I made an upgrade and erase and gcs move but now the op-link id is blank
I made an upgrade and erase of op-link but it is still blank.

How can i restore op-link id to copy it in controller configuration?
Title: Re: attitude configuration
Post by: supermax on April 09, 2019, 12:26:56 pm
I thought to attach the screenshot of op-link and now op-link id magicly appeared
Title: Re: attitude configuration
Post by: supermax on April 09, 2019, 04:23:50 pm
I made a new attempt.
Using a gps disabled configurazion i managed to arm the motors.
I added the gps and didn't find any combination of settings to make config botton greeen.
Then i stopped because the gcs stopped to move and there was no way to make it work again even disabling anywhere the gps.
I stop to try.
Title: Re: attitude configuration
Post by: TheOtherCliff on April 09, 2019, 08:43:23 pm
I don't understand why GCS stopped working for you.  Did you try stop and restart GCS program and unplug and replug USB?

If you tried all that, then it seems that it probably broke when you made some change to settings.  I would start over and at least try to know which setting made it break.  Report here and we will try to help.

Before using autonomous flight, it is best to get it all working and flying without GPS.  Save settings here to go back to when needed.  :)  Adding GPS and GPS flight modes requires new things to be mounted correctly, and several settings to be changed / added, and some rewiring (of high current motor power wires) and some new calibrations:
- Don't forget to press Save to save settings wherever you change them.
- Be aware that the GPS/Mag will not get power from USB.  You must have a flight battery plugged in.  Remember this when calibrating mags, setting HomeLocation, checking alarms, etc.
- For a 250 size quad you should buy a GPS that has a mag built in.  DJI/Naza type may be easiest because it only needs one cable, and you skip some problems that can happen with Pixhawk/APM/I2C mag.
- GPS/mag must be mounted correctly, level and arrow pointing forward (ignore where cable comes out), up on a pole.
- You must make a cable for the GPS/mag and plug it into an unused port on the Revo (usually MainPort or FlexiPort).
- All high current wire cables must be twisted.  Battery to connector.  Connector to power distribution board.  PDB to ESC.  ESC to motor.
- Set Hardware MainPort or FlexiPort (whichever it is plugged in) to GPS.
- Set Attitude->Settings->AttiEstAlgo to INS13.  This is needed to allow GPS flight modes.  There are some new options in next, but I use 16.09 with INS13 in my stuff right now.
- Set Attitiude->Magnetometer->MagUsage to AuxOnly
- Set Attitiude->Magnetometer->MagType to DJI (assuming you use a DJI GPS/mag)
- For DJI, leave everything else there at default, Warning/Error = .05 / .15 ; AuxMagOrientation = 0,0,0
- APM mags (Flexi or I2C) need AuxMagOrientation = 0,180,0
- Set your Flight Mode Switch to have at least Attitude mode and VelocityRoam (a GPS mode).  You will take off in Attitude and switch to VR which is very much like Attitude mode.  Just try it.
- Calibrate mag sensor.  Once you start, you must not let the quad close to the ground, or a car, or anything metal during calibration.  You should do this outdoors in an open place where you intend to fly it.  It is best to do this via OpLink telemetry, so you should consider getting OpLink telemetry working first.  I have done it successfully using battery and USB cable at the same time and keeping the USB cable away from the quad.  It might be best that regulated battery voltage (say 5.2V) is higher than laptop USB voltage (say 5.0V) so it gets it's power from battery, not USB.
- Set HomeLocation.  This is not a landing place, return to place, or otherwise important other than it needs to be where you fly.  I have flown with HomeLocation set 50km (30mi) away.  The only things that is bad is that the GCS GPS map location is wrong by several hundred meters.  Right click on GCS GPS screen where you want it to be.  A menu will come up. Select SetHomeLocation.  It will ask you for the altitude there (in meters) so you must know that.

Go outdoors away from metal and tall buildings.  Generally however tall a building is, you should stay at least that far away from it when you are close to the ground.  Power it up and connect it to telemetry via either USB or OpLink.  Both GPS and Mag must be green and then Atti and Stab will go green and then it can be armed in Attitude mode.

Alarm colors GPS:
Black block = GPS not fully configured
Red X = bad cable or no power to GPS
Red block = GPS working, but no satellites found yet (it should go orange then green within a few minutes)
Orange block = GPS working, but not enough satellites found yet (it should go green within a few minutes)
Green block = GPS working, enough satellites and low enough PDOP (a measure of max error).

Alarm colors Mag:
Black block = Mag not fully configured
Red block = Mag way out of range, not safe
Orange block = Mag somewhat out of range, won't arm, but will allow flight
Green block = Mag working OK and no metal around

You may have to calibrate the mag again if it is red when it should be green.  You should hope for (when holding quad away from ground and metal) usually green with orange once in a while.

You might find System->DataObjects->AuxMagSensor and ->GPSPositionSensor to be helpful.  You can see the sensor values move and you can see other things like GPS sat count and PDOP.

On the first flight of the day, it is best to wait say 12 minutes for GPS to download and save the almanac.  It will turn green well before that.  After that for the rest of the day, you can probably get away with 2 or 3 minutes.

After waiting for the GPS almanac, with everything working now and telemetry connected, you could also set HomeLocation from the Attitude->Settings page.  I forget exactly.  You may need to press the Clear button.  You may need to uncheck the IsSet check box and press Save.  Within a few seconds it will fill in the fields.  Press Save to save this new data.

If I haven't forgotten something, you should be able to arm in Atti mode, take off, switch to VR, adjust throttle stick to center, and it should hover where it is, like a PositionHold.  Move the sticks a little and fly it around in VR mode like it was Atti mode.
Title: Re: attitude configuration
Post by: supermax on May 05, 2019, 04:57:32 pm
Sorry for my late reply and thank you for time you spent in my question.
I was wondering if configuration problems may be due to auxiliary compass that flight comtroller never found.
I attach photos of gps board.
Title: Re: attitude configuration
Post by: TheOtherCliff on May 05, 2019, 06:06:03 pm
The 8 pin chip is an EEPROM (memory) chip.  It looks like this GPS does not have a mag chip.  There is a place for one, the small 16 pin location that is missing a chip looks like where the mag chip goes.

With a small quad like 250, you usually need aux mag since on board mag is so close to battery / motor power wires.

Next (newer version of GCS and firmware) has some options to allow you to use only 2D mag/compass which may work to allow you to use the Revo on board mag successfully in a 250, but I have not done this.  Maybe someone who has done this can help.
Title: Re: attitude configuration
Post by: jdl on May 07, 2019, 09:56:38 am
I have built some ZMR250 quads that are capable of autonomous flight. However, never managed to get a really stable GPS flight with onboard mag only, even in 2D compass mode. I guess the PDB is just too close (< 1cm) to the Revo and its mag sensor.

Seems that using auxmag for autonomous ZMR250 sized quads is mandatory. The best configuration I've achieved is: small sized and lightweight BN-220 GPS and GY-273 AuxMag on I2C bus. GPS located at the front of the top plate. GY-273 PCB is glued between the bottom plates, at the downward facing side of upper bottom plate, just behind the LED stripe on the photo. ALL cables twisted! With INS13 and 2D compass mode there aren't any problems neither with calibration, nor with GPS flight modes. No mag errors, no toilet bowls.

Beware, there are lots of fake GY-273 boards that state their sensor is HMC5883L but have QMC5883 instead. There were posts in the LP forum about that. These chips are not fully compatible. I recall there was an intent to add code to LP to support QMC5883 mags but didn't followed its progress. It may be already implemented in LP. However, reports say that QMC5883 is way more inaccurate that HMC5883L. So if you look for I2C auxmag board like GY-273, assure the chip is HMC5883L indeed. It has marking L883. If you see marking DA5883, this is QMC5883, go away!

Btw, I have a plane (MiniTalon) that flies perfectly in auto modes with no mag errors, using only internal Revo mag sensor. But there are at least 5-6cm separation between the Revo board and PDB there.