Marico

  • **
  • 52
Neutral positions on input channels and banked take off
« on: July 07, 2021, 12:23:28 am »
Hello,
I'm using Revolution board (250 quad) with an old flash 5MX radio converted to 2.4GHz (DIY Corona module).
I'm noticed that neutral (center sticks) is not always always repeatable, for an example: if roll neutral  value is set to 1537, not always that neutral value is reached when roll stick returns to own neutral position. Sometimes is 1540 or 1535, just close to selected neutral but not the same. How librepilot firmware deals with it? I can't see any option like "close values to neutral ​​treat as neutral" to make sure that is not a problem (I know there is a "deadband" option but I think this is not a deadband case). My question is based on some observations durning flight: in attitude mode quad often do not return to leveled position after roll or pitch and stays a bit banked or "nose" up/down which couse a little drift and I need to correct roll/pitch to force it to level. Could  such neutral "fluctuations" couse a problem with not returning to leveled position?

My second question is about take off problems (attitude mode). My first board was a CC3D and take off with it was smooth. When I replaced it with Revolution I faced take off problem: quad always take off banked to right/strong drift to right. It need strong roll left to take off  properly, but immediately after take off  about 6 feet above ground (when roll returns to neutral) it hover without drift to left. What causes this problem?

M.

Re: Neutral positions on input channels and banked take off
« Reply #1 on: July 07, 2021, 06:51:18 am »
There is a deadband option and I believe that is what you want to adjust.  I've never had to change it from default, so I don't have experience with it.

But... 1535 to 1540 is such a small amount different than 1537 that you absolutely would not see this fraction of a degree.  That said, I do adjust my "Rotate Virtual..." to a fraction of a degree to get the drift as low as possible, but it is not something that you can see other than the drift it causes.

Do you see the quad angle is not level?  If so it is probably something else, since a fraction of a degree from level is nigh impossible for a human to see.

There are several things that can cause banked takeoff that smooths out a little later, or not returning to level after flying around:
- Taking off from a slope
- Trying to "help it" stay level during takeoff
- Disabling "Zero the Integral" in the Stabilization tab.
- Poorly tuned PIDs
- Bad sensor calibrations
- Crash damage where the motors are not all pointing straight up.
- Loose motor(s) / cracked arm so that the motor points a little different direction when powered.
- Loose FC mounting that can tilt a little.
- Props out of balance (makes some sensors go crazy and it is worse at certain RPM)
- Using a vibration mount for the FC for me causes more problems than it fixes.  There is a certain RPM where the vibration is magnified because of the rubber mounts.

Generally: Enable "Zero the Integral". Take off from level ground if possible. but if you take off quickly, even the side of a hill is not a big issue.  Take off immediately after starting the motors (arming).  Jump it up to knee high at least.  Don't take off slowly.  In Attitude mode, don't touch the roll/pitch sticks until you are in the air.

Often, roll and pitch "I" term is not high enough if it will not hold your stick pitch angle during forward flight.  I recommend that you try AutoTune to see if different / better PIDs helps.

My experience with Basic/Complementary AttiEstAlgo seems is not real good at holding a bank angle for a long time.  All my quads have a GPS and use GPS Nav (INS13).  You could try INS13Indoor which doesn't need a GPS.  I haven't tried it.

Consistently strong right bank at takeoff (if taking off quickly after starting motors) might be a sensor calibration problem.  I would try recalibrating the sensors.

Marico

  • **
  • 52
Re: Neutral positions on input channels and banked take off
« Reply #2 on: July 07, 2021, 10:22:56 am »
There is a deadband option and I believe that is what you want to adjust.  I've never had to change it from default, so I don't have experience with it.

I thought deadband is for ignoring small amount of changes in all range (by analogy to mechanical loose in steering system) but not related with detecting neutral range in such cases.

