CN-121989246-A - Industrial robot control method based on programmable controller
Abstract
The invention discloses an industrial robot control method based on a programmable controller, which comprises the steps of defining a standardized control motion instruction set, including a preparation function instruction, an auxiliary function instruction, a coordinate parameter instruction and a speed parameter instruction, packaging and generating corresponding program blocks aiming at each instruction in the control motion instruction set, automatically generating a control instruction character string according to input parameters, constructing a robot controller comprising a plurality of functional modules, wherein the functional modules at least comprise a communication module, a zero return module, a manual control module, a point position teaching module, a point position tracking module, an action flow configuration module, an action flow execution module and a man-machine interaction module, and the communication module is used for realizing data exchange between the programmable controller and the robot controller, and executing corresponding functions through different functional modules. The invention can reduce the learning and use cost of the robot.
Inventors
- ZHENG LIUCHUN
Assignees
- 福建百思奇智能科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260309
Claims (10)
- 1. The industrial robot control method based on the programmable controller is characterized by comprising the following steps of: Step 1, defining a standardized control motion instruction set, wherein the control motion instruction set is divided into a preparation function instruction, an auxiliary function instruction, a coordinate parameter instruction and a speed parameter instruction according to instruction types; step 2, in a programmable controller, independently packaging and generating corresponding program blocks aiming at each instruction in the control motion instruction set, wherein the program blocks automatically generate control instruction character strings meeting the format requirements according to input parameters; Step 3, constructing a robot controller comprising a plurality of functional modules, wherein the functional modules at least comprise a communication module, a zeroing module, a manual control module, a point position teaching module, a point position tracking module, an action flow configuration module, an action flow execution module and a man-machine interaction module; The communication module is used for realizing data exchange between the programmable controller and the robot controller; the zeroing module is used for controlling the robot to return to the zero position and confirming the zeroing completion state; The manual control module is used for realizing inching control and position adjustment of the robot; The point position teaching module is used for storing the current position coordinates of the robot as teaching point positions; The point position tracking module is used for verifying the accuracy of the teaching point positions and controlling the robot to move to the taught point positions; The action flow configuration module is used for configuring a multi-step action sequence of the robot and execution parameters thereof; the action flow execution module is used for automatically controlling the robot to execute corresponding actions according to the configured action flow; The man-machine interaction module is used for providing a user operation interface and displaying the state information of the robot in real time.
- 2. The method for controlling an industrial robot based on a programmable controller according to claim 1, wherein the preparation function instruction is for controlling the robot motion, at least comprising: 1) A plurality of types of motion control instructions, including a point-to-point motion instruction, a JOG motion instruction, a straight line interpolation instruction, an arc interpolation instruction, and a door motion instruction; 2) Coordinate mode instructions, including absolute coordinate mode instructions and relative coordinate mode instructions; 3) The coordinate system instructions comprise rectangular coordinate system instructions and joint coordinate system instructions; the auxiliary function instruction is used for controlling robot auxiliary actions and at least comprises: 1) The zeroing instruction is used for driving each shaft of the robot to return to a zero position; 2) A jaw control command for controlling jaw opening or jaw closing; 3) A state query instruction, configured to obtain current state and position information of the mechanical arm; The coordinate parameter instruction is used for defining the coordinate and the arc radius of a target position, wherein the coordinate of the target position comprises a linear axis coordinate and a rotation axis coordinate, and consists of letters and numbers, wherein letters X, Y and Z are used for representing the linear axis coordinate in a Cartesian coordinate system, letters A, B and C are used for representing the rotation axis coordinate, and letters R are used for representing the arc radius; The speed parameter instruction is used for defining the movement feeding speed of the robot and consists of a letter F and a numerical value.
- 3. The method for controlling an industrial robot based on a programmable controller according to claim 1, wherein the step 2 specifically comprises: Step 21, in the programmable controller, creating a corresponding program block for each instruction in a control motion instruction set, and adding input parameters through an input interface of the program block, wherein the input parameters at least comprise coordinate parameters and speed parameters; step 22, calling a character string conversion instruction to convert the input coordinate parameters and the speed parameters from numerical value types to character string types respectively to obtain a coordinate parameter character string and a speed parameter character string; Step 23, calling a character string splicing instruction, and sequentially splicing a constant character string of a preset instruction type, a converted coordinate parameter character string and a speed parameter character string according to a preset instruction format, wherein each character string is separated by a separator; And step 24, outputting the spliced control instruction character string.
- 4. The industrial robot control method based on the programmable controller of claim 1, wherein the implementation of the communication module comprises: The communication module realizes Socket communication based on a TCP/IP protocol, the programmable controller is used as a TCP client, the robot controller is used as a TCP server, and the programmable controller establishes network connection with the robot controller through a network port and a communication instruction of the programmable controller; the programmable controller end executes the following communication steps: 1) Detecting clicking events of all axial movement buttons on a man-machine interaction interface in real time; 2) When the fact that the motion button in the axial direction of the target is clicked is detected, a corresponding program block is called to generate a control instruction character string of the target position according to the current coordinate system, the current position coordinate and the preset moving distance and speed of the robot; 3) Calling a Socket sending instruction of the programmable controller, and sending the generated control instruction character string to a robot controller with a designated IP address and port number; 4) Reading state parameters of a Socket sending instruction, and judging whether the Socket sending instruction is successful or failed; 5) When the completion state parameter of the Socket sending instruction is read to be true, the sending is successful, and the program is ended; 6) When the error state parameter of the Socket sending instruction is read to be true, representing the sending failure, executing a communication fault processing mechanism, wherein the communication fault processing mechanism specifically comprises: Accumulating a transmission failure counter by 1; judging the current value of the transmission failure counter, namely retransmitting the control instruction character string after delaying for a preset time if the current value is smaller than a preset retry threshold value, triggering a communication alarm signal if the current value is larger than or equal to the preset retry threshold value, displaying an alarm prompt box through a man-machine interaction interface, and informing a user to check a communication link; when the confirmation operation of the user on the alarm prompt box is detected, resetting the transmission failure counter, and retrying to transmit the control instruction character string; the robot controller end executes the following communication steps: 1) After the robot controller is electrified, calling a Socket communication instruction, and sequentially executing initialization operations of creating a Socket handle, binding a local port and monitoring the port; 2) When the robot controller monitors a connection request from the programmable controller, receiving connection and starting to receive a control instruction character string of the programmable controller; 3) After receiving the control instruction character string sent by the programmable controller, the robot controller calls a character string processing instruction in the robot to analyze the received control instruction character string; 4) And driving the robot to execute corresponding actions according to the analyzed content.
- 5. The industrial robot control method based on the programmable controller of claim 4, wherein the implementation of the zeroing module comprises: detecting a zero return button click event on a man-machine interaction interface in real time; when the zero-return button is detected to be clicked, calling a program block corresponding to a zero-return instruction to generate a zero-return control instruction character string; the communication module is used for sending a zeroing control command character string to the robot controller to drive the robot to execute zeroing operation; After the zero return control command character string is sent, periodically calling a program block corresponding to the state query command, generating a state query control command character string and sending the state query control command character string to the robot controller; receiving state data returned by a robot controller, and analyzing and reading current coordinate values of all joints of the robot; and when all the joint coordinate values are read to be zero, judging that the robot zeroing operation is finished.
- 6. The industrial robot control method based on the programmable controller of claim 1, wherein the manual control module is specifically implemented by: After the robot zeroing operation is finished, receiving a coordinate system switching instruction and a moving distance set value input by a user through a human-computer interaction interface; detecting clicking events of positive movement buttons and negative movement buttons in the axial directions on a man-machine interaction interface in real time; When any axial movement button is detected to be clicked, a program block corresponding to a JOG movement instruction is called according to the movement direction corresponding to the clicked button, the current coordinate system of the robot, the current joint coordinate or rectangular coordinate of the robot and the movement distance set by a user; automatically generating a JOG motion control instruction character string containing target position coordinates by a program block corresponding to the JOG motion instruction; The generated JOG motion control instruction character string is sent to a robot controller through the communication module, and the robot is driven to move along the designated axial direction for a set distance; and displaying the current rectangular coordinates and joint coordinates of the robot after moving on a human-computer interaction interface in real time.
- 7. The industrial robot control method based on the programmable controller of claim 1, wherein the specific implementation of the point position teaching module comprises: after the robot is moved to a target position through the manual control module, receiving a point position selection instruction input by a user through a human-computer interaction interface; detecting clicking events of all teaching buttons on a man-machine interaction interface in real time; When any teaching button is detected to be clicked, determining a target point position number corresponding to the current operation according to the clicked teaching button or a point position selection parameter preset by a user; Reading the current joint coordinates or rectangular coordinates of the robot; And storing the read current coordinate data into a storage unit corresponding to the target point position number in a programmable controller, and finishing point position teaching.
- 8. The industrial robot control method based on the programmable controller of claim 1, wherein the specific implementation of the point location tracking module comprises: After the point teaching is finished through the point teaching module, receiving a point selection instruction and a motion type selection instruction which are input by a user through a human-computer interaction interface; Detecting clicking events of function buttons corresponding to various motion control instructions on a man-machine interaction interface in real time, wherein the function buttons at least comprise a linear interpolation button, a point-to-point motion button and a door motion button; when any one of the function buttons is detected to be clicked, determining a target point position number corresponding to the current operation according to a point position selection parameter preset by a user; reading coordinate data stored corresponding to the target point position number from a programmable controller; calling a pre-packaged program block matched with the motion type according to the motion type corresponding to the clicked function button, and taking the read coordinate data as an input parameter; the program block automatically generates a corresponding motion control instruction character string containing the target position coordinates; And the communication module is used for sending the generated corresponding motion control instruction character string to the robot controller, driving the robot to move to the target point position according to the selected motion type, and verifying the accuracy of the teaching point position.
- 9. The industrial robot control method based on the programmable controller of claim 1, wherein the implementation of the action flow configuration module comprises: Planning a continuous storage area in a power-off storage register of the programmable controller, wherein the continuous storage area is used for storing configuration parameters of a plurality of action flows; The method comprises the steps that a user configures corresponding action instructions, point location parameters and additional parameters for a plurality of actions in each action flow in a human-computer interaction interface, wherein the action instructions are used for selecting specific action types of a robot, the point location parameters are used for specifying target point location coordinates corresponding to the actions, and the additional parameters are used for setting arc radiuses of arc interpolation instructions; converting the action instruction and the point location parameter configured by the user into corresponding numerical codes; and writing the numerical codes into register addresses corresponding to the action flow numbers and the action sequence numbers in the storage area, and writing the arc radius values corresponding to the additional parameters into the register addresses corresponding to the additional parameters in the storage area through a man-machine interaction interface to complete the configuration of the action flow.
- 10. The industrial robot control method based on the programmable controller of claim 1, wherein the implementation of the action flow execution module comprises: When the equipment runs to a trigger point where the robot needs to execute actions, automatically starting a preset action flow execution program; reading the configured action instructions in sequence according to the action sequence; calling a program block corresponding to the action instruction according to the read numerical code corresponding to the action instruction; If the current action instruction needs to correlate the point position parameters, simultaneously reading the numerical codes corresponding to the point position parameters, acquiring corresponding target point position coordinates according to the numerical codes of the point position parameters, and transmitting the corresponding target point position coordinates serving as input parameters into the program block; If the current action instruction needs to be associated with the additional parameter, simultaneously reading an arc radius value corresponding to the additional parameter, and transmitting the arc radius value as an input parameter into the program block; the program block automatically generates a control instruction character string containing an action instruction, a target point position coordinate and an arc radius value; the generated control command character string is sent to a robot controller through the communication module, and the robot is driven to execute the current action; After the current action instruction is sent, calling a program block corresponding to the state inquiry instruction, generating a state inquiry control instruction character string and sending the state inquiry control instruction character string to the robot controller; Receiving state data returned by the robot controller, analyzing and judging whether the current action is executed in place or not; And after judging that the current action is in place, automatically reading the numerical code of the action instruction of the next action, and repeating the steps until the whole action flow is completed.
Description
Industrial robot control method based on programmable controller Technical Field The invention relates to the technical field of robots, in particular to an industrial robot control method based on a programmable controller. Background Currently, industrial robots have penetrated into various industries in the automation field. When the industrial robot is used, control logic, movement tracks and the like of the robot are required to be programmed, the existing industrial robots are various in brands, each robot controller and programming language are different, learning cost is high, robots of different brands are usually used in the same enterprise at the same time, engineers are difficult to master the robots in a skilled mode at the same time, and use cost is increased. According to the traditional method, control logic and programming of motion trajectories are performed in a robot controller to control the robot. When multiple brands of robots exist in an enterprise, each brand of robot needs to independently write a whole set of programs, and the workload is huge. The thinking logic and programming habit of each engineer are different, and different programs are all a great burden on the technical level, namely communication in pairs and delivery out pairs. How to realize a robot controller which has strong universality, is friendly to interaction and can be freely expanded is a problem to be solved urgently. Disclosure of Invention In view of the above, the present invention aims to provide an industrial robot control method based on a programmable controller, which is realized by transferring the control logic and the motion track to the programmable controller instead of using the conventional method to program the interior of the robot controller, and the robot only executes simple zero returning, point-to-point motion, linear interpolation, circular interpolation, door motion, clamping jaw opening, clamping jaw closing and other actions by receiving external instructions, so that the same set of control system can be used by robots of different brands, the problem of different control modes of the robots of different brands at present is solved, and the learning and use cost of the robot is reduced. In order to achieve the technical purpose, the invention adopts the following technical scheme: The invention provides an industrial robot control method based on a programmable controller, which comprises the following steps: Step 1, defining a standardized control motion instruction set, wherein the control motion instruction set is divided into a preparation function instruction, an auxiliary function instruction, a coordinate parameter instruction and a speed parameter instruction according to instruction types; step 2, in a programmable controller, independently packaging and generating corresponding program blocks aiming at each instruction in the control motion instruction set, wherein the program blocks automatically generate control instruction character strings meeting the format requirements according to input parameters; Step 3, constructing a robot controller comprising a plurality of functional modules, wherein the functional modules at least comprise a communication module, a zeroing module, a manual control module, a point position teaching module, a point position tracking module, an action flow configuration module, an action flow execution module and a man-machine interaction module; The communication module is used for realizing data exchange between the programmable controller and the robot controller; the zeroing module is used for controlling the robot to return to the zero position and confirming the zeroing completion state; The manual control module is used for realizing inching control and position adjustment of the robot; The point position teaching module is used for storing the current position coordinates of the robot as teaching point positions; The point position tracking module is used for verifying the accuracy of the teaching point positions and controlling the robot to move to the taught point positions; The action flow configuration module is used for configuring a multi-step action sequence of the robot and execution parameters thereof; the action flow execution module is used for automatically controlling the robot to execute corresponding actions according to the configured action flow; The man-machine interaction module is used for providing a user operation interface and displaying the state information of the robot in real time. Further, the preparation function instruction is used for controlling the robot to move, and at least comprises: 1) A plurality of types of motion control instructions, including a point-to-point motion instruction, a JOG motion instruction, a straight line interpolation instruction, an arc interpolation instruction, and a door motion instruction; 2) Coordinate mode instructions, including absolute coordinate mode instructions and r