Trex500 with external Gyro and head lock mode

Hi,

I am using setup like in the title of my post.
What I have established by now is, that if I have my gyro set to head lock and ATC_RAT_YAW_P = 0, I am using ATC_*_YAW_VFF to adjust how responsive tail is in stabilize mode. Heli is stabilized quite well, however sometimes I think arducopter is trying to fix what external gyro is doing (like I have two headlocks working together). In acro mode it works ok.

As suggested here: Doubt for YAW and ext Gyro interference
If I set gyro to rate mode (without head lock), then in stabilize mode arducopter is actually doing the headlock thing quite well, however when I switch to acro mode arducopter stops doing headlock and I can observe tail drift.

Howto make arducopter use headlock all the time in both stabilize and acro modes?

I am flying acro with headlock.

p.s.
Best results till now I am observing when I use headlock in external gyro and have RCIN4 set to output4, so basically I am bypassing all arducopter control over the tail :slight_smile: But this is not good approach if I want to use automated modes, so I would like to change it. I am thinking of removing GY401 gyro and leaving only Futaba digital tail servo connected straight to the flight controller, but I don’t know if arducopter will support this digital servo (I don’t know if this is PWM 50 Hz or sth. else).

@K4cus Is this a flybarred heli? I assume so since you have the H_FLYBAR option set. Here is what I propose to fix your problem. What I think is happening is that when you go to acro, since the H_FLYBAR is set true then the code is passing through Pitch, Roll and Yaw commands and that is why you are seeing the drift in the tail because it is not using the same flight control code as in stabilize.

So Set H_FLYBAR to zero. Then set the ATC_RAT_XXX PID values to zero for all three axes. Set the ATC_RAT_XXX_VFF params to get the control deflection you expect in each of the axes. Probably best to do this in acro mode. Doing it on the bench disarmed should be fine. This is typically between 0.1 and 0.2 maybe a little higher for a flybarred heli. Keep the ATC_ANG_XXX_P gains as the default values of 4.5.

Once last word of caution. Make sure you disable the crash detection. It looks for anytime the requested angle is off more than 30 deg from the actual angle and then disarms the aircraft. For heli’s this doesn’t matter because a crash is spectacular whether you disarm right away or not. The parameter is FS_CRASH_CHECK

What I’ve suggested above should give you what you want.

Thanks for your answer. I think I am starting to understand how pids in arducopter work. Some block diagram of the controller would be useful, but I didn’t find one in the manual. I understand what You are saying, I think this will be totally fine solution. Will try that. I have found out also that I didn’t set derivative of rate pid to 0 (I thought it is done automatically when setting to flybar mode, but it is not) and it was causing oscillations on roll and pitch. Now when I have increased VFF on pitch and roll stabilize mode is working very nice. I must say I am getting closer and close to my goal :slight_smile:
Today I was testing altitude hold mode, but I forgot that when throttle goes down it will lower rpm, so I almost git the grass, luckily I am fast :stuck_out_tongue: and quickly put more throttle and jump back to stabilize. I will set fixed rpm. Well I am not 3D pilot yet, it will be sufficient to have one rpm value for now. Also my trex500 is kind of test model for ardupilot capabilities. If You need some testers I can contribute to this project, when I have some spare time. It is my hobby, but I am a programmer and have electronic education and moreover I am also an automation engineer, work with laser and microwave technology, so maybe I may do some scientific projects with my students, that will contribute to arducopter/ardupilot. If You guys have some ideas how can I help in the development, then I am willing to help.

It is fairly simple how arducopter pids work, once you understand, but without your help I think I would give up long time ago :slight_smile:

Here is a thread that has the control law diagrams.

Edit:

Always looking for testers. Anytime a new beta release comes out for ArduCopter, it’s always great to have people like yourself, put some time on it and see if there are any issues. Just looking to see if the code retained the same functionality is all that is needed. I don’t believe we have many users on the heli side that do much beta testing. If you are interested in getting into coding, that would be great too. We also invite users to beef up our wiki with new pages or updated information. It is pretty easy to do and explained in the wiki. This is also a hobby of mine that I do in my spare time. That’s why its taken 1.5 years to get the heli autotune to a point where it is ready to be merged. of course, it will be a few more months until it gets thoroughly reviewed by the senior devs and I incorporate there changes.

Glad I was able to lend a hand.

Ok, as long as I don’t crash my heli I will provide some information, maybe I will try to extend wiki articles. If I crash, then I won’t have test machine anyway :smiley:
For now I had only three accidents, but I was lucky to land with auto-rotate every time.