Default Parameters - what happens if my value is out of range or is a zero?

@rmackay9, @tridge, @LuisVale, others?

I have been struggling with tuning a collective-pitch quadcopter to get rid of oscillation, and haven’t been able to clearly determine what effect some of my changes have - specifically in the “ATC_[ ]” PID-type parameters.

I am using the WLToys V383 airframe, but I have extensively modified it, mainly due to crash repairs and difficult parts availability. I had started out with Tridge’s original parameter file for this airframe, really hoping to not be re-inventing the wheel with this one. But unfortunately, that’s not how it’s turned out for me.

My question is this: What effect does an out-of-range, zero, or blank value have when the parameters are loaded into the flight controller?

I have gotten warnings from the parameter list in Mission Planner, where it says the values are out of range, even though they are the ones in the original file - so I am assuming that MP has been updated along the way to expect the latest firmware version’s parameter range. If I put a value in a parameter that is well below the range, does it get written anyway, or is it automatically reset to the minimum allowed value? If I put a zero for that parameter, does the zero get used? If I leave it blank does it go to some default value? When does the default value show up? Am I blowing up the FC’s calculations by putting in an out of range value (especially a zero)?

Also, where can I find the default values? I barely know anything about C++ (I only know a little about C), so digging through all of the *.h and *.cpp files isn’t an easy task for me with the object-oriented things, and it’s hard for me to follow the logic of what’s coming from where. But I am trying to learn this as I go, so any help is appreciated.

I know this is actually multiple questions, but maybe there is an easy answer.

Thanks,
Brad

Hi Brad,

It’s great that you’re giving the QuadHeli a try.

It is possible that you’ll need to input out-of-range values and they will be used. They can be entered (as I’m sure you’ve found) using the MP’s “Full Parameter List” or “Full Parameter Tree” screens.

The attitude control defaults for helictopers are here I think.

If you post a log file we can have a look and maybe give some tuning advice. I guess the oscillations are in roll or pitch? It’s probably a good start to reduce the ATC_RAT_RLL_P/I/D and ATC_RAT_PIT_P/I/D values by 20% and see if that helps.

The CP quadcopter is not a true helicopter. It is a multi-rotor with a different method used to vary thrust on the propellers.

It is somewhat unfortunate the CP Quads ended up in heli, and the only reason that happened is because they use the helicopter throttling system (RSC). The collective pitch used on the CP quad is much faster than throttling motors and accelerating mass in props. So the ATC settings are going to be much tamer than what is used for a conventional quad. And this will likely force use of settings outside the “allowable” range. But Mission Planner’s Full Parameter List or Tree will let you do this. We do it with conventional helicopters all the time.

Conventional helicopters fly primarily on VFF and use the PID only for damping. They are way too fast on reaction of control input to use multi-rotor style tuning, as helicopters can easily achieve roll rates of 1000+ degrees/sec at accelerations that will blow the EKF totally out. Being your CP quad also uses collective pitch, it wouldn’t surprise me that it can also achieve those roll rates.

I haven’t looked at the params for CP Quads, but if the VFF path is available on them in the attitude controller, perhaps look at our tuning wiki for conventional helicopters. If you see settings like ATC_RAT_xxx_VFF the helicopter tuning wiki should work:

http://ardupilot.org/copter/docs/traditional-helicopter-tuning.html

Txs for the additional advice for Brad.

Putting QuadHeli’s in with tradheli was definitely the best fit in my view because they have a collective which allows reverse thrust… that’s currently a bad fit for multicopters.

Yeah, they’re probably the best fit in heli at present. And, actually, they are a low maintenance vehicle type for us since anything we do for heli usually automatically applies to the CP Quads, and it rarely requires writing any code special for them.

I took a look in the code and it appears the CP Quads do use the same attitude controller as other helicopters. So IMO following the heli tuning procedure should work. It has the VFF settings, and it’s a shame they are not being used in the default params in the Tools->Frame_params for the V383 CP Quad. Those VFF settings are pretty important for anything with fast control response, as flying them just on PID is going to be an oscillation nightmare.

