Positioning instruction system for PLC
By providing a positioning instruction system in the PLC, integrating the positioning instruction module, dedicated registers and coils, the complex problem of traditional PLC positioning control is solved, and simplified positioning instruction configuration and use is realized, and working efficiency is improved.
Patent Information
- Application Number
- CN202510356570.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-06-27
AI Technical Summary
When performing positioning control, traditional PLCs require complex programming and multiple instructions, and the configuration and use are relatively complex.
It provides a positioning instruction system for PLC, including a positioning instruction module, a special register for positioning, a special coil, a positioning working status register, a origin regression instruction module and a positioning instruction usage technique module, which simplifies the configuration and use process of positioning instructions.
By integrating multiple positioning functions, designing special registers and coils, providing real-time status monitoring, simplifying origin regression configuration, and providing usage techniques and cases, the configuration and use process of positioning instructions are significantly simplified and working efficiency is improved.
Smart Images

Figure CN120215404A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial automation technology, and particularly to a positioning instruction system for PLCs. Background Art
[0002] In the field of industrial automation, PLCs (Programmable Logic Controllers) are widely used in the control of various mechanical devices. When traditional PLCs perform positioning control, complex programming and multiple instructions are usually required to achieve precise position control. For example, products such as Mitsubishi PLCs usually provide relative positioning and absolute positioning instructions, but their configuration and use are relatively complex. Summary of the Invention
[0003] The purpose of this application is to provide a positioning instruction system for PLCs, which can simplify the configuration and use process of positioning instructions.
[0004] To achieve the above purpose, this application provides the following solutions:
[0005] In a first aspect, this application provides a positioning instruction system for PLCs, including:
[0006] A positioning instruction module, a positioning dedicated special register, a special coil, a positioning working status register, a home return instruction module, and a positioning instruction usage skill module.
[0007] Optionally, the positioning instruction module is used to execute positioning operations; the positioning operations include a home return instruction and a configuration special register instruction.
[0008] Optionally, the positioning dedicated special register and the special coil are used to store and control positioning-related parameters and states.
[0009] Optionally, the positioning dedicated special register includes a target position register, a base frequency register, a running frequency register, a return frequency register, an acceleration / deceleration register, and a current position register.
[0010] Optionally, the target position register is used to write and set the target position by assignment or running an instruction
[0011] The base frequency register and the running frequency register are respectively used to set the starting frequency and the highest frequency when pulse output;
[0012] The return frequency register and the acceleration / deceleration register are respectively used to find the frequency of finding the zero point when setting the home return and the acceleration / deceleration time based on the highest frequency;
[0013] The current position register is used to indicate the current position of the positioning instruction system.
[0014] Optionally, the special coil includes: a positioning command valid coil, a direction pin polarity coil, a forward limit limit coil, a reverse limit limit coil, a positioning pulse stop coil, and a current direction coil.
[0015] Optionally, the positioning command valid coil is used for positioning after executing the home return command;
[0016] The direction pin polarity coil is used to configure the polarity of the direction pin output;
[0017] The forward limit limit coil and the reverse limit limit coil are respectively used to set the limit limit points of the forward limit and the reverse limit in the ladder diagram;
[0018] The positioning pulse output coil and the positioning pulse stop coil are respectively used to indicate the states of the positioning function during pulse output and non-output;
[0019] The current direction coil is used to indicate the current position and current direction of the positioning command system.
[0020] Optionally, the positioning working state register is used to display the working state of the positioning program.
[0021] Optionally, the home return command module is used to start the home return function; the start of the home return function includes four parameters: Dog input point, zero point input point, pulse output point, and direction output point.
[0022] Optionally, the positioning command usage skill module is used to guide the user to configure and use the PLC positioning command system.
[0023] According to the specific embodiments provided by the present application, the following technical effects are disclosed in the present application:
[0024] The present application provides a positioning instruction system for PLC. In this system, the positioning instruction module integrates multiple positioning functions, and users only need to select the corresponding instructions to complete complex positioning control without writing cumbersome program codes. Secondly, the design of dedicated special registers and special coils for positioning enables users to conveniently set and monitor positioning parameters such as target position, speed, acceleration, etc., improving the flexibility and accuracy of configuration. Furthermore, the positioning working status register reflects the current status of the positioning system in real time, such as running, pausing, homing completed, etc., facilitating users to monitor the status and diagnose faults. In addition, the homing instruction module provides a simple homing instruction, and users only need to call this instruction to achieve the homing of the device, simplifying the configuration process of homing. Finally, the positioning instruction usage skills module provides rich usage skills and cases to help users quickly master the usage method of positioning instructions and improve work efficiency. The present application significantly simplifies the configuration and usage process of positioning instructions by integrating multiple positioning functions, designing dedicated registers and coils, providing real-time status monitoring, simplifying homing configuration, and providing usage skills and cases. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0026] Figure 1 It is a schematic diagram of the function modules of a positioning instruction system for PLC provided by an embodiment of the present application;
[0027] Figure 2 It is the positioning provided by an embodiment of the present application Figure 1 ;
[0028] Figure 3 It is the positioning provided by an embodiment of the present application Figure 2 ;
[0029] Figure 4 It is the positioning provided by an embodiment of the present application Figure 3 ;
[0030] Figure 5 It is the positioning provided by an embodiment of the present application Figure 4 . DETAILED DESCRIPTION OF THE EMBODIMENTS
[0031] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0032] In some exemplary embodiments, a positioning instruction system for a PLC is provided, including:
[0033] A positioning instruction module, a positioning dedicated special register, a special coil, a positioning working status register, a home return instruction module, and a positioning instruction usage skill module.
[0034] Among them, in this embodiment, the positioning instruction module is used to execute positioning operations; the positioning operations include a home return instruction and a configuration special register instruction. The positioning dedicated special register and the special coil are used to store and control positioning-related parameters and states.
[0035] Specifically, the positioning dedicated special register includes a target position register, a base frequency register, a running frequency register, a return frequency register, an acceleration / deceleration register, and a current position register.
[0036] The target position register is used to write and set the target position by assignment or running an instruction; the base frequency register and the running frequency register are respectively used to set the start frequency and the highest frequency when the pulse is output; the return frequency register and the acceleration / deceleration register are respectively used to find the frequency of finding the zero point when setting the home return and the acceleration / deceleration time based on the highest frequency; the current position register is used to indicate the current position of the positioning instruction system.
[0037] Specifically, the special coil includes: a positioning instruction valid coil, a direction pin polarity coil, a forward limit limit coil, a reverse limit limit coil, a positioning pulse stop coil, and a current direction coil. The positioning instruction valid coil is used to perform positioning after executing the home return instruction; the direction pin polarity coil is used to configure the polarity of the direction pin output; the forward limit limit coil and the reverse limit limit coil are respectively used to set the limit limit points of the forward limit and the reverse limit in the ladder diagram; the positioning pulse output coil and the positioning pulse stop coil are respectively used to indicate the states of the positioning function when the pulse is output and when the pulse is not output; the current direction coil is used to indicate the current position and the current direction of the positioning instruction system.
[0038] Among them, the positioning dedicated special register and the special coil are configured as shown in Table 1 (the table is only for the Y0 channel, and the addresses of other channels are incremented by 10 in sequence):
[0039] Table 1 Special Register and Special Coil Configuration Table for Positioning
[0040]
[0041] Specifically, each channel corresponds to an address, and the configuration of the Y0 channel is shown in the table. For the Y1 channel, its communication address is increased by 10 for each address based on Y0. For example, the address of the Y2 channel is increased by 20 based on the Y0 channel, and the Y4 channel is increased by 40, and so on. Taking the Y1 channel as an example, its target position address is D8350 (i.e., Y0 channel address + 10), and the positioning output status address is M8350 (i.e., Y0 channel address + 10). The base frequency address of the Y3 channel is D8372 (i.e., Y0 channel address + 30), and the forward limit switch address is M8373 (i.e., Y0 channel address + 30). Similarly, the base frequency address of the Y7 channel is D8412 (i.e., Y0 channel address + 70), and the forward limit switch address is M8413 (i.e., Y0 channel address + 70).
[0042] In addition, other special registers and special coils that may be used for positioning are shown in Table 2 below:
[0043] Table 2 Other Special Register and Special Coil Chart
[0044]
[0045] In this embodiment, the positioning working status register is used to display the working status of the positioning program. The home return instruction module is used to start the home return function; the start of the home return function includes four parameters: Dog input point, zero input point, pulse output point, and direction output point. The positioning instruction usage skill module is used to guide users to configure and use the PLC positioning instruction system.
[0046] Specifically, it is necessary to locate to the position of the working status register and then view the internal value. The internal value corresponds to the working status chart as shown in Table 3 below.
[0047] Table 3 Internal Value Corresponding Working Status Chart
[0048]
[0049] In the table, 0 is the non-positioning state, 1 - 3 are the positioning working states, and 4 - 20 are the home return states.
[0050] In some embodiments, the description of the home return instruction corresponding to the home return instruction module is as follows:
[0051] (1) This instruction contains four parameters: DSZR, S1, S2, S3, and S4. Their function descriptions are as follows:
[0052] ①S1: Dog input point, currently only supports X-point input (ordinary input port).
[0053] ②S2: Zero input point, currently only supports X-point input (ordinary input port).
[0054] ③S3: Pulse output point, currently only supports Y-point output (requires high-speed pulse output function).
[0055] ④S4: Direction output point, currently only supports Y-point output (ordinary output port, requires transistor or solid-state output).
[0056] (2) Drive the "DSZR" instruction in the ladder diagram to start the home return function. Once the home return is completed, the special coil "positioning instruction status" will be set.
[0057] (3) After the home return instruction "DSZR" completes the home return, it can be continuously started or disconnected, which will not affect the positioning operation.
[0058] (4) If the home return instruction "DSZR" is disconnected before the home return is completed, the home return operation will be exited.
[0059] (5) If the Dog point and the zero point are configured the same, the Dog point will be invalidated.
[0060] Specifically, the operation logic of the home return is as follows:
[0061] (1) After startup, if the reverse limit is invalid (i.e., the zero point is not equal to the Dog), the motor will be driven backward at full speed:
[0062] ① If the Dog point is contacted first, the speed will be reduced to the return speed, and then the zero point will be contacted to complete the home return:
[0063] Complete the return operation: Clear the "current position" and "target position", and set the "positioning instruction status", and the same applies hereinafter.
[0064] ② If the zero point is contacted first, the Dog point will be searched for forward at the return speed, and after contacting the Dog point, it will be driven backward,
[0065] until the zero point is contacted again to end, complete the home return, and execute the return operation.
[0066] ③ If the reverse limit point is contacted first, the zero point will be searched for forward at full speed, after contacting the zero point and leaving, the direction will be reversed and the origin will be searched for at the return speed to complete the home return, and execute the return operation.
[0067] (2) If the Dog point is the same as the origin, after startup: If the reverse limit is invalid, drive the motor backward at the return speed:
[0068] ① If it first touches the zero point, complete the origin return and execute the return operation.
[0069] ② If it first touches the reverse limit point, search forward at full speed for the zero point. After touching and leaving the zero point, reverse the direction and search for the origin at the return speed, complete the origin return, and execute the return operation.
[0070] (3) If during the search process, when encountering the reverse limit and searching forward, and then encountering the right turn limit, it is regarded as the zero point being invalid, the return operation will be stopped, and a failure handling will be performed.
[0071] The usage instructions of the Huibang PLC positioning instruction include: First, configure the basic parameters through the touch screen or ladder diagram, including the base frequency, operating frequency, return frequency, and acceleration / deceleration time. Second, use the ladder diagram to execute the origin return instruction and set the DOG, zero input point, pulse, and direction output point. Then, after the system drives the motor to run and finds the zero point, set the special coil of the corresponding channel. Finally, set the special register through the ladder diagram to complete the positioning operation.
[0072] In some embodiments, the positioning instruction usage skill module details the following usage skills:
[0073] (1) After the PLC powers on and starts up, the origin return operation must be executed first, and the positioning operation can only be performed after ensuring the success of the operation.
[0074] That is, [Positioning Instruction Status] needs to be set to ON.
[0075] (2) [Zero point] can coincide with [Dog point], and at this time the Dog point will be invalid.
[0076] (3) [Zero point] can also coincide with [Reverse limit].
[0077] (4) On the premise of ensuring mechanical safety and the position is not affected, all or part of [Forward limit] and [Reverse limit] can be omitted.
[0078] (5) In extreme cases, only one [Origin] needs to be set to make the system run.
[0079] (6) During the operation, assign the value of [Current position] to [Target position] to achieve an immediate stop (it will automatically return when decelerating and crossing).
[0080] (7) The method of pausing the output is: Activate the front and rear [Limit switches] simultaneously, and continue to execute the previous positioning operation after releasing.
[0081] (8) A floating-point number can be used as an intermediate variable, and the result can be converted to an integer and assigned to the [target position].
[0082] To achieve the conversion of high-precision pulse numbers to physical quantities such as distance and angle.
[0083] (9) In a belt-type incremental system, if the position value exceeds the upper limit of 2.1 billion, it will cause the system to run incorrectly.
[0084] At this time, an upper limit value can be set. Once this value is reached, both the [current position] and the [target position] will be cleared simultaneously.
[0085] (10) Negative values are allowed to be input for the [target position], indicating positions after the zero point.
[0086] (11) If the [target position] exceeds the range of the two limit positions, the system will stop at the limit position.
[0087] In addition, the present application provides a specific positioning example based on the positioning instruction system, which is as follows:
[0088] Such as Figure 2 It represents the Y0 positioning: zero point return and limit code. When both the front and rear [limit coils] are set, the positioning output can be paused.
[0089] Such as Figure 3 It represents the Y0 positioning: stop output code during operation.
[0090] Such as Figure 4 It represents the Y0 positioning: conversion of physical quantity to positioning pulse number (D100, D400, D102 are all long integers).
[0091] Such as Figure 5 It represents the Y0 positioning: high-precision conversion of physical quantity to positioning pulse number (D100, D400, D102 are all floating-point numbers).
[0092] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0093] Specific examples are used in this article to elaborate on the principle and implementation method of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A positioning instruction system for PLC, characterized in that: The positioning instruction system comprises: a positioning instruction module, a special register dedicated to positioning, a special coil, a positioning working state register, an origin return instruction module and a positioning instruction use skill module.
2. A positioning instruction system for PLC according to claim 1, characterized in that: The positioning instruction module is used to perform positioning operations; the positioning operations include homing instructions and special register configuration instructions.
3. A positioning instruction system for PLC according to claim 2, characterized in that: The special registers and special coils dedicated to positioning are used to store and control parameters and states related to positioning.
4. A positioning instruction system for PLC according to claim 3, characterized in that: The positioning-specific special registers include a target position register, a base frequency register, a running frequency register, a return frequency register, an acceleration / deceleration register and a current position register.
5. A positioning instruction system for PLC according to claim 4, characterized in that: The target position register is used to set the target position by assigning a value or writing a run instruction; The base frequency register and the operating frequency register are used to set the starting frequency and the maximum frequency of the pulse output respectively; The return frequency register and the acceleration / deceleration register are used to find the frequency of the zero point and the acceleration / deceleration time based on the highest frequency when setting the origin return. The current position register is used to indicate the current position of the positioning instruction system.
6. A positioning instruction system for PLC according to claim 5, characterized in that: The special coils include: a positioning instruction effective coil, a direction pin polarity coil, a forward limit limit coil, a reverse limit limit coil, a positioning pulse stop coil and a current direction coil.
7. A positioning instruction system for PLC according to claim 6, characterized in that: Positioning command valid coil, used for positioning after executing origin return command; Direction pin polarity coil, used to configure the polarity of the direction pin output; The forward limit limit coil and the reverse limit limit coil are used to set the limit point of the forward limit and the limit point of the reverse limit in the ladder diagram respectively; Positioning pulse output coil and positioning pulse stop coil are used to indicate the status of the positioning function when pulse is outputting and when it is not outputting respectively; The current direction coil is used to indicate the current position and current direction of the positioning instruction system.
8. A positioning instruction system for PLC according to claim 7, characterized in that: The positioning working status register is used to display the working status of the positioning program.
9. A positioning instruction system for PLC according to claim 8, characterized in that: The origin return instruction module is used to start the origin return function; the start of the origin return function includes four parameters: Dog input point, zero input point, pulse output point and direction output point.
10. A positioning instruction system for PLC according to claim 9, characterized in that: The positioning instruction usage skills module is used to guide users to configure and use the PLC positioning instruction system.