There are several things that can cause banked takeoff that smooths out a little later, or not returning to level after flying around:
- Taking off from a slope
- Trying to "help it" stay level during takeoff
- Disabling "Zero the Integral" in the Stabilization tab.
- Poorly tuned PIDs
- Bad sensor calibrations
- Crash damage where the motors are not all pointing straight up.
- Loose motor(s) / cracked arm so that the motor points a little different direction when powered.
- Loose FC mounting that can tilt a little.
- Props out of balance (makes some sensors go crazy and it is worse at certain RPM)
- Using a vibration mount for the FC for me causes more problems than it fixes.  There is a certain RPM where the vibration is magnified because of the rubber mounts.

I think there is no mechanical problem, as I mentioned earlier I just replaced cc3d with revo and quad takes off OK with the cc3d, so I think there some problems with my revo's sensors and/or PID tuning. "Zero the Integral" is checked. Sensors are calibrated, mag show max 2% (Mag is green before take off). I have installed OP GPS and tried fly with INS13 but it's impossible even to take off, quad flips or fall bank immediately after throttle increase (GPS has steady fix).
Flying with complementary+mag gives chilling experiences witch sudden flips or changes with directions, so I suspect on board magnetometer has problems with wiring, FC is too close to power distribution PCB (10 milimiters below it) etc...

Take off from level ground if possible. but if you take off quickly, even the side of a hill is not a big issue.  Take off immediately after starting the motors (arming).  Jump it up to knee high at least.  Don't take off slowly.  In Attitude mode, don't touch the roll/pitch sticks until you are in the air.

But starting without "little help" could big drift, jumps to the left.
I read Your "prepare for first fly"  hints/recommendations and "fast take off" recommendation very surprised me. I instinctively always try to gentle take off to avoid unexpected flips or hits when something goes wrong, fast take off would be a big challenge to me  :D. With cc3d slow takes off was w/o problems so I was used to take off in this way.


Often, roll and pitch "I" term is not high enough if it will not hold your stick pitch angle during forward flight.  I recommend that you try AutoTune to see if different / better PIDs helps.

My experience with Basic/Complementary AttiEstAlgo seems is not real good at holding a bank angle for a long time.  All my quads have a GPS and use GPS Nav (INS13).  You could try INS13Indoor which doesn't need a GPS.  I haven't tried it.

Currently only Basic algorithm works for me and I fly only with attitude mode, I'm not ready for rate mode yet, still practicing.
During fly my quad is quite stable, banking angle durning forward flying is stable, sometimes it wobbling durning returning to neutral level but not always. BTW I can't find any howto/info what is INS13 mode or INS13Indoor, I guess is related to GPS but  how it works in detail?
Edit:
I tried AutoTune  but whole process is too long, durning shaking quad drifts a bit far away and I have to switch it off and  fly back to start position. Documentation says that AutoTune needs ~60s to complete but it's too long for me... The documentation is not clear for me: can I touch sticks/ throttle  to prevent dirft away durning tuning or not??

I wonder is it possible to tune revo with 250 frame to fly steady as a rock like commercial drones? Without drifting, with holding altitude without swinging, with slow and gentle take off etc..?
« Last Edit: July 07, 2021, 06:05:47 pm by Marico »

Re: Neutral positions on input channels and banked take off
« Reply #3 on: July 07, 2021, 08:32:25 pm »
To add to list:
- mismatched motors, props, ESCs, ESC calibration, anything that causes a different amount of thrust in one or more motors causes some tipping until the PID "I" term adjusts for it over the course of typically a second or two.
[/quote]

I thought deadband is for ignoring small amount of changes in all range (by analogy to mechanical loose in steering system) but not related with detecting neutral range in such cases.
Deadband only removes small changes that are near neutral.  If you use 25% stick (anything outside the deadband) plus or minus a hair, the hair is acted on as if there is no deadband.

Sensors are calibrated
Maybe calibrated incorrectly so I suggest to recalibrate.  The worst thing is that recalibrate may be a waste of time.

mag show max 2% (Mag is green before take off).
Mag is not used with Basic/Complementary (no mag) AttiEstAlgo, but is used with INS13

I have installed OP GPS and tried fly with INS13 but it's impossible even to take off, quad flips or fall bank immediately after throttle increase (GPS has steady fix).
Assuming you were using Attitude mode, this is a big hint that something is actually wrong.  It is not good to use GPS flight modes for takeoff if you sit on the ground with motors running.  The GPS position changes and it tries to move to new GPS location while it is still stuck to the ground.  Use Attitude mode (with manual throttle) for takeoff.

Flying with complementary+mag gives chilling experiences witch sudden flips or changes with directions, so I suspect on board magnetometer has problems with wiring, FC is too close to power distribution PCB (10 milimiters below it) etc...
This is a very large hint.  If complementary (no mag) is OK, then there is a problem with the mag.  It is recommended to not use the "on board" mag especially with small (say less than 450) quads.  Part of mag (and thus GPS) setup is to get all motor power wiring well twisted and without this, the mag fields from the wiring completely overpower the weak earth mag field.  It is generally recommended to use "aux only" mag (mag built into GPS) for all electric models.

But starting without "little help" could big drift, jumps to the left.
Even when using Attitude with Basic / Complementary (no mag)?

I instinctively always try to gentle take off to avoid unexpected flips or hits when something goes wrong, fast take off would be a big challenge to me.
It should not be scary.  Small throttle blips up and back to zero.  Starting small blips and getting bigger and bigger helps you know how much power it needs to take off.

Currently only Basic algorithm works for me and I fly only with attitude mode, I'm not ready for rate mode yet, still practicing.
I confess that I use mostly Attitude mode for my quads because I am mainly interested in GPS flight modes.  :)

What is INS13 mode or INS13Indoor, I guess is related to GPS but  how it works in detail?
INS13 uses a high tech computer code that uses all data from all sensors as input and produces position, attitude, and velocity as output.  For instance, even the 3D mag is fully used to help know which direction is up.  It works by constantly updating a list of values for all 13 output numbers.  There is a weight table that says which sensor should be believed more if they disagree (sensors should not disagree much or there is a problem).  For instance GPS altitude is known to have a fairly large error.  Barometer altitude has a much smaller error, but it is not accurate over a long time period such as when the weather changes.  Baro altitude (even with a good hard coded correction table) changes a lot from day to day.  So for altitude, the GPS is believed over the long time frame, but the baro is believed over the short time frame, and these two sensors are "fused together" to give an altitude number that is better than either one alone could give.

I tried AutoTune  but whole process is too long, durning shaking quad drifts a bit far away and I have to switch it off and  fly back to start position. Documentation says that AutoTune needs ~60s to complete but it's too long for me... The documentation is not clear for me: can I touch sticks/ throttle  to prevent dirft away durning tuning or not??
Yes, sticks are enabled and you should keep it close with small smooth stick motions.

I wonder is it possible to tune revo with 250 frame to fly steady as a rock like commercial drones? Without drifting, with holding altitude without swinging, with slow and gentle take off etc..?
Revo with Basic/Complementary(no mag) runs code that is similar to CC3D and should act like CC3D.

================================================

If you post your settings (File -> Export UAV Settings ... with Revo plugged in) as an attachment.  I/we can look at them to see if I see anything strange.  Maybe even put them in a quad to see if they fly for me.
« Last Edit: July 07, 2021, 08:36:40 pm by TheOtherCliff »

Marico

  • **
  • 52
