A servo motion control method and system based on PLC
Through the PLC-based servo motion control method, the problem in the existing technology that the servo motion control system cannot adapt to mold changes is solved, and the manipulator can only move forward, backward, left, and right on the punch machine, adapting to different production lines, and improving the flexibility and efficiency of the production line.
Patent Information
- Application Number
- CN202311655676.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-01
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2043-12-01
AI Technical Summary
The servo motion control system in the prior art cannot adapt to mold changes, resulting in the inability to be used on new production lines after parts and molds are changed.
Adopting a PLC-based servo motion control method, by receiving servo motion instructions from the PLC controller, writing to the buffer and resetting the counter, using competition mode to perform operations, controlling the manipulator to initialize to the lateral working point, and controlling the servo driver drive through interpolation instructions The manipulator moves the parts on the slide, completes the parts transportation and stamping, avoids moving up and down, and adapts to mold changes.
It achieves wider applicability, improves servo control efficiency, ensures that the manipulator only moves forward, backward, left, and right on the punch machine, without relying on mold changes. It is suitable for different production lines and improves the flexibility and efficiency of the production line.
Smart Images

Figure CN117572817B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric motors, and in particular to a servo motion control method and system based on PLC. Background Art
[0002] In the prior art, a pull rod punching line is mostly used, which is pulled by a servo motor, and a servo motor is used to control a lifting platform to move up and down, so that the suction cup grabs the parts from one punching station to the temporary storage station. Another suction cup moves the parts from the temporary storage station to the next punching station.
[0003] The control system in the prior art cannot adapt to changes in the mold because it uses an up and down movement method. When the mold changes due to changes in parts, it cannot be used on a new production line. Summary of the invention
[0004] The embodiments of the present invention provide a PLC-based servo motion control method and system, which at least solve the above technical problems.
[0005] The present invention provides a servo motion control method based on PLC, the method comprising:
[0006] Receive servo motion instructions sent by the PLC controller;
[0007] Writing the instruction into the buffer for caching, resetting the counter and starting self-counting;
[0008] The first operation and the second operation are performed in a competitive manner: wherein the first operation includes: when the counter count reaches a preset cycle threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; the second operation includes: when the number of instructions cached in the buffer reaches a preset number threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; sending the frame of data;
[0009] Control all manipulators to initialize to a horizontal working point according to the one frame of data;
[0010] Sending a feedback signal indicating that all manipulators have completed initialization to the PLC controller;
[0011] Receiving the instruction sent by the PLC controller to control the manipulator to move the parts on the slideway, and controlling the servo driver to drive the manipulator to work through interpolation instructions;
[0012] When the robot completes the part transport and deviates from the slideway, it sends a completion instruction to the PLC controller; the PLC controller controls the punch press to press the part; thus completing one cycle of movement, the cycle continues.
[0013] In one embodiment, writing the instruction into a buffer for caching, resetting the counter and starting self-counting comprises:
[0014] When the instruction is written into the cache so that the cache state of the cache changes from empty to non-empty, the empty port of the cache changes from a high level to a low level; wherein, when the cache state of the cache is empty, the empty port is a high level and the counter remains in a reset state; when it is detected that the empty port changes from a high level to a low level, the counter is released from reset and starts self-counting; when the instruction is written into the cache so that the cache instruction in the cache changes, the counter is reset.
[0015] In one embodiment, the step of writing the instruction into a cache to cache, resetting a counter and starting self-counting includes: when the instruction is written into the cache, causing a write count signal of the cache to change; and when a change in the write count signal of the cache is detected, resetting the counter and starting self-counting.
[0016] In one embodiment, the reading of the instructions cached in the cache and the resetting of the counter include:
[0017] When the instructions cached in the cache are read, the read count signal of the cache is changed; when the read count signal of the cache is detected to be changed, the counter is reset.
[0018] In one embodiment, the reading of the instructions cached in the cache and the resetting of the counter include:
[0019] When reading the instructions cached in the buffer, the buffer state is set to be empty, so that the empty port of the buffer is at a high level; when it is detected that the empty port is at a high level, the counter is reset.
[0020] In one embodiment, controlling all manipulators to initialize to a horizontal working point according to a frame of data specifically includes:
[0021] Controlling each of the manipulators to reset horizontally to a horizontal mechanical origin in turn;
[0022] Control all robots to reset to the longitudinal mechanical origin simultaneously;
[0023] Control all robots to move horizontally to the horizontal working point simultaneously.
[0024] In one embodiment, the controlling the servo driver to drive the manipulator to work is specifically:
[0025] The servo driver is controlled by interpolation instructions to drive the manipulator to move longitudinally to the longitudinal working point first, and all the manipulators enter the mold synchronously to clamp the parts. The servo driver is immediately controlled by interpolation instructions to drive the manipulator to synchronously translate the parts horizontally on the slideway. After the parts are translated into place, all the manipulators exit the mold synchronously.
[0026] In one embodiment, before the PLC controller controls the punch press to press the part, the method further includes:
[0027] Whether the part is stuck to the mold is determined by a proximity switch arranged at each temporary storage position of the part. If it is determined that there is a part on the temporary storage position of the part, a punch press safety instruction is sent to the PLC controller.
[0028] In one embodiment, it further includes:
[0029] Receiving a first adjustment signal from a hand-cranked pulse generator to the servo motor, and using the first adjustment signal to roughly adjust the servo motor by controlling a servo driver;
[0030] Receive a second adjustment signal for the servo motor transmitted by the touch screen through the PLC controller; the servo motor is fine-tuned by controlling the servo driver with the second adjustment signal so that the servo motor drives the manipulator to reach a specified position; the second adjustment signal is a digital signal input through the touch screen.
[0031] Another aspect of the present invention provides a PLC-based servo motion control system, the system comprising:
[0032] An instruction receiving module is used to receive servo motion instructions sent by a PLC controller;
[0033] A data cache module, used for writing the instruction into a cache for caching, resetting the counter and starting self-counting;
[0034] A counting reset module, used to perform a first operation and a second operation in a competitive manner: wherein the first operation includes: when the counter count reaches a preset cycle threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; the second operation includes: when the number of instructions cached in the buffer reaches a preset number threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; sending the frame of data;
[0035] A data initialization module, used for controlling all manipulators to initialize to a horizontal working point according to the one frame of data;
[0036] A signal sending module, used for sending a feedback signal indicating that all manipulators have completed initialization to the PLC controller;
[0037] An instruction drive module is used to receive instructions sent by the PLC controller to control the manipulator to move parts on the slideway, and control the servo driver to drive the manipulator to work through interpolation instructions;
[0038] The instruction execution module is used to send a completion instruction to the PLC controller when the robot completes the part transportation and deviates from the slide; the PLC controller controls the punch press to press the part; thus completing a cycle of movement, and repeating the cycle.
[0039] In an embodiment of the present invention, the present application receives a servo motion instruction sent by a PLC controller; writes the instruction into a buffer for caching, resets the counter and starts self-counting; performs the first operation and the second operation in a competitive manner; sends a frame of data; controls all manipulators to initialize to a horizontal working point according to the frame of data; sends a feedback signal of the completion of initialization of all manipulators to the PLC controller; receives an instruction sent by the PLC controller to control the manipulator to move parts on the slide, and controls the servo driver to drive the manipulator to work through an interpolation instruction; when the manipulator completes the part transport and deviates from the slide, it sends a completion instruction to the PLC controller; the PLC controller controls the punch press to press down and punch the part; thus completing a cycle of movement, and this cycle is repeated. The manipulator only moves forward, backward, left, and right on the punch press, and does not move up and down, does not depend on the change of the mold, and has a wider applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:
[0041] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0042] Figure 1 A schematic diagram of a PLC-based servo motion control method according to an embodiment of the present invention;
[0043] Figure 2 The present invention is a structural diagram of a PLC-based servo motion control system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0045] like Figure 1 As shown, the present invention provides a servo motion control method based on PLC, comprising:
[0046] Step 101, receiving a servo motion instruction sent by a PLC controller;
[0047] Step 102, write the instruction into the buffer for caching, reset the counter and start self-counting;
[0048] Step 103, using a competitive method to perform a first operation and a second operation: wherein the first operation includes: when the counter count reaches a preset cycle threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; the second operation includes: when the number of instructions cached in the buffer reaches a preset number threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; sending a frame of data;
[0049] Step 104, controlling all manipulators to initialize to a horizontal working point according to a frame of data;
[0050] Step 105, sending a feedback signal indicating that all manipulators have completed initialization to the PLC controller;
[0051] Step 106, receiving an instruction from the PLC controller to control the manipulator to move the parts on the slide, and controlling the servo driver to drive the manipulator to work through interpolation instructions;
[0052] Step 107, when the robot completes the part transport and deviates from the slideway, it sends a completion instruction to the PLC controller; the PLC controller controls the punch press to press the part;
[0053] This completes one cycle of movement and repeats the cycle.
[0054] Collecting control data in the control process, calculating a control accuracy error value through the control data, and comparing a preset threshold with the control accuracy error value. When the control accuracy error value is greater than the preset threshold, calculating a control amount, and the controller modifies the control instruction according to the control amount and performs a control operation;
[0055] The calculation formula of the control accuracy error value is:
[0056]
[0057] Where W is the control accuracy error value, y is the y-axis position data of the preset position, x is the x-axis position data of the preset position, S1 is the initial speed of the manipulator, S2 is the acceleration of the manipulator, S3 is the average speed of the manipulator, Δy s Δx is the actual y-axis position data change of the robot from the initial position to the target position from the initial time to the end time of the movement, s is the actual x-axis position data change of the robot from the initial position to the target position from the initial time to the end time of the movement, y c is the initial position data of the robot on the y-axis, x c is the initial position data of the robot on the x-axis; when Δx s When the change is 0, set it to 1 in the formula; the position origin is set by the user;
[0058] The calculation formula of the control amount is:
[0059]
[0060] Among them, K is the control quantity, K P is a control parameter with a value range of 0.1-10, y is the y-axis position data of the preset position, x is the x-axis position data of the preset position, and W is the control accuracy error value.
[0061] In this embodiment, the method is applied to a punching machine platform, each punching machine carries a manipulator, each manipulator includes two part claws, and the manipulator moves horizontally and vertically on the punching machine; there is a temporary storage position for parts between two adjacent punching machines;
[0062] In step 101, it should be noted that the PLC controller in the present invention is used as an overall controller, and each punching machine corresponds to two servo motors, one motor is responsible for lateral drive, and the other motor is responsible for longitudinal drive. Each punching machine corresponds to a motion controller. The motion controller is used to control the servo driver. The servo driver is used to drive the servo motor. The servo motor is used to drive the manipulator to move horizontally or vertically.
[0063] In step 102, the method can be applied to a PCIE board equipped with an FPGA, wherein the buffer can be a FIFO of the FPGA; and a frame of data is a frame of Ethernet protocol data.
[0064] The present application uses an adaptive mechanism to allow a frame of Ethernet protocol data to contain multiple instructions to be sent, so that the number and frequency of instructions sent by the PC are not restricted, and a frame of Ethernet protocol data can be sent quickly, so that the number and frequency of instructions sent by the PC are not restricted, thereby improving communication efficiency.
[0065] The embodiments of the present application can be applied to any scenario in which frame data is sent using the Ethernet protocol, and is suitable for sending any instructions in a test system.
[0066] Among them, the instruction is received from the data sending end, and the data sending end may refer to the PC in the ATE test system. The PC sends instructions to the FIFO using the PCIE communication method, that is, the instructions sent by the PC are transmitted to the FPGA end through the PCIE driver and PCIEIP, and the data is stored in the FIFO. The instructions mentioned here may include all instructions involved in the test system.
[0067] In one embodiment, the counter calculates the clock of the Ethernet user-side transmitter, that is, the core chip of the PCIE board is FPGA, and this board has a clock chip. After the FPGA is introduced, the frequency is multiplied to generate 200MHz, and this clock always exists. When the timer is turned on, a number can be recorded every 5 nanoseconds (5 nanoseconds is a period of 200MHz). For example, the preset threshold period can be set to 7 periods, that is, 7 5 nanoseconds, or other values, which are determined manually according to the actual instruction sending and the data processing of the receiving end FPGA.
[0068] In one embodiment, writing an instruction to a buffer to cache, resetting a counter and starting self-counting includes:
[0069] When the instruction is written into the buffer so that the buffer state changes from empty to non-empty, the empty port of the buffer changes from high level to low level; wherein, when the buffer state of the buffer is empty, the empty port is high level, and the counter remains in reset state;
[0070] When the empty port is detected to change from high level to low level, the counter is reset and starts self-counting;
[0071] When writing an instruction into the cache causes the cache instruction in the cache to change, the counter is reset.
[0072] In one embodiment, writing an instruction to a buffer to cache, resetting a counter and starting self-counting includes:
[0073] When writing a command into the buffer, the write enable signal of the buffer is made valid or the write count signal changes;
[0074] When the write enable signal of the buffer is detected to be valid or the write count signal changes, the counter is reset and self-counting is started.
[0075] In one embodiment, reading the instructions cached in the cache and resetting the counter includes:
[0076] When reading the instruction cached in the cache, the read count signal of the cache is changed;
[0077] When a change in the read count signal of the buffer is detected, the counter is reset.
[0078] In one embodiment, reading the instructions cached in the cache and resetting the counter includes:
[0079] When reading the instruction cached in the buffer, the buffer cache state is made empty, so that the empty port of the buffer is at a high level;
[0080] When the empty port is detected as high level, the counter is reset.
[0081] Among them, empty is the output signal of FIFO. When there is no cached data, the empty signal is 1; when there is cached data, empty becomes 0.
[0082] The read count signal rd_data_count and the write count signal wr_data_count are both statistics of cached instructions, and are built-in FIFO. When there is no cached data in the FIFO (that is, the FIFO is empty), the read count signal rd_data_count and the write count signal wr_data_count are both 0. When an instruction is written to the FIFO, they are both increased by 1, and when an instruction is read from the FIFO, they are both decreased by 1. That is, the read count signal rd_data_count and the write count signal wr_data_count change when an instruction is written or read, and the signal change indicates that the instruction has changed. The counter is cleared when BIT0 of the write count signal wr_data_count and / or the read count signal rd_data_count changes. When BIT0 changes from 0 to 1 or from 1 to 0, it indicates that a cached instruction has changed, which can be stored or read, and both need to be judged.
[0083] When in use, wr_data_count uses the clock synchronization of the write end, the write clock is 250MHz, and the PCIE instructions are stored in the FIFO at 250MHz. rd_data_count uses the clock synchronization of the read end, the read clock is 200MHz, and the back-end sending and detection judgment are all at 200MHz. Therefore, if wr_data_count is used as a detection signal, the write clock needs to be synchronized to 200MHz.
[0084] Or, when a change is detected between the write enable signal and the read enable signal at the FIFO end, it indicates that the cached instruction has changed and the counter is cleared.
[0085] Among them, the write enable signal wren and the read enable signal rden of the FIFO end can also be used together to determine whether the instruction has changed, wherein the write enable signal wren and the read enable signal rden perform an "OR" operation. Because the cache data changes include increase and decrease, wren increases the cache and rden decreases the cache, so if you want to comprehensively determine the cache data changes, these two signals should be used together. Furthermore, the write enable signal wren uses the write end clock 250MHz, while the read enable signal rden uses the read end clock 200MHz. When using the write enable signal wren, it needs to be synchronized to the 200MHz clock.
[0086] In one embodiment, the specific process in step 103 may be as follows:
[0087] If the interval between instructions is small and the number of instructions is large, the counter will be continuously cleared. When the number of instructions in the cache FIFO exceeds the threshold number (the threshold number can be 16, directly judge rd_data_count>=16), read data from the FIFO, the read enable signal changes, and reading data will cause rd_data_count to change, thereby clearing the counter. When the instruction interval period is long or the number of instructions is small, the counter value reaches the threshold period and releases a send signal (this signal remains at 1 after exceeding the threshold period, and is reset to 0 after reading the data), read data from the FIFO, and read data will cause rd_data_count to change, thereby clearing the counter and resetting the send signal. The detection is always in progress, and any change in rd_data_count will clear the counter (including an increase in rd_data_count when writing and a decrease in rd_data_count when reading).
[0088] After the sending is completed, if there are still instructions in the FIFO, when the counter count exceeds the threshold cycle, all instructions in the current FIFO are sent. If new instructions are stored during the sending process, the new instructions are not sent, and only the instructions that have been cached in the FIFO at the time of exceeding the threshold cycle are sent; if the counter count does not exceed the threshold cycle, and the cached instructions exceed the threshold number, a fixed threshold number of instructions are sent.
[0089] Among them, when the threshold number is reached and the threshold cycle signal is sent at the same time, reading the instructions cached in the FIFO will clear the counter and reset the signal sent by the threshold cycle, which will not cause the problem of repeated transmission. In these two situations, no matter which one causes the data to be sent, they will reset each other.
[0090] In one embodiment, the total length of a frame of data is a preset fixed length, and the frame of data also includes a target MAC address field, a source MAC address field, a length field, an instruction field, and a stop instruction field;
[0091] The instruction field is filled with the instructions cached in the read buffer;
[0092] The stop instruction field is filled with a variable length of stop instructions, and the variable length is such that the total length of a frame of data reaches a preset fixed length.
[0093] Among them, the IEEE802.3 format is used to define the Ethernet protocol data frame format.
[0094] Specifically, when the number of FIFO cache instructions reaches the threshold, a frame of Ethernet protocol data consists of a 6-byte target address, a 6-byte source address, a 2-byte length, a fixed threshold number of instruction data, and a 4-byte stop instruction; when the counter reaches the threshold cycle, a frame of Ethernet protocol data consists of a 6-byte target address, a 6-byte source address, a 2-byte length, all instruction data in the FIFO, and an adaptive fill stop instruction.
[0095] Specifically, the threshold number is set to 15. When the number of instructions in the cache FIFO exceeds 15, a frame of Ethernet protocol data including 15 write instructions is sent. When the number of instructions in the cache FIFO does not exceed 15, but the counter count exceeds the cycle threshold, for example, there is only one instruction in the cache FIFO, then a frame of Ethernet protocol data including 1 write instruction is sent. When the counter count exceeds the cycle threshold again after a long time interval, and there are 3 instructions in the cache FIFO at this time, then a frame of Ethernet protocol data including 3 write instructions is sent.
[0096] In steps 104 and 105, it specifically includes: controlling each manipulator to reset to the horizontal mechanical origin in turn; controlling all manipulators to reset to the vertical mechanical origin at the same time; and controlling all manipulators to move to the horizontal working point at the same time.
[0097] It should be noted that before working, all manipulators need to be initialized to the horizontal working point. After all manipulators have completed the initialization, a feedback signal is sent to the PLC controller to inform the PLC controller that the control operation can be performed.
[0098] In step 106, the robot transports the part to the slide in two steps. The first step is to move longitudinally from the horizontal working point to the longitudinal working point to grab the part, and then move the part transversely on the slide to the next station. That is, the robot first moves longitudinally to the station, and then immediately moves the part transversely. After the robot moves longitudinally to the position, it moves the part transversely to the next station without stopping.
[0099] In step 107, the manipulator is installed on the punch press, and the manipulator can move on the punch press, and the moving trajectory is reciprocating cyclic motion at the following four points, namely: longitudinal mechanical origin-transverse mechanical origin-transverse working point-longitudinal working point-transverse mechanical origin.
[0100] Calculate the operation time of the robot and set the operation time threshold.
[0101] The operation time of the manipulator is adjusted by adjusting the number of ratios of cache instructions, and the length is compared with the operation time threshold. When the operation time of the manipulator is greater than the operation time threshold, the controller sends a time warning signal, reduces the number of cache instructions, or adjusts other calculation parameters to adjust the operation time of the manipulator.
[0102] The operation duration threshold is 1.25 times the historical average operation duration of the same type of control.
[0103] The calculation formula for the operation time of the manipulator is:
[0104]
[0105] Among them, T is the operation time of the robot, D1 is the longitudinal movement distance of the robot, D2 is the lateral movement distance of the robot, V1 is the longitudinal movement speed of the robot, V2 is the lateral movement speed of the robot, Z1 is the actual number of cache instructions sent, and Z2 is the cache instruction threshold.
[0106] Compared with the prior art, the present invention has the following advantages:
[0107] The motion controller receives the servo operation command sent by the PLC controller and starts to control the robot to work. First, it controls the robot to initialize to the horizontal working point; then it controls the robot to move to the longitudinal working point to grab the parts. After sending the command for the robot to move longitudinally to the longitudinal working point, it immediately sends the command for the robot to move horizontally, that is, it sends the command to control the longitudinal movement of the robot and the command to control the horizontal movement of the robot in sequence, and does not wait for the robot to move to the longitudinal working point before sending the command for the horizontal movement. The robot moves the parts horizontally on the slideway immediately after grabbing the parts. This can reduce the time interval. When the number of punching machines increases, the entire servo control time will not increase too much, thereby improving the efficiency of servo control. In addition, the robot only moves forward, backward, left and right on the punching machine, and does not move up and down. It does not depend on the change of the mold and has a wider applicability.
[0108] The operation time of the manipulator in the calculation formula of the operation time of the manipulator is related to the longitudinal movement distance D1 and the lateral movement distance D2 of the manipulator. By explicitly considering the movement distance of the manipulator in different directions, the operation time can be calculated more accurately and the time cost of moving in different directions can be reflected. The longitudinal movement speed V1 and the lateral movement speed V2 of the manipulator in the formula reflect the movement speed of the manipulator in different directions. Considering the movement speed of the manipulator can make a more detailed estimate of the operation time and better control the movement behavior of the manipulator. The actual number of cache instructions sent Z1 and the cache instruction threshold Z2 in the formula involve the time process of the manipulator receiving and processing instructions. The number of cache instructions will affect the operation time of the manipulator because when the cache instruction reaches the preset threshold, it will trigger the reading, packaging and sending process of the instruction. By considering the number of cache instructions, the operation time can be calculated more accurately and the system performance can be optimized and controlled. Calculating the operation time of the manipulator through the calculation formula can more comprehensively describe the time required for the operation of the manipulator and can serve as a basis for evaluating and optimizing the performance of the manipulator system. Improve the efficiency of the control system and enhance the degree of automation of the manipulator adjustment. By collecting the control data during the control process, the control accuracy error value is calculated based on this data. The calculation of this error value takes into account the y-axis and x-axis position data of the preset position, as well as the actual y-axis and x-axis position data change of the robot from the initial position to the target position. This design enables the system to accurately evaluate the deviation between the robot's movement path and the preset path, so as to adjust the control instructions in time. When the control accuracy error value is greater than the preset threshold, the system will calculate the control amount. The calculation of this control amount takes into account the control parameter K Pand error value W. Through such a design, the system can adjust the control instructions according to the size of the error, thereby achieving more precise control of the manipulator. The controller modifies the control instructions according to the control amount and performs control operations. This real-time modification and execution can ensure that the manipulator always stays on the correct path during movement, thereby achieving precise operation of the object. The calculation formula of the control accuracy error value and the calculation formula of the control amount both contain some adjustable parameters, such as the control parameter K P and control thresholds, etc. These parameters can be adjusted according to different application scenarios and requirements, making the system more adaptable and flexible. By collecting actual position data and comparing it with preset position data, the system can achieve high-precision position control. At the same time, by calculating the control accuracy error value and adjusting the control instructions in real time, the system can also maintain good stability, so that the manipulator will not have large oscillations or overshoots during movement. The control system can be fully automated without human intervention. At the same time, since it includes error calculation, threshold comparison, and real-time adjustment, the system has certain intelligent characteristics and can automatically adapt to different working environments and task requirements. The control system is scalable and flexible. It can be applied to various types of manipulators and objects, and can be customized and expanded according to different requirements. For example, the performance of the system can be optimized by adding sensor nodes or adjusting control parameters. By calculating the control accuracy error value and adjusting the control instructions in real time, the system can effectively reduce the collision and friction of the manipulator during movement and improve the safety performance of the system. In addition, the system also has fault detection and recovery functions, which can automatically detect and resume operation when a fault occurs, ensuring the stability and reliability of the system. The control system is characterized by high efficiency. It can complete precise position control operations in a short time, thereby improving production efficiency and quality. In addition, due to the automation and intelligent characteristics of the system, manual intervention and operation time can be reduced, further improving production efficiency. The control system has the characteristics of environmental protection and energy saving. It can achieve low-energy operation and reduce energy waste. In addition, the system can also reduce energy consumption by optimizing control algorithms and reducing unnecessary operations, thus contributing to environmental protection.
[0109] In one embodiment, before the PLC controller controls the punch press to press down to punch the part, the method further includes:
[0110] The proximity switch set at each temporary storage position of the parts is used to determine whether the parts are stuck to the mold. If it is determined that there are parts on the temporary storage position, a punch press safety command is sent to the PLC controller.
[0111] In this embodiment, in order to prevent the parts from sticking to the mold after the mold is pressed down and returned, causing the mold to be damaged when the next part is pressed down again, a group of proximity switches are added to the temporary storage position of the parts between the punch presses. By judging whether the parts have reached the temporary storage position, it is determined whether there are parts stuck to the mold.
[0112] It is understandable that under normal circumstances, the proximity switch can allow parts to approach. When the proximity switch detects that there are no parts approaching, the robot may be unhooked, or the parts may be attached to the mold. In the above two situations, an alarm will be issued and the punch press will not press down. After the fault is resolved, the punch press will be controlled to press down.
[0113] In one embodiment, a first adjustment signal from a hand-cranked pulse generator to a servo motor is received, and the servo motor is roughly adjusted by controlling a servo driver according to the first adjustment signal;
[0114] The second regulating signal for the servo motor transmitted by the touch screen through the PLC controller is received; the servo motor is fine-tuned by controlling the servo driver by the second regulating signal so that the servo motor drives the manipulator to reach the specified position; the second regulating signal is a digital signal input through the touch screen.
[0115] In this embodiment, the touch screen is connected to the PLC controller and transmitted to the motion controller through the PLC controller. The position value set by the touch screen is input to the PLC controller, which is transmitted to the motion controller through the devicenet bus by the PLC controller, and the motion controller controls the servo motor to drive the manipulator to move to the specified position. It should be noted that the above positions all refer to absolute positions. Because the position setting is transmitted from the touch screen to the motion controller through the PLC controller, the PLC controller transmits digital signals to the motion controller.
[0116] The pulse signal from the manual pulse generator is directly received by the motion controller. When the PLC controller sends a manual pulse command to the motion controller, the motion controller drives the corresponding servo motor to move according to the number of pulses sent by the manual pulse generator.
[0117] It is understandable that the motor is roughly adjusted using a hand-cranked pulse generator, and the current position of the motor is displayed on the touch screen. The second adjustment signal is input through the touch screen for fine adjustment. Since the touch screen is connected to the PLC controller, the PLC controller transmits the second adjustment signal input on the touch screen to the motion controller, and the motion controller controls the motor to reach the specified position.
[0118] Another aspect of the present invention provides a PLC-based servo motion control system, the system comprising:
[0119] The instruction receiving module 201 is used to receive the servo motion instruction sent by the PLC controller;
[0120] A data cache module 202, used to write instructions into a cache for caching, reset a counter and start self-counting;
[0121] The counting reset module 203 is used to perform the first operation and the second operation in a competitive manner: wherein the first operation includes: when the counter count reaches a preset cycle threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; the second operation includes: when the number of instructions cached in the buffer reaches a preset number threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; sending a frame of data;
[0122] The data initialization module 204 is used to control all manipulators to initialize to a horizontal working point according to a frame of data;
[0123] The signal sending module 205 is used to send a feedback signal indicating that all manipulators have completed initialization to the PLC controller;
[0124] The instruction drive module 206 is used to receive the instruction sent by the PLC controller to control the manipulator to move the parts on the slideway, and control the servo driver to drive the manipulator to work through the interpolation instruction;
[0125] The instruction execution module 207 is used to send a completion instruction to the PLC controller when the robot completes the part transportation and deviates from the slideway; the PLC controller controls the punch press to press the part; thus completing a cycle of movement, and repeating the cycle.
[0126] In this embodiment, the execution mode of the system is the same as the method steps, and will not be repeated here.
[0127] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0128] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0129] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A servo motion control method based on PLC, characterized in that: The method comprises: Receive servo motion instructions sent by the PLC controller; Writing the instruction into the buffer for caching, resetting the counter and starting self-counting; The first operation and the second operation are performed in a competitive manner: wherein the first operation includes: when the counter count reaches a preset cycle threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; the second operation includes: when the number of instructions cached in the buffer reaches a preset number threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; sending the frame of data; Control all manipulators to initialize to a horizontal working point according to the one frame of data; Sending a feedback signal indicating that all manipulators have completed initialization to the PLC controller; Receiving the instruction sent by the PLC controller to control the manipulator to move the parts on the slideway, and controlling the servo driver to drive the manipulator to work through interpolation instructions; When the robot completes the transport of the parts and deviates from the slideway, it sends a completion instruction to the PLC controller; the PLC controller controls the punch press to press the parts; thus completing a cycle of movement, and repeating the cycle; The manipulator is installed on the punch press and moves on the punch press. The moving trajectory is a reciprocating cycle at the following four points, namely: longitudinal mechanical origin-transverse mechanical origin-transverse working point-longitudinal working point-transverse mechanical origin; Calculate the operation time of the manipulator, set an operation time threshold, compare the operation time of the manipulator with the operation time threshold, and when the operation time of the manipulator is greater than the operation time threshold, the controller sends a time warning signal, reduces the number of cache instructions, and then adjusts the operation time of the manipulator; The calculation formula for the operation time of the manipulator is: Among them, T is the operation time of the robot, D1 is the longitudinal movement distance of the robot, D2 is the lateral movement distance of the robot, V1 is the longitudinal movement speed of the robot, V2 is the lateral movement speed of the robot, Z1 is the actual number of cache instructions sent, and Z2 is the cache instruction threshold; Collecting control data in the control process, calculating a control accuracy error value through the control data, and comparing a preset threshold with the control accuracy error value. When the control accuracy error value is greater than the preset threshold, calculating a control amount, and the controller modifies the control instruction according to the control amount and performs a control operation; The calculation formula of the control accuracy error value is: Where W is the control accuracy error value, y is the y-axis position data of the preset position, x is the x-axis position data of the preset position, S1 is the initial speed of the manipulator, S2 is the acceleration of the manipulator, S3 is the average speed of the manipulator, Δy s Δx is the actual y-axis position data change of the robot from the initial position to the target position from the initial time to the end time of the movement, s is the actual x-axis position data change of the robot from the initial position to the target position from the initial time to the end time of the movement, y c is the initial position data of the robot on the y-axis, x c is the initial position data of the robot on the x-axis; when When the change in is 0, set it to 1 in the formula; The calculation formula of the control amount is: Among them, K is the control quantity, K P is a control parameter with a value range of 0.1-10, y is the y-axis position data of the preset position, x is the x-axis position data of the preset position, and W is the control accuracy error value.
2. The method according to claim 1, characterized in that The step of writing the instruction into a buffer for caching, resetting a counter and starting self-counting comprises: When the instruction is written into the cache so that the cache state of the cache changes from empty to non-empty, the empty port of the cache changes from a high level to a low level; wherein, when the cache state of the cache is empty, the empty port is a high level and the counter remains in a reset state; when it is detected that the empty port changes from a high level to a low level, the counter is released from reset and starts self-counting; when the instruction is written into the cache so that the cache instruction in the cache changes, the counter is reset.
3. The method according to claim 1, characterized in that The step of writing the instruction into the buffer for caching, resetting the counter and starting self-counting comprises: when writing the instruction into the buffer, causing the write count signal of the buffer to change; and when detecting the write count signal of the buffer to change, resetting the counter and starting self-counting.
4. The method according to claim 1, characterized in that The step of reading the instructions cached in the cache and resetting the counter comprises: When the instructions cached in the cache are read, the read count signal of the cache is changed; when the read count signal of the cache is detected to be changed, the counter is reset.
5. The method according to claim 1, characterized in that The step of reading the instructions cached in the cache and resetting the counter comprises: When reading the instructions cached in the buffer, the buffer state is set to be empty, so that the empty port of the buffer is at a high level; when it is detected that the empty port is at a high level, the counter is reset.
6. The method according to claim 1, characterized in that The controlling of all manipulators to initialize to the horizontal working point according to one frame of data specifically includes: Controlling each of the manipulators to reset horizontally to a horizontal mechanical origin in turn; Control all robots to reset to the longitudinal mechanical origin simultaneously; Control all robots to move horizontally to the horizontal working point simultaneously.
7. The method according to claim 1, characterized in that The interpolation instruction is used to control the servo driver to drive the manipulator to work, specifically: The servo driver is controlled by interpolation instructions to drive the manipulator to move longitudinally to the longitudinal working point first, and all the manipulators enter the mold synchronously to clamp the parts. The servo driver is immediately controlled by interpolation instructions to drive the manipulator to synchronously translate the parts horizontally on the slideway. After the parts are translated into place, all the manipulators exit the mold synchronously.
8. The method according to claim 1, characterized in that Before the PLC controller controls the punch press to press the part, the method further includes: Whether the part is stuck to the mold is determined by a proximity switch arranged at each temporary storage position of the part. If it is determined that there is a part on the temporary storage position of the part, a punch press safety instruction is sent to the PLC controller.
9. The method according to claim 4, characterized in that Also includes: Receiving a first adjustment signal from a hand-cranked pulse generator to a servo motor, and using the first adjustment signal to roughly adjust the servo motor by controlling a servo driver; Receive a second adjustment signal for the servo motor transmitted by the touch screen through the PLC controller; the servo motor is fine-tuned by controlling the servo driver with the second adjustment signal so that the servo motor drives the manipulator to reach a specified position; the second adjustment signal is a digital signal input through the touch screen.
10. A servo motion control system based on PLC, characterized in that: The system comprises: An instruction receiving module is used to receive servo motion instructions sent by a PLC controller; A data cache module, used for writing the instruction into a cache for caching, resetting the counter and starting self-counting; A counting reset module, used to perform a first operation and a second operation in a competitive manner: wherein the first operation includes: when the counter count reaches a preset cycle threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; the second operation includes: when the number of instructions cached in the buffer reaches a preset number threshold, reading the instructions cached in the buffer, encapsulating them in a frame of data, and resetting the counter; sending the frame of data; A data initialization module, used for controlling all manipulators to initialize to a horizontal working point according to the one frame of data; A signal sending module, used for sending a feedback signal indicating that all manipulators have completed initialization to the PLC controller; An instruction drive module is used to receive instructions sent by the PLC controller to control the manipulator to move parts on the slideway, and control the servo driver to drive the manipulator to work through interpolation instructions; The instruction execution module is used to send a completion instruction to the PLC controller when the robot completes the part transportation and deviates from the slideway; the PLC controller controls the punch press to press the part; thus completing a cycle of movement, and repeating the cycle; The manipulator is installed on the punch press and moves on the punch press. The moving trajectory is a reciprocating cycle at the following four points, namely: longitudinal mechanical origin-transverse mechanical origin-transverse working point-longitudinal working point-transverse mechanical origin; Calculate the operation time of the manipulator, set an operation time threshold, compare the operation time of the manipulator with the operation time threshold, and when the operation time of the manipulator is greater than the operation time threshold, the controller sends a time warning signal, reduces the number of cache instructions, and then adjusts the operation time of the manipulator; The calculation formula for the operation time of the manipulator is: Among them, T is the operation time of the robot, D1 is the longitudinal movement distance of the robot, D2 is the lateral movement distance of the robot, V1 is the longitudinal movement speed of the robot, V2 is the lateral movement speed of the robot, Z1 is the actual number of cache instructions sent, and Z2 is the cache instruction threshold; Collecting control data in the control process, calculating a control accuracy error value through the control data, and comparing a preset threshold with the control accuracy error value. When the control accuracy error value is greater than the preset threshold, calculating a control amount, and the controller modifies the control instruction according to the control amount and performs a control operation; The calculation formula of the control accuracy error value is: Where W is the control accuracy error value, y is the y-axis position data of the preset position, x is the x-axis position data of the preset position, S1 is the initial speed of the manipulator, S2 is the acceleration of the manipulator, S3 is the average speed of the manipulator, Δy s Δx is the actual y-axis position data change of the robot from the initial position to the target position from the initial time to the end time of the movement, s is the actual x-axis position data change of the robot from the initial position to the target position from the initial time to the end time of the movement, y c is the initial position data of the robot on the y-axis, x c is the initial position data of the robot on the x-axis; when When the change in is 0, set it to 1 in the formula; The calculation formula of the control amount is: Among them, K is the control quantity, K P is a control parameter with a value range of 0.1-10, y is the y-axis position data of the preset position, x is the x-axis position data of the preset position, and W is the control accuracy error value.
Citation Information
Patent Citations
Cored punch bus multi-axis servo control method and system
CN105137915A
Instruction sending method and device
CN116074406A
