Method for modeling and automatically tuning PID (proportion integration differentiation) parameters of two-axis pan-tilt

文档序号:1658225 发布日期:2019-12-27 浏览:18次 中文

阅读说明:本技术 一种两轴云台建模以及自动整定pid参数方法 (Method for modeling and automatically tuning PID (proportion integration differentiation) parameters of two-axis pan-tilt ) 是由 李秀智 贾桐 张祥银 于 2019-08-23 设计创作,主要内容包括:本发明属于系统辨识和运动控制领域,尤其涉及一种两轴云台建模以及自动整定PID参数方法,用于解决两轴云台存在静态误差并且信号跟随能力较差的问题,本方法采用频域分析,对两轴云台输入变频正弦的位置信号,使用惯性导航模块采集两轴云台实际的位置信号,通过计算机中的MATLAB工具箱对两轴云台建立传递函数模型,并且自动整定PID参数,最终将获得的参数应用于云台电机控制器中,以此作为对现有问题的改进。本方法不需要对云台原有的机械结构做出改动,同时降低凑试法整定PID参数时间,且具有一定的鲁棒性和有效性。(The invention belongs to the field of system identification and motion control, and particularly relates to a method for modeling and automatically setting PID (proportion integration differentiation) parameters of a two-axis pan-tilt, which is used for solving the problems of static errors and poor signal following capability of the two-axis pan-tilt. The method does not need to change the original mechanical structure of the holder, reduces the time for setting the PID parameters by a test method, and has certain robustness and effectiveness.)

1. A method for modeling and automatically setting PID parameters of a two-axis pan-tilt is based on two pan-tilt motors, a pan-tilt motor controller, an inertial navigation module, a serial port transmission module, a signal generator, a double closed-loop PID controller, a feedforward compensation controller and a computer,

wherein the content of the first and second substances,

the pan-tilt motor is two: the Pitch control device is used for controlling a course angle Yaw and a Pitch angle Pitch of the holder respectively;

cloud platform motor controller: and the singlechip with a programming function is used for communicating with the computer and acquiring the data of the inertial navigation module.

The inertial navigation module is used for acquiring the current attitude of the holder, and comprises a course angle value, a pitch angle value, a course angular velocity and a pitch angle velocity;

a serial port transmission module: and the signal conversion module is used for converting the signal output by the holder motor controller into a signal which can be identified by a computer.

A signal generator: the generator is software, is arranged in a holder motor controller through programming and is used for generating variable-frequency sine expected position signals.

Double closed loop PID controller: the system is a classical dual-ring PID controller, is arranged in a holder motor controller in a soft implementation mode and comprises a speed inner ring PID controller and a position outer ring PID controller, wherein the input of the position outer ring PID controller is the deviation value of an expected position signal generated by a signal generator and an actual position signal of a Yaw axis holder acquired by an inertial navigation module, and the output is an expected speed signal; the input of the speed inner ring PID controller is a deviation value between the output of the position outer ring PID controller and an actual speed signal acquired by the inertial navigation module, and the output is an expected PWM signal;

a feedforward compensation controller: after the cradle head transfer function model is obtained, the transfer function is discretized, and the discretized transfer function is arranged in the cradle head motor controller through programming.

A computer: computer with MATLAB software

The method is characterized by comprising the following steps:

step 1: installing an inertial navigation module into the two-axis pan-tilt;

step 2: connecting a holder motor controller with a computer;

step 3, loading a double closed-loop PID controller on the Yaw axis holder to respectively obtain a transfer function C of the inner-loop PID controller2(S) and transfer function C of position outer loop PID controller1(S);

And 4, step 4: placing a signal generator in a holder motor controller;

and 5: leading the expected position signal generated by the signal generator and the actual position and speed signal of the Yaw axis holder acquired by the inertial navigation module into a System Identification toolbox in MATLAB to obtain a System transfer function Gc after loading the double closed-loop PID controller;

step 6: obtaining a Yaw axis holder transfer function G (S), wherein the specific calculation formula is as follows:

