LibrePilot Forum

Users => Vehicles - Helicopters => Topic started by: karla on November 16, 2017, 01:30:56 am

Title: GPS assist and Heli
Post by: karla on November 16, 2017, 01:30:56 am
Doesn't GPS assist work for Heli vehicles?
I get a red config error on the flight mode setting as soon as I change to gps assist.

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6886;image)

I am using a Revo with Librepilot 16.09. Think I have used GPS assist before on another Heli with no problem...
Maybe something else is causing this?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 16, 2017, 04:16:36 am
Do you have INS13 for Attitude->Settings->AttEstAlgo
and mags calibrated
and HomeLocation set

all these are required for GPS use (other than OpMap)

It should work with CruiseControl, but you could try changing that too.
Title: Re: GPS assist and Heli
Post by: karla on November 16, 2017, 06:18:41 am
INS13 yes,
Homelocation set yes,
Mags are calibrated, but at the moment in-house and no sats of course and mags mostly red inside, should still be possible to set the GPS assist.
Have already tried all options for the thrust setting, but no change.
Odd...

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6888;image)

it say the mag source is invalid here ...

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6888;image)

But in the system it seems Valid...

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6890;image)
Title: Re: GPS assist and Heli
Post by: f5soh on November 16, 2017, 07:27:16 am
This is the normal behavior, only Multirotors frames allow "GPS assisted" flight modes.
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 16, 2017, 07:31:09 am
Hmmm.  I always assumed that helis could be configured like quads.

I knew there was a problem in that it does not control both motor and collective, but that is a different story.  We need a mix curve for that and the thrust channel should control both motor and collective via the new mix curves.
Title: Re: GPS assist and Heli
Post by: karla on November 16, 2017, 07:39:01 am
Oh  :'(
I can live without GPS assist i guess, but it's very useful and simplifies flying especially for FPV/Photo missions, like my current project.
Title: Re: GPS assist and Heli
Post by: f5soh on November 16, 2017, 07:02:34 pm
You can use VelocityRoam as well ?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 16, 2017, 09:43:17 pm
Uhhh...

So VelocityRoam is allowed on a heli, but GPS Assist is not allowed?  That doesn't make sense from my viewpoint...
Title: Re: GPS assist and Heli
Post by: karla on November 17, 2017, 08:04:32 am
Yes, VelocityRoam does not give a red error on the config page.

VelocityRoam
Hold position, and control it with stick inputs
Position is adjusted in vehicle's own orientation, pitch forward makes vehicle go forward
See also Gps assist page for something similar.

This description is a bit short for me.
Is it like GPS assist but without the break sequence?
If i let go of sticks, will it hold current position and hover?

Good thing is that Position hold, RTB and Pathplanner works for a Heli.
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 17, 2017, 10:11:37 am
Yes. Velocity Roam with neutral sticks is Position Hold.

It is a lot like Attitude mode with GPS Assist.
Title: Re: GPS assist and Heli
Post by: karla on November 17, 2017, 10:27:06 am
Thanks, great, then I will explore that.
In a way i wonder like you why the gps assist can't work for a heli, but my question is more academic...
Title: Re: GPS assist and Heli
Post by: f5soh on November 17, 2017, 07:19:46 pm
Uhhh...
So VelocityRoam is allowed on a heli, but GPS Assist is not allowed?

Yes, you're right  ???
That's a known "issue" since some time now: https://librepilot.atlassian.net/browse/LP-375
The only cause of GPSAssist only enabled for Multirotors is a lack of testers with Heli + GPS and Heli vehicles in general. Look Heli tab story.
Title: Re: GPS assist and Heli
Post by: karla on November 17, 2017, 11:38:49 pm
The only cause of GPSAssist only enabled for Multirotors is a lack of testers with Heli + GPS and Heli vehicles in general. Look Heli tab story.

Oh, but I can test it on a Trex450L with a revo.
How do I go about that?
In the link you just posted you ask Volker to first start a Forum thread, but I can't see he ever did.
Can we use this thread instead?
Title: Re: GPS assist and Heli
Post by: f5soh on November 17, 2017, 11:58:42 pm
Try setting the FlightModeSettings > DisableSanityChecks to True, this may help as a start.
Be safe...
Title: Re: GPS assist and Heli
Post by: karla on November 18, 2017, 12:33:19 am
Okay and then I just try using it and report back here, right?
I have a quad that I could test at the same time so there is something to compare with.
Title: Re: GPS assist and Heli
Post by: f5soh on November 18, 2017, 09:45:44 am
You need to test the PositionHold first, be sure is solid without toilet bowling in all cases.
Be prepared to go back in Attitude mode if something wrong occurs.

Title: Re: GPS assist and Heli
Post by: karla on November 18, 2017, 10:36:35 am
Tried position hold today - toilet bowl  ::)
Whats the first actions to fix it?
The mags and calibration looks good, but I noticed the compass is spinning round.

Title: Re: GPS assist and Heli
Post by: f5soh on November 18, 2017, 12:52:03 pm
Toilet bowling means the heli do a correction of position, but not in the right direction/heading.
Can be a mag disturbed by strong currents or wrong orientation of AuxMag.

Be sure the Mag alarm still green while main motor is running at full load.
Set Mag usage to AuxMag only and keep away your GPS/Mag away from strong currents.
Twist all power wires or at least keep red/black wires close together.
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 19, 2017, 12:43:20 am
aux mag orientation is important

look at Flight Data page.  Is PFD stable or is it flipping around violently, like completely upside down and flipping around like a fish out of water.
Title: Re: GPS assist and Heli
Post by: karla on November 19, 2017, 05:05:27 am
Thank you both.
I will double check all what you mentioned and test in the field later today.

Just want to confirm something.
The Revo board is mounted inside the Trex frame, on one of the sides and therefor needs to be virtually rotated like this:

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6918;image)

But the external mag is a OP v9 GPS (kind of) and mounted pointing forward on the tail boom, so it should be rotated 0,0,0. Now, does the fact that the Revo and the external Mag are mounted differently make a problem for the mags to align and the INS13 attitude estimation algorithm?

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6924;image)

In the PFD the model is turning correctly when I move the heli around, yaw left right, pitch and roll. The fc also make compensations in the correct directions.

To further complicate this a bit, is the compensation of 5 degrees roll I use to make this heli hover at zero stick input (the tail rotor effect). This is how I set it up.
First a put in the virtual rotate the board in the Attitude | Settings, then using complementary attitude estimation algorithm I do the Board level calibration. Then I fly it in Attitude mode and adjust the BoardLevelTrip roll and pitch until it hovers without any stick input.
After this I change to INS13 and hover in attitude mode and adjust the external mag rotation to hover without any stick input. As good as it allows.
Maybe there is a better procedure?

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6922;image)

In the field, the external mag is always green and internal mag at warning or red. I have not worried so much that they don't align since the internal mag is almost always wrong... should I?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 19, 2017, 05:37:32 am
Different FC vs. aux mag orientations is fine if you configure it correctly; just remember that the angles (FC and uax mag) are relative to the driftless Attitude mode hover orientation.  I have to scratch my head and check the code or read wiki and extrapolate/empirical when doing strange FC mounting.  If the PFD moves correctly (including roll left makes PFD go right) and stabilization moves in the correct direction, then you have  proven it is correct.

Level hover:  That is the way I set it up:  RotateVirtual (Attitude mode using CF/Basic) and aux mag orientation trimming (Attitude mode using INS13).  It makes sense and I haven't found anyone to say it wasn't the way to do it if you want it perfect.

That OnBoard mag does really look bad.  Is there a magnet close by the FC?

