Quoted from R_Lefebvre in another thread
Joly, I just pushed a change to try and get your motor tail working:
I have not tested this *at all*, all I know is that it compiles. As you can see, I've hijacked the External Gyro code.
So previously, you had the parameter H_GYR_ENABLE, and H_GYR_GAIN. Those are going to be changed to be called H_AUX_FUNCTION and H_AUX_SETPOINT. But I'll do that in the future. For now, you just play with the Gyro settings. Again, previously GYR_ENABLE was either 0 for off, or 1 for on. Now, you should be able ot set it to 2 and 3 as well, though this will probably need to be done in the Adv Parameters list.
2 is DD_VP, and 3 is DD_FP.
Right now, this will only work with RSC_MODE 2. I'll figure out how to do it with Mode 1 later.
So in your case, you would plug your tail ESC into Ch7, not Ch4. Then, after you arm, flick CH8 to the mid position, and the tail should start. All I've done is copy the output from Ch4 to Ch7, and make it switch on and off with Ch8.
For the DD_VP setting, you would plug the rudder servo into 4 as normal, and the rudder ESC into Ch7. Then, after arming, and flicking Ch8 to the mid position, the ESC should start. It will be sent a setpoint of "H_GYR_GAIN". Obviously you need a governor ESC for this to work.
So go ahead and bench test it. Take your blades off, this is not guaranteed to work!
I've just uploaded your code, and have had a go at getting it to work. RSC mode 2, gyr_enable to 2, tail motor connected to ch7 out, tail servo the ch4 etc. So far, APM is not responding to radio input at all, even though mission planner shows it. Servos are alive, but are stuck in "mid" position.
I just tested the piro comp code in alt_hold. Success :)
You can feel the i term being transformed because the body tilt gets translated when yaw is introduced, i.e. for a heli with 5 degrees of right lean (almost all of helis are like this) left yaw causes forward movement due to the tilt being rotated the opposite way (left yaw = right swash rotation). The stabilize controller soon corrects this difference in body tilt though.
Its not 100% ready yet because the body tilt shouldn't be rotated -- BUT this means that swash rotation IS happening.
The next step is to subtract the body tilt before rotating the swash, before adding it back in.
Update: I tried subtracting 200 off the roll i before rotating, then adding it back on. I could almost do a perfect pirouette in stab mode and it was windy as hell (>20mph). Maybe I could turn the 200 into a parameter for mission planner? I might be able to figure out what number works best and leave it as a default.
At any rate, this has a huge benefit to flying wind. Its not noticeable in still air, but as soon as the wind gets up it really kicks in.
Very impressive, Joly! I am new to this forum but just read the entire thread. I want to make one my 450 helis into a UAV, which I have been planning to do since 2006, but you guys now have an awesome system working so I can't wait to try it. I'm also a graduate student in control systems looking for a project.
What is the current state of autonomous landing of traditional helis? Does it work, or almost, with the existing stabilizer, or is there more work to be done? I was thinking it would probably require an optical flow sensor to deal with the ground effect, so I guess that means I would need a PX4 to experiment with it. What do you think?
Very impressive work here Joly. I think it bears investigation if we can use the Ch7 Save Trim function to save the trim, while simultaneously saving the I-term. We'd have to ask Randy I think.
The only thing is, I tend to do Save Trim on the ground, not in flight, so obviously it won't work so well as-is. But the idea is there.
Autonomous landings are tricky. One of the biggest issues is that helis have narrow set landing gear. They can't be moving at all when they touch down or they will tip over. With wide-set landing gear, it's much easier. Quads can't tip over on the ground really (Unless something has gone HORRIBLY wrong). But a heli can.
There's also a few issues with collective pitch management during auto takeoff and landing. I'm actually working on this right now.
I had a PX4 I was starting to play with, but it just flew away on a quad. I don't know when I'll be able to get another.
Sorry, I don't know the answer.
At this point, I think you should sign up for the Arducopter Dev Group, and maybe try asking Randy? I've actually already notified Randy and Chris Anderson that we've got a new Dev-Team member. ;)
Don't miss my blog posting showing the latest in my full I-term flying and full auto takeoff and auto landing.
This actually doesn't show off the I-term flying, that actually requires flying manually. I did have a near-tipover on my last flight with the 600. I'm not sure what happened yet. Might have been the ground detection, or it might have been "leans" (that would suck) or it might have been the AHRS getting dizzy?