Thanks @rmackay9 and @ChrisOlson - those are helpful responses. I’m going to check out the helicopter defaults to see how much different the V383 file is and get some idea of how those changes affect things.

I would still like to know if I blank out a parameter in MP, does it automatically use the default value to replace the missing value, or just assume it should be zero? I don’t know if I even can do it - I haven’t tried it, it was just a thought so I will investigate it some more. This is probably a minor detail really - I doubt that has been an real issue for me.

Chris, I agree with your assessment and can confirm that this thing is crazy responsive - I’m sure that’s why Curtis Youngblood thought it would be a major drone aerobatics hit, especially when you look at some of the videos of experts flying them. But with my complete newbie-ness to this field having never flown an R/C anything, I have had a steep learning curve just to learn to control it, and these hardware problems haven’t helped. I have managed to successfully fly it several times on stabilize before the glitch crashes and all the hardware “upgrades” and mods. I started practicing with “light in skids” and then just little low hovers and such and sort of went from there, and it seemed to work for me - until I tried branching out. Like I said - steep curve.

I did try the helicopter tuning route where you start with just the VFF’s at 0.15, and zero out the PID terms, and then build them up. But unfortunately, that didn’t work that well for me. I seems to me now in hindsight that probably the starting VFF at 0.15 was still way too high for this thing. The original P terms are around 0.125 for pitch and 0.095 for roll in the starting parameter file, with the VFF’s zeroed. At 0.15 it was actually worse in the oscillation, primarily in roll, but it is also there in pitch. The logs show it in all axes, but it’s roll that causes the problems. So I lowered the VFFs to 0.10 and this seemed much better, and I was preparing to lower it a bit more to give some headroom there and start with the small incremental PID increases .

But, naturally that’s when something caused a radio flat-line, and the thing just rolled over and went top down in the grass. No major breakage, but in locking the rotors it did strip the plastic motor pulley, and burn up one of the plastic shaft pulleys - so I had to wait for the slow boat from China. I have just now gotten the parts back together, and meanwhile I’ve been studying the parameters and learning more about the code. I plan to have some very tame settings in there the next time I fly, and probably will start again with the VFF’s at 0.08 this time.

I’m hoping to give it another try here in a few days, so I will take these things you guys have confirmed and see what happens.
Thanks again.

Yeah, being it’s so lightweight and not spinning a big flywheel like a conventional heli, you may have to back off the VFF. The logs, as explained in the heli wiki, tell how much VFF you need for proper rate response.

It will be quite jerky on VFF alone with no damping. So the PID basically only damps the feedforward. With the VFF set right, half the PID value that sets up oscillation is all that’s needed for damping.

If you get it tuned satisfactory, please post your param file so I can update the one in frame params for the future.

Brad,

We don’t currently have an easy way for users to return a single parameter to the default. We’ve talked about it but I can’t promise when that will happen. we do support resetting all parameters to their defaults.

@rmackay9, I have been looking through the parameters and have been trying to understand more about when things are called/activated in the code.

I was specifically a little concerned about the H_LAND_COL_MIN and H_RSC_CRITICAL parameters, since I am concerned (suspect maybe?) that a few of my crash issues may have been related to me putting a bad fail safe setting somewhere that basically causes the heli-quad to stop flying when Land or RTL is triggered, and a couple where radio glitches have resulted in flipping over on it’s back. I am trying to determine whether these two parameters are actually PWM values or percentages of the output range, and it appears to me that they function as percentages. But this is difficult for me to simulate on the bench. Any thoughts? Could you possibly point me to where these are in the code?

Also, I found something curious that I am wondering if you can explain to me:
In Copter.h, at lines 914: ModeAltHold, 931: ModeFlip, and 938: ModeLand there are mode statements that are not embedded in if-loops. What is the effect of that? Is there some other call or function that allows these to just be stand-alone statements? Are they just pass-throughs to mode.h to keep everything on the same page?

Thanks in advance for your time, I know this could be annoying when you guys are working on more important things.
Brad

Both are percentages of total range, as percent * 10. Both are critical to proper auto takeoff and landing function.

