I'm moving from my flybarless TREX 45 to a Raptor 90 SE with a flybar soon.


I heard that control for roll and pitch is rate based, and we have full acro control, but does stabilize mode also work?

Also, are there any general rules to consider when setting new PID's for yaw? Do the constants generally go up or down? I'll start it from scratch on a test bench, obviously, but the test bench can't handle everything, so if anyone has any pro tips, I'd owe you one.



Views: 783

Reply to This

Replies to This Discussion

Make that a TREX 450* Not sure why I can't edit the original post.

Hmmm... can't give you any insight into the tuning between sizes off the top of my head.  Best I could do is to send you files for my 450 and 600, and you can compare and see what I ended up with.

There is no rate control on flybarless or flybarred.  Stab is the only mode, and it works the same for both.  The only difference is, with a flybarless, you CANNOT use Acro mode, period, it does not work, at all.  With flybar, you can set the parameter H_Flybar_Mode (IIRC) to 1, which means flybarred.  Now, if you use Acro mode, you will get direct stick input to swash with no gyro interference on pitch/roll, it's full manual just like the APM wasn't there.

I have tested flying in Acro mode, getting out of shape, and then flipping to Stab, and it stabilizes it well.  But I wouldn't try going inverted, it can't handle that at this time.

The Raptor 90 I'm using belongs to my controls lab, and I'm not sure replacement parts can be had for it anymore, so I'll be holding off on the inferno rolls.

I'll PM you with my email if you'd like to send those configs. Having multiple data sets will at least let me see trends, so that'll be great. I appreciate it.

BTW, we've implemented fuzzy logic control on the pitch axis, and it works well. We'll be implementing it on the roll axis soon.

I was also thinking of fuzzifying the yaw controller by replacing the stab yaw controller with fuzzy as well. Then the fuzzy-based rate error could be fed into the linear controller. I'm not sure if that's even been done before. Could be worthy of a conference paper.

Could you quickly sketch out how the fuzzy controllers work?  I was curious about those, looked into them before.  I'm interested to see how they could help.

Basically, fuzzy logic allows for a non-linear response to error. Instead of a linear response, the designer can choose different responses for different ranges on the scale. Where boolean logic designates a specific response to a specific discrete condition, fuzzy logic assigns a response to a range on the number line, scaling the response by its proximity to the center point of that range.

Basically, a crisp logic system would say, "If the error is exactly +1.0, set the control response to exactly 5". In a fuzzy logic system, the control response would be assigned to a range from 0.2 (for example) as the left bound, 1 as the center point, and 2.0 (or whatever) as the right bound. If the error fell in that range, that response of 5 would be scaled by its proximity to the center value.

When you have multiple fuzzy membership functions assigned across the entire set of possible conditions, the fuzzy sets overlap one another, and the responses are mixed based on the degree of fulfilment of the error to each fuzzy set.

To use the example of the APM pitch controller we implemented, I could set it up to mirror the existing proportional controller APM uses when the error is small, and produce a stronger response than the existing controller at the higher ends of the error scale, making for faster rise time while maintaining percentage overshoot characteristics closer to the smaller controller constants. Once I get the controller fully implemented, that's probably something I'll be experimenting with.

Hmmm... you going to be sharing this?

You know where I think this sort of thing could be really beneficial?  Helping deal with the non-linearities of helicopters in high speed flight.  Hovering, and attitude/rate control is fairly straight forward near a hover condition.  It's in high speed where things really start to go a bit crazy.

Particularly, it's that hover to high speed transition where, the control laws need to change.  The current controls, which approximate a simple thruster model, work fairly well in hover, right now.  But when we transition to fast forward flight, it's not working at all.  The helicopter starts flying more like an airplane than a hovering machine.  When you change the attitude to affect a turn for example, the relative wind through the disk creates all kinds of extra Z-axis lift that  can't be accommodated easily in the thruster model.

I will absolutely be sharing it. The controller I made isn't set up for multivariable fuzzy, but it could possibly be stacked to accomplish that result. At the same time, I'm using five membership functions in the controller, each of which takes about three times the processing power of linearly computing a PID response. Stacking the controllers makes a 5x5 set of membership functions. If we're going to start using complex fuzzy like that, it will need to be implemented on ARM.

As for addressing non-linear dynamics, that's exactly what fuzzy logic is for. If we want, we can use the fuzzy libraries not to replace the PID's, but to augment them, creating a PID controller whose constants change based on air speed, for example. Have one controller for slow flight, one for fast, and even controller models for flying backwards, and the heli would morph between them based on what the model needed at the time.

That said, this is not a linear process that can be dictated by a transfer function. The advantage of fuzzy is also its curse. For every condition the user implements, the user has to assign the response. Tuning 1 PID can be hard enough. Tuning 5 different PIDs at the same time is that much harder.

One of the things we explored was using a neural network to optimize the controller. Do you know anyone who's good with CUDA? 

We could also use some help making a GUI for modding the fuzzy sets in the GCS. I'm not sure our C# skills are up to the task.

Chris, have you ever looked at this before?  You mention Neural Networks...


Over my head, so don't ask me any questions. ;)  Just you mentioned neural networks.

I haven't seen that specific paper, but it's basically what we were looking to do. The difference is, the DARPA team was using a neural network to tune PID's, and we were looking to use it on the fuzzy controller.

The other difference is, the neural networks on that project probably ran offline, as opposed to real-time. If we can get the CUDA libraries doing what we want, we might be able to do it faster.

But we've kinda given up on the neural network for now. We don't have a good CUDA programmer on our team, and we don't have the resources to figure it out before our design project is due.


I was reading this post and you stated you had files on your 450 and 600. I currently don't have the APM 2.5 w/GPS unit but will very soon. I'll be install the unit on my TREX 500 flybar, If you think your files will help me, please send them.

Thanks Brian

Ok, I'll try to remember to post them.

But just so everybody knows, I'm going to be doing some testing on 2.8+ for helis shortly, and it's looking like it will be pretty radically different.  All the old gains will be gone, but in return, I hope we'll have a working acro mode.  I will try to give you some guidance on how to get a good guess at new gains based on your old gains.

Reply to Discussion



Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service