I am opening this topic to serve as the go-to place for talking about the upcoming 2.9 software release for Trad Helis.  I think this will be necessary as 2.9 will have SIGNIFICANT changes in the way that the helis fly, and also in the settings you will use.

Yesterday, I flew 4 packs of "2.9 - rc2" from the downloads section on my 450 heli.  The file is located here:


I would be interested in having some other people try some test flying with this.  I'll have to walk you through the setup, as it requires a bit of work to get a flying parameter setting using the rate controllers which are now active.  You CANNOT fly using the old parameters for Stabilize PID.  Don't even try it.  Also, the Alt_Hold parameters will have significantly changed.

This is slightly complicated by the fact that we have some new Heli-specific Rate PID parameters called "Rate_Pitch_FF", also for Roll and Yaw.  Unfortunately these are only accessible in MP from the Advanced Parameters List.  Hopefully I can get that fixed.  What I'd like to do is for TradHeli, in MP, remove the Rate_Pitch_D, in the Config PID screen, and replace it with Rate_Pitch_FF.  This is because I have found the D-term to be completely unusable anyway.  The FF is feed-forward.  This was what I found was the key to getting the heli to be able to fly in rate mode.  Basically, it is like P-term, but has no error correction.  It's sort of like this:

P-output = P-term x (Rate Input - Current Rate)

FF-output = FF-term x Rate Input

then you also have the I-term output.  So the total servo command is:

Servo-output = P-output + I-output + FF-output

I have also implemented the FF on the yaw controller, and found that it actually helps to stop the slight "tail wag" that we always had.  

There are also some new settings for the collective.  These are Stab_Col_Min and Stab_Col_Max.  What these are for is sort of like Idle-up pitch curves.  You can now set up your swash plate with full negative pitch, maybe a range of -10° to +10°, or +/-12°, but when flying in Stabilize mode, you can set Stab_Col_Min to reduce the amount of negative pitch available to something like -3° or whatever you prefer.  This gives a nice soft feel.  However, in Acro mode, you will get the full range, and also the auto-pilot modes get the full range.  For example, I set my Col_Min and Col_Max to give me +/-10°, and then I set Stab_Col_Min to 40, which is 40%, and this changes the negative pitch to only -2° in Stab mode.

The only thing to know here is that when you change modes between Acro and Stab, the swash-plate will jump up and down, so you have to be ready for it.  It's no different than using Idle-up in your Tx.

My test flights yesterday went quite well.  The Alt_Hold now works beautifully, and I actually prefer landing in Alt_Hold rather than Stabilize!  I also did a few flips with it in Acro mode (very ugly, I'm not good at this) using full negative collective when upsidedown, and it worked well.  It didn't seem to get confused.  Finally, I tried going into Acro, rolling it over upside-down or sideways, then back to Stabilize, and it flipped right way up which is good.

The only problem I have seen so far is that when flying in Alt_Hold, if you push the cyclic full forward and get up a high speed, the altitude starts to oscillate badly.  I suspect this is a classic "phugoid", or pitch/throttle oscillation.  We'll have to work on this. However it seems to fly well up to about 1/2 Vmax.  

I'll try to post my Parameter file here tonight, but I caution that the settings will be HIGHLY dependent on your servo speed, as well as many other setup differences.

Views: 31884

Reply to This

Replies to This Discussion

will this version work on the old board?

Do you mean the APM1?

APM1, I dunno.  It's completely untested.  One aspect of this is we are now making use of digital filtering in MPU6000.  That's actually another thing that we need to talk about, because you have to manually set the filter in the Parameters list, it defaults to unfiltered.  I'm currently using a 10Hz filter.  This seems to help a lot with vibration.

Unfortunately, this can't be done with the APM1, since it uses analog sensors.  Doesn't mean it flat out won't work, but I haven't flown it.

If you are referring to APM2.0, there should be no issue.

Yes. I only have version one. I think 1.4 is written on the board. With the 2560 processor. besides the filtering any other potential issues? Last version I successfully used was 2.7. something

That’s really great, will start testing it with my 450 tomorrow.

I downloaded it already.

Thanks a lot Robert, and thanks to all the others involved

Happy New Year  

I've tested the new code on an APM1 in a quad and it worked fine.

Alt hold was not as good as with the APM2 because the barometer is much better on the APM2 still, I think the new alt hold is a big improvement for the APM1 as well.

By the way, I've found out that on the APM1 we're only running the baro at 5hz even though the sensor can run as high as 30hz.  The reason is that we check the temperature too much (also 5hz) but more importantly the sensor shares the i2c bus with other sensors including the compass so we need to be very careful of interference.  We need to add a semaphore to allow us to increase the update rate of the baro.

Ok. Great. I will load it as well. Can anyone comment please how to load. I assume latest version of arduino. Are the right parameters for compiling already set in your download file or do I need to mod anything for apm1 for compiling?

Ok, that's great to hear Manfred, you have been pushing the limits of the code for helis as well so I look forward to your feedback.  

So here is what I think you should do to get started.

First, I'd save all your existing parameters to a file, then do an erase EEPROM and Reset after you finish loading the new code.  This will bring in all the new parameters.

Now this means you will have to go through the swashplate setup again. Many of the values will remain the same, such as the servo reversing and trim.  However, the H_Col_Min, Max, and Mid will all change.  This is because Randy and I found and fixed the bug that was making this not work correctly.  So the good news is that when you do the Min/Max/Mid configuration, it should actually work, and you won't need to fiddle with the numbers you get.  After doing the setup, the swash should then move the correct amount when you test it.

I set my heli up with +/-10° pitch, IIRC.  Then, you will need to go in to the Advanced Parameters tab, then Parameters List, and find H_Stab_Col_Min, and Max.  I set these Min to 30, and Max to 90, IIRC.  This gave me a collective pitch range of I think -2° to +8° in Stab mode.  That's how I like to fly.  

Now, any time you change these numbers (ie: change them in MP and "Write" to the APM), they won't take effect right away.  There's a number that gets calculated, and it is only recalculated when you reset the swash.  The swash is reset any time you reboot.  However, you can force it, if you find H_Swash_Manual, and set it to 1, write, then set it to 0, and write, that forces it to reset the swash, and you'll see the effect of the Stab_Col changes.  Hopefully we can get this fixed up in MP.  I would like all of this in the Heli setup screen.

You should be able to switch between Acro and Stab, and move your throttle, and you'll see the difference in the swashplate movement.

I do recommend setting up the swash with lots of negative pitch, and then set the Stab_Col_Min for whatever you are comfortable with. Even if you'll never use it negative pitch in acrobatics, this still allows the Alt_Hold controller to have access to full negative pitch, which sometimes it will need.

So I think that covers the swashplate setup changes.

Now, we come to the PID tuning.  This part is a bit tricky.

The first tip I can offer, is that whenever you go into the Arducopter PID config screen, make sure that Lock Pitch/Roll is unchecked.  From my experience, helis need seperate pitch/roll values, because the moment of inertia of the airframe is very different in the axes, this is because the tail boom is so long, there's a lot more mass in the fore/aft axis, so it's slower.

Another very VERY important thing to know.  In Advanced Parameters/Parameters List, find a param called "MPU6K_FILTER".  This is the built-in filtering of the MPU6000 chip.  Using this can help to cure "leans", and it also has an effect on the stability, I think.  It defaults to 0 which means "use the default filter rate" which is currently set to 42hz.  Valid selections here are 98hz, 42hz, 20hz, 10hz, and 5hz.  I have flown with most of them.  98hz is what we used to have.  42hz should be a bit better.  But I would recommend people to try 20hz, and 10hz.  I am flying with 10hz on my 450.  I should try 5 sometime. The lower the filtering number you have, means a stronger filter.  A stronger filter helps with vibration, but does make it very slightly less responsive.  So it's a balance.  In reality, I can't "feel" the filter while flying.

I forgot to grab my parameter file last night, but going from memory here...

First, I would say that the Stab_Roll_P value should be the default, 4.5, and Stab_Pitch_P, I actually changed to 3.5.  This softens the pitch axis a bit, and helps prevent bouncing.  I-term on both should be zero, D-term too.

Now, the rate part is tricky.  

Here's what I did while developing, and I think this should work for others.

You need to be able to change the Rate_Roll_FF, and the only place you can do that is in Advanced Parameters/Parameter List, at this time.  To start with, set these to 0, they should be 0 by default.

Now, go back to the PID config screen.  Here's where it gets tricky.  I really recommend you do this in a large area, with no wind.  Maybe indoors.  I did it inside in a 20x20 area, but only if you're a good pilot.

Something to keep in mind here, because the Rate PID numbers you come up with will be heavily influenced by the following:

1) Your swash servo speed

2) Your swash servo motion ratio (ie: servo arm length, swashplate dimensions, and blade grip arm length)

3) H_Pitch_Max and H_Roll_Max

Any time you change these, you'll probably have to retune your Rate PID's a bit.  I expect that with faster servos, you'll be able to tune Rate P up, and get better control without oscillation.

I'd start with Rate_Roll_I of 0.100, Rate_Pitch_I of 0.050.  Now, set Ch6 tuning to Rate_P, and set the numbers from min 0.010 to a max of 0.075.  Turn your Ch6 knob all the way down.  Refresh parameters and make sure that Rate_Pitch/Roll_P shows up at 0.010, so that you know the Ch6 tuning is working right.

Now it's time to spool up the heli.  Be VERY careful.  Don't just take off, because you will have very little control over the heli!  It might be best to do this with training gear if you can.

