PID Adjustment of porting APM code

Source: Internet
Author: User
Tags apm versions

APM code I've seen several versions of it, From 2.91b to the Pix4flow 3.2.1 to the latest 3.3.1, different versions of the PID code are a little different, about his PID code understanding I will be in a separate article to talk about, today first of my on the Renesas G13 microcontroller platform Tuning PID experience, the PID code is transplanted arducopte R_3.2.1rc1, everyone can go to GitHub to download.

Tuning PID process has reference Bo main Super_mice's blog, the method of four axes and his unexpectedly similar (haha, is "grilled four-axis"), but we did not tie the four-axis so dead, we do not exactly say that we did not tie up two poles, because that may affect the four-axis rotation axis, You can't figure out whether the reason for the pole is causing his small vibration or the PID parameter. But without tying up the four-axis two poles, there is also the problem that he will fly in one direction when there is a static error.

The adjustment process with the super_mice is different, I first give the outer ring (angle ring) parameter a fixed value (this value is not greater than 4.5, the official program of this parameter is 4.5), and then adjust the inner ring, the inner ring is the angular velocity ring, the process is not smooth mainly look at the inner ring adjustment is good or bad. We need to pay attention to, must be able to take off the throttle around the adjustment, or there will be many students have encountered the problem: I am low throttle when the four-axis very stable, but pushed to high throttle he began to shake badly. The inner ring adjustment is good, mainly to see him interference he can quickly stabilize down, anyway, my four axes to his interference, he is able to stabilize the balance of living, in fact, the inner ring parameters OK, you want to give it interference, to use a great effort.

After the inner ring OK, give the x, Y, Z axis the appropriate target angle to observe the response speed, if the response is slow, then appropriate add a little outer ring p, but the outer ring of the General Assembly caused a slow oscillation.

Oh yes, here's the z-axis (yaw) adjustment, and the z-axis in x mode spins if you don't control it. We put a pen cap under the rack (hahaha, refer to the top of the place to do, very witty have wood), so you can put on the ground to observe the adjustment process of yaw. Generally speaking, the inner ring of yaw can be used only to a p to pull the yaw back to the target angle, and there is a static difference to add an I. Finally, looking at the angle response of the z-axis, we find a very serious problem, when the z-axis exceeds the desired angle of 45°, the entire aircraft can be shaken. This means that the x, y axis parameter D may also be fine-tuned. Have a classmate to ask, off X, y axis what thing ah, this will say APM code PID understanding.

Summarize the implementation of the APM Cascade PID Control process: The outer ring (PI) to give a random value, if it is 450 or 330 rack, suggested in between. Then adjust the internal loop PID. After the inner ring adjustment is almost the response of the outer ring, the response is not ideal, then fine-tune the outer ring p. After the x and Y axes are adjusted, the z-axis is adjusted, and the z-axis exceeds the 90° target to see if the aircraft will tremble, and if it shakes, the x and Y axes are still to be adjusted.

is not that APM PID tuning of Good annoying, this is also the general Cascade PID adjustment process, cascade control than the single-layer PID has a lot of, the main anti-jamming ability is stronger, response faster, stable. Two APM stabilize mode and Alt_hold mode control are posted here Partogram

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.