I sometimes use an FC or GPS/mag sitting still on the wooden table and view a mag sensor (not mag state) scope while I move the thing under test close to it.  If there is a mag field in the thing, this will show you.  It will also show you how close you can get before the mag sensor is affected.  This helps when deciding how far the aux mag needs to be away from component X.  You could move the heli FC close to the table FC and look for a change...
Title: Re: GPS assist and Heli
Post by: f5soh on November 19, 2017, 11:17:00 am
Quote
Level hover:  That is the way I set it up:  RotateVirtual (Attitude mode using CF/Basic) and aux mag orientation trimming (Attitude mode using INS13).  It makes sense and I haven't found anyone to say it wasn't the way to do it if you want it perfect.

Latest INS13 used in Next will not need anymore this level of precision because Mag will not contradict the roll+pitch estimate derived from accelerometers. Complementary+Mag+GPS can be used as well using Next.

@karla Can you post your config file ?
Title: Re: GPS assist and Heli
Post by: karla on November 19, 2017, 11:19:00 am
I sometimes use an FC or GPS/mag sitting still on the wooden table and view a mag sensor (not mag state) scope while I move the thing under test close to it.  If there is a mag field in the thing, this will show you.  It will also show you how close you can get before the mag sensor is affected.  This helps when deciding how far the aux mag needs to be away from component X.  You could move the heli FC close to the table FC and look for a change...
Thanks. I will remember this one.
K
Title: Re: GPS assist and Heli
Post by: karla on November 19, 2017, 11:24:43 am
That OnBoard mag does really look bad.  Is there a magnet close by the FC?

I know, its really messy inside the heli, power cables close, 600mW FPV transmitter back to back and OSD board 2 mm away plus a Video source switch. The onboard mag is doomed and forever confused :) Forget him.
Title: Re: GPS assist and Heli
Post by: karla on November 19, 2017, 12:02:21 pm
I checked all things you mentioned
. Aux mag mounted correct way - yes forward looking
. Aux mag orientation okay (0.0.0) - yes
. Mag only Aux - yes
. Mag green - yes
. Mag green at full throttle - yes still at 0.0-1.5% error
. PFD horizon not jumping around like fish without water - calm when good # of sats, bit jumpy when less.
. Alignment of Onboard and Aux mag - well, when onboard gets better then alignment better so I don't worry.

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6926;image)

First when I got to the field I had, smack 11 sats on 3 minutes! flew one lipo pack.
Next round I had to wait for 45 min get a 3D position, and not a very good one. Flew another lipo pack.

I could only engage Position hold mode for some seconds each time since it was obviously not going well, and I want to regain control before out of control. It was typically first reducing throttle and then increasing it and then compensating too much, too abrupt with pitch backwards, then I did not want to experience more of that but bailed out ...

When sats where good then the flight with Attitude was much smoother and just like flying with Complimentary. When sats where just barley ok then flying was unpredictable and not locked in.

I am not using Next now but LP 16.09.

@Laurent,
Attached is the oav file and one log file where I engage Position hold some 3 times very short.

My own thinking is that the mags a pretty okay, the sats and my GPS might be crappy and maybe I should just try to calibrate my PIDs better, since now they are very laxed and could get much more snappy.
Any other settings to make the position hold adjustments not so violent?
Title: Re: GPS assist and Heli
Post by: f5soh on November 19, 2017, 12:50:46 pm
You may switch to Next and get rid of INS13 / 3D Mag issues in 16.09 and also made possible Complementary+Mag+GPS usage.

First at all, did you try a simple Attitude stabilization + AltitudeVario/AltitudeHold ?
Try setting the SystemSettings > ThrustControl to Collective maybe.
In all cases the Stabilization tab > AltitudeHold settings will need some tuning.

You can also set SystemSettings > VtolPathFollowerSettings > ThrustControl to Manual so you will remove the Throttle changes while switching to PositionHold and only check the position behavior (and possible toilet bowling)

Simple check about Mag: point the Heli to the North and check if the compass matches heading in PFD.
Title: Re: GPS assist and Heli
Post by: karla on November 20, 2017, 03:22:04 am
Thanks, that was a bunch of good tips.
When this is reasonably resolved I will come back to the GPS assist, I could not enable it even though I disabled the sanity check of the flight modes. Its due to an Error of the ? -symbol (config), that prevents it from arming.
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 20, 2017, 04:14:29 am
Quote
Level hover:  That is the way I set it up:  RotateVirtual (Attitude mode using CF/Basic) and aux mag orientation trimming (Attitude mode using INS13).  It makes sense and I haven't found anyone to say it wasn't the way to do it if you want it perfect.

Latest INS13 used in Next will not need anymore this level of precision because Mag will not contradict the roll+pitch estimate derived from accelerometers. Complementary+Mag+GPS can be used as well using Next.

I remember hearing about that.  Is it an option to use 2D vs. 3D mags?  I imagine that 3D mags are better in the following use case which (as I imagine) causes problems in Basic/CF AttiEstAlgo and now will cause the same problem in INS13:

Fly a quad in Attitude mode for a long time in a straight line using forward pitch stick (like flying 2km FPV).  After a while, you must add more and more pitch to keep it flying forward.
Title: Re: GPS assist and Heli
Post by: f5soh on November 20, 2017, 10:26:54 am
Quote
Fly a quad in Attitude mode for a long time in a straight line using forward pitch stick (like flying 2km FPV).  After a while, you must add more and more pitch to keep it flying forward.
Think when you are in a train, after the acceleration phase at start and when speed is stabilized for hundreds of kilometers in a straight line:
- do you fell horizontal acceleration ?
- do you need to bank your body to compensate something ?
- when you take a drink, liquid surface is inclined ?
In my opinion this situation do not cause any issues.

One known situation is when you are flying circles for some time, due to centrifugal forces.
Title: Re: GPS assist and Heli
Post by: f5soh on November 20, 2017, 11:24:39 am
Quote
When this is reasonably resolved I will come back to the GPS assist, I could not enable it even though I disabled the sanity check of the flight modes. Its due to an Error of the ? -symbol (config), that prevents it from arming.
Maybe you are trying to arm while the flightmode switch is one GPS/GPSAssisted mode ?
You must choose one flightmode with only primary stabilization for arming.
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 20, 2017, 04:48:05 pm
Quote
Fly a quad in Attitude mode for a long time in a straight line using forward pitch stick (like flying 2km FPV).  After a while, you must add more and more pitch to keep it flying forward.
In my opinion this situation do not cause any issues.

I'm just saying that there should be an option to allow it to heading only or 3D mag with the new INS13 ... if there is not currently an option.

If I understand Basic AttiEstAlgo...

I know that most advanced FPV fliers don't use Attitude mode, but beginners do.  This would also be an issue when hovering in a constant wind for a long time (with the same compass heading).  You need more and more stick to counteract the wind.  That's not right.

It seems to me that needing more and more stick (or a similar issue that comes from flying continuous coordinated circles) is wrong (I know it's hard to fight this issue) ... and that always needing the same amount of stick to get the same bank angle is right.  And if my understanding is correct, then an INS13 with a 3D mag will be better at doing this correctly than an INS13 with a heading only mag.
Title: Re: GPS assist and Heli
Post by: f5soh on November 20, 2017, 05:13:26 pm
Quote
This would also be an issue when hovering in a constant wind for a long time (with the same compass heading).  You need more and more stick to counteract the wind.  That's not right.
Flying in a constant wind changes nothing to the Attitude estimation, simply need bank angle or more bank angle than expected if moving for a multirotor. There is no issue here.
Put your quad in a car and go to the highway, run at stabilized speed for 10km. Is the Attitude (complementary) wrong after a while ?

Quote
It seems to me that needing more and more stick (or a similar issue that comes from flying continuous coordinated circles) is wrong (I know it's hard to fight this issue) ...
You can easily reproduce the issue with complementary, attach your quad to a 3m rope and do turns around you for some time.
A carousel for kids can be used as well.
Title: Re: GPS assist and Heli
Post by: karla on November 21, 2017, 07:10:42 am
Maybe you are trying to arm while the flightmode switch is one GPS/GPSAssisted mode ?
You must choose one flightmode with only primary stabilization for arming.

Nope, I use mode stab5 and stab4 got the GPS assist.
Any other possible reason?
Title: Re: GPS assist and Heli
Post by: f5soh on November 21, 2017, 08:56:34 am
Maybe remove CruizeControl in Stab4

You should do testing in this order:
- basic AltitudeVario
- PosHold
- VelocityRoam and others modes
- GpsAssist

GPSAssist is the latest step and can be properly enabled Heli at end.
Title: Re: GPS assist and Heli
Post by: karla on November 21, 2017, 09:04:20 am
Thanks.
I will try it in that order.
I have tried with all possible combinations for the thrust setting on stab4
- no change, same error.
Will take me a while to get to GPS assist it seems :) so no hurry
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 21, 2017, 10:42:02 am
Quote
This would also be an issue when hovering in a constant wind for a long time (with the same compass heading).  You need more and more stick to counteract the wind.  That's not right.
Flying in a constant wind changes nothing to the Attitude estimation, simply need bank angle or more bank angle than expected if moving for a multirotor. There is no issue here.
Put your quad in a car and go to the highway, run at stabilized speed for 10km. Is the Attitude (complementary) wrong after a while ?

Attitude mode: Hovering in wind in one place at same heading is exactly the same as flying in a straight line for the same length of time, so it is not just FPV that has this issue.  Hovering in the wind would need more and more stick the same way as a long straight flight with no turns.  This is also the same issue as using transmitter trims (instead of Rotate Virtual) to adjust level Attitude mode hover.

This of course assumes I am correct about how Attitude mode works.
Title: Re: GPS assist and Heli
Post by: f5soh on November 21, 2017, 06:19:15 pm
Quote
Hovering in the wind would need more and more stick the same way as a long straight flight with no turns.
Still no issue.

Why more and more stick input ?
What's the limit ?
There is a point where you cannot counteract the wind due to a limited attitude response ?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 22, 2017, 05:10:11 am
Maybe asking a question will help.  If you only use Attitude mode, can you use transmitter trims to stop/reduce the drift or do you need to keep adjusting the trims?
Title: Re: GPS assist and Heli
Post by: f5soh on November 22, 2017, 07:22:20 am
There is already plenty of questions before.
Can you explain why there is a issue flying in a straight line and no issue flying circles using complementary ?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 22, 2017, 08:33:44 am
(Attitude mode) They are both problems.  It sounded like you agree there is a problem when flying in circles, but not that there is a problem when flying for a long time in a straight line, which is the same as hovering in the wind, which is the same as using transmitter trims to stop drift.

In my opinion this situation do not cause any issues.
Title: Re: GPS assist and Heli
Post by: karla on November 22, 2017, 01:26:36 pm
You should do testing in this order:
- basic AltitudeVario
- PosHold
- VelocityRoam and others modes
- GpsAssist

Today basic AltitudeVario completed reasonably well.

It was very gusty winds today and a heli is really sensitive in vertical stab with sudden gusts gives a strong lift on the rotor. So, it was not ideal, but I think it kept altitude reasonably well. Did some adjustments on the Stabilization-Altitude page, but it had limited impact. What had more impact was to adjust the combination of throttle and pitch curves on the transmitter around where hover takes place. Also checked the barometers, they seem okay and fluctuate in less than 1 meter. Next time I will redo it to make sure.
Title: Re: GPS assist and Heli
Post by: karla on November 22, 2017, 02:53:54 pm
Did some adjustments on the Stabilization-Altitude page, but it had limited impact.
What had more impact was to adjust the combination of throttle and pitch curves on the transmitter around where hover takes place.

I have a suspicion here:
the FC in AltitudeVario/AltitudeHold is trying to correct altitude just by altering the thrust, and not by changing the collective pitch of the heli.

This would be logical, its a mode to be set for the thrust.
Also, since both throttle- and collective pitch curves are defined in the transmitter (in my case), there would be no way for the FC to know what pitch to change into, since the pilot is not changing the sticks.

Can anyone confirm if this is how it works?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 22, 2017, 06:37:22 pm
It's my understanding that that is a current deficiency in LP...  The FC will only control throttle or collective, but not both.

It would be fairly simple to add a curve and have the thrust channel control both throttle and collective, but no one has done this...  Sorry.

Do you have open cell foam covering the baro sensor?  That is needed to keep air gusts from affecting baro sensor readings too much.
Title: Re: GPS assist and Heli
Post by: f5soh on November 22, 2017, 07:55:40 pm
Quote
(Attitude mode) They are both problems.  It sounded like you agree there is a problem when flying in circles, but not that there is a problem when flying for a long time in a straight line, which is the same as hovering in the wind, which is the same as using transmitter trims to stop drift.

Yes, there is a issue with attitude estimation using complementary when flying in circles.
Flying in a straight line should not cause issue with complementary, if there is a issue in this situation it should be great if you can explain why.
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 23, 2017, 02:05:36 am
Do you agree that there is a problem with using transmitter trims to correct drift in Attitude mode (even when Attitude is the only mode you use)?  I know that changing trims for Attitude mode will mess up Rate mode but that is not what I am talking about.
Title: Re: GPS assist and Heli
Post by: karla on November 24, 2017, 03:19:17 pm
I have a suspicion here:
the FC in AltitudeVario/AltitudeHold is trying to correct altitude just by altering the thrust, and not by changing the collective pitch of the heli.

Unfortunately, I feel pretty sure this is the case.
This is not good news.
The main way to control the vertical position for a heli is not done with the throttle.
The head speed (rpm of rotor) changes little and the collective pitch angle does most of the job.

I am afraid this will be the case for the other autonomous altitude modes as well, like PositionHold, RTB, Pathplanner and GPSassist.
Well true, the vertical component can be disabled, but that makes for example RTB or Pathplanner questionable to use.

I have an idea how to get around this.
If the throttle when controlled by the FC during AltitudeVario is following the throttle curve set in the GCS, then possibly if I can set the Collective curve to follow the throttle, then the pitch will change as well but using its own curve.

To do this I need to move the definition of the throttle- and collective curves from the transmitter to the GCS.
Did that, no problem, its done by un-clicking the option Collective Pass through and set up the two curves in the GCS instead. In the transmitter I just pt them linear. The two curves are very different.
It works and output is controlled by these new curves.

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6965;image)


(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6963;image)

However, I want the source of Curve2 to be the throttle, and not as before the Collective. But when I change the source setting from collective to Throttle, then the servos do not move at all when moving the throttle stick. It just moves to what ever value is on the Min position of collective curve. Change the Min value and save and then servos will move to new position and stay there regardless of stick movement.

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6967;image)

Any ideas here?
Should be possible to chose Throttle as a valid option since its in the dropdown list box right?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 25, 2017, 05:49:25 pm
Sorry that LP doesn't have a really full heli setup...

If I were doing this, I would start with a governor mode ESC and let the FC control collective.  I think that even BLHeli and SimonK have governor options.
Title: Re: GPS assist and Heli
Post by: karla on November 26, 2017, 03:07:14 am
Thanks Cliff.
The thought has crossed my mind.
The Align ECS, RCE-BL45X, aboard do support Governor mode.

I might look in to it, however, it will be a new way of flying for me and likely present several unforeseen configurational issues and undesired consequences.

Meanwhile, I am tempted to have a look at the code and understand why the curve2source not seem to like the option throttle as source. If that can be sorted its preferred and much more useful for heli users than going governor mode. I have a build environment and next on my MS win 10 machine, so its more to find my way around. Do you guys have some forum for detailed code discussion?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 26, 2017, 05:12:09 am
I'm going to make a guess that there are not a lot of developers that do helis.

Maybe someone else can come by here to suggest a better discussion place.
Title: Re: GPS assist and Heli
Post by: f5soh on November 26, 2017, 08:18:24 pm
Quote
It sounded like you agree there is a problem when flying in circles, but not that there is a problem when flying for a long time in a straight line, which is the same as hovering in the wind, which is the same as using transmitter trims to stop drift.
Did some testing this afternoon, setting a 10 degrees virtual rotation for Pitch and adding Pitch trim using Complementary.
Looks working and didn't see a issue related to attitude estimation after 5 flights.
https://www.youtube.com/watch?v=ve3YnX1yWtw
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 27, 2017, 03:14:32 am
If I'm not mistaken, it would be a problem with long stationary hover with same heading and would reset with each new battery.

Trim transmitter trim for no drift and hover as described.  The problem would be that the trim you start out with is not the trim you need after a long hover with it misconfigured the way you have your quad set.

One of the accel settings, I forget which one, when you turn it up, the issue is more noticeable.  And there was a reason we used to tell people to try changing it.
AttitudeSettings->AccelKp
AttitudeSettings->AccelKi
AttitudeSettings->AccelTau

I will see if I can recreate...
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 27, 2017, 10:21:31 pm
I tried.  I cannot recreate any issue with this.  So I have no problem with the idea of INS13 using only heading from the compass.  Recall that this discussion was whether we needed an option to allow the current (16.09) 3D compass in the new INS13 because inclusion of 3D mag may give better attitude estimation in certain cases.

In this testing, Rattitude mode transmitter trims work just as well as RotateVirtual.  I would never recommend that since changing transmitter trims will mess up Rate mode flight...

I tried Rattitude (forgot it was Rattitude till late in flight; would have used Attitude) with CF/Basic with RotateVirtual roll +10 degrees and could not recreate any issue within the limits of human noticing and fine mode transmitter trims in a 3 minute hover.  I then tried just AccelTau = max; no problem.  I then tried just AccelP *= 4 and Acceli *= 10; no problem.  I didn't check the code to verify whether these are even used in CF/Basic.

AccelTau change recommendations may have been needed more when we had that "base 2" vs. "base 1" sensor data conversion error.  That may be where we suggested increasing the value.  Increased throttle -> increased vibration -> sensor overflow -> bad attitude estimation because of conversion error at max value.

As to whether we ever had an issue where Attitude mode worked better by adjusting RotateVirtual than by adjusting transmitter trims I don't know but assume not...  Maybe I am remembering problems from different firmware brand long ago.  Edit: Or it is a CC3D only issue with the different flight code base, but that doesn't matter for this discussion which was raised because of changes in INS13.
Title: Re: GPS assist and Heli
Post by: karla on November 30, 2017, 10:51:46 am
I have a suspicion here:
the FC in AltitudeVario/AltitudeHold is trying to correct altitude just by altering the thrust, and not by changing the collective pitch of the heli.

When looking more in to this, I get more and more puzzled.
I meant to say in the above post that the FC is trying to correct the altitude by altering the throttle, not really the thrust.
I realize now that I don't understand the difference between these two terms.

In the System Settings, you have these settings:

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6983;image)

But in the Systems - Data Settings, you have this additional concept of Thrust:

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=6985;image)

Is the throttle the values that comes from the transmitter and the thrust is what actually gets out to the motor(s)/collective via the actuator as lift after the FC tampered with it?

When I look at the values the thrust takes on, its just identical to the values of the throttle...

What is this Thrust thing?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on November 30, 2017, 01:22:34 pm
calculations all use the thrust variable

At the end, the calculated thrust is either put out on the throttle or on the collective.  There is a setting somewhere in System page (I think SystemSettings) that says whether to use throttle or collective.
Title: Re: GPS assist and Heli
Post by: karla on December 03, 2017, 02:53:56 pm
You may switch to Next and get rid of INS13 / 3D Mag issues in 16.09 and also made possible Complementary+Mag+GPS usage.

For now I have put aside all ambitions with the vertical altitude automation.
This weekend I flew some 8 lipo packs, each some 15 min, trying to get the PIDs good and locked-in and the magnetometer to be very stable.
I think it became better and can do position hold on gps for some time (thrust = manual though). However, after a while it gets out of hand and starts making increasingly larger corrections and must be aborted.
When just using attitude mode and INS13 its difficult to get a stable hover without drift by adjusting the mag roll and pitch settings.
I will try the advice to convert to Next and see if that will get a more stable attitude hover in INS13.
If so, then my hope is that the position hold will also work better.
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on December 04, 2017, 08:00:50 pm
Just some thoughts...

If you have good Attitude mode flight with Basic AttiEstAlgo, You could test if Attitude mode is good with INS13.  If Attitude flies better with Basic than with INS13, it is probably a mag issue.

You could also try to fly in Rate mode which removes accels from the question.

If bad in both Basic and INS13, you could record telemetry (so you can replay the same flight several times) during a difficult flight and look at accels and gyros for excess noise maybe caused by vibration.

I wonder if mag issues are caused by increased current needs toward the end of flight or when using old batteries.  Voltage drop due to low battery or old battery voltage sag means you need more current to hover.  More current = worse mags?

Good luck.
Title: Re: GPS assist and Heli
Post by: karla on December 05, 2017, 08:20:43 am
Thanks Cliff,

and for sure, Attitude mode with Basic AttiEstAlgo flies like a charm, very stable, no drift, but Attitude with AttiEstAlgo INS13 then its moving around. My conclusion also, its a mag issue. So before I upgrade to Next I should move the Mag to an even better mounting location on the heli and see if that solves all. However, I want the new video gadget for the OSD PFD only available on Next so I will upgrade, and also move mount to a better location.

This will involve some serious soldering to extend the gps/mag cables. I will try make an extension cable rather than a fix soldering of them. I think this is not the problem so I like to revert easily to the original set up.

By this, I (we) will not know if the issue will be fixed by moving the mount of the mag/pgs or if its due to Next software.

I have several log files from last weekend but don't really know what to look for in terms of vibrations... I attach one small one here, if you care to have a look (have a beer instead? or just hint where to look :- )

For mag issues at end of lipo life due to higher current and higher interference, I don't think its likely for this set up. All Lipos new and its the same over 15 min of each lipo flight.
I would have noticed.
Title: Re: GPS assist and Heli
Post by: karla on December 07, 2017, 08:31:44 am
Today I moved the gps-mag unit to better location on heli tail boom,
completed the conversion to Next,
calibrated Attitude using Basic.
It flies well.

Then calibrated mags and turned to INS13 and Attitude.
It flies well.
Then did Pos Hold.
Its really gusty around 6 m/s but it show clear tendencies of 'bowling'.
However, its at a new and better level than before, but still not where I can trust it or where I want it to be :(

My conclusion is I still have mag issues, too much disturbances.
Will try to improve the mount location on heli but it will involve some serious reconfiguration of transmitters etc etc

This feels like a long march...
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on December 07, 2017, 05:08:37 pm
Do you have all your high current wire pairs/triples twisted?  Battery to connector, connector to ESC, ESC to motor?
Title: Re: GPS assist and Heli
Post by: f5soh on December 07, 2017, 09:25:15 pm
Did you do a simple check looking if compass in PFD matches a known North heading ?
Remove the Roll/Pitch in Auxmag orientation and redo a test.
Title: Re: GPS assist and Heli
Post by: karla on December 08, 2017, 01:57:45 am
Thanks guys,
Yes, power cables twisted as fas it allows, even to servos, can't be done everywhere.
Yes, I did the simple compass check, north is where the fc think it is.
Title: Re: GPS assist and Heli
Post by: karla on December 08, 2017, 02:47:54 am
Remove the Roll/Pitch in Auxmag orientation and redo a test.

Well, I removed the trims and put the values back to 0,0 before doing mag calibration. Then I simply left them at that.
Title: Re: GPS assist and Heli
Post by: f5soh on December 08, 2017, 07:17:57 am
Auxmag orientation has no effect while calibrating Mag.

Remember you can test the Complementary+Mag+GPS fusion algorithm assuming you are using Next branch.
Maybe post some log, while flying at same heading may help.
Title: Re: GPS assist and Heli
Post by: karla on December 08, 2017, 07:38:05 am
Thanks. Yes this heli is now using Next branch.
If using Complementary+Mag+GPS instead of INS13, what could be expected? Does it rule out some sensors?
Yes, I can do some logs while flying in same direction, once I got the heli re-configured with the mag/gps mounted further out on the tail boom. I have another trex450 with the gps installed at that location and its doing very stable position hold with a DJI Naza-H FC and GPS.
Title: Re: GPS assist and Heli
Post by: f5soh on December 08, 2017, 09:22:52 pm
If you're happy with Basic (Complementary) in Attitude stabilization, Complementary+Mag+GPS will work fine for all GPS modes.
Title: Re: GPS assist and Heli
Post by: karla on December 09, 2017, 01:29:28 pm
okay, lets see.
Have completed the hardware readjustments today.
tomorrow if weather allows will try it
K
Title: Re: GPS assist and Heli
Post by: karla on December 12, 2017, 03:27:02 am
Too windy this weekend but did fly a bit anyway, ended up with a bad soldering on the power cable and had to abort testing. Next time...
Title: Re: GPS assist and Heli
Post by: karla on December 22, 2017, 05:50:58 am
Finally, yesterday I got to fly some 3 packs and try the improved location of the mag/gps unit and the Position Hold.
It holds position better.
Still have bowling motions, but not always and not as much as before, but still more than acceptable. So I conclude I still have remaining disturbances with the compass.
I only fly in Attitude mode and using Next.
It flies good in Basic, INS13 and 'Basic+Mag+Gps'. Tried PS in both INS13 and B+M+G, with no noticeable difference what I can see.

There might be additional issues with my Heli, though.
At the end of the last flight there was a sudden drop of engine power. Then motor spin back up again but enough late to almost end on ground.
I would need some help to determine (if possible) Was this because of a radio link failure (failsafe) or was the failsafe due to a short power outage from the LiPo's, a cable disconnect ?
Where to look in the log-file?

It happens during the last 20 seconds of the log file.
During this flight I move in and out of PH several times.

Thanks a lot
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on December 22, 2017, 10:55:20 am
I forget:  Are you flying 16.09 or recent "next" or some other version?

There is a thing called "bumpless transition" in the thrust/throttle management PID for PH.  A safety fix was put in to "next" that broke this "bumpless transition" and I don't know if that breakage itself got fixed.  "Bumpless transition" is supposed to make sure the thrust actuator has the same value when you switch into PH, rather than some other value and the aircraft say descends before determining that it needs to add thrust.

If I am correct though, this would be for the thrust channel, so if your motor power dropped (to zero) but you are configured to use collective for thrust control, this is probably not your issue.  If you are configured to use throttle for thrust control then this could be the cause.

You could replay the log file and watch the bottom status line of the PFD to see if it went into failsafe.  There are also some alarms you could check by configuring and watching a scope on the chance that it was so brief that it did not show up on the PFD long enough to see easily.

If you use DJI/Naza GPS, you might try the patch 16.09 firmware I did or patch the next source with the same changes from that thread.
Title: Re: GPS assist and Heli
Post by: karla on December 30, 2017, 01:55:05 pm
Hello and thank you cliff!
Christmas came in between :)

I forget:  Are you flying 16.09 or recent "next" or some other version?
Next

There is a thing called "bumpless transition" in the thrust/throttle management PID for PH.  A safety fix was put in to "next" that broke this "bumpless transition" and I don't know if that breakage itself got fixed.  "Bumpless transition" is supposed to make sure the thrust actuator has the same value when you switch into PH, rather than some other value and the aircraft say descends before determining that it needs to add thrust.
Right now its pretty Bumpy when switching from Manual to AltitudeVario thrust mode. However, much less so, after I adjusted the Thrust limit for Neutral, it was way off.

If I am correct though, this would be for the thrust channel, so if your motor power dropped (to zero) but you are configured to use collective for thrust control, this is probably not your issue.  If you are configured to use throttle for thrust control then this could be the cause.
Now, this is a really interesting idea you have. Really.
However, I don't think it works like this at all.
There is no way or place you can select if 'Thrust' is managed via throttle or collective.
Please prove me wrong, it would be fantastic :)

You could replay the log file and watch the bottom status line of the PFD to see if it went into failsafe.  There are also some alarms you could check by configuring and watching a scope on the chance that it was so brief that it did not show up on the PFD long enough to see easily.
Did replay it and looking for useful variables to check, but was unable to determine if the motor outage was due to a power outage from LiPo or a radio glitch causing the failsafe (and shutting motor down). Anyways, last soldering of power cables seems good. The OPLM unit on the heli did have a bad connector of the antenna and have swopped for another unit now. Also changed the 'Air Data Rate' up to 100.000 baud from 64.000 as suggested by Laurent.
Now it seems a good stable connection and I dont expect any motor or failsafe issues going forward.

If you use DJI/Naza GPS, you might try the patch 16.09 firmware I did or patch the next source with the same changes from that thread.
I use a OP gps unit now. However, I consider a DJI unit if this do not show improvement.
I have one on another Trex450 mounted at the same place and it holds position just fine.


The heli is set up fine now and I plan to head for the field tomorrow to test position hold :)
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on December 30, 2017, 06:20:03 pm
It has been a long time since I looked at heli thrust, but back then, you use your transmitter throttle stick to control something called Thrust (called thrust for all vehicle types), then in the setup you tell it (SystemSetting->ThrustControl) whether Thrust controls the throttle channel (coming out of the FC) or the collective channel.

It should be possible to use a governor mode ESC (same RPM at any load) connected to an aux channel, then use Thrust=Collective for good heli setup ??
Title: Re: GPS assist and Heli
Post by: karla on December 31, 2017, 05:47:24 am
OMG, you are right, I found it.

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=7046;image)

This gives me new hope, will explore it.
But after I get the 'bowling' to a complete stop
Thanks
Title: Re: GPS assist and Heli
Post by: f5soh on December 31, 2017, 01:02:24 pm
Quote
OMG, you are right, I found it.

:D
https://forum.librepilot.org/index.php?topic=3999.msg27035#msg27035
Title: Re: GPS assist and Heli
Post by: karla on January 01, 2018, 05:21:48 am
Yes, I missed that.
It was not my focus at the time, sorry laurent.

Meanwhile, I flew some more yesterday.
Its still 'bowling' while in position hold more than I think is acceptable.
I compared the direction of north to my iPhone compass and noticed it points to the same direction but during a 60 sec period the direction is moving around +10 to -10 degrees.
This is when standing on ground and mags are different there, however it can't be good.

