CN115987176B - Method and device for carrying out zero return control on motor position and edge controller - Google Patents

Method and device for carrying out zero return control on motor position and edge controller Download PDF

Info

Publication number
CN115987176B
CN115987176B CN202310117931.9A CN202310117931A CN115987176B CN 115987176 B CN115987176 B CN 115987176B CN 202310117931 A CN202310117931 A CN 202310117931A CN 115987176 B CN115987176 B CN 115987176B
Authority
CN
China
Prior art keywords
control
zero
period
zeroing
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310117931.9A
Other languages
Chinese (zh)
Other versions
CN115987176A (en
Inventor
齐斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kyland Technology Co Ltd
Original Assignee
Kyland Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN202310117931.9A priority Critical patent/CN115987176B/en
Publication of CN115987176A publication Critical patent/CN115987176A/en
Application granted granted Critical
Publication of CN115987176B publication Critical patent/CN115987176B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The embodiment of the application relates to the technical field of intelligent manufacturing, and relates to a method, a device and an edge controller for controlling zero return of a motor position. The method comprises the following specific scheme: configuring pin parameters of a PLCOpen functional block for executing zero return control; acquiring a preset zeroing control mode based on the pin parameters; according to the preset zeroing control mode, utilizing a limit switch to carry out zeroing control on the motor position; and running a preconfigured interpolation algorithm in the functional block based on the pin parameter in the process of executing the zeroing control by the functional block, and controlling the motion of the moving part. According to the embodiment of the application, the pin parameters of the function block are configured based on PLCOpen specifications to realize zero return control, so that the standardization of motion control can be realized, and the compatibility and the universality of the motion control function on different software and hardware platforms are improved.

Description

Method and device for carrying out zero return control on motor position and edge controller
Technical Field
The application relates to the technical field of intelligent manufacturing, in particular to a method and a device for controlling motor position to return to zero and an edge controller.
Background
With the development of intelligent manufacturing in recent years, the market demand for high-end intelligent manufacturing is more and more urgent. In particular, the need for motion control is more stringent. However, most controllers and motion control algorithm libraries used in the existing intelligent manufacturing in the market are not open in source code. The prior application is mostly secondary development application based on an algorithm library. For example, PLCOpen specifications are directed to standardization of motion control, which may increase compatibility and multiplexing of motion control functions with different software and hardware platforms. But there is less development in current applications of motion libraries that conform to the PLCOpen specification. Taking the zeroing control function as an example, there is no motion control function block conforming to PLCOpen specifications at present, so that compatibility and universality of the motion control function on different software and hardware platforms are poor.
Disclosure of Invention
In view of the above problems in the prior art, embodiments of the present application provide a method, an apparatus, and an edge controller for performing zero-return control on a motor position, which implement zero-return control by configuring pin parameters of a functional block based on PLCOpen specifications, so that standardization of motion control can be implemented, and compatibility and universality of motion control functions on different software and hardware platforms are increased.
To achieve the above object, a first aspect of the present application provides a method for controlling zero-return of a motor position, including:
configuring pin parameters of a PLCOpen functional block for executing zero return control;
acquiring a preset zeroing control mode based on the pin parameters;
according to the preset zeroing control mode, utilizing a limit switch to carry out zeroing control on the motor position; and running a preconfigured interpolation algorithm in the functional block based on the pin parameter in the process of executing the zeroing control by the functional block, and controlling the motion of the moving part.
As a possible implementation manner of the first aspect, the preset zeroing control manner includes: the sensor is zero-resetting completed when being ON, the sensor is zero-resetting completed when being OFF, the rising edge is zero-resetting completed when triggering or the falling edge is zero-resetting completed when triggering.
As a possible implementation manner of the first aspect, the running a preconfigured interpolation algorithm in the functional block based on the pin parameter, performing motion control on a mobile component includes:
for each control period of the operation control, running a preconfigured interpolation algorithm, and calculating the speed increment of the period;
Calculating the pulse number output in the period by utilizing the speed increment of the period;
and controlling the motion of the moving part by using the pulse number output in the period.
As a possible implementation manner of the first aspect, the pin parameters include a torque limitation parameter and a speed parameter when searching for a switch;
the operation of a preconfigured interpolation algorithm, the calculation of the periodic speed increment, comprises the following steps:
calculating the acceleration value of the period according to the torque limiting parameter;
and calculating the current period speed increment according to the speed parameter during the switch searching and the current period acceleration value.
As a possible implementation manner of the first aspect, the pin parameters include a return-to-zero distance limit parameter and a speed parameter when searching for a switch;
the calculating the pulse number output in the period by using the speed increment in the period comprises the following steps:
and calculating the pulse number output in the period according to the zeroing distance limiting parameter, the speed parameter during searching the switch and the speed increment of the period.
As a possible implementation manner of the first aspect, the method further includes:
and under the condition that the preset zeroing control mode is that zeroing is completed during rising edge triggering or zeroing is completed during falling edge triggering, if the limit switch is in a triggering state, controlling the moving part to leave the position triggering the limit switch, and then reversely moving to the position triggering the limit switch.
The second aspect of the present application provides an apparatus for controlling zero return of a motor position, comprising:
a configuration unit, configured to configure pin parameters of a PLCOpen function block for performing return-to-zero control;
the acquisition unit is used for acquiring a preset zeroing control mode based on the pin parameters;
the control unit is used for carrying out zero return control on the motor position by utilizing a limit switch according to the preset zero return control mode; and running a preconfigured interpolation algorithm in the functional block based on the pin parameter in the process of executing the zeroing control by the functional block, and controlling the motion of the moving part.
As a possible implementation manner of the second aspect, the preset zeroing control manner includes: the sensor is zero-resetting completed when being ON, the sensor is zero-resetting completed when being OFF, the rising edge is zero-resetting completed when triggering or the falling edge is zero-resetting completed when triggering.
As a possible implementation manner of the second aspect, the control unit includes:
the first calculating subunit is used for running a preconfigured interpolation algorithm for each control period of running control to calculate the period speed increment;
the second calculating subunit is used for calculating the pulse number output in the period by utilizing the speed increment of the period;
And the control subunit is used for controlling the motion of the moving part by utilizing the pulse number output in the period.
As a possible implementation manner of the second aspect, the pin parameters include a torque limitation parameter and a speed parameter when searching for a switch;
the first computing subunit is configured to:
calculating the acceleration value of the period according to the torque limiting parameter;
and calculating the current period speed increment according to the speed parameter during the switch searching and the current period acceleration value.
As a possible implementation manner of the second aspect, the pin parameters include a return-to-zero distance limit parameter and a speed parameter when searching for a switch;
the second computing subunit is configured to:
and calculating the pulse number output in the period according to the zeroing distance limiting parameter, the speed parameter during searching the switch and the speed increment of the period.
As a possible implementation manner of the second aspect, the control unit is configured to:
and under the condition that the preset zeroing control mode is that zeroing is completed during rising edge triggering or zeroing is completed during falling edge triggering, if the limit switch is in a triggering state, controlling the moving part to leave the position triggering the limit switch, and then reversely moving to the position triggering the limit switch.
In a third aspect, the present application provides an edge controller, including a device for controlling zero return of a motor position according to any one of the second aspects.
A fourth aspect of the application provides a computing device comprising:
a communication interface;
at least one processor coupled to the communication interface; and
at least one memory coupled to the processor and storing program instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of any of the first aspects described above.
A fifth aspect of the application provides a computer readable storage medium having stored thereon program instructions which when executed by a computer cause the computer to perform the method of any of the first aspects above.
These and other aspects of the application will be apparent from and elucidated with reference to the embodiment(s) described hereinafter.
Drawings
The various features of the application and the connections between the various features are further described below with reference to the figures. The figures are exemplary, some features are not shown in actual scale, and some features that are conventional in the art to which the application pertains and are not essential to the application may be omitted from some figures, or additional features that are not essential to the application may be shown, and the combination of features shown in the figures is not meant to limit the application. In addition, throughout the specification, the same reference numerals refer to the same. The specific drawings are as follows:
FIG. 1 is a schematic diagram of an embodiment of a method for controlling a motor position to return to zero according to an embodiment of the present application;
fig. 2 is a schematic diagram of a packaged PLCOpen functional block of an embodiment of a method for performing zero-return control on a motor position according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an embodiment of a method for controlling a motor position to return to zero according to an embodiment of the present application;
FIG. 4 is a flowchart of an interpolation algorithm according to an embodiment of a method for performing zero-return control on a motor position according to an embodiment of the present application;
FIG. 5 is a flowchart of an interpolation algorithm according to an embodiment of a method for performing zero-return control on a motor position according to the present application;
FIG. 6 is a schematic diagram of an implementation flow of an embodiment of a method for performing zero-return control on a motor position according to an embodiment of the present application;
fig. 7 is a schematic flowchart of an implementation flow of an embodiment of a method for performing zero-return control on a motor position according to an embodiment of the present application;
fig. 8 is a schematic implementation flow chart of an embodiment of a method for performing zero-return control on a motor position according to an embodiment of the present application;
fig. 9 is a schematic flowchart of an implementation flow of an embodiment of a method for performing zero-return control on a motor position according to an embodiment of the present application;
FIG. 10 is a schematic diagram of an embodiment of a device for controlling a motor position to return to zero according to an embodiment of the present application;
FIG. 11 is a schematic diagram of an embodiment of a device for controlling the return-to-zero of a motor according to an embodiment of the present application;
FIG. 12 is a schematic diagram of a computing device provided by an embodiment of the present application.
Detailed Description
The terms first, second, third, etc. or module a, module B, module C and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order, and it is to be understood that the specific order or sequence may be interchanged if permitted to implement embodiments of the application described herein in other than those illustrated or described.
In the following description, reference numerals indicating steps such as S110, S120, … …, etc. do not necessarily indicate that the steps are performed in this order, and the order of the steps may be interchanged or performed simultaneously as allowed.
The term "comprising" as used in the description and claims should not be interpreted as being limited to what is listed thereafter; it does not exclude other elements or steps. Thus, it should be interpreted as specifying the presence of the stated features, integers, steps or components as referred to, but does not preclude the presence or addition of one or more other features, integers, steps or components, or groups thereof. Thus, the expression "a device comprising means a and B" should not be limited to a device consisting of only components a and B.
Reference in the specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. Thus, appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment, but may. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments as would be apparent to one of ordinary skill in the art from this disclosure.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. If there is a discrepancy, the meaning described in the present specification or the meaning obtained from the content described in the present specification is used. In addition, the terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application. For the purpose of accurately describing the technical content of the present application, and for the purpose of accurately understanding the present application, the following explanation or definition is given for terms used in the present specification before the explanation of the specific embodiments:
1) PLCOpen: the PLCopen motion control specification specifies a separate library of functional blocks. This provides a standard command set while hiding the underlying architecture and complexity (called abstraction) from the user. Such a structure may be used on a number of platforms and architectures. The development of an application may be independent of the control architecture or brand, and a developer may decide which architecture to use at the final stage of the development cycle. The advantage to the machine manufacturer is that the cost of supporting the different platforms is low and the application software can be freely developed in an independent way without compromising productivity. In addition, the system is easier to maintain and the education period is shorter.
2) Edge controller: the edge controller is a physical interface between IT (Information Technology ) and OT (Operational Technology, operational technology). On the basis of completing the control function of a workstation or a production line, the interface capability and the computing capability of industrial equipment are improved, and the applicability of the industrial equipment is improved.
3) IEC 61131-3: the International Electrotechnical Commission (IEC) was set by the International Electrotechnical Commission (IEC) in section 3 of the IEC61131 standard, which was set by the month 12 of 1993, for standardizing the programming system of Programmable Logic Controllers (PLCs), and the application of the IEC61131-3 standard has been a trend in the field of industrial control. In the aspect of PLC, the editing software only accords with the international standard specification of IEC61131-3, and can establish a program which can be known by anyone by means of a language architecture which accords with various standards.
The prior art method is described first, and then the technical scheme of the application is described in detail.
With the development of intelligent manufacturing in recent years, the market demand for high-end intelligent manufacturing is more and more urgent. In particular, the need for motion control is more stringent. However, most controllers and motion control algorithm libraries used in the existing intelligent manufacturing in the market are not open in source code. The prior application is mostly secondary development application based on an algorithm library. For example, PLCOpen specifications are directed to standardization of motion control, which may increase compatibility and multiplexing of motion control functions with different software and hardware platforms. But there is less development in current applications of motion libraries that conform to the PLCOpen specification. Taking the zeroing control function as an example, there is no motion control function block conforming to PLCOpen specifications at present, so that compatibility and universality of the motion control function on different software and hardware platforms are poor.
The prior art has the following defects: for the zeroing control function, no motion control function block conforming to PLCOpen specifications exists at present, so that the compatibility and the universality of the motion control function on different software and hardware platforms are poor.
Based on the technical problems in the prior art, the application provides a method, a device and an edge controller for controlling the motor position to return to zero. The method is based on the input/output pin configuration conforming to PLCOpen specifications, the PLCOpen functional block is packaged, the return-to-zero control is realized by configuring the pin parameters of the functional block based on PLCOpen specifications, the standardization of motion control can be realized, and the compatibility and reusability of the motion control function to different software and hardware platforms can be increased, so that the technical problem that the compatibility and the universality of the motion control function to different software and hardware platforms in the prior art are poor is solved.
Fig. 1 is a schematic diagram of an embodiment of a method for performing zero-return control on a motor according to an embodiment of the present application. As shown in fig. 1, the method may include:
step S110, aiming at a PLCOpen functional block for executing zero return control, configuring pin parameters of the functional block;
step S120, based on the pin parameters, acquiring a preset zeroing control mode;
step S130, carrying out zero return control on the motor position by using a limit switch according to the preset zero return control mode; and running a preconfigured interpolation algorithm in the functional block based on the pin parameter in the process of executing the zeroing control by the functional block, and controlling the motion of the moving part.
The PLCOpen specification is a motion control specification based on the IEC61131-3 function block basis. This specification includes the behavior of the function block interface and shaft movements. A multi-axis motion control system involves a number of components including servo drives and motors, etc. They constitute a distributed control system. The method for realizing the zero return control provided by the embodiment of the application can be executed in the edge controller of the distributed control system. For example, a library of motion control algorithms may be deployed in the edge controller, including PLCOpen function blocks that implement various control functions. The PLCOpen function block in the edge controller runs an interpolation algorithm, outputs a motion control instruction to the servo driver and the motor in each motion control period, and performs motion control on the moving part through the servo driver and the motor. Among them, motion Control (MC) is also called electric drag Control. The motion control is based on a motor, and realizes the control of the change of physical quantities of the moving part such as angular displacement, speed, torque and the like.
Fig. 2 is a schematic diagram of a packaged PLCOpen functional block of an embodiment of a method for performing zero-return control on a motor position according to an embodiment of the present application. Hereinafter, the "PLCOpen function block" will be simply referred to as a function block. In the PLCOpen specification, motion control functions may be packaged as functional blocks in the form of input-output pins. The pins may include various configuration parameters for motion control with which the functions of the software call may be implemented. Wherein one PLCOpen function block can realize motion control on a single axis. In multi-axis motion control, motion control may be implemented using a plurality of functional blocks accordingly. Wherein each axis is motion controlled by its corresponding PLCOpen function. Referring to fig. 2, the encapsulated PLCOpen function block is named mc_steplimit switch, and the function of the function block includes implementing zero-return by using a limit switch. The pin configuration of the functional block is described as follows:
1) Input/output pins:
AxisID: the axis number is the input/output signal.
2) Input pin
Execute: the rising edge triggers a signal to start movement of the corresponding axis when the rising edge is generated.
Direction: the direction options have the following two values:
the value 1 is: searching a positive limit switch in a positive direction;
And (3) taking a value of 2: the negative limit switch is searched in the opposite direction.
LimitSwitchMode: the switch mode has the following four values:
the value 1 is: returning to zero when the sensor is ON;
and (3) taking a value of 2: returning to zero when the sensor is OFF;
and (3) taking a value of 3: zero return is completed when the rising edge is triggered;
and (3) taking a value of 4: zero return is completed when the falling edge is triggered.
Velocity: the speed at which the switch is searched is in u/s. Where u may be a user-defined unit (unit).
SetPosition: and the unit of the current position is u when the zeroing is completed. Also, u may be a user-defined unit.
TorqueLimit: torque limit in percent.
TimeLimit: zero time limit.
DistanceLimit: zero distance limit.
BufferMode: the mixing mode belongs to the connection management with other modules, and has the following two values:
the value 0 is: interrupting the last module and immediately running;
the value 1 is: and immediately running after the operation of the last module is completed.
Under the condition of the value of 0, the last module can be cached, and the last module is operated after the operation of the module is completed; for example, the last module may be a function block that controls the moving member to move a set distance.
Tsm: the running period of the module is unit of seconds.
PositiveLimitSwitch: the positive limit switch takes the value.
Negotivelimit switch: the negative limit switch takes on a value.
For positive and negative limit switch values, in one example, a value of 1 indicates ON, i.e., indicates a triggered state; a value of 0 indicates OFF, i.e. a state without triggering. When the moving part touches the limit switch, a driver or a controller connected with the limit switch sends out a signal to enable a preset variable value in the driver to be 1, and the value is assigned to a PositiveLimitSwitch variable. The function block then controls the moving part to stop moving.
3) Output pin
Done: the zeroing function is completed.
Busy: the zeroing function is in progress.
Active: the zeroing action is in progress.
CommanddAborted: the zeroing function is interrupted.
Error: the function block reports errors.
ErrorID: the function block reports the error number.
The variables of the above output pins correspond to various situations that are possible in the zero-back function execution result. For example, the function block may report a fault when the zeroing exceeds a time limit or exceeds a distance limit. The user or other application may obtain variable values for these output pins and implement other control functions based on these variable values.
The PLCOpen function block can be used for realizing the function of standard motion control, and the motion of the moving part can be planned on line for iterative control. The manner of iterative control may include: in each motion control period, a motion control instruction of the period is obtained according to the number of pulses and other values of the previous period. The accurate and stable operation control is realized through the iterative control of each motion control period.
Referring to the examples of fig. 1 and 2, in step S110, various pin parameters of a function block may be configured for a PLCOpen function block performing return-to-zero control. For example, the value of the target speed Vi entered by the user may be configured to the speed variable in the input pin. For another example, the value of the travel distance Si input by the user may be assigned to the distance limit variable in the input pin. For another example, the user may configure the value of the LimitSwitchMode variable according to different conditions of the system software and hardware. The value of the limit switch mode variable can be used to indicate the return-to-zero control mode used in the motion control process.
In one embodiment, the preset zeroing control manner includes: the sensor is zero-resetting completed when being ON, the sensor is zero-resetting completed when being OFF, the rising edge is zero-resetting completed when triggering or the falling edge is zero-resetting completed when triggering.
Referring to the description of the pin configuration of the functional block, when the variable value of the distance limit is 1, the zero return control mode adopted by the instruction is as follows: the return to zero is completed when the sensor is ON. Similarly, when the value of the distance limit variable is 2, the zero return control mode adopted by the instruction is as follows: return to zero is completed when the sensor is OFF. The user can select the zeroing control mode which is adaptive to the hardware according to different conditions of different hardware, for example, based on the difference of NPN type and PNP type.
The return to zero is completed when the sensor is ON, namely when the moving part touches the limit switch, the return to zero is completed when the state of the sensor becomes ON (the value is 1); the completion of the return to zero when the sensor is OFF means that the return to zero is completed when the sensor state becomes OFF (value of 0) when the movable member hits the limit switch.
Referring to the pin configuration introduction of the functional block, when the value of the distance limit variable is 3, the zero return control mode adopted by the instruction is as follows: the return to zero is completed when the rising edge is triggered. When the value of the distance limit variable is 4, the zero return control mode adopted by the indication is as follows: zero return is completed when the falling edge is triggered. Likewise, the user can select the zeroing control mode adapted to the hardware according to different situations of different hardware, for example, based on the difference of NPN type and PNP type.
When the movable part touches the limit switch, the limit switch is enabled to be in a triggered state. A rising or falling edge may occur from the moment no trigger to the moment this action is triggered. When the moving part touches the limit switch, if the sensor state becomes ON (value 1), a rising edge is generated from the moment when no trigger is reached to the moment when the trigger is reached; when the sensor state is turned OFF (0) when the movable member touches the limit switch, a falling edge occurs from the moment when no trigger is reached to the moment when the trigger is reached. The zero return is completed when the rising edge is triggered, namely when the moving part moves to a certain position and detects the rising edge, the zero return is triggered; the zero return is completed when the falling edge is triggered, namely when the moving part moves to a certain position and detects the falling edge, the zero return is triggered.
In step S120, a preset zeroing control manner may be obtained based on the value of the distance limit variable in the pin parameter of the PLCOpen function block. In step S130, the PLCOpen function block performs zero-return control on the motor position by using the limit switch according to the preset zero-return control manner acquired in step S120. And in the process of executing the zeroing control by the PLCOpen functional block, running a preconfigured interpolation algorithm in the functional block, and calculating by using pin parameters in the interpolation algorithm to obtain a motion control instruction. And controlling the movement of the moving part according to the movement control instruction.
Typically, a position-controlled servo motor requires a reference point to be determined prior to operation. The position coordinates of the servo motor are established based on the reference points. That is, the servo motor needs to determine a reference point in the position space where the motor operates. And determining the real-time position of the servo motor by the reference point. This reference point is referred to as zero, and the process of determining this reference point is referred to as zeroing. The position of the reference point may be determined by a limit switch. That is, the limit switch can be used to achieve the zero-return control of the motor position. Specifically, when the moving part touches the limit switch to stop moving, the zero return control is completed. And the current value of the motor position may be set to a value preset by the user when the moving part stops moving. The current position of the motor is now the reference point mentioned above. The process of finding the reference point and setting the current value of the motor position is the process of returning to zero.
According to the embodiment of the application, the pin parameters of the function block are configured based on PLCOpen specifications to realize zero return control, so that the standardization of motion control can be realized, and the compatibility and the universality of the motion control function on different software and hardware platforms are improved.
Fig. 3 is a schematic diagram of an embodiment of a method for performing zero-return control on a motor according to an embodiment of the present application. As shown in fig. 3, in an embodiment, in step S130 in fig. 1, the running a preconfigured interpolation algorithm in the functional block based on the pin parameter, performs motion control on a moving component, including:
Step S210, running a preconfigured interpolation algorithm for each control period of running control, and calculating the speed increment of the period;
step S220, calculating the pulse number output in the period by utilizing the speed increment of the period;
and step S230, performing motion control on the moving part by using the pulse number output in the current period.
In one example, the zeroing control may take the form of a T-shaped acceleration and deceleration. The T-shaped acceleration and deceleration belongs to the category of pulse increment interpolation and belongs to one kind of interpolation algorithm. The T-shaped acceleration and deceleration curve is the most commonly used acceleration and deceleration mode, and the acceleration is kept at a constant value in the acceleration and deceleration stages, so that the mode is simple to calculate and has higher efficiency. The T-shaped velocity profile includes three phases: the acceleration section Ta, the constant velocity section Tm, the deceleration section Td, the acceleration a remains unchanged during acceleration and deceleration. The T-type acceleration and deceleration algorithm is a lightweight algorithm, taking pulses as a unit of measure. Wherein the distance may be expressed in terms of a pulse number. Because the pulse number corresponding to one rotation of the motor is a constant value, the distance can be expressed by the pulse number by taking the pulse as a measurement unit based on the constant value. The T-shaped acceleration and deceleration algorithm can change the target speed and the target acceleration at any time in the motion process, has the pause function, has the advantage of high motion precision, and is particularly suitable for various pulse control motion scenes.
In each motion control period, a preconfigured interpolation algorithm is run in the PLCOpen functional block to carry out iterative control on the moving part. Specifically, in step S210, the interpolation algorithm shown in fig. 4 may be used to calculate the current cycle speed increment; in step S220, the number of pulses output in the present period is calculated by using the interpolation algorithm shown in fig. 5 by using the present period speed increment calculated in step S210; in step S230, the number of pulses outputted in the present cycle calculated in step S220 is used as a motion control instruction, the motion control instruction is outputted to a servo driver and a motor, and the motion of the moving member is controlled by the servo driver and the motor.
The symbols in fig. 4 and 5 are explained as follows:
vt: unit cycle speed, i.e. the position increment of the cycle; the "unit period" in the following description refers to the "present period", that is, the current period.
Vt': vt of the last cycle.
Vr: the target speed of the unit cycle is the target speed of the current cycle.
Vdelta: a unit cycle speed increment.
a: acceleration.
Sd: at the current speed and acceleration, the number of pulses required to decelerate to a speed of 0.
Sd': sd of the last cycle.
Tsm: time in seconds for a single run period.
Srest: the number of pulses remaining to be walked.
Sready: the number of pulses that have passed.
Sready': the number of pulses that have passed the last cycle.
Vi: target speed of user input (transition to single cycle);
the functional block enables the moving part to reach the final target speed through iterative control of a plurality of motion control periods, and the final target speed can be converted into a single period to obtain the target speed of the single period.
Wherein Vr is a target speed in the calculation process, and Vr and Vi are not necessarily equal. Vr equals Vi during acceleration; during deceleration, vr may be equal to 0.
Si: the distance travelled by the user input (converted to pulses).
Pdelta: the number of pulses output in this period.
The motion mode of the linear interpolation algorithm used in the embodiment of the application is unidirectional acceleration and deceleration, when the motion direction is reverse, the method only needs to take the negative sign of Pdelta, and the related calculation can be still carried out by adopting the flow shown in fig. 4 and 5.
In one embodiment, the pin parameters include a torque limit parameter and a speed parameter at the time of searching for a switch;
the operation of a preconfigured interpolation algorithm, the calculation of the periodic speed increment, comprises the following steps:
Calculating the acceleration value of the period according to the torque limiting parameter;
and calculating the current period speed increment according to the speed parameter during the switch searching and the current period acceleration value.
Referring to the pin configuration description in the example of fig. 2, the pin parameters include a torque limit parameter TorqueLimit and a speed parameter vector when searching for a switch. When each pin parameter of the function block is configured in step S110, the value of the target speed Vi input by the user is configured to the speed variable in the input pin. Referring to the flow shown in fig. 4, the value of the speed parameter vector variable when searching for a switch in the pin parameters of the functional block is obtained, namely Vi. Vi is a target speed configured by a user, and Vi is converted into a single period, so that the target speed of each motion control period can be obtained, namely the target speed Vr of the unit period. In the flow of fig. 4, it is first determined whether Vt < Vr. Depending on the magnitude relation of Vt and Vr, the algorithm performs different branches in three different cases of Vt < Vr, vt=vr, vt > Vr, respectively. Wherein, the moving part is controlled to do acceleration motion under the condition of Vt < Vr; controlling the moving part to do uniform motion under the condition of Vt=Vr; the moving part is controlled to perform a decelerating motion in case of Vt > Vr.
Referring to fig. 4, in the case of Vt < Vr, first, the unit cycle speed increment Vdelta is calculated using the following equation (1):
Vdelta = a*Tsm (1)
among the pin parameters of the PLCOpen function block, the user configures a torque limitation parameter TorqueLimit. The torque limiting parameter is the derivative of acceleration. The value of TorqueLimit is obtained from the pin parameter, and the value of acceleration a is obtained from this value. Then, the value of the acceleration a is substituted into the above formula (1), and the unit cycle speed increment Vdelta is calculated. Next Vr-Vt is assigned to Vdelta in case vdelta+vt > Vr. In the case of vdelta+vt > Vr, the speed exceeds the unit cycle target speed Vr if the acceleration is performed according to Vdelta calculated in the formula (1). In this case, therefore, vr-Vt is assigned to Vdelta so that the speed of the moving part just reaches the unit cycle target speed Vr, achieving the desired control target. Finally, the number of pulses Sd required to decelerate to a speed of 0 is calculated using the formula sd=sd' +vt+vdelta.
Referring to fig. 4, in the case of vt=vr, vdelta=0 because the moving part makes uniform motion.
Referring to fig. 4, in the case of Vt > Vr, first, the unit cycle speed increment Vdelta is calculated using formula (1). Then, in the case where Vt-Vdelta < Vr, vr-Vt is assigned to Vdelta. In the case where Vt-Vdelta < Vr, the speed is smaller than the unit cycle target speed Vr if the Vdelta calculated according to the formula (1) decelerates. In this case, therefore, vr-Vt is assigned to Vdelta so that the speed of the moving part just reaches the unit cycle target speed Vr, achieving the desired control target. Finally, the number of pulses Sd required to decelerate to a speed of 0 is calculated using the formula sd=sd' -Vt-Vdelta.
In summary, in the interpolation algorithm shown in fig. 4, the current periodic acceleration value a is calculated according to the torque limit parameter TorqueLimit, then the above calculation process is performed according to the speed parameter Velocity and the current periodic acceleration value a when the switch is searched, finally the current periodic speed increment Vdelta is calculated, and the pulse number Sd required for decelerating to 0 at the current speed and acceleration is calculated.
In one embodiment, the pin parameters include a return-to-zero distance limit parameter and a speed parameter at the time of searching for a switch;
the calculating the pulse number output in the period by using the speed increment in the period comprises the following steps:
and calculating the pulse number output in the period according to the zeroing distance limiting parameter, the speed parameter during searching the switch and the speed increment of the period.
Referring to the flow shown in fig. 5, first, it is determined whether there is a need for suspension in the motion control process. If there is a pause demand, then Vr is assigned 0. If there is no pause demand, it is further determined whether Sest < Sd. The Sd is the number of pulses required to decelerate to 0 in the flow shown in fig. 4. If the number Sest of the remaining pulses needing to walk is smaller than the number Sd of the pulses needing to be decelerated to the speed of 0, vr is assigned to be 0. If the number Sest of the remaining pulses to be walked is greater than or equal to the number Sd of pulses required to be decelerated to 0, the target speed Vi input by the user is assigned to the unit cycle target speed Vr. Executing the above flow to obtain the value of Vr.
In the flow of fig. 5, the value of Vdelta may be directly used with the current cycle speed increment Vdelta calculated in the flow of fig. 4. That is, in the flow of fig. 5, vdelta and Sd calculated according to the flow of fig. 4 are used as data participating in calculation in the present flow, and the number of pulses output in the present period is finally obtained through subsequent calculation. In the flow of fig. 5, the relation between the speed vector variable and the target speed Vi and the target speed Vr of the unit cycle configured by the user when the pin parameter of the functional block searches for the switch can be referred to the related description of the flow of fig. 4, and will not be repeated here.
Referring to the flow shown in FIG. 5, after obtaining the values of Vr and Vdelta, it is next determined whether Vt < Vr. In the case where Vt < Vr and Vr-Vt > =a, vt '+vdelta is assigned to Vt, i.e., vt=vt' +vdelta; in the case where Vt > Vr and Vr-Vt > =a, vt '-Vdelta is assigned to Vt, i.e., vt=vt' -Vdelta; in the case of vt=vr, vt 'is assigned to Vt, i.e., vt=vt'. The above procedure is performed to obtain the value of Vt.
Referring to the flow shown in FIG. 5, after the Vt value is obtained, it is next determined whether Vdelta+Vt > Vr. If yes, srest is assigned to Pdelta, i.e. pdelta=srest, and the movement is ended. If not, assigning Vt to Pdelta, i.e., pdelta=vt; srest is then calculated using the following equation (2) and equation (3):
Sready = Sready’+Pdelta (2)
Srest = Si – Sready (3)
The pin parameters include a zeroing distance limit parameter, distanceLimit, described with reference to the pin configuration in the example of fig. 2. When configuring the various pin parameters of the function block in step S110, the user configures the value of the distance limit variable. According to this configuration, the moving member can continue to move when the distance is not reached. Referring to formula (3) in fig. 5, the value of the zeroing distance limit parameter distance limit variable in the pin parameters of the functional block is obtained, namely Si. Substituting Si into the formula (3) to calculate the number Sest of the remaining pulses needing to walk.
The above procedure is performed to obtain the value of the pulse number Pdelta output in the present period. The value of Pdelta can be output to the motor as a motion control instruction, indicating that the number of pulses the motor walks in this cycle is the value of Pdelta. In addition, the number Srest of remaining pulses to be walked is obtained by executing the above procedure, and can be used to calculate using the data when the algorithm is executed in the next cycle.
In summary, in the interpolation algorithm shown in fig. 5, the number of pulses Pdelta output in the present period is finally calculated according to the zeroing distance limit parameter distance limit, the speed parameter Velocity when searching for the switch, and the present period speed increment Vdelta calculated in the flow shown in fig. 4, and the number of pulses Srest that need to be walked is calculated.
In the embodiment of the application, the implementation flows of different values of the pin parameter LimitSwitchMode switch mode are respectively shown in fig. 6 to 9. In the motion control process of each implementation flow, the interpolation algorithm shown in fig. 4 and 5 is adopted to perform motion control of acceleration and deceleration motion.
When the value of the distance limit variable is 1, the zero return control mode adopted by the indication is as follows: the return to zero is completed when the sensor is ON, and the implementation flow is shown in fig. 6. In fig. 6, it is first determined whether to return to zero in the forward Direction based on the value of the pin parameter Direction variable. If the positive limit switch is returned to zero in the positive direction, detecting the positive limit switch; if the negative limit switch is returned to zero in the negative direction, the negative limit switch is detected. Specifically, when the Direction variable value is 1, the positive return is zero, and at the moment, the positive Direction searches for a positive limit switch; the Direction variable value is 2, and is negative return zero, and the negative limit switch is searched in the opposite Direction.
Referring to fig. 6, when the result of detecting the positive limit switch is positive limit ON, the moving component has moved to the limit switch, the limit switch is in a triggered state, and the motion control flow ends. And under the condition that the result of detecting the positive limit switch is positive limit OFF, controlling the moving part to move forward until the movement control flow is finished when the positive limit switch is ON. Similarly, when the result of detecting the negative limit switch is negative limit ON, the moving part moves to the limit switch, the limit switch is in a triggered state, and the motion control flow is ended. And under the condition that the result of detecting the negative limit switch is negative limit OFF, controlling the moving part to move in the negative direction until the movement control flow is finished when the negative limit switch is ON.
When the value of the distance limit variable is 2, the zero return control mode adopted by the indication is as follows: return to zero is completed when the sensor is OFF. The implementation flow is shown in fig. 7. In fig. 7, it is first determined whether to return to zero in the forward Direction based on the value of the pin parameter Direction variable. If the positive limit switch is returned to zero in the positive direction, detecting the positive limit switch; if the negative limit switch is returned to zero in the negative direction, the negative limit switch is detected. Specifically, when the Direction variable value is 1, the positive return is zero, and at the moment, the positive Direction searches for a positive limit switch; the Direction variable value is 2, and is negative return zero, and the negative limit switch is searched in the opposite Direction.
Referring to fig. 7, when the result of detecting the positive limit switch is that the positive limit switch is OFF, the moving component has moved to the limit switch, the limit switch is in a triggered state, and the motion control flow is ended. And under the condition that the result of detecting the positive limit switch is positive limit ON, controlling the moving part to move forward until the movement control flow is finished when the positive limit switch is OFF. Similarly, when the result of detecting the negative limit switch is negative limit OFF, the moving part moves to the limit switch, the limit switch is in a triggered state, and the motion control flow is ended. And under the condition that the result of detecting the negative limit switch is negative limit ON, controlling the moving part to move in the negative direction until the movement control flow is finished when the negative limit switch is OFF.
Referring to the examples of fig. 8 and 9 above, in one embodiment, the method further comprises:
and under the condition that the preset zeroing control mode is that zeroing is completed during rising edge triggering or zeroing is completed during falling edge triggering, if the limit switch is in a triggering state, controlling the moving part to leave the position triggering the limit switch, and then reversely moving to the position triggering the limit switch.
When the value of the distance limit variable is 3, the zero return control mode adopted by the instruction is as follows: the return to zero is completed when the rising edge is triggered. The implementation flow is shown in fig. 8. In fig. 8, it is first determined whether to return to zero in the forward Direction based on the value of the pin parameter Direction variable. If the positive limit switch is returned to zero in the positive direction, detecting the positive limit switch; if the negative limit switch is returned to zero in the negative direction, the negative limit switch is detected.
Referring to fig. 8, when the result of detecting the positive limit switch is positive limit ON, at this time, the moving part has moved to the limit switch, and the limit switch is in a triggered state, then the moving part is controlled to move in a negative direction until positive limit is OFF, i.e. the position where the limit switch is triggered is left, then the moving part is controlled to move in an opposite direction, i.e. to move in a positive direction until a rising edge is detected, and the motion control flow is ended. And under the condition that the positive limit switch is detected to be in the positive limit OFF state, controlling the moving part to move forward until the rising edge is detected, and ending the movement control flow. Similarly, under the condition that the result of detecting the positive limit switch is negative limit ON, at this time, the moving part moves to the limit switch, the limit switch is in a triggered state, the moving part is controlled to move forward until positive limit OFF, namely, the position of triggering the limit switch is separated, then the moving part is controlled to move in the opposite direction, namely, move in the negative direction until a rising edge is detected, and the movement control flow is ended. And under the condition that the result of detecting the positive limit switch is negative limit OFF, controlling the moving part to move negatively until the movement control flow is finished when the rising edge is detected.
When the value of the distance limit variable is 4, the zero return control mode adopted by the indication is as follows: zero return is completed when the falling edge is triggered. The implementation flow is shown in fig. 9. In fig. 9, it is first determined whether or not to return to zero in the forward Direction based on the value of the pin parameter Direction variable. If the positive limit switch is returned to zero in the positive direction, detecting the positive limit switch; if the negative limit switch is returned to zero in the negative direction, the negative limit switch is detected.
Referring to fig. 9, when the result of detecting the positive limit switch is positive limit OFF, at this time, the moving part has moved to the limit switch, and the limit switch is in a triggered state, then the moving part is controlled to move in a negative direction until the positive limit is ON, i.e. the position where the limit switch is triggered is separated, then the moving part is controlled to move in an opposite direction, i.e. to move in a positive direction until a falling edge is detected, and the motion control flow is ended. And under the condition that the positive limit switch is detected to be positive limit ON, controlling the moving part to move forward until the movement control flow is ended when the falling edge is detected. Similarly, under the condition that the result of detecting the negative limit switch is negative limit OFF, at the moment, the moving part moves to the limit switch, the limit switch is in a triggered state, the moving part is controlled to move forward until the negative limit is ON, namely, the position of triggering the limit switch is separated, then the moving part is controlled to move in the opposite direction, namely, the moving part moves in the negative direction until the falling edge is detected, and the movement control flow is ended. And under the condition that the result of detecting the negative limit switch is negative limit ON, controlling the moving part to move negatively until the movement control flow is ended when the falling edge is detected.
In the above several zero-return control modes, the examples of fig. 6 and 7 implement triggering of the limit switch according to the level, and the examples of fig. 8 and 9 implement triggering of the limit switch according to the rising edge and the falling edge. In comparison, the control accuracy is higher in the manner of realizing the triggering of the limit switch according to the rising edge and the falling edge than in the manner of realizing the triggering of the limit switch according to the level. In the mode of triggering the limit switch according to the level, no matter which part of the moving part touches the limit switch, the zero return is triggered due to the certain width of the moving part. Thus, control accuracy in this manner is limited in comparison. In a specific application, a user can configure a zeroing control mode according to actual control requirements.
Referring to the flow of fig. 6 to 9, when the moving member hits the limit switch to stop moving, the return-to-zero control is completed. The current value of the motor position is set to the value in the user configured pin parameter SetPosition variable after zeroing. E.g., the value of the user configured SetPosition variable is zero, the current value of the motor position is cleared.
In summary, the embodiment of the application executes an interpolation algorithm based on PLCOpen specifications according to the input/output pin parameters of the PLCOpen functional block, so that the motor can be smoothly accelerated or decelerated or suspended, and the functions of accurate control and stability are achieved. Based on PLCOpen function block, utilize limit switch to carry out zero return control to the motor position, can realize motion control's standardization, increase motion control function to different software and hardware platform's compatibility and commonality.
As shown in fig. 10, the application further provides a corresponding embodiment of a device for performing zero-return control on the motor position. Regarding the beneficial effects of the device or the technical problems to be solved, reference may be made to the description in the method corresponding to each device, or reference may be made to the description in the summary of the application, which is not repeated here.
In an embodiment of the device for zeroing the motor position, the device comprises:
a configuration unit 100, configured to configure pin parameters of a PLCOpen function block for performing a zeroing control;
an obtaining unit 200, configured to obtain a preset zeroing control mode based on the pin parameter;
the control unit 300 is configured to perform zero-returning control on the motor position by using a limit switch according to the preset zero-returning control mode; and running a preconfigured interpolation algorithm in the functional block based on the pin parameter in the process of executing the zeroing control by the functional block, and controlling the motion of the moving part.
In one embodiment, the preset zeroing control manner includes: the sensor is zero-resetting completed when being ON, the sensor is zero-resetting completed when being OFF, the rising edge is zero-resetting completed when triggering or the falling edge is zero-resetting completed when triggering.
As shown in fig. 11, in one embodiment, the control unit 300 includes:
a first calculating subunit 310, configured to run a preconfigured interpolation algorithm for each control cycle of the running control, and calculate a current cycle speed increment;
a second calculating subunit 320, configured to calculate the number of pulses output in the present period by using the speed increment in the present period;
and a control subunit 330, configured to perform motion control on the moving component by using the number of pulses output in the current period.
In one embodiment, the pin parameters include a torque limit parameter and a speed parameter at the time of searching for a switch;
the first computing subunit 310 is configured to:
calculating the acceleration value of the period according to the torque limiting parameter;
and calculating the current period speed increment according to the speed parameter during the switch searching and the current period acceleration value.
In one embodiment, the pin parameters include a return-to-zero distance limit parameter and a speed parameter at the time of searching for a switch;
the second computing subunit 320 is configured to:
and calculating the pulse number output in the period according to the zeroing distance limiting parameter, the speed parameter during searching the switch and the speed increment of the period.
In one embodiment, the control unit 300 is configured to:
and under the condition that the preset zeroing control mode is that zeroing is completed during rising edge triggering or zeroing is completed during falling edge triggering, if the limit switch is in a triggering state, controlling the moving part to leave the position triggering the limit switch, and then reversely moving to the position triggering the limit switch.
The application further provides an embodiment of the edge controller. The edge controller comprises any one of the above devices for controlling the motor position to return to zero. A library of motion control algorithms may be deployed in the edge controller, including PLCOpen function blocks that implement various control functions. The method for realizing the zero return control provided by the embodiment of the application is executed in the PLCOpen functional block. Regarding the beneficial effects of the edge controller or the technical problems to be solved, reference may be made to the description of the method corresponding to each device, or reference may be made to the description of the summary of the application, which is not repeated here.
Fig. 12 is a schematic diagram of a computing device 900 provided by an embodiment of the application. The computing device 900 includes: processor 910, memory 920, and communication interface 930.
It should be appreciated that the communication interface 930 in the computing device 900 shown in fig. 12 may be used to communicate with other devices.
Wherein the processor 910 may be coupled to a memory 920. The memory 920 may be used to store the program codes and data. Accordingly, the memory 920 may be a storage unit internal to the processor 910, an external storage unit independent of the processor 910, or a component including a storage unit internal to the processor 910 and an external storage unit independent of the processor 910.
Optionally, computing device 900 may also include a bus. The memory 920 and the communication interface 930 may be connected to the processor 910 through a bus. The bus may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, or the like. The buses may be classified as address buses, data buses, control buses, etc.
It should be appreciated that in embodiments of the present application, the processor 910 may employ a central processing unit (central processing unit, CPU). The processor may also be other general purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (Application specific integrated circuit, ASIC), off-the-shelf programmable gate arrays (field programmable gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Or the processor 910 may employ one or more integrated circuits for executing associated programs to perform techniques provided by embodiments of the present application.
The memory 920 may include read only memory and random access memory and provide instructions and data to the processor 910. A portion of the processor 910 may also include nonvolatile random access memory. For example, the processor 910 may also store information of the device type.
When the computing device 900 is running, the processor 910 executes computer-executable instructions in the memory 920 to perform the operational steps of the methods described above.
It should be understood that the computing device 900 according to the embodiments of the present application may correspond to a respective subject performing the methods according to the embodiments of the present application, and that the above and other operations and/or functions of the respective modules in the computing device 900 are respectively for implementing the respective flows of the methods according to the embodiments, and are not described herein for brevity.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The embodiments of the present application also provide a computer-readable storage medium having stored thereon a computer program for executing a diversified problem generating method when executed by a processor, the method comprising at least one of the aspects described in the respective embodiments above.
The computer storage media of embodiments of the application may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present application and the technical principle applied. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, while the application has been described in connection with the above embodiments, the application is not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the application, which fall within the scope of the application.

Claims (6)

1. A method of zeroing the position of a motor, comprising:
configuring pin parameters of a PLCOpen functional block for executing zero return control;
acquiring a preset zeroing control mode based on the pin parameters; the preset zeroing control mode comprises the following steps: zero-returning is completed when the sensor is ON, zero-returning is completed when the sensor is OFF, zero-returning is completed when the rising edge is triggered or zero-returning is completed when the falling edge is triggered;
according to the preset zeroing control mode, utilizing a limit switch to carry out zeroing control on the motor position; wherein, in the process of executing the zero-return control by the functional block, running a preconfigured interpolation algorithm in the functional block based on the pin parameter to control the motion of the moving part;
wherein, based on the pin parameters, running a preconfigured interpolation algorithm in the functional block to control the motion of the moving part, including: for each control period of the operation control, running a preconfigured interpolation algorithm, and calculating the speed increment of the period; calculating the pulse number output in the period by utilizing the speed increment of the period; performing motion control on the moving part by using the pulse number output in the period;
Wherein the pin parameters include a torque limit parameter and a speed parameter when searching for a switch; the operation of a preconfigured interpolation algorithm, the calculation of the periodic speed increment, comprises the following steps: calculating the acceleration value of the period according to the torque limiting parameter; calculating the current period speed increment according to the speed parameter of the search switch and the current period acceleration value;
wherein the pin parameters further comprise a return-to-zero distance limit parameter; the calculating the pulse number output in the period by using the speed increment in the period comprises the following steps: and calculating the pulse number output in the period according to the zeroing distance limiting parameter, the speed parameter during searching the switch and the speed increment of the period.
2. The method according to claim 1, wherein the method further comprises:
and under the condition that the preset zeroing control mode is that zeroing is completed during rising edge triggering or zeroing is completed during falling edge triggering, if the limit switch is in a triggering state, controlling the moving part to leave the position triggering the limit switch, and then reversely moving to the position triggering the limit switch.
3. An apparatus for controlling the return-to-zero of a motor position, comprising:
A configuration unit, configured to configure pin parameters of a PLCOpen function block for performing return-to-zero control;
the acquisition unit is used for acquiring a preset zeroing control mode based on the pin parameters; the preset zeroing control mode comprises the following steps: zero-returning is completed when the sensor is ON, zero-returning is completed when the sensor is OFF, zero-returning is completed when the rising edge is triggered or zero-returning is completed when the falling edge is triggered;
the control unit is used for carrying out zero return control on the motor position by utilizing a limit switch according to the preset zero return control mode; wherein, in the process of executing the zero-return control by the functional block, running a preconfigured interpolation algorithm in the functional block based on the pin parameter to control the motion of the moving part;
the control unit includes:
the first calculating subunit is used for running a preconfigured interpolation algorithm for each control period of running control to calculate the period speed increment;
the second calculating subunit is used for calculating the pulse number output in the period by utilizing the speed increment of the period;
a control subunit, configured to control movement of the moving component by using the number of pulses output in the present period;
The pin parameters comprise a torque limiting parameter and a speed parameter when a switch is searched; the first computing subunit is configured to: calculating the acceleration value of the period according to the torque limiting parameter; calculating the current period speed increment according to the speed parameter of the search switch and the current period acceleration value;
the pin parameters also comprise a zeroing distance limiting parameter; the second computing subunit is configured to: and calculating the pulse number output in the period according to the zeroing distance limiting parameter, the speed parameter during searching the switch and the speed increment of the period.
4. An edge controller comprising a device for zeroing the position of a motor as claimed in claim 3.
5. A computing device, comprising:
a communication interface;
at least one processor coupled to the communication interface; and
at least one memory coupled to the processor and storing program instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of claim 1 or 2.
6. A computer readable storage medium having stored thereon program instructions, which when executed by a computer cause the computer to perform the method of claim 1 or 2.
CN202310117931.9A 2023-02-01 2023-02-01 Method and device for carrying out zero return control on motor position and edge controller Active CN115987176B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310117931.9A CN115987176B (en) 2023-02-01 2023-02-01 Method and device for carrying out zero return control on motor position and edge controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310117931.9A CN115987176B (en) 2023-02-01 2023-02-01 Method and device for carrying out zero return control on motor position and edge controller

Publications (2)

Publication Number Publication Date
CN115987176A CN115987176A (en) 2023-04-18
CN115987176B true CN115987176B (en) 2023-09-12

Family

ID=85976254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310117931.9A Active CN115987176B (en) 2023-02-01 2023-02-01 Method and device for carrying out zero return control on motor position and edge controller

Country Status (1)

Country Link
CN (1) CN115987176B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001275397A (en) * 2000-03-27 2001-10-05 Yazaki Corp Stepper motor drive control circuit
CN103454979A (en) * 2013-09-11 2013-12-18 大连理工计算机控制工程有限公司 Quick variable-speed curve circular interpolation method packaged into PLCopen instruction
CN103941650A (en) * 2014-04-18 2014-07-23 华南理工大学 Logic and movement integrated controller
CN108582082A (en) * 2018-07-04 2018-09-28 北京镁伽机器人科技有限公司 Robot, back to zero position method, system with accurate back to zero bit function and medium
CN109062145A (en) * 2018-08-13 2018-12-21 大古智能科技(上海)有限公司 Numerically-controlled machine tool motion control card based on WIFI communication
CN109313687A (en) * 2016-01-24 2019-02-05 赛义德·卡姆兰·哈桑 Computer security based on artificial intelligence
CN114296393A (en) * 2021-12-29 2022-04-08 北京半导体专用设备研究所(中国电子科技集团公司第四十五研究所) Zero-returning method and device for motion platform, electronic equipment and storage medium
CN114995536A (en) * 2022-08-08 2022-09-02 广东科伺智能科技有限公司 Motion controller for servo motor
CN115453967A (en) * 2022-10-24 2022-12-09 傲拓科技股份有限公司 Scheduling execution method of PLCopen single-axis motion control function block

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10162698B2 (en) * 2016-03-25 2018-12-25 Dropbox, Inc. System and method for automated issue remediation for information technology infrastructure

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001275397A (en) * 2000-03-27 2001-10-05 Yazaki Corp Stepper motor drive control circuit
CN103454979A (en) * 2013-09-11 2013-12-18 大连理工计算机控制工程有限公司 Quick variable-speed curve circular interpolation method packaged into PLCopen instruction
CN103941650A (en) * 2014-04-18 2014-07-23 华南理工大学 Logic and movement integrated controller
CN109313687A (en) * 2016-01-24 2019-02-05 赛义德·卡姆兰·哈桑 Computer security based on artificial intelligence
CN108582082A (en) * 2018-07-04 2018-09-28 北京镁伽机器人科技有限公司 Robot, back to zero position method, system with accurate back to zero bit function and medium
CN109062145A (en) * 2018-08-13 2018-12-21 大古智能科技(上海)有限公司 Numerically-controlled machine tool motion control card based on WIFI communication
CN114296393A (en) * 2021-12-29 2022-04-08 北京半导体专用设备研究所(中国电子科技集团公司第四十五研究所) Zero-returning method and device for motion platform, electronic equipment and storage medium
CN114995536A (en) * 2022-08-08 2022-09-02 广东科伺智能科技有限公司 Motion controller for servo motor
CN115453967A (en) * 2022-10-24 2022-12-09 傲拓科技股份有限公司 Scheduling execution method of PLCopen single-axis motion control function block

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
PLCopen轴组运动功能块的研究与实现;王夫康;张得礼;周伟;;机电工程(第12期);全文 *

Also Published As

Publication number Publication date
CN115987176A (en) 2023-04-18

Similar Documents

Publication Publication Date Title
US10981274B2 (en) Automatic trajectory generation for controlling a drive system
US4609855A (en) Adaptive servomotor control
JP4973792B1 (en) Arithmetic unit, output control method, and program
CN110026820B (en) Machine tool anti-collision method and system applying same
CN103197673A (en) Robot motion track locating method and robot motion track locating device
JP7087316B2 (en) Information processing equipment, information processing methods and programs
CN111993411A (en) Robot motion planning method and device, robot and storage medium
KR101207248B1 (en) Industrial robot and method for controlling the movement of an industrial robot
CN115987176B (en) Method and device for carrying out zero return control on motor position and edge controller
US4059746A (en) Pulse distribution apparatus for linear interpolation in a numerical control system
US20180311821A1 (en) Synchronization of multiple robots
CN110557080A (en) Servo motor control method and device and computer readable medium
US8155781B2 (en) Automation system and method for movement control of at least one moveable machine element
CN204423086U (en) A kind of piler servo positioning system
CN109696910B (en) Steering engine motion control method and device and computer readable storage medium
CN112612245A (en) Shaft motion control method and device, terminal device and computer readable storage medium
JPS6232508A (en) Positioning control method for servo-system of numerical controller
CN112272808A (en) Control device and control method
CN112207824B (en) Method, system, device and storage medium for controlling multiple single-axis modules
KR101787233B1 (en) Method and Apparatus for Friction Characteristic Measurement of Electric Drive System
JP7375632B2 (en) Control system and support equipment
CN104570914A (en) Stacker servo positioning system
CN115328120A (en) Control method and device for automatic guided vehicle, storage medium and automatic guided vehicle
CN109976256B (en) Control method and control module for laser welding analog quantity
Žemla et al. The Programmable Virtual Model of the Mechatronic System Using NX 12 Environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant