-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/TPA #5861
Feature/TPA #5861
Conversation
Awesome! Do you have some feedback on MC_RATE_I_MODE? |
I have removed it from this PR, I am still trying to figure out how this code affects flight characteristics |
@anton-matosov Interesting; have you done any testing to show the motivation for and effectiveness of also scaling the I and D gains? Also, what is more predictable about the scaling now? |
My drone had D oscilations at 0.8+ throttle that I couldn't compensate with existing TPA. That was the main motivation for these changes. |
@@ -1005,6 +1053,63 @@ MulticopterAttitudeControl::task_main() | |||
_controller_status_pub = orb_advertise(ORB_ID(mc_att_ctrl_status), &_controller_status); | |||
} | |||
} | |||
|
|||
if (_v_control_mode.flag_control_termination_enabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should be in my RC failsafe PR #5863
@anton-matosov Thanks,that makes sense. I hadn't noticed a need for decreasing D when tuning and my procedure was just to increase the slope till the oscillations were inaudible. Hence I didn't really care what the actual attenuation at max throttle was, though I did calculate it afterward. With the new scaling, both r and b affect the slope, so it might be best to rename the r parameter to something which more accurately names its function. |
Agreed. In other flight stacks it's called TPA Rate |
@anton-matosov This looks awesome. Is it feasible to enable a safe default for all platforms? Do you have a chance to test with a 450 sized drone? |
Unfortunately I have only 250 racer and 550 hexa (which weight 2 kg). I was ok to test full throttle with racer, but not comfortable at all to do this with hexa. |
# Conflicts: # src/modules/mc_att_control/mc_att_control_params.c
Can anyone please take a look at this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the autostart id 4070 to something else? This conflicts with the recently merged Intel Aero board.
Sure, will change to 4080 |
@kd0aij P gains don't even participate in the acro mode, only rates. The main influencer of the attitude hold for acro mode is I rate, I have found it should be in the range of 0.19-0.25 for my frame/motors/esc/battery/props setup. @LorenzMeier parameters are actually very unique for frame/motors/esc/battery/props combination. If I simply change props I already need to re-tweak parameters (deviation depends on how big is the change).
Setup for which zmr250 config was created is as follows:
I will put this info into config as well. I have switched to 3 blades recently and tried 2 different kinds:
I have some flight videos captured for current settings and RK5051 props. Once I get a change to process them I will share them in the px4 discussion forums. |
@anton-matosov Of course I was referring to the rate P gains; sorry for the ambiguity in my comment. |
Yep, that is what I am flying at, and with RK5051 props I will have to lower them even more |
Here is one of the FPV flights https://youtu.be/-SNok411Btc |
Thanks for posting video; that helps a lot for comparison. I'm running 3S, 2300KV motors and 5.4.6 Hyperion bullnose 2-blade props at a field elevation of 1760m. Hard to believe the altitude makes such a big difference; I wonder if something else is different? I'd appreciate it if you could post logs using the new logger, with lots of rapid roll/pitch action. (easier to do in stabilize mode without crashing) That would let me run an impulse response analysis for comparison with my racers. BTW, the current TPA eliminated high-throttle oscillations for me without degrading overall performance. |
You are welcome. |
Assuming you're using Pixracer, all you have to do is use QGC to set parameter SYS_LOGGER to "new logger". |
|
Why have you reduced the multirotor mixer roll_scale parameter for the zmr250? Are you using that to compensate for a lower moment of inertia on the roll axis? My approach would be to lower the rate_P gain for the roll axis instead. |
Are you referring to MC_PITCH_TC and MC_ROLL_TC? these parameters work as simple PID fine tune scale factor (MC_ROLLRATE_P/I/D * 0.2/MC_ROLL_TC, same for pitch). There is no real need to change them, you can simply adjust your PIDs, but I have changed them during original tuning and got current PIDs with TC applied and it was flying really well so I decided to leave them. In the next iteration of tuning for 3 blades I am going to remove MC_*_TC from config |
Thanks for the good details @anton-matosov, it makes a lot more sense now. It would be great if you could work with @DonLakeFlyer on a tuning UI for multicopters that is more user-friendly (new or different sliders). |
I've rebased this, removed the merge commit, removed all noisy (fix ABC) commits and was left with one clean commit. See master. |
@anton-matosov Thanks for all the hard work! |
@@ -0,0 +1,10 @@ | |||
# R: <geometry> <roll scale> <pitch scale> <yaw scale> <deadband> | |||
R: 4x 7654 10000 10000 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anton-matosov I'm talking about the roll_scale parameter (7654) on this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, never mind my previous post then.
Mixer config is the best way to accommodate custom geometry. ZMR 250 is asymmetric and mixer compensates this.
For ZMR250 mixing for cleanflight/betaflight please refer to https://oscarliang.com/custom-motor-output-mix-quadcopter/
@LorenzMeier |
I'd like to see flight logs for both your 250 and 450 quads (in the new
.ulg format) for impulse response analysis.
…On Thu, Dec 15, 2016 at 12:16 AM Anton Matosov ***@***.***> wrote:
I have performed some testing of the acro mode on SK450 frame with 11kv
motors, 10x4.5 slow-fly props and 3s battery. And it doesn't seem to have
any noticeable oscillations on full throttle punches.
I have not finished PID tuning tho (broke frame), but I have noticed that
I can/need get much higher D rate gain compared to racer setup before I get
response without overshoot and even much higher gain to get sluggish
response or D style twitchiness.
So behavior of PID loop in acro for bigger frame is very different.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5861 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACMZPS4ZhURs7dlKWe7bqg41S5jTXyD_ks5rIOllgaJpZM4KyTM4>
.
|
@kd0aij my 450 is flying pixhawk, not pixracer will new logger work there? |
If you're building fmu-v2_default, you have to change the cmake config for that target to build logger instead of sdlog2. Then just set parameter SYS_LOGGER to the new logger and it should start up on boot. |
@kd0aij here are some flips and rolls logs for my ZMR250 (I hope this is the right file, FlightPlot doesn't plot any of it for some reason) |
Thanks, Anton. This log looks fine in FlightPlot; make sure you have the
latest version of PX4/FlightPlot installed.
I'll run the impulse analysis today for comparison with my own 250s. Should
be interesting.
Here's a 450 size frame that would be hard to break:
http://www.aquacopters.com/store/p2/Project_X-Frame_Only.html
but so far I've only crashed mine into water. That saves a lot of props;
I've only managed to break one prop that way.
…On Sat, Dec 17, 2016 at 10:36 PM Anton Matosov ***@***.***> wrote:
@kd0aij <https://github.com/kd0aij> here are some flips and rolls logs
for my ZMR250 (I hope this is the right file, FlightPlot doesn't plot any
of it for some reason)
ZMR250 flips and rolls logs.zip
<https://github.com/PX4/Firmware/files/659270/ZMR250.flips.and.rolls.logs.zip>
Unfortunately I broke my SK450 before I got a chance to grab logs for
flips and rolls. So will get them for you once I fix it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5861 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACMZPcbB-svKAvIIKfeF8P4yaTJDnb2Aks5rJMZAgaJpZM4KyTM4>
.
|
@anton-matosov Your tuning looks great! Here's a link to the plots: https://github.com/kd0aij/impulse-response/tree/master/sample_ulogs/ZMR250/flips_250/plots |
Thanks. I am very pleased to hear that I did it right 😊 |
The waterproof frame looks interesting. How do you recover your quad from the water? What if it flips over? |
A canoe is a good idea... Even with a receiver antenna taped to the inside bottom of the hull, I've not managed to flip back upright. Seems I lose the RC signal. But I'm sure I've seen videos of copters flipping back upright; would probably work with external whip antennas. A boat (or maybe a Golden Retriever) would still be a good idea though. |
BTW, this is my S250 (3S) tuning: https://github.com/kd0aij/impulse-response/blob/master/sample_ulogs/S250AQ/2016-12-13/plots/rate_impulse.png A little faster than yours, but a bit under-damped. |
Re-implement Throttle PID Attenuation to support per-component setting of attenuation break and slope rate.
Used a bit different function that has preductable curve based on inputs.
You can compare both functions here https://www.desmos.com/calculator/gn4mfoddje
(PR includes new ZMR250 frame rc and mix files)