I think already did my best to twist cables and find best possible location to mount the mag/gps on heli. Now will try another unit.
If that will not work I think need to find a drastically different mounting.
Or maybe its the material on the whole tail boom...
I tried to have another unit with mag standing still and then move the heli over and around it, it is showing some more error % but its difficult to draw any firm conclusions.

 
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on January 01, 2018, 09:49:46 am
Once you start calibrating mag, it is always getting data until procedure is complete.

You should not set model on the ground or set it on anything metal or even calibrate close to big metal things (car, metal tanks, etc.) at any time once you start the procedure until it is complete.

You can click the GCS mag cal "next position" button 5 times before you even start, and leave it on the 6th position, and then do all the positions, then click the button the 6th time.

You can just do the "Naza dance" instead of the 6 positions.  I do a different 6 position dance where I simply point (and wiggle a little) each of the 6 directions of the model (nose, tail, left, right, top, bottom) at the north mag field which for me is north and 60 degrees down.

World magnetic inclination map
https://en.wikipedia.org/wiki/File:World_Magnetic_Inclination_2015.pdf

LiPo alarms have magnets in them.

You can find the limits of the mag fields of things by setting a spare FC on the table.  Connecting it to GCS.  Watching mag scope in GCS while you move the model close to it.  When you see the scope change you have found a mag field in the model and have found how large it is.
Title: Re: GPS assist and Heli
Post by: karla on January 02, 2018, 12:33:43 pm
Thanks Cliff, as always.

I got all of those points.

Today, i was flying with a new unit, another OP though. Also fixed it loser with 3m thing not tied down so hard to prevent vibrations. I was really hoping it would make a difference. However it did not.
I had a bad crash, could not prevent it from hitting some trees after going in to position hold mode.

Damage report:
. Main shaft bent - must be replaced
. Feathering shaft bent - must be replaced
. Tail shaft bent - must be replaced
. both main rotor blades smashed - must be replaced
. one power cable to motor snitched off  - must be resoldered
. battery holder string torn off - must be amended
. 3D gimbal camera totally smashed - need to be replaced :(
. Video tx antenna broken - needs to be replaced

Today I don't feel happy,
maybe this hobby is not for me ...
 :-\
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on January 02, 2018, 05:01:33 pm
Oh man.  Sorry about that.  :(

One time I had an oscillation that seems to be caused by GPS in NMEA mode.

Does it hover well (no toilet bowl) in Rate mode and Attitude mode?  Maybe reduce some PIDs in VtolPathFollowerSettings.

I've got an old 300 size clunker that I have been planning to get back out and put an FC on...

Good luck.  :)
Title: Re: GPS assist and Heli
Post by: karla on January 05, 2018, 09:42:40 am
Thanks a lot Cliff.
Where I come from we don't give up easily so I am back on to this,
eventhough I might be wiser just to drop it and move on in life  ::)

I am really curious why it behaves like this.
There must be a reason. I dont belive in mystries.

To your direct questions,
yes it hovers nicely in rate (thats up to the pilot) and also in attitude mode, provided i use Basic est.

When using est of INS13 its a different story. Its totally nice to fly in INS13 and Attitude when the mags settings are in 0,0,0 for roll, pitch and yaw. But when I tried to compensate for the strong drift (to the right, having tail in), it does not seem to matter how much I put in there. I start with 5 degrees up and moved to 20 degrees roll compensation for the mag. Bare in mind this is after the Basic Attititude is perfectly stable with the board oreintation settings. The only thing changed is the INS13 est.
It becomes incontrollable.
Ended up in tree  :'(

(I noticed the wiki recently been edited/changed - at Fine tuning... talking of INS13 compensation https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/18382863/Aux+Mag+Setup+and+Calibration )
so now it make more sense in what direction to compensate drift :)
Unless its wrong :( and should be as before?

Anyways, it does not work for me.
i have tried to increase and decrease companesation but it does not do much change at all to the real movements of the heli.
Maybe the mag axis i am trying to correct is not the correct one? Its yaw or pitch and not roll ???


In addition to this question, i just want to share two different configurations,
maybe someone can spot someting obvious that i am missing?

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=7052;image)

To the left in the picture is a really nice working postition hold trex 450 with DJI gps and Naze-H flight controller.
To the right is the LibrePilot FC with OPLM radio link and gps.

You spot anything that would disturb mags a lot more?

Title: Re: GPS assist and Heli
Post by: TheOtherCliff on January 06, 2018, 09:07:53 am
Your toilet bowl sounds like it is caused by mag not aligned with other sensors.

I see that you are using "next".  I understand that next effectively uses 2D mag.  I greatly suspect that you must leave the mag alignment / orientation / rotation numbers at 0,0,0 for OpGpsV9/DJI GPS/mag (0,180,0 for APM/I2C mags) for "next".  It is OK to change the 0,0,0 to correct for the case where you visually see that the mag is not mounted straight.  You should not change it to fix hover drift like the wiki says.  I will edit the wiki right now.
Title: Re: GPS assist and Heli
Post by: karla on January 07, 2018, 12:40:29 am
Yes, using Next.
I also think they better be left at 0,0,0 since it really don't seem to make any noticeable change on the drift when flying Attitude in INS13 or Basic + Mag + GPS.
I noticed that I need to re-adjust the board trim every time I change LiPo.
I adjust the trim while flying Basic and Attitude.
I was thinking that these battery packs are much larger and heavier than the stock ones and therefor Heli becomes more sensitive to how they are mounted (a little bit forward or aft or left, right have more impact).
But could the drifting in attitude be caused by the Accelerometers not being calibrated in a good way?
Its been difficult to put the heli in all the positions that is required and its not been straight at all times...

Title: Re: GPS assist and Heli
Post by: TheOtherCliff on January 07, 2018, 06:25:13 am
Transmitter trims should be centered where they were when you did transmitter wizard.  You can check trim centers on the Input page with flight battery plugged in and transmitter on.  Of course set RotateVirtual to make it hover without drifting in Attitude mode.

Stabilization -> ZeroTheIntegral... should be enabled or it will go a bit crazy at takeoff

Stabilization -> Advanced -> EnablePirouetteCompensation should be disabled or an unbalanced aircraft will become unlevel when you pirouette with yaw in some flight modes.

What all modes do you use that you have problems with?  Rate and Attitude have different causes.

Quote
I noticed that I need to re-adjust the board trim every time I change LiPo.
Trim will change when you change from Rate to Attitude if transmitter trims are not centered.  Also, does this happen with Basic and INS13 AttiEstAlgo or just INS13?  Just INS13 should only happen in 16.09 with fairly bad mag problems.
Title: Re: GPS assist and Heli
Post by: karla on January 08, 2018, 06:18:59 am
It’s in Attitude mode - the problem is getting a steady hover without drifting, once and for all.

It first happens in Basic AttiEstAlgo after changing LiPo.
The drifting can be fixed by adjusting System Settings BoardLevelTrim +/- some 3-6 degrees
(I usually don't touch the BoardRotation setting since its the main mounting of the board).
But, for the next LiPo pack, then I will most likely need to adjust the settings again to compensate drift.
I was just thinking if this can have anything to do with poorly calibrated accelerometers?

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=7054;image)

After I have completed a good trim in Basic, then I switch over to AttiEstAlgo INS13 (still using Attitude and same LiPo).
Then it will drift a lot (like 10 degrees off), most often drifting to the right and some backwards.

I am aware that Mags are treated differently in Attitude in INS13 when using LP 16.09 from using LP Next.
You may switch to Next and get rid of INS13 / 3D Mag issues in 16.09 and also made possible Complementary+Mag+GPS usage.
I was actually hoping LP Next would be the solution and fix the drift in INS13 - but it did not, so this might be a different issue  :-\
b t w I have also tested with AttiEstAlgo 'Complementary+Mag+GPS', but behave similarly.

It was after that, lacking other things to try, I changed the Mag rotation setting for Pitch anyway  ::)
After raising it gradually and nothing happened i was up to -40 degrees (drift was forward), then I lost it in the tree unable to apply enough neg pitch.

(https://forum.librepilot.org/index.php?action=dlattach;topic=3999.0;attach=7056;image)

. Trims - I never use the trims on the transmitter, they are always centered (easily checked on the display of TX).
. ZeroTheIntegral - enabled
. EnablePirouetteCompensation - disabled
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on January 08, 2018, 07:31:51 am
Just some thoughts.  Maybe some are new...

If it happens in Basic, then maybe:
- FC mounting is loose or frame is loose and some screws need to be tightened
- vibration
- gyro calibration/bias issue

Are you running the stock settings that delay gyro calibration (in Basic AttiEstAlgo) until the FC is motionless, or did you change them?  Could it be that gyro is not calibrating well each new battery because vehicle is moving a little?  If that is the case, then INS13 might not have the issue.

I can sort of imagine that it could be a warmup issue where the board is warmer the second battery than the first battery.

Maybe you should redo the thermal calibration.  I presume you have at least done it once.  You might consider redoing all calibrations...

Thermal calibration and INS13:  I have found that after doing thermal calibration, you must recalibrate gyros to get the gyro scope to center at 0,0,0 but I wouldn't think that would drift from battery to battery.

Check your accel filter settings (pages: Stabilization and maybe Attitude) to make sure they are default.

Does it only need roll changes?  If so, I wonder whether "more throttle with less collective" vs. "less throttle with more collective" is changing the roll angle required for level hover.  The more collective you use, the more drag and the more tail rotor it needs to correct for the drag and the more bank angle the main rotor needs to compensate for the tail rotor thrust.  Similarly, a different weight (bigger battery or adding a camera) would do this too.  I wouldn't imagine this would be 6 degrees difference though.

Maybe tightening the battery strap a different amount warps something that is springy and causes the FC to be at a different angle.

FlySky transmitters have a problem with loose wires.  Really.  This is a problem with wires to pins connecting the pots.  Moving the vertical axis wiggles the wire to the horizontal pot.  If you have a FlySky transmitter, please read this for a video to prove if you have the issue and a fix I found:
https://www.rcgroups.com/forums/showthread.php?p=38300831&postcount=1755

Settings don't save permanently when FC is armed.  Maybe you are just moving it from 1.0 to 5.0 over and over?
Title: Re: GPS assist and Heli
Post by: karla on January 08, 2018, 08:03:09 am
Wow :)
thanks for thoughts - some very new. I will run the list one by one later, but for now I trigger on the thermal calibration.

No I have not done a thermal calibration on this board. I have many and only did it once with one Revo and saved the settings and then update all my other Revos with those settings. The reason is that its troublesome and time consuming to do that calibration and don't really seem to matter.

But now I really have a reason to ask something I been thinking about for a long time.
Can I use the calibration details here below and just update the board?

Code: [Select]
<!DOCTYPE UAVObjects>
<uavobjects>
    <settings>
        <object name="AccelGyroSettings" id="0x1262B2D0">
            <field name="accel_bias" values="-0.000841957,-0.0601984,-0.569099"/>
            <field name="accel_scale" values="1.00235,0.994619,0.988395"/>
            <field name="accel_temp_coeff" values="0,0,0"/>
            <field name="gyro_bias" values="0.0322891,0.00425314,0.00241962"/>
            <field name="gyro_scale" values="1,1,1"/>
            <field name="gyro_temp_coeff" values="-0.0186192,-0.00151585,-0.0267329,0.000716467,-0.0101649,0.00010742"/>
            <field name="temp_calibrated_extent" values="-15.8235,72.0824"/>
        </object>
        <object name="RevoSettings" id="0xC456EB9A">
            <field name="BaroGPSOffsetCorrectionAlpha" values="0.999334"/>
            <field name="MagnetometerMaxDeviation" values="0.05,0.15"/>
            <field name="BaroTempCorrectionPolynomial" values="-0.0644952,0.00604459,-0.000197262,1.42936e-06"/>
            <field name="BaroTempCorrectionExtent" values="-17.42,72.04"/>
            <field name="VelocityPostProcessingLowPassAlpha" values="0.999"/>
            <field name="FusionAlgorithm" values="Basic (Complementary)"/>
        </object>
    </settings>
</uavobjects>

its from the LP Wiki https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058675/Sensor+calibration#Sensorcalibration-Thermalcalibration (https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/12058675/Sensor+calibration#Sensorcalibration-Thermalcalibration)


If yes, great!
If no, why not?
Can these boards be so different?
Is it better to not do the calibration at all, or to import these settings?

Thanks for being around Cliff and - Happy New year!
/Karlitos
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on January 08, 2018, 05:11:42 pm
Using any calibrations from Revo#1 on Revo#2 is about as bad as not doing calibrations at all.  That includes thermal calibration.

Yes, I do cut out those calibrations and save them as a separate uav file, but I mark each board and mark each file to match the board it goes with.

I do the following to upgrade to newest LP version where UAVOs changed:
- export UAV file twice, to two different names (one of them will be modified, one kept for fallback) old.uav and new.uav
- use uavofix to modify new.uav so that name comes first (before value) on each line
- erase settings and export that UAV file to olddefault.uav
- use uavofix to modify olddefault.uav (not usually needed) so that name comes first (before value) on each line
- upgrade to new version
- export UAV file to newdefault.uav
- use uavofix to modify newdefault.uav (not usually needed) so that name comes first (before value) on each line
- use grep or a text editor that can quickly and easily switch between two files so you can flip back and forth between exactly the same page in olddefault.uav and newdefault.uav and the "blink test" will make changes obvious.
- where ever you find a change between olddefault.uav and newdefault.uav, understand what the change ls (insert new default value, rename variable, add extra value, etc.) and make a change in new.uav.  Any change in a UAVO will change the object ID, so you will change a lot of those.  Important to decide if you think that what you are doing for that line is safe.

Here is a set of 16.09 "calibrations only" for my Sparky2#1
Code: [Select]
<!DOCTYPE UAVObjects>
<uavobjects>
    <settings>
        <object id="0x1262B2D0" name="AccelGyroSettings">
            <field name="accel_bias" values="0.0518125482,0.125044808,0.728489697"/>
            <field name="accel_scale" values="1.00152528,1.00071549,0.983911216"/>
            <field name="accel_temp_coeff" values="0,0,0"/>
            <field name="gyro_bias" values="-0.578340948,-0.517927885,-0.588053286"/>
            <field name="gyro_scale" values="1,1,1"/>
            <field name="gyro_temp_coeff" values="-0.00543077243,0.000153706147,0.0181076545,-0.000194396431,0.000825154886,4.76835885e-05"/>
            <field name="temp_calibrated_extent" values="-1.91499996,81.534996"/>
        </object>
        <object id="0xB20D3DE" name="AttitudeSettings">
            <field name="BoardSteadyMaxVariance" values="5"/>
            <field name="InitialZeroWhenBoardSteady" values="True"/>
        </object>
        <object id="0x9A5BA08" name="RevoCalibration">
            <field name="mag_bias" values="-114.978195,-195.573441,-47.4925842"/>
            <field name="mag_transform" values="1.7704668,0,0,0,1.73121321,0,0,0,1.77277255"/>
        </object>
        <object id="0xC456EB9A" name="RevoSettings">
            <field name="BaroTempCorrectionPolynomial" values="-43.4937019,2.87412429,-0.0833765119,0.000425159669"/>
            <field name="BaroTempCorrectionExtent" values="-4.36000013,75.0400009"/>
        </object>
    </settings>