Re: Neutral positions on input channels and banked take off
« Reply #4 on: July 07, 2021, 11:33:06 pm »
OK, thank You for all hints.
I tried AutoTune again (now with touching sticks during fly) and WOW  :D. After tuning quad is much stable, no more wobbling or oscillating during fly and during fast descent.
But take off is still banked to right, even if I try fast take off as you recommended. When I add throttle in the air quad little banks to right, too.
I think problem is with the replaced motor, I've replaced SW motor a while ago (crash broke stator windings). New motor has same type/KV  (2204 2300KV) but different brand and I think it could give a bit more thurst that others... Is it possible to reduce SW power in configuration? The plan B is replace NE motor for compensation...
Anyway the strange thing is with that replaced engine CC3D has no problems. When I switched to Revolution suddenly it starts banking. 
The next problem is the mag. How can I recognize GPS with mag? I bought this one:

https://www.ebay.com/itm/283891542510

It was detected by FC  but configuration says "AuxMag not found" :(

The last my question is about GPS Assit function, when I select it and click Save I get red "config error". Why? GPS Assist needs selected INS13 in attitude config algo?

INS13 uses a high tech computer code that uses all data from all sensors as input and produces position, attitude, and velocity as output.  For instance, even the 3D mag is fully used to help know which direction is up.  It works by constantly updating a list of values for all 13 output numbers.  There is a weight table that says which sensor should be believed more if they disagree (sensors should not disagree much or there is a problem).  For instance GPS altitude is known to have a fairly large error.  Barometer altitude has a much smaller error, but it is not accurate over a long time period such as when the weather changes.  Baro altitude (even with a good hard coded correction table) changes a lot from day to day.  So for altitude, the GPS is believed over the long time frame, but the baro is believed over the short time frame, and these two sensors are "fused together" to give an altitude number that is better than either one alone could give.

And what about INS13Indoor?

I attached my UAV settings, AutoTuned PIDs are in Bank 3.


Marico

  • **
  • 52
Re: Neutral positions on input channels and banked take off
« Reply #5 on: July 08, 2021, 01:46:23 am »
I have installed OP GPS and tried fly with INS13 but it's impossible even to take off, quad flips or fall bank immediately after throttle increase (GPS has steady fix).
Assuming you were using Attitude mode, this is a big hint that something is actually wrong.  It is not good to use GPS flight modes for takeoff if you sit on the ground with motors running.  The GPS position changes and it tries to move to new GPS location while it is still stuck to the ground.  Use Attitude mode (with manual throttle) for takeoff.

So how use GPS flight modes after take off without set attitude algo to INS13? I think (correct me if I wrong) any GPS mode (doesn't  matter which fly mode select it) need INS13 algo. Selecting any GPS mode without INS13 algo gives me red "config error" warning  in Input-> Flight Mode Switch Settings.

According to GPS assist help:

https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058685/Gps+assist

it doesn't say that  INS13 algo is required to select it....
« Last Edit: July 08, 2021, 02:02:09 am by Marico »

Re: Neutral positions on input channels and banked take off
« Reply #6 on: July 09, 2021, 02:10:50 am »
I tried AutoTune again (now with touching sticks during fly) and WOW  :D. After tuning quad is much stable, no more wobbling or oscillating during fly and during fast descent.
:)

But take off is still banked to right, even if I try fast take off as you recommended. When I add throttle in the air quad little banks to right, too.
I think problem is with the replaced motor, I've replaced SW motor a while ago (crash broke stator windings). New motor has same type/KV  (2204 2300KV) but different brand and I think it could give a bit more thurst that others... Is it possible to reduce SW power in configuration? The plan B is replace NE motor for compensation...
Two strong motors on diagonally will affect yaw.  It will spin a little (instead of bank) when you add or remove power.

I measure the motor KV when I buy them.  Sometimes from cheap places like eBay the seller mixed them up and I get a KV1500 in with a batch of KV1000, etc., or a just a range of slightly different KV.  I match them together when I build a new quad.

I would:
- recalibrate ESC's and retest
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058743/ESC+Calibration?search_id=0354dc6e-a060-4a45-ac08-3ae6d47bbcd8
- if that doesn't fix it, you can reduce the "max" for that motor on the output page if that motor is stronger, or reduce all other maxes if it is weaker.  I think it is supposed to proportionally rescale the whole output range if you reduce the max of one motor, but not sure without checking the code.

Anyway the strange thing is with that replaced engine CC3D has no problems. When I switched to Revolution suddenly it starts banking. 
ESC's can loose calibration in some cases.

The next problem is the mag. How can I recognize GPS with mag? I bought this one:

https://www.ebay.com/itm/283891542510

It was detected by FC  but configuration says "AuxMag not found" :(
That GPS does not have a mag.  If you buy a DJI/Naza GPS or if you buy an OP GPS Platinum (no longer available), it puts GPS and mag on a single connector.  Otherwise you must buy a GPS that says it has mag and has 2 connectors.  I recommend DJI/Naza GPS like this (I have not bought this one).
https://www.ebay.com/itm/224196412911

Some aux mag info:
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/18382863/Aux+Mag+Setup+and+Calibration?search_id=0354dc6e-a060-4a45-ac08-3ae6d47bbcd8

The last my question is about GPS Assit function, when I select it and click Save I get red "config error". Why? GPS Assist needs selected INS13 in attitude config algo?

And what about INS13Indoor?
For 16.09 GPS Assist needs INS13.  Basically it needs to be able to fly GPS flight modes.

------------------

Got to go...

Marico

  • **
  • 52
Re: Neutral positions on input channels and banked take off
« Reply #7 on: July 10, 2021, 07:25:58 pm »
I would:
- recalibrate ESC's and retest

I did it and take off banking magically gone! I was skeptical about recalib because only at first time recalibration process was as described in the manual: max all ESC's - battery on - wait for first beep - fast home key - after a while was a couple of beeps. Following tries (to start over recalibration) sounds different. Immediately after first beep was the second one, no matter how fast I try hit the home button after the first beep. So I thought that maybe my ESC's are not configurable at all with this method. Anyway now take off is stable and smooth.
But still I have problems with mag. During waiting for delivery an external mag I played with build in. I twisted all wires (motors, battery). I recalibrated mag many times. Now it stays green even when motors runs but flying with INS13 algo with Attitude mode is still unstable. Quad won't level horizontally, often banks left or rights. When switched to fly mode with gps assist (still attitude mode) quad immediately increase throttle and jumps up, when I reduce throttle it swings and drifts in any directions (GPS has strong 3d fix with 7 sats). I have telemetry (I recorded logs during tests) and I think (as I remember) mag was green all the time.  I noticed that GPS works only with 9600 bps and Revo can't change it to faster speeds (don't know why), maybe 9600 is too slow for proper data processing?

 


Re: Neutral positions on input channels and banked take off
« Reply #8 on: July 11, 2021, 12:39:20 pm »
I assume that you are flying Attitude mode.  If it smooths out when you use Basic AttiEstAlgo, then it is usually a mag problem.

Altitude (baro) is another hurdle to overcome.  You must cover the baro chip snugly with open cell foam.  If you don't, it will climb rapidly and when you get it to stop climbing it will descend quickly and crash if you don't switch to a Manual throttle mode.  The baro chip is used in all GPS flight modes and any time you select Altitude Hold or Altitude Vario for thrust mode.

For uBlox GPS's that can change the baud rate, Revo will automatically change the GPS baud rate to whatever it is configured at in the setup.

Marico

  • **
  • 52
Re: Neutral positions on input channels and banked take off
« Reply #9 on: July 11, 2021, 01:54:13 pm »
Altitude (baro) is another hurdle to overcome.  You must cover the baro chip snugly with open cell foam. 

Is it necessary even when FC  is enclosed in a plastic case?
Edit:
When I opened the case I figured out that foam is already there...
« Last Edit: July 11, 2021, 02:12:42 pm by Marico »

Re: Neutral positions on input channels and banked take off
« Reply #10 on: July 11, 2021, 07:03:14 pm »
Yes, even needed inside the case and inside of a dome (that leaks air where the wires go through).