H_LAND_COL_MIN should be set to a value where the rotor system produces zero thrust. The logic pulls the collective to this value when the landing detector senses the “bump” on auto-landing. If no further descent is detected with the collective at the zero thrust point, the logic assumes the aircraft is landed and it ok to disarm. Having it set to an excessively high value (positive thrust) can cause unwanted disarm in the air. Having it set to excessively low value (negative thrust) can cause ground resonance issues, especially with large 700+ class machines running a significant amount of negative pitch range.

H_RSC_CRITICAL should be set to a throttle value where the helicopter’s powerplant is no longer producing enough power for the helicopter to fly. This applies mostly to large machines running piston or turbine engines on a throttle curve. But does apply to electric as well, if the electric machine is using a throttle curve. It is used for the system to determine the minimum throttle to the engine that can be used in flight when on autopilot. Anything below the critical throttle, the helicopter is in autorotation. And for auto-takeoff, once the runup timer expires the throttle must be advanced above critical before the autopilot is going to pull pitch to lift off.

I’m not familiar with how RSC critical is applied to the CP Quadcopter. CP Quads can’t autorotate as they do not contain enough rotating mass in the rotors to accomplish it. And further, they rely on differential collective pitch for attitude control, while managing collective for proper rotor speed during autorotation is critical. So even for one with large rotors with autorotation clutches, using up energy to control the machine, that should be being stored for flare to landing, results in a crash anyway.

If you are using a throttle curve with your CP Quad, then you can probably determine the minimum throttle required for flight, and set it accordingly.

The H_LAND_COL_MIN should apply to a CP Quad and be set to zero thrust like any other helicopter.

@ChrisOlson - thanks for the confirmation on this percentage of range thing. I was sort of figuring that out, but it is nice to have someone say - yeah that’s right. This probably needs to be corrected in the parameters listing at some point, it’s a bit misleading as it is.

I am using the RSC setpoint with a new ESC that has the governor feature, and that seems to be working much better than the throttle curve. I had also sort of figured that these two settings were like you describe, but couldn’t find much information anywhere to confirm it - so thanks for the feedback there as well.

Right now, I haven’t adjusted the servo ranges to limit negative collective, although I don’t really have much intention of doing any inverted flight. So I have 1250-1750 range on the servos, which gives just about +/- 10 degrees pitch. I need to limit this to +9/-2, since these little blades will stall beyond 9 degrees, and I don’t need much down pitch at all for attitude control even in quick direction changes. With the range I have right now, I have the H_LAND_COL_MIN at 450, which should be giving me about -1 degree.

I have the H_RSC_CRITICAL at 625, which is just below to the H_RSC_SETPOINT at 650. My ESC governor is expecting something above 1600 to go to full headspeed, so my thought was that if the output is less than the set point for some reason, then I’m pretty much in a critical state. And you are right, there is no spinning energy in these four 12" rotors to maintain any kind of lift at all, so if the motor quits it’s coming down. I was actually worried that this critical setting may be causing some bad behavior with the fail safes by going to some value that would cause the governor to shut down, but now it appears that’s not the case, so I feel better about it.

I am still working through the tuning parameters, and am getting closer. I got a decent low hover today with the VFF’s at 0.04, and the rate P’s at 0.048 (the angle P’s are still at 4.5). I now only have about a 1.5Hz wobble that I am chasing, but the VFF’s definitely gave me much better control response. The wobble is bad enough that I can’t stay up for very long without fear of crashing, and it definitely isn’t a stabilized flight. Thing is, I don’t know if it is coming from the angle P, the VFF, the rate P, or just isn’t enough damping (D) in general. My D’s are pretty low at 0.00133, so I think my next trial will be to increase those to maybe 0.002 and see if that starts to tame the oscillations.

I’m not familiar with the mechanical makeup of the CP Quads, but it should not be that inherently unstable. Do you have play and/or binding someplace in the collective linkages? Or possibly running headspeed too low?

The throttle curve (along with the H_RSC_IDLE setting for ground idle power) is primarily for piston and turbine engines, not for electric. But it can be used with electric, although the curve is usually pretty flat with an electric motor, as compared to say a piston engine. I have one electric helicopter I fly with the throttle curve and it works quite well once the curve is tuned. But it does not go to full 100% throttle like it does with combustion engines.

