Dual Helicopter auto takeoff issues!

Hello ,
I need advice and help about Helicopter takeoff in my case i use Dual Heli , I share the log with the parameters, I often have takeoffs that are not straight and leans to a side that seems random to me and does not depend to the direction of the wind, I think it’s somewhere connected with the parameters of the feed forward command ATC_RAT_PIT/RLL_VFF or the integral parameters ATC_RAT_RLL/PIT_ILMI or something else that I don’t know .
this picture is from the second takeoff in the log

On the first takeoff I had a strange phenomenon that happened to me for the first time and I do not want to see it again, it is that the initial roll setpoint was at -80 deg, the drone on takeoff leaves at - 45 deg (limit) then stabilizes, I would like to have some help about this,I must specify that in this case I connect a new battery, means that the pixhawk has just started

https://drive.google.com/file/d/1TwLNS_Wqkw0wOCILgDc4pZ2_Aq0T-bJO/view?usp=sharing

I have also some problem with the oscillation before takeoff on the ground when the motors stabilizes at their speed, I reduced this problem by reducing the parameter PSC_ACCZ_P from 0.5 to 0.2, but I had it later once , in this case i changed the payload and the weight of the drone and it was windy condition ,what is the real cause of this problem and how to fix it!

@Tarek-H First, you do not have the most recent stable version of code loaded. You have 4.1.1 and the stable version is 4.1.5. I’m pretty sure there are some important fixes, especially one that deals with the oscillations you see with the collective.

As far as the first issue you discuss in your post, I think this may be due to the controller trying to navigate before you takeoff. Thus it commands a pitch or roll angle in the direction that the navigation controller is telling it to move. You can stop the navigation controller from trying to move the aircraft before the takeoff by raising the WP_NAVALT_MIN to maybe 50 cm. It may drift a little on takeoff but will quickly correct itself .

I’m not sure what to say about the second plot. it is very strange that your desired attitudes are so high. It may be something you should monitor in the ground control station to avoid taking off with this condition. If you see this happen again then turn on logging disarmed by setting the LOG_DISARMED parameter to 1. If it is consistently happening then leave the log_disarmed parameter set to 1 and provide a log that shows the boot up and everything up to the point of arming. That way we can see how the desired values are getting so high.

@bnsgeyer I did last week several take-off and landing with LOG_DISARMED =1 , this strange high initial desired attitudes did not appear again , I tried several values of ATC_RAT_PIT/RLL_VFF from 0.03 to 0.15 to see if it impact the takeoff , with 0.03 and 0.15 it oscillates , 0.1 is better result but still not a perfect straight takeoff ,i try to understand how the controller calculates and give between 5° - 10° initial pitch roll target just before takeoff , i will try raising the WP_NAVALT_MIN and see what happen
i will upgrade soon to 4.1.5 and do a tests and i will give a feedback
i need to understand how to tune perfectly to have a perfect machine ,there is manual tune wiki and now the autotune is added ,this is new for helicopter AutoTune — Copter documentation , recently you made a conference videos explain the heli update and autotune ,if it work now and improves performance and not a lot risk I’m interested in testing on my coaxial helicopter ,just what i see from the code i need to use beta version (master ) ,that’s right ?

It would be helpful to see the logs where you are encountering even 5-10 deg of desired attitude before takeoff. At a minimum Please upgrade to the stable version of 4.1.5.

As for autotune, we hope that version 4.2.0 will be out soon but if you would like to use autotune then you can load the beta version using mission planner. Don’t load master.

The first plot (the second flight in the log ) the desired pitch attitude before takeoff was -7,7° the pitch reached up to -15° after he got up from the ground ,
the same log : https://drive.google.com/file/d/1TwLNS_Wqkw0wOCILgDc4pZ2_Aq0T-bJO/view?usp=sharing
I share the series of take-off and landing tests that I did ,this is big file https://drive.google.com/file/d/1iRHMgdVElGFdlJWMJeva69WNjIXYczAm/view?usp=sharing

I don’t know if it’s related to my issue, i am aware that there is a noise in the control signal according to Preparing for Tuning — Copter documentation , i planned to enable and test the harmonic notch with 4.1.5 upgrade .

About 4.2 beta , in my case i need to build the code , I have checked now the master ,the things go fast , it is 4.3 dev , there is Copter-4.2 branch ( the last is V4.2.0-rc4 ) i think this is the mission planner 4.2 beta version .