wherein, C1(S) is the position loop PID controller transfer function, C2(S) is the transfer function of the speed loop PID controller, H (S) is negative feedback in units, Gc(S) is a system closed loop transfer function;

and 7: importing the cradle head transfer function G (S) which is obtained in the step 6 and does not comprise the double closed-loop PID controller into a Control System toolbox in the MATLAB, adding a speed loop and a position loop controller into the toolbox, and finishing automatic setting of the parameters of the Yaw-axis double closed-loop PID controller by using default parameters of the toolbox;

and 8: introducing a feedforward compensation controller u into the Yaw axis holderf(s) is

The output of the controller is

u(t)=up(t)+uf(t)

Wherein u isf(s) is the output signal of the feedforward compensation controller, yd(s) is the desired position signal, G(s) is the Yaw axis pan-tilt transfer function without the dual closed loop PID controller, up(t) is the output signal of the speed loop PID controller, u (t) is the output signal of the feedforward compensation controller and the double closed loop PID controller;

and step 9: repeating the step 2 to the step 8, and carrying out model establishment and PID parameter setting on the Pitch shaft;

step 10: and applying the parameters of the double closed-loop PID controller and the feedforward compensation controller obtained in the steps to a holder motor controller.

2. The method for modeling and automatically tuning the PID parameter of the two-axis pan-tilt according to claim 1, wherein the method comprises the following steps:

transfer function C of inner ring PID controller in step 32(S) and transfer function C of position outer loop PID controller1The calculation procedure of (S) is as follows:

(1) firstly, loading a speed loop PID controller, inputting any signal and setting a speed loop PID parameter by using a trial and error method;

(2) secondly, loading a position outer ring PID controller, and setting a position outer ring PID parameter by using a trial and error method;

(3) respectively calculating the transfer function C of the PID controller loaded in two steps (1) and (2) according to the control rule of the PID and the set PID parameter2(S) and C1(S), wherein the PID control rule relationship is as follows:

e(t)=yd(t)-y(t)

wherein e (t) is a deviation value, yd(t) is the input signal, y (t) is the actual signal, Kp、Ki、KdRespectively are proportional, integral and differential coefficients, T is control frequency of the two-axis pan-tilt controller, and G (S) is a transfer function of the PID controller.

Technical Field

The invention belongs to the field of system identification and motion control, and particularly relates to a method for modeling a two-axis pan-tilt and automatically tuning a PID parameter.

Background

The sports competition, the high-definition film and the comprehensive program enable the life of people to have more fun, and with the continuous development and innovation of the scientific research field, in the image technology, particularly the image processing and the image transmission change day by day, the development of the technologies can not be separated from the acquisition of images, so the shooting requirement of the images becomes more and more severe, and the tripod head is an important carrier for the image shooting.

With the increasing requirements of technical requirements, the cradle head is required to be started quickly, stopped flatly and slowly, the positioning can be adjusted at any position, and the speed can be changed in multiple stages. Most of holders circulating in the market do not establish a transfer function model, and are mostly controlled by classical PID (proportion integration differentiation), fuzzy control or Bang-Bang, so that the holders have poor robustness, static errors and poor signal following capability.

Disclosure of Invention

Aiming at the problem of the current two-axis pan-tilt control, the invention provides a method for identifying and automatically setting PID (proportion integration differentiation) based on an off-line system, and a feedforward control link is introduced to reduce dynamic errors and eliminate static errors. The method comprises the steps of inputting variable-frequency sinusoidal position signals to a two-axis tripod head by adopting frequency domain analysis, acquiring actual position signals of the two-axis tripod head by using an inertial navigation module, establishing a transfer function model for the two-axis tripod head through an MATLAB tool box in a computer, automatically setting PID parameters, and finally applying the obtained parameters to a tripod head motor controller to improve the existing problems. The method does not need to change the original mechanical structure of the holder, reduces the time for setting the PID parameters by a test method, and has certain robustness and effectiveness.

The control system of the method comprises the following steps:

