One-week summary of four-axis spacecraft PID debugging

Source: Internet
Author: User

Arduino + XXD ESC +1000kv motor, using PID to adjust the stability, this morning finally adjust the x, Y axis stability. Recall the problem encountered, really is the value of the test out.

The PID algorithm is very simple, writes the words does not need 10 minutes to be able to write, but wants to find the value to the p,i,d three parameter The good luck words, does not needless to say, the bad luck adjustment one months not necessarily can stabilize. With MPU6050 debugging, a shaft is debugged in the interior, which is a frame on the stool, allowing an axis to rotate freely, similar to the following

Using Euler angle to adjust the PID three parameters, first encountered a problem, that is, when I set a value of 0 degrees when the level of the performance of the time is also a small shock, there is not too much divergence phenomenon, but when I set the value is not 0 degrees but deflection a certain angle when the performance of what is not. The cause of the problem is: my throttle is too small. Because the first tune when the blade turn quickly, do not dare to increase the throttle, only 1100 of the throttle (full-scale is 1900, is the program's duty ratio), the throttle is too small to get rid of the impact of gravity, so there is no way to tune the right. This is the first place that can't be left open.


The next time we will increase the base throttle, at least to get rid of the impact of gravity, and then a few days of P, I, d parameter tuning.

First of all, if you can put the balance position and also divergent shocks, indicating that the p is large, narrow down, narrow to a small amplitude of the concussion, here to say a little trick, is to use the hand to the axis to about set angle, to see if the axis is small amplitude oscillation, if the small oscillation explanation p adjusted well, conversely,  If the shaft is too strong, too big, if the force feeling is not enough, it is too small. At this time we must not ask for quick and static errors.

The elimination of static error, adjustment I. P can be adjusted, slowly increase I, Our I are all 0.01 increase, the specific practice is that I first add a larger value, this time the four-axis reaction is as intense as the X-ray, and then slowly shrink, until the four-axis began to calm down, about the calm down I also do not have a standard, of course, if you reduce the process can be quickly placed in the balance of the position and not the oscillation does not overshoot Unfortunately, I will be able to wait for the amplitude of shock, even if the amplitude of the amplitude is still very large as long as you can wait for the amplitude of turbulence, as long as it is not divergent can already be, and so unequal amplitude are subjective induction, do not need too accurate, after all, people are not instruments.

The above two parameters are not easy to adjust, and then began to tune D (some open source flight control does not need D ah, but for our rough debugging without D above the two value is simply impossible to use). Just started to tune D, the formula is not released, because the adjustment of P, I was the experience that I can predict the tangent range must be around here.  But D is not the case at all ah, I once +1 +5 +10 There is still concussion, and fast, it is not easy to say that the smooth adjustment needs 5~10s!! Until I suspect that the program is wrong, and then check the data is to open other people's flight control. Look at the anonymous flight control, CAI Large code of the PID, then found that a few lines of core code are poor Ah, why is not it!  Until this morning, let go and tune again, D sang Sheng was I added to 200-_ (-, Steady!) The curve is probably like this.


Rise time of not more than 0.5s and can also be stable in the set value there, reached the online mature flight control smooth effect.

The PID algorithm itself is very simple, the theory behind although all in the classroom handed over to the teacher, but in the use of such a cool but instead inspired their desire for knowledge. The PID core algorithm was extracted from the wiki with the following pseudo-code

Previous_error = 0integral = 0start:   error = setpoint-measured_value   integral = integral + Error*dt   Derivati ve = (error-previous_error)/dt   output = kp*error + ki*integral + kd*derivative   previous_error = Error   Wait (d T)   Goto Start

In addition to the key point is to be bound by a number of potential awareness of the process of commissioning the theoretical analysis of the aircraft is also essential.



One-week summary of four-axis spacecraft PID debugging

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.