Yes. Copter 4.2 is the beta version.

I did several takeoffs last month with version 4.1.5 and Notch filter enable, the takeoff is much better ,
log : https://drive.google.com/file/d/1hIrZCzGDXC7LTru1vc3xZ0ua7maxuJ5S/view?usp=sharing

I upgraded to version 4.2 on one of our machines ; i planned to test autotune i will let you know ,you can see I use different pid values than the initial Heli parameters recommended in the documentation , ATC_RAT_PIT/RLL_P is not null .
ATC_RAT_PIT/RLL_FLTT :10 Hz ,unlike the multicopters, it is not explained how to adjust this parameter in the helicopters .

@Tarek-H found a bug in heli autotune. It affects tuning multiple axes in one flight. If you use it, then only tune one axis in a flight then cycle power before testing another axis. I hope to have the fix come out in a stable version in about 10 days.

@bnsgeyer I tried to do the AutoTune with 4.2.0 in my coax Heli for the pitch ,i planned to do the tune in this sequence FF → Rate D ,Rate P → Angle P
I kept the same pid that I fly with ( Pitch : Rate P : 0.115 , I=0.115 , D= 0.001 ) , while I noticed that in the tutorial you started with Rate P ,I and D = 0.

about Autotune param Test frequency i keep the default value ( min 10 , max 70) ( i use 1 meter rotor , three blades ) , Maximum Response Gain = 1.5 , i know it should be 1.8 .

the first fly for the FF tuning was successful , ATC_RAT_PIT_FF has changed from 0.1 to 0.059 , i noticed that not only the FF , the ATC_RAT_PIT_I has also changed from 0.115 to 0,029
log : https://drive.google.com/file/d/1Zv_wUQHXSuxdq2YA_mJn8vc91Y8OsLEc/view?usp=sharing

For the second fly , Rate D ,Rate P autotune ,before takeoff i changed manually ATC_RAT_RLL_FF = 0.059 ,ATC_RAT_RLL_I = 0.029 to be equal with the pitch values
the first temptation he started to do autotune but in the end it was interrupted with a message Max Gain Determination Failed
I restarted again but I got the message AutoTune: failing to level, please tune manually ,
there was a bit of wind so I stopped the autotune.
log : https://drive.google.com/file/d/107Kp9_nII95g3EwAAfPOSHAuDCkRSZUW/view?usp=sharing

The feed forward tuning has difficulty determining the gain for smaller heli’s. Plus I don’t think having non-zero rate P and rate D gains helps. I would recommend zeroing the rate P and Rate D gain for both pitch and roll when doing the tuning of FF and rate P and Rate D of these axes. Start with 0.15 for the FF gain and 0.1 for the I gain unless you have some concern with that. After autotune finishes. switch out of autotune and then back into autotune to test the gains to see if you feel there is good control still. If you think the control is good then land in autotune and disarm to have it save the gains. then do the same thing with tuning the roll FF gain. After that you can start tuning the pitch and roll rate P and D gains. But please start with the Rate P and D gains at zero. The tuning process is much better that way.

I never did the Rate P and D gains at zero i will try, it should work .
what i understand after the FF tuning , i do AUTOTUNE_SEQ = 2 for Rate p and D ( or = 3 FF and Rate at the same time ) it will start with frequency sweeps and determine the max allowable value of gains , so what is the difference and the purpose of AUTOTUNE_SEQ = 8 (Max Gain Determination) ?

I would recommend FF by itself first and check the value. I think what it determined previously was low. So I’m hoping the zero Rate P and D gains help it to find the proper value.
Check the FF gain. It should be greater than 0.1 if not closer to 0.15 from what i was seeing in the data. Then you can run the Rate P and Rate D tuning for the same axis.

The max gain determination is always done before tuning Rate P and Rate D. I added the option to just have the autotune determine the max gains. It is for those that just want to check the autotune feature without having it tune rate P and Rate D. It will provide the max allowable Rate P and Rate D gains. Now these are not the values that you want to plug in for the gains. They are just a way to gauge how big of steps you want to take to tune. The autotune feature uses 5% of these max allowable gain values as increments when tuning.

Remember that you only want to tune one axis any flight. The bug fix went into 4.2.2 which we are waiting to go stable.

