PLC has a wide range of applications in automation equipment, in which motion control is widely used in manufacturing industry, but the general PLC has no interpolation instructions, which limits the use of oblique or arc where two axes need to move together.
Using formula deduction, simple interpolation program is developed on PLC, which enlarges its scope of use and reduces equipment.
Development and manufacturing costs. Programmable Logic Controller (PLC) is widely used in industrial automatic control because of its versatility, high reliability and simple instructions. In motion control, servo and stepper motor can be controlled to achieve positioning, linear motion and so on. However, there is no interpolation instruction. If the oblique feed or arc is connected by two axes, the more expensive motion control module or special motion controller should be used. However, the special motion controller is only designed for multi-axis motion control, without PLC logic and sequence control. It is more expensive to use CNC numerical control system. At present, the mainstream small PLC generally has more than three high-speed pulse output (called axis), and each axis can be independently controlled.
By compiling interpolation algorithm, it can be used in NC machine tools with low requirements. For example, the precision and speed requirements of interpolation such as glue coating, flame cutting, polishing and ordinary welding are not very high, which is a good choice. In order to improve the accuracy, we need to choose a smaller pulse equivalent (the distance of each pulse), but it can not be too small, otherwise the feed speed of the motor is too slow. Generally, choosing a pulse equivalent of 1 micron or 0.5 micron is convenient to calculate and can take into account the speed. The formula of linear interpolation can be deduced if the pulse is determined properly.
Because calculating the distance of interpolation section is relative to the current point, the positioning pulse instruction of PLC can only use relative positioning when executing interpolation movement. The number of pulses driving the servo motor is the length/pulse equivalent.
The calculated real number is rounded to get the number of pulses that need to be sent.
The effect of walking this oblique line is that the X-axis and Y-axis travel the Xa and Ya sections at the same time at a uniform speed, which requires the control of the feed speed of the axis, thermostatic element i.e. the pulse frequency. The setting of speed can be to set one axis of X/Y axis and another axis by trigonometric function technology, or to set the combined speed of the oblique line to be moved and calculate the feed speed of the two axes respectively by trigonometric function. After each processing, the absolute instruction or the back-to-origin instruction should be used to return to zero to eliminate the accumulated error. From the principle of drawing circles in computer graphics of CAD and other drawing software, we can know that circles can be composed of many small straight lines connected at the beginning and the end. Using this feature, we can set each straight line to 1 micron or a pulse to describe, which can be called point-by-point comparison method according to the realization method.
When F (Xi, Yi) = 0, take Xi 1 = Xi 1, Yi 1 = Yi, that is, take a step towards X, from inside to outside of the circle.
When F (Xi, Yi) > 0, take Xi 1 = Xi, Yi 1 = Yi – 1, that is, take a step towards – Y, from the outside to the inside of the circle or circle.
For each step, it is necessary to recalculate where the current moving point is in the circle, so as to determine the direction of the next step until it reaches the target point (such as point B), and determine the termination value of the interpolation process according to the requirements of the product process and the size of the error data. Different quadrants require different acquisition of the next moving point.
The above interpolation algorithms are all based on Pythagorean theorem and three functions in middle school mathematics. The principle is concise, the formula is simple, and the programming is easy. Most technicians can understand and apply the interpolation algorithms. It can make small PLC the core of middle and low grade CNC system, and also has the dual channel function of high grade CNC system.