I agree the negative pitch is not needed if you don’t intend to do inverted flight with it. What type of blades does your CP Quad use? Are they a symmetrical airfoil like most helicopters have? I wonder if they might be like conventional helicopter tail rotor blades? I have one of my bigger turbine helicopters with a 13" diameter tail rotor and that sounds like about the same size as your rotors on your CP Quad.

@ChrisOlson - The rotors are basically belt-driven electric helicopter tail rotors at the ends of 1/2" aluminum tubes. The tubes are attached in an “I” configuration, with a shaft running down the inside of the main center one, with pulleys on each end of the shaft driving the belts. The motor is on a pulley at one end, and the battery is on the other end, with the FC in the middle. The blade grips and control slides and linkages and such are all plastic, but seem to be fairly durable considering all the crashes I have had without breaking any.

I changed the original plastic rotor blades to a carbon fiber set from HobbyKing that are for their Assault Reaper copy of the Stingray. They are normal 110mm tail rotor blades, and these are symmetrical. I have checked the tightness and security of these head parts pretty regularly, since I found some things loosening up on the original machine. So I don’t think there is any play or binding anywhere in the system.

The rotors run at about 6500-7000 rpm, and the motor and ESC have enough headroom to drive them higher, but I don’t see that it’s needed. The 0.6 Mach limit on these would be around 13,000 rpm, but I am running them a lot lower, mainly because the belt gearing is what the thing came with, but also because I’m not sure the plastic parts could take any more without flying apart.

If I can get a successful flight or two, I will post some pics and logs and such to commemorate the event. My goal was to experiment with the autonomous flying options - but I have only had about one minute of flight in Position Hold mode so far, and that resulted in a crash due to a bad setting I put in the battery fail safe. It’s definitely been a learning process - but fun too.

What I was wondering is why the blades seem to stall at 9 degrees of pitch. The same size tail rotor on my helicopter using the same type of blades will handle the torque from 55lbs takeoff weight with a quite powerful turboshaft engine without any tail blowouts. They can handle 15 degrees of pitch pretty easy on the tail rotor. That is a 806 helicopter with the main rotor spinning at 1,450 rpm, and the tail rotor at 6,500 rpm. The blades are 116’s on the tail.

The stall condition is an airfoil thing. Assuming that the blades are thin NACA 0012 style symmetrical airfoils, at this blade length and RPM, the Reynolds number is about 140,000, which gives a peak lift coefficient at about 9 degrees pitch. This value is from test data charts for that airfoil. It would take a Re of about 10,000,000 to get to 15 degrees before stalling - which is about 500,000 RPM for that size blade.

The thing is, even in the stalled condition, there is a little bit of thrust available still, and by 15 degrees, you would have gone out of the efficient “aerodynamic” lift condition, and into the “flat plate” condition, where it making thrust just because it is there spinning in the air, but the drag goes up a lot too. There is a drastic drop in lift (stall) from the peak lift coefficient of 0.8 at 9 degrees down to a minimal amount at 10-12 degrees with lift coefficients of about 0.1 - 0.2, then by 15 degrees it comes back up to about 0.3. But the drag, which was essentially nothing at 0 - 9 degrees, goes up to a Cd of about 0.2 at 15 degrees. So the blades still make thrust, but at the expense of a lot of drag energy being required.

Different airfoils would certainly give different results, but not by a huge amount - still in the same ball park. Flat paddles would “work”, but the cost in terms of drag would make them much less attractive. I wonder if you see a flat spot in the tail thrust in that 9-15 degree range? That would be the stall. I’m pretty sure I was seeing this in this machine before I tuned it down a bit to get better control range, it would clearly sort of quit flying if I gave it too much stick input.

Here are a couple of charts, that show these effects for your enjoyment:

NACA 0012 - Drag.pdf (214.7 KB)
NACA 0012 - Lift.pdf (229.3 KB)

