A PID control inertial servo system and control method
By constructing a PID-controlled inertial servo system, combined with fuzzy PID control and a linear quadratic regulator, the problem of rapid response and high-precision control of micro-sized intelligent projectiles in complex environments was solved, achieving higher environmental adaptability and dynamic response.
Patent Information
- Application Number
- CN202511122603.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-08-12
AI Technical Summary
Existing micro-sized smart projectiles cannot respond quickly and accurately to external environments in complex weather conditions, and the difficulty in adjusting algorithm parameters hinders their generalization development.
A PID-controlled inertial servo system is constructed, which combines a fuzzy PID control algorithm and a linear quadratic regulator. By adjusting the PID parameters through feedback control and fuzzy logic, fast response and high-precision control are achieved.
It improves the system's environmental adaptability, dynamic response, and reliability, and has higher control precision and stability, shorter settling time, and smaller overshoot.
Smart Images

Figure CN120652782B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of PID control, more particularly to a PID control inertial servo system and control method. BACKGROUND
[0002] At present, the inertial servo system of the steering engine on the micro intelligent shell can be divided into pneumatic servo steering engine, hydraulic servo steering engine and electric servo steering engine according to the power source. Compared with the pneumatic servo steering engine and the hydraulic servo steering engine, the electric servo steering engine has the advantages of simple structure, small size, convenient maintenance, convenient control, high control precision and fast dynamic response, and is widely used in micro intelligent shells and unmanned aerial vehicles.
[0003] In control, the existing micro intelligent shell usually adopts PID algorithm, but the parameter adjustment of the algorithm is difficult, especially for nonlinear and time-varying systems. However, the micro intelligent shell usually needs to work in various complex weather environments. How to quickly and accurately respond to the external environment has always been one of the factors restricting the development of micro intelligent devices. SUMMARY
[0004] The technical problem to be solved by the present application is that the parameter adjustment of the algorithm of the existing micro intelligent shell is difficult, and the external environment cannot be quickly and accurately responded. In view of the above defects of the prior art, a PID control inertial servo system and control method are provided.
[0005] The technical scheme adopted by the present application to solve its technical problem is:
[0006] The PID control inertial servo system is constructed, wherein, the controller, the control circuit, the driving circuit, the motor, the potentiometer, the system clock, the timer, the analog-digital converter, the plurality of serial ports, the communication bus, the main control device, the steering wheel, the fuzzy PID control module, the sampling module, the current sensor, the linear quadratic regulator, the PWM duty cycle module and the integral module are included; the control circuit includes the control chip; the control chip is electrically connected with the controller and the linear quadratic regulator respectively; the driving circuit is electrically connected with the PWM duty cycle module; the driving circuit includes the first driving circuit and the second driving circuit; the first driving circuit includes the driving chip; the second driving circuit is electrically connected with the motor and is provided with a plurality of switches; the motor is electrically connected with the steering wheel and is used to drive the steering wheel; the potentiometer is electrically connected with the analog-digital converter and is used to adjust the resistance to control the output voltage; the system clock, the timer, the analog-digital converter and the serial port are electrically connected with the controller respectively; the analog-digital converter is used to convert the signal; the communication bus is electrically connected with the controller and is used to receive the position given instruction of the main control device in real time and send the position of the steering wheel to the main control device; the controller is electrically connected with the fuzzy PID control module; the sampling module is electrically connected with the current sensor; the current sensor is used to measure the current of the motor and calculate the phase current feedback value of the motor; the linear quadratic regulator is electrically connected with the fuzzy PID control module; the fuzzy PID control module is electrically connected with the PWM duty cycle module; the integral module is electrically connected with the sampling module and is used to convert the rotating speed of the motor into the angle position signal.
[0007] The control method of the PID control inertial servo system is constructed, including the following steps:
[0008] The plurality of preset function modules are initialized; wherein, the function modules include the system clock, the timer, the analog-digital converter, the serial port and the fuzzy PID control module;
[0009] The initialization is interrupted by the timer;
[0010] The function modules are executed in sequence according to the time label;
[0011] The position instruction sent by the main control device is received in real time through the communication bus, and the position information of the steering wheel is sent to the main control device by the control chip every preset time period;
[0012] The current and position information are collected by the control chip every system control cycle;
[0013] Whether the angle position deflection instruction is received is judged;
[0014] If yes, update the set target angle information, and input the error signal of the position information and the position error rate signal to a preset linear quadratic regulator to infer to obtain an inference result;
[0015] Send the inference result to a fuzzy PID control module, and call a fuzzy PID control algorithm;
[0016] Execute the fuzzy PID control algorithm every other system control period, and output a PWM regulation amount; wherein the PWM regulation amount comprises proportional, integral and differential regulation coefficients;
[0017] Superimpose the PWM regulation amounts to obtain a superimposed result;
[0018] Convert the superimposed result into a duty cycle signal through a preset PWM duty cycle module to control a driving circuit; wherein the driving circuit comprises a plurality of MOS tubes;
[0019] Collect the rotating speed of the motor, and convert the rotating speed into an angle position signal through a preset integral module;
[0020] Feed back the position error signal and the position error rate signal to the fuzzy PID control module.
[0021] Further, the step of opening the timer to interrupt the initialization comprises:
[0022] Set the timer to 100us, and use it as the system control period.
[0023] Further, the step of collecting the current and position information by the control chip every other system control period comprises:
[0024] Real-time acquire the motor bus current measured by a current sensor through a sampling module.
[0025] Further, the step of executing the fuzzy PID control algorithm every other system control period, and outputting the PWM regulation amount comprises:
[0026] Update the weight of the regulation coefficient through a preset linear quadratic regulator to obtain a PWM duty cycle.
[0027] Further, the step of updating the weight of the regulation coefficient through the preset linear quadratic regulator comprises:
[0028] Establish a dynamic model through the linear quadratic regulator, and calculate the regulation coefficient through the fuzzy PID control algorithm; wherein the dynamic model comprises a state space equation; the state space equation comprises a state vector, a control input and a system dynamic matrix.
[0029] Furthermore, the state space equation is:
[0030] ;
[0031] in, is the time derivative of the state vector, which represents the rate of change of the state over time;
[0032] A is the system matrix; represents the state vector;
[0033] B is the input matrix; is the control input vector.
[0034] Furthermore, a linear feedback controller is added to the state space equation to obtain:
[0035] ;
[0036] in, is the control input vector, is the state vector; K is the feedback gain matrix;
[0037] At this point, the new state space equation is obtained:
[0038] ;
[0039] Among them, A-BK is the closed-loop system matrix.
[0040] Furthermore, after the step of adding a linear feedback controller on the basis of the state space equation, the method further comprises:
[0041] Define the quadratic cost function:
[0042] ;
[0043] Among them, Q and R are positive definite symmetric matrices, representing the weights of state and control input respectively;
[0044] Define an auxiliary constant matrix P and get:
[0045] ;
[0046] Substituting into the quadratic cost function, we obtain:
[0047] ;
[0048] in, is the initial state vector;
[0049] The differential item of the auxiliary constant matrix P is expanded, and the auxiliary constant matrix P is defined as , to obtain:
[0050] ;
[0051] Wherein, K is the optimal feedback gain matrix; is the inverse matrix of the control weight matrix R; is the transpose matrix of the matrix B;
[0052] The auxiliary matrix is obtained by setting A, B, Q and R, and the PWM duty ratio is obtained.
[0053] Further, after the step of converting the superposition result into a duty ratio signal by the preset PWM duty ratio module, the method comprises:
[0054] The motor phase current feedback value is calculated according to the PWM duty ratio;
[0055] The position information of the steering engine fed back by the potentiometer is collected through an analog-digital converter.
[0056] The application has the advantages that: the application is based on position closed-loop feedback, takes the fuzzy PID control algorithm as the core, and obtains the optimal system parameters through a linear quadratic regulator, so that the environmental adaptability, dynamic response and reliability of the system are improved. Compared with the traditional PID control, the fuzzy PID control has higher control precision, stability and response speed, and has shorter adjustment time and smaller overshoot. BRIEF DESCRIPTION OF DRAWINGS
[0057] Figure 1 is a combined fuzzy PID control block diagram in an embodiment of the application;
[0058] Figure 2 is a structural block diagram of a PID control inertia servo system in an embodiment of the application;
[0059] Figure 3 is a circuit diagram of a main control chip in an embodiment of the application;
[0060] Figure 4 is a circuit diagram of a PWM driving circuit in an embodiment of the application;
[0061] Figure 5 is a circuit diagram of an H-bridge circuit of the application;
[0062] Figure 6 is a method step schematic diagram of a control method of a PID control inertia servo system of the application;
[0063] Figure 7 is an MCU controller software design flow in an embodiment of the application;
[0064] Figure 8 is a closed-loop control schematic diagram of fuzzy PID in an embodiment of the present application;
[0065] Figure 9 is a control effect comparison diagram of traditional PID and fuzzy PID in simulation environment 1 of the present application;
[0066] Figure 10 is a control effect comparison diagram of traditional PID and fuzzy PID in simulation environment 2 of the present application;
[0067] Figure 11 is a control effect comparison diagram of traditional PID and fuzzy PID in simulation environment 3 of the present application;
[0068] Figure 12 is a control effect comparison diagram of traditional PID and fuzzy PID in simulation environment 4 of the present application. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0070] PID control is the most widely used automatic controller, and the servo system often uses incremental and position algorithms to control the platform. The position PID algorithm is selected, and the relative increment of the output control quantity , and the algorithm formula is as follows:
[0071]
[0072] wherein, represents a proportional coefficient, represents an integral coefficient, represents a differential coefficient;
[0073] When the position PID algorithm is used for control, the control quantity is obtained by using the deviation of the front, middle and rear three measurements, and the control effect is improved by adjusting , , Due to the complexity of the actual working environment, a single set of parameters is difficult to adapt to different scenes in actual application, and problems such as poor environmental adaptability, slow dynamic response and poor reliability may occur.
[0074] To solve the problem of poor adaptability of the traditional PID controller, the present application uses a linear quadratic regulator (LQR) to update the PID , , )’s weight.
[0075] Using a combined fuzzy PID controller such as Figure 1 As shown, de / dt is the error change rate, input r is the angular position of the rudder blade that needs to be deflected, and output y is the actual position of the rudder blade. Through feedback, the input and output of the system output error can be obtained, and the error and the differential of the error are used as the input of the fuzzy PID controller to determine 、 and Update scope.
[0076] Please refer to Figure 2 The present invention proposes a PID control inertial servo system, including a controller, a control circuit, a drive circuit, a motor, a potentiometer, a system clock, a timer, an analog-to-digital converter, multiple serial ports, a communication bus, a main control device, a steering gear, a fuzzy PID control module, a sampling module, a current sensor, a linear quadratic regulator, a PWM duty cycle module and an integration module; the control circuit includes a control chip; the control chip is electrically connected to the controller and the linear quadratic regulator respectively; the drive circuit is electrically connected to the PWM duty cycle module; the drive circuit includes a first drive circuit and a second drive circuit; the first drive circuit includes a drive chip; the second drive circuit is electrically connected to the motor and is provided with multiple switches; the motor is electrically connected to the steering gear and is used to drive the steering gear; the potentiometer and The analog-to-digital converter is electrically connected and used to adjust the resistance to control the output voltage; the system clock, timer, analog-to-digital converter, and serial port are electrically connected to the controller respectively; the analog-to-digital converter is used to convert signals; the communication bus is electrically connected to the controller and is used to receive the position given instructions of the main control device in real time and send the position of the servo to the main control device; the controller is electrically connected to the fuzzy PID control module; the sampling module is electrically connected to the current sensor; the current sensor is used to measure the current of the motor and calculate the phase current feedback value of the motor; the linear quadratic regulator is electrically connected to the fuzzy PID control module; the fuzzy PID control module is electrically connected to the PWM duty cycle module; the integration module is electrically connected to the sampling module and is used to convert the motor speed into an angular position signal.
[0077] In this embodiment, the system includes a controller, a control circuit, a drive circuit, a motor, a potentiometer, a system clock, a timer, an analog-to-digital converter, multiple serial ports, a communication bus, a main control device, a servo, a fuzzy PID control module, a sampling module, a current sensor, a linear quadratic regulator, and a PWM duty cycle module;
[0078] Specifically, the control circuit includes a control chip, which is electrically connected to the controller and the linear quadratic regulator. In this embodiment, the control chip is an STM32 chip. Figure 3As shown, it is a circuit schematic diagram of the control chip in the embodiment, and as can be seen from the diagram, the control chip has four PWM outputs, supports ADC sampling, and supports IIC (Inter-Integrated Circuit), UART (Universal Asynchronous Receiver / Transmitter) and SPI (Serial Peripheral Interface) communication. Among them, PWM is pulse width modulation, which controls analog circuits by adjusting the duty cycle of the pulse signal; ADC is an analog-to-digital converter; control chip pin 26 is PWM B1, that is, a PWM pulse signal.
[0079] Further, the control circuit comprises a first driving circuit and a second driving circuit, and the first driving circuit comprises a driving chip. Specifically, the first driving circuit is a PWM driving circuit. As shown in Figure 4 As shown, the PWM driving circuit comprises PWM pulse B1, capacitor C58, capacitor C59, capacitor C61, resistor R29, resistor R33, resistor R35, driving chip U13, and diode D2. Among them, PWM pulse B1 is Figure 3 the pulse signal obtained after the isolation chip in the middle PWM_B1. The model of the driving chip U13 is driving chip 2014, an insulated gate bipolar transistor, which has the advantages of high speed, high voltage and low on-resistance. Among them, high voltage, that is, the rated voltage of the driving chip is 1200V, which can work stably in a higher voltage range. Low on-resistance, that is, the on-resistance of the driving chip is only 0.06-0.25Ω, which can reduce energy loss and improve equipment efficiency. In addition, it also has fast switching speed and wide working range. Fast switching speed, that is, the driving chip has a faster switching speed, which can realize high-frequency switching mode power supply and frequency converter. Wide working range, that is, the working temperature range of the driving chip is -55℃ to 150℃, which can adapt to different environmental conditions.
[0080] Specifically, the second driving circuit is an H-bridge circuit, and the H-bridge circuit is electrically connected with the motor. As shown in Figure 5 As shown, the H-bridge circuit is provided with four MOS tubes Q1, Q2, Q3 and Q4; when MOS tubes Q1 and Q4 are closed and Q2 and Q3 are disconnected, the DC motor rotates normally, and the rotation direction is the positive direction; when MOS tubes Q2 and Q3 are closed and Q1 and Q4 are disconnected, the DC motor rotates normally, and the rotation direction is the negative direction; when MOS tubes Q1 and Q2 are closed and Q3 and Q4 are disconnected or when MOS tubes Q3 and Q4 are closed and Q1 and Q2 are disconnected, the DC motor does not rotate, at this time, it can be considered that the motor is in "brake" state, and the potential generated by the inertia rotation of the motor will be short-circuited, forming a counter electromotive force to hinder the movement, playing the role of "brake".
[0081] When MOS tube Q1 and Q3 are closed or when MOS tube Q2 and Q4 are closed, the power supply is short-circuited, which is strictly prohibited; when the four switches of MOS tubes Q1, Q2, Q3 and Q4 are all disconnected, the motor is in the "idling" state, and the potential generated by the motor inertia cannot form a circuit, and no counter electromotive force will be generated to hinder the movement, and the motor will rotate for a long time.
[0082] Further, the motor is electrically connected with the steering engine, and the steering engine can be driven to rotate. The potentiometer is electrically connected with the analog-digital converter, and is used for adjusting resistance and controlling output voltage. The system clock, the timer, the analog-digital converter and the serial port are respectively electrically connected with the controller. The controller can initialize the system clock, the timer, the analog-digital converter and the serial port. In a specific embodiment, the analog-digital converter is an ADC (Analog-to-Digital Converter Module) used for converting the continuous analog voltage signal output by the potentiometer into a discrete digital value that can be recognized and processed by the microcontroller.
[0083] Further, the communication bus is an RS422 bus, the communication bus is electrically connected with the controller, and is used for receiving the position given instruction sent by the master control device in real time, and simultaneously sending the current position of the steering engine to the master control device every 2 ms. Figure 2 As shown in the figure, the controller is electrically connected with the fuzzy PID control module; the sampling module is electrically connected with the current sensor; the current sensor is used for measuring the current of the motor and calculating the phase current feedback value of the motor; the sampling module can obtain the bus current of the motor measured by the current sensor in real time, and calculate the phase current feedback value of the motor combined with the current PWM duty cycle. The linear quadratic regulator is electrically connected with the fuzzy PID control module, and the fuzzy PID control module is electrically connected with the PWM duty cycle module. The integral module is electrically connected with the sampling module, and converts the motor speed into an angular position signal, and then feeds back the current position error signal and the position error change rate to the PID controller, to complete the closed-loop control of the whole system.
[0084] Please refer to Figure 6 The application provides a control method of a PID control inertia servo system, comprising the following steps:
[0085] S1, a plurality of preset function modules are initialized; wherein the function modules include a system clock, a timer, an analog-digital converter, a serial port and a fuzzy PID control module;
[0086] S2, the timer interrupt initialization is turned on;
[0087] S3, the function modules are executed in a loop according to the time tag sequence;
[0088] S4, receiving the position instruction sent by the master device in real time through the communication bus, and sending the position information of the steering engine to the master device every preset time interval by the control chip;
[0089] S5, collecting the current and position information every system control cycle by the control chip;
[0090] S6, judging whether the angle position deflection instruction is received;
[0091] S7, if yes, updating the set target angle information, and inputting the position error signal and the position error change rate signal to the preset linear quadratic regulator for reasoning to obtain a reasoning result;
[0092] S8, sending the reasoning result to the fuzzy PID control module, and calling the fuzzy PID control algorithm;
[0093] S9, executing the fuzzy PID control algorithm every system control cycle, and outputting the PWM regulation amount; wherein the PWM regulation amount includes the proportional, integral and differential regulation coefficients;
[0094] S10, superimposing the PWM regulation amounts to obtain a superimposed result;
[0095] S11, converting the superimposed result into a duty cycle signal by the preset PWM duty cycle module to control the driving circuit; wherein the driving circuit includes a plurality of MOS tubes;
[0096] S12, collecting the rotating speed of the motor, and converting the rotating speed into an angle position signal by the preset integral module;
[0097] S13, feeding back the position error signal and the position error change rate signal to the fuzzy PID control module.
[0098] In the embodiment, as shown in Figure 6As shown, first, the system clock, timer, analog-to-digital converter, serial port and fuzzy PID control module are initialized, then the timer is opened for interrupt initialization, then the function modules are executed in sequence according to the time tag, then the position command sent by the host device is received in real time through the communication bus, and the chip sends the position information of the steering engine to the host device every time period; the control chip collects current and position information every system control period; then it is judged whether the angle position deflection command is received; if so, update the set target angle information, and input the position error signal and the position error rate signal to the preset linear quadratic regulator for reasoning to obtain the reasoning result; then the reasoning result is sent to the fuzzy PID control module, and the fuzzy PID control algorithm is called; wherein, "fuzzy" means controlling through fuzzy logic, specifically, the precise input value is fuzzified into a language variable, then reasoning, and finally the fuzzy output obtained by reasoning is de-fuzzified into an accurate value, which can be used to adjust the PID parameters or as a control quantity.
[0099] Then the fuzzy PID control algorithm is executed every system control period, and the PWM adjustment amount is output; wherein, the PWM adjustment amount includes proportional, integral and differential adjustment coefficients; then the PWM adjustment amount is superimposed to obtain a superimposed result; the superimposed result is converted into a duty cycle signal through a preset PWM duty cycle module to control the driving circuit; then the speed of the motor is collected, and the speed is converted into an angle position signal through a preset integral module; finally, the position error signal and the position error rate signal are fed back to the fuzzy PID control module.
[0100] Specifically, as shown in Figure 7 As shown, first, each function module is initialized; wherein, the function modules include system clock, timer, analog-to-digital converter, serial port and fuzzy PID control module. The fuzzy PID control module initializes the fuzzy PID control algorithm parameters. Then the timer interrupt initialization program is opened. Each function module is executed in sequence according to the time tag, and the controller is MCU. The MCU receives the position command sent by the host device in real time through the RS422 bus, and ensures that the current position information of the steering engine is sent to the host device every 2ms. Then the MCU generates a 100us timing interrupt as a system control period through the timer, and collects current and position information every 100us.
[0101] Then it is judged whether an angle position deflection instruction is received; if yes, the set target angle information is updated, and an error signal of position information and a position error change rate signal are input to a preset linear quadratic regulator for reasoning to obtain a reasoning result; the reasoning result is sent to a fuzzy PID control module, and a fuzzy PID control algorithm is called; the fuzzy PID control algorithm is executed once every system control period, and a PWM adjustment amount is output to adjust the output of the control amount; wherein the PWM adjustment amount includes proportional, integral and differential adjustment coefficients; the current position of the steering engine fed back by the potentiometer is collected through an A / D module; then the PWM adjustment amount is superimposed to obtain a superimposed result; the superimposed result is converted into a duty cycle signal through a preset PWM duty cycle module to control a driving circuit; the motor bus current measured by the electromechanical current sensor is obtained in real time through a sampling module, and the motor phase current feedback value is calculated in combination with the current PWM duty cycle. Then the speed of the motor is collected, and the speed is converted into an angle position signal through a preset integral module; finally, the position error signal and the position error change rate signal are fed back to the fuzzy PID control module. Compared with the traditional PID control, the fuzzy logic control is adopted in the application, which can be applied to the electric steering engine and lays a foundation for the intelligent development of the electric steering engine.
[0102] In an embodiment, the step of opening the timer interrupt initialization comprises:
[0103] The timer is set to 100us and serves as a system control period.
[0104] In this embodiment, the time of the timer is set to 100us and serves as a system control period. Specifically, the MCU takes 100us set by the timer as a system control period, collects current and position information every 100us, and executes the control PID algorithm once every 100us to adjust the output of the control amount.
[0105] In an embodiment, the step of collecting current and position information by the control chip every system control period comprises:
[0106] The motor bus current measured by the current sensor is obtained in real time through a sampling module.
[0107] After the step of converting the superimposed result into a duty cycle signal through a preset PWM duty cycle module, comprising:
[0108] The motor phase current feedback value is calculated according to the PWM duty cycle;
[0109] The position information of the steering engine fed back by the potentiometer is collected through an analog-to-digital converter.
[0110] In the embodiment, the motor bus current measured by the current sensor is acquired in real time through an IIC bus (Inter-Integrated Circuit) sampling module, and the motor phase current feedback value is calculated in combination with the current PWM duty cycle, and the current PWM duty cycle is obtained by updating the weight of the adjustment coefficient through a linear quadratic regulator.
[0111] In an embodiment, the step of executing the fuzzy PID control algorithm once every other system control period and outputting the PWM adjustment amount comprises:
[0112] The weight of the adjustment coefficient is updated through a preset linear quadratic regulator to obtain the PWM duty cycle.
[0113] In the embodiment, the fuzzy PID control algorithm is executed once every other system control period, that is, the weight of the adjustment coefficient is updated through a linear quadratic regulator (LQR) to obtain the PWM duty cycle.
[0114] Table 1
[0115]
[0116] Table 1 is a PID parameter state table. As shown in Table 1, in the traditional PID control, when the proportional, integral and derivative coefficients are increased respectively, the parameters of the system are affected respectively.
[0117] In an embodiment, the step of updating the weight of the adjustment coefficient through a preset linear quadratic regulator comprises:
[0118] The dynamic model is established through a linear quadratic regulator, and the adjustment coefficient is calculated through a fuzzy PID control algorithm. The dynamic model comprises a state space equation, and the state space equation comprises a state vector, a control input and a system dynamic matrix.
[0119] In the embodiment, in order to obtain optimal PID control parameters, a linear quadratic regulator is used to provide the PID control parameters. First, a linear time-invariant dynamic model of the system is established, which is expressed as a state space equation comprising a state vector, a control input and a system dynamic matrix.
[0120] In an embodiment, the state space equation is:
[0121] ;
[0122] wherein, is the time derivative of the state vector, representing the rate of change of the state over time;
[0123] A is the system matrix; is the state vector;
[0124] B is the input matrix; is the control input vector.
[0125] Then, a linear feedback controller is added to the state space equation to obtain:
[0126] ;
[0127] where, is the control input vector, is the state vector; K is the feedback gain matrix, which generates the control input through state feedback to stabilize the system and optimize the performance;
[0128] At this time, the new state space equation is obtained:
[0129] ;
[0130] where A-BK is the closed-loop system matrix.
[0131] A quadratic cost function is defined again:
[0132] ;
[0133] where Q and R are positive definite symmetric matrices, respectively, representing the weights of the state and control input, i.e., the degree of influence of the state and input on the cost function;
[0134] An auxiliary constant matrix P is defined to obtain:
[0135] ;
[0136] Substituting the quadratic cost function, the cost function is obtained:
[0137] ;
[0138] where, is the initial state vector;
[0139] As can be seen from the above formula, the cost function is only related to the matrix P and the initial state of the system, i.e., finding the smallest P can make the cost function J minimum. Now, the differential term on the left side of the definition of P is expanded, and is defined, to obtain:
[0140] ;
[0141] where K is the optimal feedback gain matrix; is the inverse matrix of the weight matrix R; is the transpose matrix of the matrix B, i.e. the exchange of rows and columns;
[0142] By setting A, B, Q, R to get the auxiliary matrix through the given (A, B, Q, R) of matlab (math software), then the PID coefficients are calculated, and the PWM duty ratio is obtained.
[0143] In an embodiment, the step of converting the superposition result into a duty ratio signal by the preset PWM duty ratio module to control the driving circuit includes:
[0144] The motor is controlled by controlling the MOS tube.
[0145] In specific implementation: the MOS tube is electrically connected with the motor, and the forward rotation, reverse rotation and rotation speed of the motor are controlled by controlling the switch of the MOS tube.
[0146] In an embodiment, as shown in Figure 8 , a step function is generated according to an input signal; the two inputs of the fuzzy PID control module are the current position error signal and the position error rate signal, then the proportional, integral and differential adjustment coefficients are output, then the proportional, integral and differential adjustment amounts are superimposed to obtain a superposition result, then the PWM duty ratio module is called to convert the superposition result after the adjustment amount superposition into a PWM duty ratio signal to control the H-bridge circuit, then the rotation speed of the motor is sampled, the rotation speed is converted into an angular position signal through the integral module, and then the current position error signal and the position error rate signal are fed back to the fuzzy PID control module to complete the closed-loop control of the whole system.
[0147] In an embodiment, the traditional PID system and the fuzzy PID system are placed in simulation environment 1, simulation environment 2 and simulation environment 3 for simulation test, and the following results are obtained:
[0148] The simulation environment 1 is a step response of 1°, as shown in Figure 9 , after simulation control, compared with the traditional PID and the fuzzy PID in the simulation environment 1, the horizontal coordinate in the figure represents time, and the vertical coordinate represents position, it can be seen that with the change of time, the change degree of the fuzzy PID is smaller, and it has better stability.
[0149] Table 2:
[0150]
[0151] As shown in Table 2, it is the test data comparison of simulation environment 1, and as can be seen from the table, the maximum overshoot of the fuzzy PID is much smaller than that of the traditional PID, and the adjustment time is shorter.
[0152] The simulation environment 2 is a 3° step response, as shown in Figure 10 After simulation control, as shown in Table 3, the maximum overshoot of the fuzzy PID is much smaller than that of the traditional PID, and the adjustment speed is also faster than that of the traditional PID.
[0153] Table 3:
[0154]
[0155] As shown in Table 3, the test data comparison of simulation environment 2 shows that the maximum overshoot of the fuzzy PID is much smaller than that of the traditional PID, and the adjustment speed is also faster than that of the traditional PID.
[0156] The simulation environment 3 is a 5° step response, as shown in Figure 11 After simulation control, as shown in Table 4, the maximum overshoot of the fuzzy PID is much smaller than that of the traditional PID, and the adjustment speed is also faster than that of the traditional PID.
[0157] Table 4:
[0158]
[0159] As shown in Table 4, the test data comparison of simulation environment 3 shows that the maximum overshoot of the fuzzy PID is much smaller than that of the traditional PID, and the adjustment speed is also faster than that of the traditional PID.
[0160] The simulation environment 4 is a 1° sinusoidal response, as shown in Figure 12 As shown in Table 5, the test data comparison of simulation environment 4 shows that the maximum overshoot of the fuzzy PID is much smaller than that of the traditional PID, and the adjustment time is shorter than that of the traditional PID.
[0161] Table 5:
[0162]
[0163] As shown in Table 5, the test data comparison of simulation environment 4 shows that the maximum overshoot of the fuzzy PID is much smaller than that of the traditional PID, and the adjustment time is shorter than that of the traditional PID.
[0164] In summary, the fuzzy PID has shorter adjustment time and smaller overshoot, and realizes the optimization of control.
[0165] The simulation data results show that, compared with the traditional PID control, the fuzzy PID control has higher control accuracy, stability and response speed. In addition, the control accuracy can be further improved by refining the fuzzy rules in the later stage.
[0166] It is to be understood that the terminology "including", "comprising", or any other variation thereof, is intended to cover a non-exclusive inclusion such that process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0167] The preferred embodiments of the present application have been described above with the specific language, or example. It should nevertheless be understood that no limitation of the scope of the application is intended by illustrative examples which can include other formats that are deemed to be equivalent. Therefore, the scope of the present application is defined not by the detailed description of the application but by the appended claims, and any equivalents thereto.
Claims
1. A PID control inertial servo system, characterized by, The controller, the control circuit, the driving circuit, the motor, the potentiometer, the system clock, the timer, the analog-digital converter, the plurality of serial ports, the communication bus, the master control device, the steering engine, the fuzzy PID control module, the sampling module, the current sensor, the linear quadratic regulator, the PWM duty cycle module and the integral module; The control circuit comprises a control chip; the control chip is electrically connected with the controller and the linear quadratic regulator respectively; The driving circuit is electrically connected with the PWM duty cycle module; The driving circuit comprises a first driving circuit and a second driving circuit; the first driving circuit comprises a driving chip; the second driving circuit is electrically connected with the motor and is provided with a plurality of switches; The motor is electrically connected with the steering engine and is used for driving the steering engine; The potentiometer is electrically connected with the analog-digital converter and is used for adjusting resistance to control output voltage; The system clock, the timer, the analog-digital converter and the serial port are electrically connected with the controller respectively; The analog-digital converter is used for converting signals; The communication bus is electrically connected with the controller and is used for receiving position given instructions of the master control device in real time and sending positions of the steering engine to the master control device; The controller is electrically connected with the fuzzy PID control module; The sampling module is electrically connected with the current sensor; the current sensor is used for measuring current of the motor and calculating phase current feedback values of the motor; The linear quadratic regulator is electrically connected with the fuzzy PID control module; The fuzzy PID control module is electrically connected with the PWM duty cycle module; The integral module is electrically connected with the sampling module and is used for converting rotating speed of the motor into angle position signals; Position instructions sent by the master control device are received in real time through the communication bus, and position information of the steering engine is sent to the master control device by the control chip every time interval; The control chip collects current and position information once every system control cycle; It is judged whether angle position deflection instructions are received; If yes, set target angle information is updated, and error signals of the position information and position error change rate signals are input to the linear quadratic regulator for reasoning to obtain reasoning results; The reasoning results are sent to the fuzzy PID control module, and a fuzzy PID control algorithm is called; The fuzzy PID control algorithm is executed once every system control cycle, and PWM regulation amounts are output; The PWM regulation amounts are superimposed to obtain superimposed results; The superimposed results are converted into duty cycle signals by the PWM duty cycle module to control the driving circuit; Position error signals and position error change rate signals are fed back to the fuzzy PID control module.
2. A control method for a PID control inertial servo system based on the system of claim 1, characterized by, The following steps are included: A plurality of preset function modules are initialized; wherein the function modules comprise a system clock, a timer, an analog-digital converter, a serial port and a fuzzy PID control module; The timer interrupts the initialization; The function modules are executed in a loop according to time tag sequences; Receiving position instructions sent by the master device in real time through a communication bus, and the control chip sends position information of the steering engine to the master device every preset time interval; The control chip collects current and position information every system control cycle; Determining whether an angle position deflection instruction is received; If yes, updating the set target angle information, and inputting an error signal of the position information and a position error change rate signal to a preset linear quadratic regulator for reasoning to obtain a reasoning result; Sending the reasoning result to a fuzzy PID control module, and calling a fuzzy PID control algorithm; Executing the fuzzy PID control algorithm every system control cycle, and outputting a PWM regulation amount; wherein the PWM regulation amount includes proportional, integral, and differential regulation coefficients; Superimposing the PWM regulation amounts to obtain a superimposed result; Converting the superimposed result into a duty cycle signal through a preset PWM duty cycle module to control a driving circuit; wherein the driving circuit includes a plurality of MOS tubes; Collecting a rotating speed of the motor, and converting the rotating speed into an angle position signal through a preset integral module; Feeding back a position error signal and a position error change rate signal to the fuzzy PID control module.
3. The control method of a PID control inertial servo system according to claim 2, wherein, In the step of opening the timer to interrupt the initialization, comprising: Setting the timer to 100us as the system control cycle.
4. The control method of a PID control inertial servo system according to claim 2, characterized by, In the step of collecting current and position information by the control chip every system control cycle, comprising: Real-time acquiring a motor bus current measured by a current sensor through a sampling module.
5. The control method of a PID control inertial servo system according to claim 2, wherein, In the step of executing the fuzzy PID control algorithm every system control cycle, and outputting a PWM regulation amount, comprising: Updating weights of the regulation coefficients through a preset linear quadratic regulator to obtain a PWM duty cycle.
6. The control method of a PID control inertial servo system according to claim 5, wherein In the step of updating the weights of the regulation coefficients through the preset linear quadratic regulator, comprising: Establishing a dynamic model through the linear quadratic regulator, and calculating the regulation coefficients through the fuzzy PID control algorithm; wherein the dynamic model includes a state space equation; the state space equation includes a state vector, a control input, and a system dynamic matrix.
7. The control method of a PID control inertial servo system according to claim 6, wherein, The state space equation is: ; wherein, a time derivative of the state vector, representing a rate of change of the state over time; A is the system matrix; x represents the state vector; B is an input matrix; is a control input vector.
8. The control method of a PID control inertial servo system according to claim 7, wherein, Adding a linear feedback controller to the state space equation to obtain: ; wherein, is a control input vector, is a state vector; K is a feedback gain matrix; At this time, a new state space equation is obtained: ; Wherein, A-BK is a closed-loop system matrix.
9. The control method of a PID control inertial servo system according to claim 8, wherein, After the step of adding a linear feedback controller to the state space equation, comprising: Defining a quadratic cost function: ; Wherein, Q and R are positive definite symmetric matrices, respectively representing weights of states and control inputs; Defining an auxiliary constant matrix P to obtain: ; Substituting the quadratic cost function to obtain: ; wherein is the initial state vector; The differential term of the auxiliary constant matrix P is expanded and defined as , which gives ; wherein K is an optimal feedback gain matrix; is an inverse matrix of the weight matrix R; is a transpose matrix of the matrix B; Obtaining an auxiliary matrix through setting A, B, Q, and R, and then solving each PID coefficient to obtain the PWM duty cycle.
10. The control method of a PID control inertial servo system according to claim 2, wherein, After the step of converting the superimposed result into a duty cycle signal through the preset PWM duty cycle module, comprising: Calculating a motor phase current feedback value according to the PWM duty cycle; The position information of the steering engine fed back by the potentiometer is collected by an analog-digital converter.
Citation Information
Patent Citations
Inertial navigation modulation axis control method based on LQR regulator
CN115903507A
Linear quadratic optimal control-based fuzzy expansion state observer design method
CN116088306A