1) the pan-tilt motor is two: the Pitch angle control device is used for controlling a course angle (Yaw) motor and a Pitch angle (Pitch) motor respectively.

2) Cloud platform motor controller: and the singlechip with a programming function is used for communicating with the computer and acquiring the data of the inertial navigation module.

3) An inertial navigation module: and acquiring the current attitude of the holder, including a course angle value, a pitch angle value, a course angular velocity and a pitch angular velocity.

4) A serial port transmission module: and the signal conversion module is used for converting the signal output by the holder motor controller into a signal which can be identified by a computer.

5) A signal generator: the generator is software, is arranged in a holder motor controller through programming and is used for generating variable-frequency sine position signals.

6) Double closed loop PID controller: the controller is a classical dual-ring PID controller, the speed ring is an inner ring, the position ring is an outer ring, and the controller is arranged in the holder motor controller in a software mode.

7) A feedforward compensation controller: after the cradle head transfer function model is obtained, the transfer function is discretized, and the discretized transfer function is arranged in the cradle head motor controller through programming.

8) A computer: a computer with MATLAB software.

A method for modeling and automatically tuning PID parameters of a two-axis pan-tilt comprises the following steps:

step 1: installing an inertial navigation module into the two-axis pan-tilt; (confirmation of transfer function with double closed-Loop controller)

Step 2: connecting a holder motor controller with a computer;

step 3, loading a double closed-loop PID controller on the Yaw axis holder;

and 4, step 4: placing a signal generator in a holder motor controller;

and 5: using the System Identification toolkit in MATLAB, the System transfer function is obtained:

step 6: acquiring a Yaw axis holder transfer function;

and 7: automatically setting PID parameters by using a Control System toolbox in MATLAB;

and 8: dispersing a Yaw axis holder transfer function through MATLAB to obtain feedforward compensation controller parameters;

and step 9: and (5) repeating the step 2 to the step 8, and establishing a model and setting PID parameters for the Pitch shaft.

Step 10: and applying the parameters of the double closed-loop PID controller and the feedforward compensation controller obtained in the steps to a holder motor controller.

The invention has the following advantages:

(1) the original mechanical structure does not need to be changed.

(2) The time for setting the PID parameters can be greatly reduced, and the method has better practicability.

(3) After the PID parameters are automatically adjusted and feedforward control is added, the holder has good robustness and rapidity.

Drawings

FIG. 1 is a general flow diagram of the present invention;

FIG. 2 is a two-axis pan-tilt diagram;

FIG. 3 is a three-dimensional view of a two-axis pan-tilt;

FIG. 4 is a flow chart of a dual closed loop PID controller;

FIG. 5 is a graph of excitation signal frequency;

FIG. 6 is a time domain diagram of an excitation signal;

FIG. 7 is a System Identification toolkit parameter setting screenshot;

FIG. 8 is a System Identification toolset generating a pan-tilt Yaw axis transfer function used in the present method;

FIG. 9 is a flow chart of the transfer function of the dual closed-loop PID controller;

FIG. 10 is a Control System toolset parameter setting interface;

FIG. 11 is a flow chart of a dual closed loop PID controller incorporating a feedforward compensator;

Detailed Description

The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

The invention provides an off-line identification-based method for completing the establishment of a transfer function model of a two-axis pan-tilt, and meanwhile, the parameters of a PID (proportion integration differentiation) controller are automatically set and a feedforward compensation controller is introduced, and the operation flow chart of the method is shown in figure 1. The invention researches the characteristics of a two-axis tripod head system by applying frequency response characteristics, loads a signal generator in a tripod head motor controller, stores an expected position signal and an actual position signal by a computer, obtains a transfer function of the system by using an MATLAB off-line identification tool, and finally sets PID parameters by a tool box.

The specific process of the invention is as follows:

step 1, installing an inertial navigation module to the two-axis pan-tilt.

(1) The method adopts closed-loop identification, and firstly, a closed-loop control system needs to be formed for the two-axis pan-tilt.