</uavobjects>:

I removed some "non calibration" fields from some UAVOs

I included mag calibrations but you should really redo mag calibrations when you move the FC to a new model.

I included BoardSteadyMaxVariance and InitialZeroWhenBoardSteady.  These are only modified if you are using Basic AttiEstAlgo and you have a marginal FC, but if you change them, you probably want to keep the values.  This is documentation for others that may read this.

Here is the (Linux) command that I wrote to fix the name / value order; I call it uavofix:
Code: [Select]
#!/bin/bash

if (( $# != 1 )); then
  echo Usage: uavofix filename.uav
  exit 1
fi

if [ -f "$1" ]; then
  directory="$(dirname "$1")"
  original="$directory/original"
  mkdir "$original" 2>/dev/null
  if [ -f "$original/$(basename "$1")" ]; then
    echo Backup file exists: \"original/$1\"
    exit 2
  fi
  mv "$1" original
  sed -e 's/\(values=\".*\"\) \(name=\".*\"\)/\2 \1/g' -e 's/\(id=\".*\"\) \(name=\".*\"\)/\2 \1/g' < "$original/$(basename "$1")" > "$1"
  # beware that this touch makes some editors blind to the changes (they won't ask for reload)
  touch -r "$original/$(basename "$1")" "$1"
else
  echo File not found: \"$1\"
  exit 3
fi

To do thermal calibration I connect USB cable to FC, put FC in a fairly sealed (keep moisture out) plastic bag with usb cable extended to come out of bag.  Put in freezer for 10 minutes.  Get it out of freezer and put it in the bottom of a small box with paper or cloth towels wadded on top to hold it against the bottom.  Sit box firmly on a hot light bulb in a way where it won't move.  Immediately start thermal calibration.  Don't let the box move at all until thermal cal is complete.  Unplug light bulb a bit before FC it gets to temperature you want.  I go from 0 degrees C (I may want to fly when it is freezing) to 70 degrees C (one of my quad FC is inside a dome and it gets to 70C in mid summer when sitting in the sun and powered on).  These extremes (especially the 70C hot side) may do more harm than good, both to the FC and to the polynomial which may not handle such a wide range very well.
Title: Re: GPS assist and Heli
Post by: karla on January 09, 2018, 03:55:12 am
Thanks.
A question when coming to the Accelerometer calibration.
Since my fc is mounted standing on the side inside Heli, it needs a virtual rotation setting.
Should I zero out the virtual rotation 0,0,0 before doing the calibration?
And follow the instructions in the GCS on what side up, down etc.
Then change virtual rotation back to adjust for the mounting after calibration is completed.
It should matter right?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on January 09, 2018, 04:27:03 am
There are two accel calibrations.  The one called accel calibration is the board only "removed from vehicle" (if reasonable).  It shouldn't matter how RotateVirtual is set for that.  The other one is leveling calibration.  You should have RotateVirtual set correctly before running that.  So I would just leave RotateVirtual set correctly for both.  Read the help (last tab) for some info, but assume you need all calibrations, and redo gyro calibration after thermal calibration.
Title: Re: GPS assist and Heli
Post by: karla on January 09, 2018, 11:20:15 am
This is the one I want to discuss.
Skip the other one, I got it covered.

What you say is totally unexpected to my expectations ...

The one called accel calibration is the board only "removed from vehicle" (if reasonable).  It shouldn't matter how RotateVirtual is set for that. 

How, can that be possible?
The data collected during calibration must be wrong:
when for example: Turn board Up side Down, when it its not upside down at all?
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on January 10, 2018, 05:56:02 am
"Accelerometer calibration" is best done with board removed from model (see calibration help tab).  If you don't remove it from model, you should pretend it is removed from model and know that the rotations are all about the board orientation.  This is one of the low level calibrations.  It really just calibrates the raw accel bias (zero point) and scale (multiplicative factor) and doesn't know anything about vehicle leveling or gyros, like gyro calibration is low level and only knows gyro bias.

I would consider it a bug if this needs to have RotateVirtual set to 0,0,0 ... but I have not tested that.
Title: Re: GPS assist and Heli
Post by: karla on January 10, 2018, 06:29:06 am
Thank you Cliff.

This part of the calibration is so difficult for me to understand - the Accelerometer part.

It is measuring/calibrating the gravitation, so I have to set home location first, since that is different where you are located on the globe and especially the hight over sea level, I would take it.

If it dosn't matter what orientation the board has when they ask for Turn it upside down, Turn it left side down etc etc,
is it more like the magnetometer calibration - no need to know where north is, the important thing is to move it around in all possible orientations?

I thought the point was to measure the gravity acceleration values for each orientation, for example,  Upside down, for later usage in the AttEstAlg.

Anyway,
This time I need to rip the FC out of the heli to complete the magnetometer cal anyway, can't fit the whole heli in my freezer :)
So I will put orientation to 0,0,0 and do the Accel cal by the book.
My only concern is that, when mounting it back again in heli and add the virtual rotation, that the accel will be bad and AttEstAlg be confused  :-\

When I go to Europe next time the Accel cal should have to be re-done?






Title: Re: GPS assist and Heli
Post by: TheOtherCliff on January 11, 2018, 02:08:36 am
As far as I know, the accel cal has never used a home location, but your point that it could use one for best accuracy is true...

I think this is because CC3D and Basic don't need it (no home location) and INS13 allows calibration with home location values farther up the stack and that could take it into account.

It does matter what orientation the board has.  That is what it asks you for.  If you do it with it still mounted in the vehicle, just hold the vehicle so the board is in the desired orientation.

I would not rip it out just to put in in the freezer.  Most people just do it from cool room temperature to full warm temperature.  a 10C difference is all that is required IIRC.  If above the equator, maybe just put it outside in the winter for a few minutes...
Title: Re: GPS assist and Heli
Post by: karla on January 11, 2018, 03:49:10 am
Ah.
It would save me a lot of trouble and time if I can leave it mounted inside heli while doing these calibrations (thermo and accelerometer).
Its minus 5 C outside today so I will try that.
Also will try just keep the virtual orientation setting but placing the board in the positions GCS asks me.

In the previous accelerometer calibration i have been flying with, I did it with the virtual orientation set, but placing the whole heli in the positions GCS asked me.
This should make a difference... maybe this is one reason why Attitude is confused...
Title: Re: GPS assist and Heli
Post by: TheOtherCliff on January 11, 2018, 04:59:54 am
for accel calibration:
-------------------------
Make sure the board orientation is as requested, as exactly as possible and as motionless as possible.

Heli landing gear on floor, on wall (joint with floor for completely locked in orientation), ceiling upside down...  The motionless part is probably the hardest issue.  Good luck.

for thermal calibration:
----------------------------
The main issue is that it needs to be completely motionless for the whole time.  Afterward, you may want to look at gyro scope and notice there is a slight bias now.  The gyro noise is not centered exactly on zero.  To fix this, just make sure to run the gyro calibration again, after the thermal calibration.  The scope will show you that it is fixed now.
Title: Re: GPS assist and Heli
Post by: karla on January 12, 2018, 09:12:57 am
Ah thats a great idea to do floor, wall, ceiling for support.
I might need to redo it later, but I think I got the thermo calibration okay.
It was tied down heavily and I applied a hair dryer gently blowing hot air over the frame.
It said the range was some 60 degrees range from 3-4 C up to over 60.
I am still waiting for the delivery of my main shaft before I can do any flying.