Ah, I see. Yeah, the AoA actually determines stall, not pitch. The pitch certainly affects the angle of attack. But I was quite surprised to learn you are getting stall with that pitch range. Normal helicopter rotor blades using symmetric airfoils usually run at 12 degrees quite happily on aerobatic machines but blade flapping (thru flex of the blades, as most RC do not have flapping hinges) mitigates stall issues at the blade tips. Only at very high forward flight speeds does the retreating blade of a helicopter rotor approach critical AoA causing sudden roll to the direction of the retreating blade along with a sudden nose up attitude as the rotor system goes into Retreating Blade Stall (RBS).

Again, I’m not sure how this applies to CP Quads. The blade tip speed with 12" rotors @ 6,500 rpm is only 340fps. I consider 380fps to be the minimum for so-called “low headspeed” RC helicopters where they will still fly, but quite poorly. 450fps is the minimum for decent performance. 500-550fps is better. Full-size light utility helicopters typically run 550-650fps. All full-size larger than light utility class run 700-750fps.

Since blade flapping, flapping hinges, etc. is a function of the cyclic of a normal helicopter, and your CP Quad does not have cyclic, it is likely handicapped compared to what we are used to. So is more related to a normal multirotor, simply relying on differential thrust from the rotors and extreme frame angle in order to actually move in flight. So you may be correct and hitting the critical AoA at only 9 degrees of pitch. Add to that the fact that the rear rotors of a multirotor run in “dirty” air from the front ones in forward flight, which is not a problem with conventional helicopters, and it would likely cause stability issues.

Instability in conventional heli’s at a particular disc loading is almost always related to headspeed too low, and subsequent operation of the airfoils in an inefficient range of angle of attack to produce enough thrust so it can fly. Conventional helicopters are inherently very stable machines and can be flown without stabilization systems with no problem - it is done in the world of full-size every day. Multirotor aircraft are inherently very unstable and none that I’m aware of can be flown without electronic stabilization. So it’s likely quite difficult to apply conventional helicopter aerodynamic theory to the CP Quad.

OK - yeah, I am only talking about hover conditions here on this little machine. As I have said before, I really have not yet been able to achieve a steady hover - so all of the retreating blade stall, disturbed air, and conventional helicopter flight dynamics stuff doesn’t even come into the picture yet. And for the normal RC tail rotor thrust I was assuming steady state condition as well, and I was just comparing this quad to the rotor on the RC helicopter’s tail from a thrust standpoint, not a flight dynamics standpoint.

A 12 degree pitch on the 0012 airfoil is fine with higher head speeds and longer blades, specifically because that puts it in a high Reynolds number area of around 1-2 million or better. If I was building one of these with larger rotors then I would consider those higher pitches more appropriate, but my point was that these small rotors aren’t operating in that range to begin with, and I don’t think I can spin them any faster for fear of the plastic parts failing, so the 8-9 degrees in hover/climb is about as much as they can tolerate.

As far as I can tell, this machine does have the same basic flight dynamics as a normal multi-rotor, but the collective pitch makes it extremely more sensitive and responsive to control inputs, either from me or from the FC. So the tuning parameters that are used for those don’t work the same here, and I am having to tune things much differently. And since it doesn’t have a swash plate and cyclic pitch, all of the normal parameters you would apply there from the traditional RC helicopters aren’t used either. So it really is a bit of a different animal from a tuning and tweaking standpoint. But - the original machine flew out of the box, and still did on AP with Tridge’s & Randy’s parameters so it is obviously achievable, I just have to figure it out on this one with all the changes I’ve made.

Yeah, I think that’s the main problem with the stability. The collective pitch is so much more responsive than accelerating/decelerating motors and props that it makes it extremely quick. That’s where a PID loop sort of falls apart because proportional and derivative gains can set up oscillations quite easily. I think leaning heavier on the VFF path and using the PID only for damping it should help mitigate that problem.

Well, thrust increases with the square of the speed of the rotor shafts. So maybe try going the other way and slow the rotors down. That will reduce their available thrust and make it less sensitive to pitch changes. I assume the thrust to weight ratio on this thing is quite impressive. So if it’s on the verge of blowing up anyway, and you can run the rotors at slower speed without getting vibration issues, it’s worth a try.