(2) In order to ensure the authenticity of data, the inertial navigation module is installed at the intersection of the axes of the two axes of the holder, and if the inertial navigation module cannot be installed at the position, the inertial navigation module is close to the position as much as possible.

(3) And filtering the original angle value and the angular speed data of the inertial navigation module to remove noise in a non-working range. Fig. 2 and fig. 3 are a real object diagram and a three-dimensional model diagram of a two-axis pan-tilt system used in the method, a super-nuclear electronic H219 module is selected as an inertial navigation module, and the normal working angular speed of the pan-tilt system is within +/-250 DEG/s, so that the angular speed range of the inertial navigation module is set to +/-250 dps. The maximum control frequency of the holder system is 1KHz, the cutoff frequency is 500Hz according to Shannon sampling theorem, and the bandwidth of the inertial navigation module is adjusted to be 532Hz by inquiring a manual.

(4) And reading the course angle value, the course angular velocity, the pitch angle value and the pitch angle velocity value of the inertial navigation module through the holder motor controller.

And 2, connecting the holder motor controller with a computer.

(1) In order to observe the states of the actual signal and the expected signal, the motor controller of the holder is connected with a computer.

(2) The method adopts the serial port transmission module for connection, and can also use a Bluetooth module, a wireless module and the like, and only the stability of connection is required to be ensured.

(3) A digital oscilloscope having a save function is provided in a computer.

And 3, loading a double closed-loop PID controller on the Yaw axis holder.

The flow chart of the double-closed-loop PID controller is shown in FIG. 4, a position signal is input into the double-closed-loop PID controller, a position signal deviation value is obtained by an expected position signal and an actual position signal obtained by the inertial navigation module, the position signal deviation value is transmitted into the position loop PID controller to obtain an expected speed signal, a speed signal deviation value is obtained by the expected speed signal and the actual speed signal obtained by the inertial navigation module, the speed signal deviation value is transmitted into the speed loop PID controller to obtain an expected PWM signal, the PWM signal is transmitted into the motor to drive the motor, and the motor drives the inertial navigation module to update the actual signal.

(1) Firstly, loading a speed loop PID controller, and setting PID parameters by using a compact test method, so that an actual speed signal can better track an expected speed signal.

(2) And secondly, loading a position outer ring PID controller, and setting PID parameters by using a trial and error method to enable an actual position signal to better track an expected position signal.

(3) And (2) calculating the transfer function of the PID controller loaded in the two steps (1) and (2) according to the control rule of the PID, wherein the control rule relationship of the PID is as follows:

e(t)=yd(t)-y(t)

wherein e (t) is a deviation value, yd(t) is the input signal, y (t) is the actual signal, Kp、Ki、KdRespectively are proportional, integral and differential coefficients, T is control frequency of the two-axis pan-tilt controller, and G (S) is a transfer function of the PID controller.

And 4, placing the signal generator in a holder motor controller.

(1) The signal generator is programmed in the pan-tilt motor controller to generate a variable frequency sine wave of 1Hz to 500Hz, which is the desired position input signal and is maintained for 25 cycles at each frequency.

(2) Since the frequency variation range of the desired position signal is large and the amplitude of the actual position signal is small near the cutoff frequency, a total of 66 different frequencies of the desired position signal are used to reduce the amount of computation by the computer, and the frequency variation is shown in fig. 5, and fig. 6 is a time-domain image of the desired position signal.

(3) To ensure that the desired position signal does not jump, it is necessary to start with zero phase each time the frequency of the desired position signal changes, so the period of the desired position signal should be an integer.

(4) After the configuration of the signal generator is completed, the signal generator is opened through an instruction, the signal generator is applied to the Yaw axis holder, and the expected position signal and the actual position signal at each moment are stored through a computer.

And 5, establishing a transfer function model for the Yaw axis holder by using the tool box.

(1) The expected position signal and the actual position signal stored in step 4 are led into an MATLAB System Identification toolbox, the signal type is selected to be a time domain signal, the sampling time is 1ms, and the setting interface is as shown in fig. 7.