Lift off just one inch, but be ready to put it down because you will have no control.  It's gonna be bad, so be ready for it!  So, you should have no oscillation with a P-term of 0.010.  If you do...  I dunno, you have big problems!  Now, try turning the knob up a bit, maybe to 0.020.  Try just lifting off, you will still have little control, but hopefully you will have no oscillation.  Keep doing this, testing more and more P-term until you get oscillation.  Be careful with that P-term, because once you find the point where it oscillates, it gets bad REALLY fast and you could destroy the helicopter!

You will find that the oscillation will always happen in the roll direction first.  This is because of the lower moment of inertia.  I am using a Rate_Roll_P of 0.040.  Hopefully you end up in that range.  However, you will find that you still have very little control, even up to the point where it starts to oscillate!  This was the problem we always had.

Once you find the oscillation point, back off a bit, maybe 0.005 to 0.010.  Now, set the Ch6 tuning to "None", and make sure you have a good Rate P-term in the window.  Again, mine oscillates around 0.050, so I set it to 0.040.  If you fly right at the limit of oscillation, you will find that sometimes if you bump the skids, or there's a wind gust, it can start to oscillate.  That's why you want to back off a bit.  

Now you have established your Rate_Roll_P value.  Your Rate_Pitch_P value can be a little higher.  I think I'm using 0.050 (while 0.040 for Roll, make sure you have unchecked "Lock Pitch/Roll"!)

Now you can play with the I-term.  You can do so similarly, with Ch6 on the knob.

However, important to remember, that in this case, the Rate_Pitch_I term will be LOWER than the Rate_Roll_I.  I am using Roll_I = 0.250, and Pitch_I = 0.150.  These are less critical, you're not likely to destroy the heli with a high value, more likely just just get a "bounce".

So, at this point, you should have a heli that will fly without shaking, but it still flies like it's drunk.  It'll just wander around and you're chasing it.  Now it's fine to fix that.  Go into Advanced Parameters/Parameters List, and find Rate_Roll_FF.  Set it to maybe 0.020 to start.  Do the same for Rate_Pitch_FF.  Write those, and then give it a test fly.  You should now find that it flies much better, you will have more control, it should hover nicer.  Play with those numbers a bit, always doing a Write, of course.  I am using I think 0.040 on Roll, and 0.050 on Pitch.  I don't actually know yet how high you can push these, I think it will start to oscillate eventually.

At the same time, think about adding some Rate_Yaw_FF.  I think I'm using 0.040 here too.  You might expect to back-off on the Rate_Yaw_P just a bit.  I think I used to have P=0.120, and now I have P=0.100.  I'm not finished fiddling with this yet.  But what I found was that this makes the yaw control even stronger, while also reducing the very small oscillation I always had.

So, that's what I've got off the top of my head.  Any questions, please ask.  And be careful!

Great stuff, thanks Robert for the detailed advice.

I compiled the code already successful, after a bit of a hick up.

I will set it up now and hopefully the weather forecast  is right for the next days, calming down the wind.

Couple things I forgot:

1) When you change the MPU6000 filter rate, it only takes effect when you reboot.  It does not work immediately.  This is because we only set the filter in the MPU on boot-up.  Luckily, you really shouldn't have to play with this too much.

2) I found a bug yesterday.  The Alt_Hold controller uses the Stab_Col scaling.  It will use the same collective range you have in Stabilize mode.  The Loiter control, uses the Acro scaling (full range).  So this means that in Alt_Hold, you don't have as much range as you should.  It also affects the Alt_Hold tuning.  Finally, if you switch from Alt_Hold to Loiter, the heli jerks vertically.

I have fixed this, and you should see a 2.9 rc3 available soon.  I'll post here when it comes out.

You could also make the fix manually, it's super simple, just copy this into your file:


I am using the default Alt Hold parmaters, except for the Throttle Accel or whatever it is.  Default is P=0.75, I=1.5, and I'm using P=0.5, I=2.5.  Give it a shot.

Leonard Hall has suggested detuning the Alt Hold Accel numbers a bit, it should help with the "porpoising" problem in fast flight, and hopefully still leave us with enough control in a loiter.  I'll see.

I am prepared to hack in a Z-Accel FF if I have to.  I think it will help, as I bet the oscillation is largely due to I-term action.

Do I need a flybar-less bird for this?  I Just got my 500 in the air on 2.7, so I don't have much to lose by testing this code.

It should work with a flybar, but know that it's not well tested.  I actually did the initial development work for the rate controller on my 600 flybar.  I finished the work on my 450 flybarless.  But I don't foresee any problem.  

So I think it will be Ok.  

You just have to set H_Swash_Type to 1, which changes a few settings for the flybar.  

I compiled and loaded the 2.9 then I went to Mission Planer Terminal

There it was acknowledged 2.9 are loaded.

Then I went to setup – erase:  EEPROM erased ok.

Then I commanded reset and Y, got the message reboot APM

 Switched off and on to reboot, but he doesn’t reboot.

I tried command reboot in the Terminal no success.  

I think I do something wrong, but what?

Reply to Discussion


© 2018   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service