Design of Position PID Control Algorithm Deng-Yuan ZENG*, Ling LONG and Jun-Xiang HE Southwest National University of Chengdu, China *Corresponding Author
Total Page:16
File Type:pdf, Size:1020Kb
2017 2nd International Conference on Applied Mechanics and Mechatronics Engineering (AMME 2017) ISBN: 978-1-60595-521-6 Design of Position PID Control Algorithm Deng-yuan ZENG*, Ling LONG and Jun-xiang HE Southwest National University of Chengdu, China *Corresponding author Keyword: Position PID Single Chip Microcomputer Servo Error Last Error KP KD. Abstract. The servo control scheme on the basis of single-chip, this paper presents a solution to a positional PID control algorithm, the algorithm is to control the volume when full output, adding proportional, integral, differential link, the feedback to the output, complete closed-loop Control system to speed up the controlled response rate. Successfully solved in a short time the steering gear to achieve the desired effect, speed up the steering gear response rate. Introduction The steering gear can be said to be integrated with a DC motor, a motor controller and a geared motor, etc., and is packaged with a housing servo unit. Through the input of a fixed frequency of different duty cycle PWM signal to the steering wheel to rotate the more accurate angular displacement of the motor control system. Widely used in various colleges and universities, primary and secondary school robot teaching, but also all small and medium enterprises in the control system of choice. Add positional PID servo control on the control algorithm, when the speed of the system's response to the deviation signal is greatly enhanced, the system greatly reduces the time adjustment, and does not require a large number of complicated theoretical calculation, we do not have precise knowledge of the controlled object precisely of the mathematical model. The Classic PID Analysis For the control of the steering gear can be open-loop control and closed-loop control, open-loop control directly given the desired value, through a period of time, to overcome some of the defects and then slowly set the desired value, or near the expected value, by the outside world The position error can occur when the input unit enters the desired value, so that the current position error can be obtained, so that it can compensate in time and solve the influence of the external environment on the steering angle. Increase, the reaction rate also has a big improvement. The control schematic is as follows among them. Figure 1. PID controller schematic. 1(t de t) uKetetdtT(t) () () pd 0 Tdti Proportion of links - the main amplification output, its role can be expressed as K*ep ( t); Integral link - the main thing is to integrate the time constant, its role can be expressed as 1 t K*etdt () ; p 0 T i 185 Differential link - mainly on the time constant differential, its role can be expressed as de() t K*T ; p d dt Actuator - for the actuator, that is, the work of the accused unit; this article to the steering gear for the implementation of the unit. Sensor-sensor, such as the speed measurement, the need for photoelectric encoder; measured voltage need to use a voltage divider to collect small voltage. Its role is to pass the feedback signal to the system. Realization of Positional PID Algorithm for Servo The positional PID adds a step signal input to the given PID algorithm and discretizes n T TD Un() Kp {() en ei () [() en en ( 1)]} u0 Tii0 T After simplification, can also be expressed as n u(n)=Kpien ( ) K ek ( ) K d ( en ( ) en ( 1))+u0 k 0 among them KT K T p , K P d K i d T i T With the microcontroller (MK60DN512VLL105N22D) to the steering gear (S3010) input control signal for the servo work generally use 50hz frequency of different duty cycle PWM wave to give the steering gear gives a more accurate angular displacement, here through the program control microcontroller internal PIT The timer generates 300Hz different duty cycle PWM wave to the steering gear to send the angular displacement of the control signal, and then through the position PID to do closed-loop control. C language program Val uint16 SetVal Kp * Error Kd * Error Last_ Error ; where Val is the final output value, SetVal is the set value, and then the current error is calculated at the end of the program. Error = Expected value - Output value , And then the current error in the calculation assigned to the last error LastError Error ; KP is proportional to the controller, in fact, is proportional to the adjustable controller can be adjusted, that is, Val KP * Error ; where KP for the proportional gain can be greater than 1, but also can be less than 1; where KP larger, the controller magnification The larger the curve of the controlled parameter, the smaller the KP, the smaller the magnification of the controller, and the smoother the curve of the controlled parameter. But at the same time the proportion of the controller will introduce the role of surplus, to eliminate the influence of the surplus to introduce the integral link KI. KI is the integrator, the integral is accumulated over time, and then the introduction of the error to accumulate, that is, when the measured value and set the value of error when the integrator will continue to accumulate the deviation over time. The integrator will only stop when Error is 0. Val KP * Error KI * Error , KI * Error is the output caused by the integrator. The smaller the integration time is, the higher the integral is, the stronger the integral effect is. The larger the integration time is, the smaller the integral speed is, and the weaker the integral effect. KD is a differential controller, mainly used to overcome the lagging problem of the controlled object, differential output and differential time and deviation changes and the deviation does not matter. The longer the deviation rate is, the longer the derivative time is, the greater the differential output is caused, and if the differential effect is too strong, the controller will produce significant "spikes" and "mutations". 186 Analysis of Positional PID Algorithm Control In the control of the steering gear analysis of the response Figure 2. P controller response curve. Figure 3. PI controller response curve. Figure 4. PD controller response curve. Figure 5. PID controller response curve. P Controller Diagram Response Curve (Figure2) Shows that only in the proportion of links, the proportion of links is to amplify the error signal to improve the sensitivity of the controller on the error signal, with no distortion, no delay, proportional amplification of the input signal with the characteristics of the signal changes over time. But too large Kp will appear system shock and divergence, the system becomes unstable, increase the overshoot; PI Controller Diagram Response Curve (Figure3) Shows that the proportion of links to join the integral part of the elimination of residual. Integral link can play a part of the memory function, it can accumulate the error, so that the control signal of the controller continue to increase until the error is 0, will stop working, eliminating the system deviation; PD Controller Response Curve (Figure4) Diagram shows that in the differential link, it changes the trend of the system to the controller output control signal, the system can make a large change in the advance correction signal, greatly reduce the overshoot, so that the system response rate has been greatly improved. PID Controller Diagram Response Curve (Figure5) Can be obtained. After the positional PID control algorithm is added to the steering control system, the performance of the system has been greatly improved. The system is not distorted and 187 improved at the corresponding rate, and the system is eliminated. Residuals, so that the system can overcome the external factors to achieve the desired results. Conclusion After the test, in the control of the servo on the position of the PID, the rapid response to the servo on the algorithm to control, in a short time to allow the servo control system to be handled accordingly, greatly speed up the rudder reaction speed, So that the steering gear can be in a short time to achieve "stable fast." Acknowledgements This work was financially supported by the Fundamental Research Funds for the Central Universities of Southwest University for Nationalities (NO.20 16NZYQN08). Reference [1] Wang Q.G., Hang C.C., Yang X.P. PID controller design via IMC principles[C]// Control Conference. IEEE, 2015: 514-521. [2] Panagopoulos H., Åström, Karl J. PID control design and ℋ∞ loop shaping [J]. International Journal of Robust & Nonlinear Control, 2015, 10(15): 1249-1261.] [3] Shah P., Agashe S. Review of fractional PID controller [J]. Mechatronics, 2016, 38:29-41. [4] Freire H.F., Oliveira P.B.D.M., Pires E J S, et al. Many-Objective PSO PID Controller Tuning [J]. Lecture Notes in Electrical Engineering, 2015, 321:183-192. [5] Maheshappa H.D., Samuel R.D.S., Prakashan A. Digital PID Controller for Speed Control of DC Motors [J]. Iete Technical Review, 2015, 6(3): 171-176.] [6] Vishal, Ohri J. G.A. tuned LQR and PID controller for aircraft pitch control [C]// IEEE, India International Conference on Power Electronics. IEEE, 2015: 1-6. [7] Liu L., Pan F., Xue D. Variable-order fuzzy fractional PID controller. [J]. Isa Transactions, 2015, 55: 227. [8] Hwang S.H., Shiu S.J., Lin M.L. PID control of unstable systems having time delay[C]// Control Conference. IEEE, 2015: 2162-2167. [9] Garrido J., Vázquez F., Morilla F. Multivariable PID control by decoupling [J]. International Journal of Systems Science, 2016, 10(1): 1-19. [10] Taeib A., Chaari A. Tuning optimal P.I.D. controller [J]. International Journal of Modelling Identification & Control, 2015, 23(2): 140.