(2) Because the sine position signals are adopted in the experiment, the average value of the signals is 0, the bandwidth is within 532Hz, and all the collected position signals need to be identified, the signals do not need to be preprocessed.

(3) The sampling frequency and the number of the poles-zero are set, the number of the poles-zero is related to the control law of the double-closed-loop PID controller, the number of the poles is increased in the integral link, and the number of the zeros is increased in the differential link. In order to reduce the time for setting the PID parameters by using the compact test method, the double-closed-loop PID controller only adopts proportional control, namely P control, when the PID controller is set by using the compact test method, so that the number of poles of the transfer function is 2, and the number of zeros is 1.

(4) The closed-loop transfer function of the Yaw axis pan-tilt is generated, and the result is shown in fig. 8.

And 6, obtaining a Yaw axis holder transfer function.

(1) Step 3 and step 5 respectively obtain the PID controller and the Yaw axis pan-tilt transfer function containing the double closed loop PID controller, and the flow chart of the Yaw axis pan-tilt transfer function is shown in fig. 9, wherein C1(S) is a position loop PID controller, C2(S) is a speed loop PID controller, G (S) is a pan-tilt transfer function without a double closed-loop controller, H (S) is unit negative feedback, G (S) is unit negative feedbackcAnd (S) is a system closed loop transfer function.

(2) The cradle head transfer function without the double closed-loop PID controller can be obtained through the formula, wherein the PID controller parameters set by a trial and error method have no direct influence on the cradle head transfer function without the double closed-loop PID controller, and zero-pole cancellation is not carried out because system identification cannot completely depict system characteristics so as to ensure the stability of the system.

And 7, automatically setting the PID parameters by using the System Control Designer.

(1) And (3) importing a pan-tilt transfer function G (S) which does not comprise a double closed-loop PID controller into the tool box, adding a speed loop and a position loop controller into the tool box, and using default parameters of the tool box.

(2) The method comprises the steps of automatically setting the parameters of the Yaw-axis double-closed-loop PID controller by using a PID Tuning tool, setting a setting interface as shown in FIG. 10, setting response time and robustness, and controlling only proportion (P) and derivative (D) without integral (I) because of the time lag characteristic of the integral link of the PID controller, wherein the setting can be started after the setting is finished.

(3) And discretizing the transfer function of the automatically-set double-closed-loop PID controller to obtain a proportional coefficient and a differential coefficient.

Step 8, introducing a feedforward compensation controller into the Yaw axis holder

The feedforward compensation controller may be configured to reduce the dynamic error of the system such that the product of the feedforward compensator transfer function and the system transfer function is 1, thereby achieving a complete reproduction of the input position signal by the output position signal.

(1) Because the double closed-loop PID controller only uses the PD control law in the method, static errors exist, and in order to eliminate the static errors and reduce the dynamic errors, a feedforward compensation controller is introduced.

(2) A control flow diagram for introducing a feedforward compensation controller is shown in FIG. 11, the feedforward compensation controller is

The output of the controller is u (t) up(t)+uf(t)

Wherein u isf(s) is the output signal of the feedforward compensation controller, yd(s) is the desired position signal, G(s) is the Yaw axis pan-tilt transfer function without the dual closed loop PID controller, upAnd (t) is the output signal of the speed loop PID controller, and u (t) is the output signal of the feedforward compensation controller and the double closed loop PID controller.

(3) The transfer function of the feedforward compensation controller is the reciprocal of the Yaw shaft holder transfer function without the double closed-loop PID controller, and the transfer function of the feedforward compensation controller is discretized by using a bilinear variation method.

And 9, repeating the steps 2 to 8 to carry out the same work on the Pitch shaft holder so as to obtain the parameters of the double closed loop PID controller and the feedforward compensation controller of the Pitch shaft holder.

And step 10, applying the parameters of the double closed-loop PID controller and the feedforward compensation controller acquired by the Yaw axis and the Pitch axis to a holder motor controller, and ending the method.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种复合干扰下的欠驱动AUV反步自适应模糊滑模控制方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!