APM code I've seen several versions of it, From 2.91b to Pix4flow 3.2.1 can be used to the latest 3.3.1, the different versions of the PID code are some differences, about his understanding of the PID code I will be in a separate article to chat, today I first talk about the Renesas G13 SCM platform to adjust the experience of PID, PID code is a transplant arducopte R_3.2.1RC1, you can go to github download.
The process of tuning the PID reference Bo Master Super_mice's blog, the four-axis method also and his unexpectedly similar (haha, it's "grilled four-axis", but we didn't tie the four-axis to death, so we didn't tie up two poles at all, because that might affect the four-axis rotation axis, You can't figure out why the pole is causing his small vibration or the reason for the PID parameter. But there is also the problem of not tying up the two poles of a four-axis pole, that is, when there is a static difference, he will fly in one direction.
Unlike the regulation process of super_mice, 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 speed loop, the process flat instability mainly look at the inner ring tune good. We need to be aware of, must be able to take off the throttle around adjustment, or there will be a lot of students have encountered the problem: I was low throttle when the four-axis is very stable, but pushed to the high throttle he began to tremble badly. The inner ring of good, mainly to see him interference he can quickly stable down, anyway my four-axis to him interference, he is able to stabilize the balance, in fact, the inner ring parameter OK, you want to give it interference, to use a lot of strength.
After the inner ring OK, to X, Y, Z axis of the appropriate target angle to observe the response speed, if the response is slow, then appropriate to add a little outer ring p, but the outer ring p over the assembly caused by slow vibration.
Oh, well, here's what you need to say about the Z axis (yaw), which spins if the z axis is not controlled in x mode. We installed a pen cap with ballpoint pens under the rack (ha ha, refer to the location of the gyro to do, very witty there are wood), so you can put on the ground to observe the yaw adjustment process. Generally speaking, the inner ring of yaw is only used to a p to pull the yaw back to the target angle, there is static difference words plus a i. Finally, looking at the z-axis angle response, we found a very serious problem, when the z-axis exceeded the expected 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, close X, y axis what thing ah, this will say APM code PID understand.
Summary of APM this cascade PID regulation process: first the outer ring (PI) to give a value, if it is 450 or 330 racks, recommended between the 2~4. Adjust the inner loop PID again. The inner ring is about the same, then look at the outer ring response, the response is not ideal and then fine-tune the outer ring p. After the x and Y axes have been tuned, the z axis is adjusted to exceed the 90° target to see if the plane shakes, if it shakes, the X, Y axis is still to be tuned.
is not think APM's PID tune good annoying, this is the general Cascade PID Regulation process, cascade control than single layer PID has a lot of a bit, the main anti-interference ability is stronger, response speed, stability. Here are two APM stabilize mode and Alt_hold mode control Partogram