Pneumatic compliance device control system and method based on PLC
Technical Field
The invention relates to the technical field of pneumatic compliance control, in particular to a pneumatic compliance device control system and method based on a PLC.
Background
Currently, finish machining operations such as grinding and polishing of many parts in industry mainly depend on manual grinding by skilled workers or machining by using a grinding machine, but the machining quality of the workers is not uniform, the machining efficiency is low, the operation environment is hard, the requirement on the proficiency of the workers is high, and the machining level cannot be guaranteed; although the grinding machine has stable processing quality and high efficiency, the grinding machine can only polish one type of parts and is greatly limited, and therefore, a processing device with enough flexibility and accuracy is needed. The positioning accuracy of the robot is far higher than that of a common machine tool at present, so that the robot machining is a good alternative scheme. In order to obtain more uniform surface quality during part finish machining, the grinding force must be ensured to be constant on the premise of ensuring the stable rotating speed and feeding speed of the grinding tool, so that a pneumatic compliance device is required to control the grinding force.
Most of the grinding force control systems on the market are designed by circuit control, the control mode is complex, and faults are easy to occur when the circuit board is impacted or subjected to other physical actions due to the compliance device.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a pneumatic compliance device control system and method based on PLC.
The purpose of the invention can be realized by the following technical scheme:
a pneumatic compliance device control system based on PLC comprises an air cylinder with bidirectional output force, a piston rod of the air cylinder is connected with a terminal tool through a guide rail, the terminal tool acts on a processing surface, the system also comprises a pressure sensor for measuring pressing force between the terminal tool and the processing surface, a displacement sensor for measuring displacement of the guide rail, a pose sensor for measuring pose of the piston rod of the air cylinder and a PLC controller for controlling a control valve of the air cylinder;
the guide rail and the tail end tool are used as loads, the loads are automatically weighed before the tail end tool acts on the machining surface, after the tail end tool acts on the machining surface, the PLC acquires the actual pressing force, guide rail displacement and cylinder piston rod pose of the tail end tool and the machining surface in real time, the output force of the cylinder is compensated based on the load gravity, and the pressing force of the tail end tool and the machining surface is accurately controlled to be kept constant.
Preferably, the attitude sensor comprises an acceleration sensor for measuring the angle between the piston rod of the air cylinder and the plumb line.
A PLC-based pneumatic compliance device control method, the method of the control system, the method includes:
taking the guide rail and the tail end tool as loads, adjusting the load position, starting the air cylinder and gradually increasing the output force of the air cylinder until the displacement sensor outputs displacement, simultaneously recording the angle between the piston rod of the current air cylinder and the plumb line and the magnitude of the output force of the air cylinder, and calculating the magnitude of the load gravity based on the output force of the air cylinder and the angle between the piston rod of the current air cylinder and the plumb line;
the tail end tool acts on the machining surface, the actual pressing force, the guide rail displacement and the position and posture of a piston rod of the cylinder on the tail end tool and the machining surface are collected in real time, the set pressing force on the tail end tool and the machining surface is compared with the actual pressing force, and the output force of the cylinder is compensated for once based on load gravity to obtain a first compensation given value of the output force of the cylinder;
performing secondary compensation on the output force of the cylinder by adopting an incremental PID control algorithm based on the actual output force of the cylinder and the given value of the output force of the cylinder in the previous control period to obtain a second compensation given value of the output force of the cylinder;
and controlling the cylinder to work based on the second compensation set value of the output force of the cylinder.
Preferably, the load position is adjusted when automatically weighing the load to: the angle between the output force direction of the cylinder and the load gravity direction is 0-45 degrees.
Preferably, the cylinder output force is increased in steps of 0.1N when the load is automatically weighed.
Preferably, the specific way of compensating the output force of the cylinder once based on the load gravity comprises the following steps:
s1, acquiring a cylinder piston rod and leadThe angle of the vertical line is combined with the load gravity to calculate the acting force F of the gravity borne by the load on the piston rod of the cylinderpIf F ispThe direction is towards the processing surface, and is denoted by Fp> 0, otherwise Fp<0;
S2, acquiring actual pressing force Fr on the end tool and the machined surface in real time, and acquiring set pressing force Fs on the end tool and the machined surface;
s3, if FpIf > 0, executing step S4, otherwise executing step S5;
s4, if Fr > Fs, Fn+1,1=Fn-|FpIf not, Fn+1,1=Fn-|FpL + | Fr-Fs |/2, where FnFor a given value of the output force of the cylinder at n moments, Fn+1,1A first compensation given value of the output force of the cylinder at the moment n + 1;
s5, if Fr > Fs, Fn+1,1=Fn+|FpIf not, Fn+1,1=Fn+|FpL + | Fr-Fs |/2, where FnFor a given value of the output force of the cylinder at n moments, Fn+1,1The first compensation set value of the output force of the cylinder at the moment n + 1.
Preferably, the specific way of performing secondary compensation on the output force of the cylinder by adopting the incremental PID control algorithm is as follows:
obtaining secondary compensation value F of cylinder output force based on incremental PID control algorithmΔ;
Calculating a second compensation given value of the output force of the cylinder: fn+1,2=Fn+1,1+FΔ。
Preferably, F in step S1pCalculated by the following formula: fp=Fg·cosθ,FgTo load the gravity, θ is the angle of the cylinder piston rod from the vertical.
Preferably, FΔObtained by the following formula:
FΔ=Kp(F(n)-F(n-1))+KiF(n)+Kd(F(n)-2F(n-1)+F(n-2))
F(n)=FS(n)-Fr(n)
F(n-1)=FS(n-1)-Fr(n-1)
F(n-2)=FS(n-2)-Fr(n-2)
wherein, FS(n)、FS(n-1)、FS(n-2) represents the set pressing force between the end tool and the working surface at time n, time n-1, and time n-2, respectively, and Fr(n)、Fr(n-1)、Fr(n-2) represents the actual pressing force on the end tool and the processing surface at the time n, the time n-1 and the time n-2, respectively, and when n is 0, F (n-1) is 0 (n-2), and K is 0p、Ki、KdIs a PID parameter.
Preferably, Kp、Ki、KdThe values are as follows:
the value range of the set pressing force Fs on the end tool and the processing surface is (0N, 100N)]When, Kp=3.5,Ki=0.02,Kd=0;
The value range of the set pressing force Fs on the end tool and the processing surface is (100N, 200N)]When, Kp=2.5,Ki=0.02,Kd=0;
The value range of the set pressing force Fs on the end tool and the processing surface is (200N, 400N)]When, Kp=1.5,Ki=0.02,Kd=0。
Compared with the prior art, the invention has the following advantages:
(1) the PLC is arranged outside the pneumatic flexible device, so that a sensor signal can be received, the control system fault caused by the interference of the pneumatic flexible device in the movement process can be avoided, the stability and the maintainability of the PLC are fully utilized, and the reliability of the pneumatic flexible device is greatly improved;
(2) the invention adopts a scheme of PLC as distributed control, which is different from the conventional integrated circuit control, so that the volume of the device is reduced, and the mechanical impact on a control system in the using process of the device is avoided;
(3) the invention adopts the functions of automatic weighing and gravity compensation, introduces an incremental PID control algorithm and improves the precision of the output force control of the pneumatic compliance device.
Drawings
FIG. 1 is a block diagram of a PLC-based pneumatic compliance device control system according to the present invention;
FIG. 2 is a schematic diagram of the cylinder with bidirectional output force according to the present invention;
FIG. 3 is a flow chart of the present invention for automatic load weighing;
FIG. 4 is a schematic diagram of the automatic weighing of a load according to the present invention;
FIG. 5 is a flow chart of the present invention for performing cylinder accuracy force control.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. Note that the following description of the embodiments is merely a substantial example, and the present invention is not intended to be limited to the application or the use thereof, and is not limited to the following embodiments.
Examples
As shown in fig. 1, the present embodiment provides a PLC-based pneumatic compliance device control system, which includes an air cylinder having a bidirectional output force, a piston rod of the air cylinder is connected to a terminal tool through a guide rail, the terminal tool acts on a processing surface, the system further includes a pressure sensor for measuring a pressing force between the terminal tool and the processing surface, a displacement sensor for measuring a displacement of the guide rail, a pose sensor for measuring a pose of the piston rod of the air cylinder, and a PLC controller for controlling a control valve of the air cylinder, the pose sensor includes an acceleration sensor for measuring an angle between the piston rod of the air cylinder and a plumb line;
the guide rail and the tail end tool are used as loads, the loads are automatically weighed before the tail end tool acts on a machined surface, after the tail end tool acts on the machined surface, the PLC acquires the actual pressing force, guide rail displacement and cylinder piston rod pose of the tail end tool and the machined surface in real time, the output force of the cylinder is compensated based on the load gravity, and the pressing force of the tail end tool and the machined surface is accurately controlled to keep constant.
The invention adopts a double-acting cylinder, has the function of bidirectional output force, and is shown in figure 2 after simplification, wherein the direction of a piston moving from a cavity a to a cavity b is regarded as a positive direction, and the force applied to the positive direction is regarded as a positive force. The load to which the piston rod is connected, i.e. the end tool, is shown in the figure, in practice the cylinder piston rod is connected to the end tool via a guide rail, to which the end tool is fixed. The pneumatic compliance device controls the pressure in the cylinder by the electromagnetic valve, the piston rod moves by changing the pressure difference at the two ends of the piston rod of the cylinder, so that the cylinder generates certain output force, and the output force of the cylinder is transmitted to the end tool through the guide rail, so that the end tool generates certain pressing force on a processing surface.
The embodiment also provides a method for controlling the pneumatic compliance device based on the PLC, and the method comprises the following steps:
taking the guide rail and the tail end tool as loads, adjusting the load position, starting the air cylinder and gradually increasing the output force of the air cylinder until the displacement sensor outputs displacement, simultaneously recording the angle between the piston rod of the current air cylinder and the plumb line and the magnitude of the output force of the air cylinder, and calculating the magnitude of the load gravity based on the output force of the air cylinder and the angle between the piston rod of the current air cylinder and the plumb line;
the tail end tool acts on the machining surface, the actual pressing force, the guide rail displacement and the position and posture of a piston rod of the cylinder on the tail end tool and the machining surface are collected in real time, the set pressing force on the tail end tool and the machining surface is compared with the actual pressing force, and the output force of the cylinder is compensated for once based on load gravity to obtain a first compensation given value of the output force of the cylinder;
performing secondary compensation on the output force of the cylinder by adopting an incremental PID control algorithm based on the actual output force of the cylinder and the given value of the output force of the cylinder in the previous control period to obtain a second compensation given value of the output force of the cylinder;
and controlling the cylinder to work based on the second compensation set value of the output force of the cylinder.
The control method of the invention comprises two main contents based on the following: load automatic weighing and cylinder precision force control, as described in detail below.
Firstly, the load automatic weighing function can measure the end tool mass by adjusting the output force of the air cylinder, the automatic weighing process is shown in fig. 3, and the weighing principle is shown in fig. 4. In the figure 3, m is the number of times of weighing, the pneumatic compliance device is firstly adjusted to the position where the included angle between the direction of the gravity borne by the pneumatic compliance device and the direction of the output force of the air cylinder is within 45 degrees, then the output force of the air cylinder is gradually increased by 0.1N of the minimum force control precision until the guide rail of the device generates 1mm displacement, the output force of the air cylinder is taken as the component of the weight borne by the tail end tool in the current posture, the mass of the tail end tool can be obtained by reverse thrust, and the average value is taken as the mass of the tail end tool by repeated measurement for three times so as to reduce the measurement error.
As shown in fig. 5, the cylinder precision force control includes primary compensation and secondary compensation of the cylinder output force, specifically:
the specific mode of carrying out primary compensation on the output force of the cylinder based on the load gravity comprises the following steps:
s1, obtaining the angle between the piston rod of the cylinder and the plumb line, and calculating the acting force F of the gravity borne by the load on the piston rod of the cylinder by combining the load gravitypIf F ispThe direction is towards the processing surface, and is denoted by Fp> 0, otherwise Fp<0;
S2, acquiring actual pressing force Fr on the end tool and the machined surface in real time, and acquiring set pressing force Fs on the end tool and the machined surface;
s3, if FpIf > 0, executing step S4, otherwise executing step S5;
s4, if Fr > Fs, Fn+1,1=Fn-|FpIf not, Fn+1,1=Fn-|FpL + | Fr-Fs |/2, where FnFor a given value of the output force of the cylinder at n moments, Fn+1,1A first compensation given value of the output force of the cylinder at the moment n + 1;
s5, if Fr > Fs, Fn+1,1=Fn+|FpIf not, Fn+1,1=Fn+|FpL + | Fr-Fs |/2, where FnFor a given value of the output force of the cylinder at n moments, Fn+1,1The first compensation set value of the output force of the cylinder at the moment n + 1.
The specific mode of carrying out secondary compensation on the output force of the cylinder by adopting an incremental PID control algorithm is as follows:
obtaining secondary compensation value F of cylinder output force based on incremental PID control algorithmΔ;
Calculating a second compensation given value of the output force of the cylinder: fn+1,2=Fn+1,1+FΔ。
F in step S1pCalculated by the following formula: fp=Fg·cosθ,FgTo load the gravity, θ is the angle of the cylinder piston rod from the vertical.
FΔObtained by the following formula:
FΔ=Kp(F(n)-F(n-1))+KiF(n)+Kd(F(n)-2F(n-1)+F(n-2))
F(n)=FS(n)-Fr(n)
F(n-1)=FS(n-1)-Fr(n-1)
F(n-2)=FS(n-2)-Fr(n-2)
wherein, FS(n)、FS(n-1)、FS(n-2) represents the set pressing force between the end tool and the working surface at time n, time n-1, and time n-2, respectively, and Fr(n)、Fr(n-1)、Fr(n-2) represents the actual pressing force on the end tool and the processing surface at the time n, the time n-1 and the time n-2, respectively, and when n is 0, F (n-1) is 0 (n-2), and K is 0p、Ki、KdIs a PID parameter.
Kp、Ki、KdThe values are as follows:
the value range of the set pressing force Fs on the end tool and the processing surface is (0N, 100N)]When, Kp=3.5,Ki=0.02,Kd=0;
The value range of the set pressing force Fs on the end tool and the processing surface is (100N, 200N)]When, Kp=2.5,Ki=0.02,Kd=0;
The value range of the set pressing force Fs on the end tool and the processing surface is (200N, 400N)]When, Kp=1.5,Ki=0.02,Kd=0。
The method comprises the steps of obtaining an analog signal of a numerical value of an output force of an air cylinder through a force sensor, obtaining an analog signal of a guide rail position of a pneumatic flexible device through a displacement sensor, obtaining an analog signal of an angle numerical value of the pneumatic flexible device through an acceleration sensor, connecting the analog signal to an AI module interface of a PLC, calculating and processing the analog signal into a corresponding metric numerical value through a function corresponding to a sensor parameter, calculating through a gravity compensation program and a force output program of the PLC to obtain a numerical value of an actual output force of the air cylinder, outputting a voltage signal through the AO module interface, carrying out voltage control on an electromagnetic valve and a proportional pressure valve, changing valve port displacement of the electromagnetic valve, controlling the size and direction of gas flow in the air cylinder, outputting a certain force to the guide rail of the pneumatic flexible device, transmitting the force to a tail end tool, enabling the force to be attached to a processing surface and keeping constant force contact, and realizing constant force output.
The above embodiments are merely examples and do not limit the scope of the present invention. These embodiments may be implemented in other various manners, and various omissions, substitutions, and changes may be made without departing from the technical spirit of the present invention.