I tried to do the autotune , for the first time in order not to take any risks I had to increase the Angle p = 5.5 and FF = 0.2 ( with Rate I =0,1 Rate p =0 Rate D=0), it was little wind ,I felt the aircraft slightly less stable than before, I launched the autotune for the FF but each time it ended with the message AutoTune: failing to level, please tune manually
I share flight logs :
https://drive.google.com/file/d/1hxOSkZG-0PdDh_obLNfZ86ukrE3iiqrX/view?usp=sharing

https://drive.google.com/file/d/1iNgKW_763HIbMMGx-Al2ZUj_Dj3DqVmn/view?usp=sharing

by analyzing the log I felt that there is a lot of overshoot and he try to reduce the FF to 0.07 but after that overshoot starts to increase ( maybe because wind or he goes to instability ), for the next test I think to reduce the angle P to 5 - 4.5 and see .

today I tested several values of angle p (switch CHAN 6 ) and I launched the autotune of the FF
p-angle = 4.5
https://drive.google.com/file/d/1uz8nFlJvQ-TKcIWcVln1SSjL-APpZksF/view?usp=sharing

after that Autotune FF with several value angle p pitch =5, 5.5, 7.
in this log I made also some movements in Roll to see the reaction of the drone
https://drive.google.com/file/d/1d1zWeD-WenAFbpm68W040iyNn3DWMrty/view?usp=sharing

there is always overshoot and when the autotune reduces the value of the FF it gets to the point where auotune error :failling to level (the control Setting Time increase !? )

i dont know if i need to increase again the angle P , or increase the Rate I to fix failling to level problem …

Let me look at your logs and I will tell you how to proceed.

@Tarek-H The FF tuning is not working well for your Heli. So don’t perform any more FF tuning for the Pitch axis. Please set the ATC_RAT_PIT_FF to 0.12. You can set ATC_RAT_PIT_I to 0.1 for the rest of the tuning tests. With the ATC_RAT_PIT_P, ATC_RAT_PIT_D, ATC_RAT_RLL_P and ATC_RAT_RLL_D set to zero, run the Pitch rate P and Rate D tuning. Post the results and let me look at them before moving on.

@bnsgeyer hello , i did today the pitch autotune,he succeeded I saved the parameters and use the same values for the roll, I did a test flight it works well.

https://drive.google.com/file/d/1IimHyAR3TrVXPNEB6kSVFe9Cxz43DcyY/view?usp=sharing

@bnsgeyer , did you had time to look at the log and Autotune result ?

@Tarek-H Thanks for the reminder! Sorry for the delay. Looking at your log, It seems like pitch FF may still be a little to low. I would recommend increasing Pitch FF to 0.15. The frequency response of your heli is very well damped which means that we don’t have to use max response gain of 1.8 for the autotune. I would reduce AUTOTUNE_GN_MAX to 1.1. Please re-run the pitch rate P and Rate D tuning. Set the ATC_RAT_PIT_P back to 0 and ATC_RAT_PIT_D to 0.0007. I want to give a little bit of D gain to see if it can tune the RATE D any higher. I would like to see a little rate D gain but if it isn’t able to increase it anymore then it will keep it at the value you set. I would expect the Rate P gain would be around 0.1 after the autotune completes.

If the autotune for the pitch axis completes successfully then run the roll axis autotune for rate P and rate D.

Post the logs and let me take a look. I promise to do a quicker turn around.

@bnsgeyer I’m curious to know what made it think that the FF is still be to low , is it the fact that in my case the RATE cannot reach the Target Rate at the beginning of the autotune and the autotune increase Rate_P to corrects this ?

I did the pitch Autotune with what you recommended ,it looks better with the ATC_PIT_D reached the values 0.001 and Rate P gain 0.078 not far from what you expected 0.1 (Rate P* gain limited by AUTOTUNE_GN_MAX =1.1 )
https://drive.google.com/file/d/1dlRNs6cOlrMeyGqbJLM7iK0bAHpaPJ5W/view?usp=sharing

I restarted the pixhawk and I launched the roll autotune with the same initial parameters (AUTOTUNE_GN_MAX =1.1 ,FF =0.15 ,RATE D = 0.0007 , RATE P = 0) but this time the autotune was stuck on the first Step , until the battery failsafe , in the log I noticed that the response is slower and the calculated gain was higher compared to the pitch, I’m sending you the log too
https://drive.google.com/file/d/1khtqchvxSSO_9stiwKI1sDCTLzOTwr5h/view?usp=sharing