CN111522313B - Method for controlling servo motor curve motion based on CANOPEN protocol - Google Patents

Method for controlling servo motor curve motion based on CANOPEN protocol Download PDF

Info

Publication number
CN111522313B
CN111522313B CN202010349709.8A CN202010349709A CN111522313B CN 111522313 B CN111522313 B CN 111522313B CN 202010349709 A CN202010349709 A CN 202010349709A CN 111522313 B CN111522313 B CN 111522313B
Authority
CN
China
Prior art keywords
target position
workpiece
next period
distance
motion track
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
CN202010349709.8A
Other languages
Chinese (zh)
Other versions
CN111522313A (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.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
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 Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN202010349709.8A priority Critical patent/CN111522313B/en
Publication of CN111522313A publication Critical patent/CN111522313A/en
Application granted granted Critical
Publication of CN111522313B publication Critical patent/CN111522313B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/418Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS], computer integrated manufacturing [CIM]
    • G05B19/4185Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS], computer integrated manufacturing [CIM] characterised by the network communication
    • G05B19/4186Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS], computer integrated manufacturing [CIM] characterised by the network communication by protocol, e.g. MAP, TOP
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/403Bus networks with centralised control, e.g. polling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The invention discloses a method for controlling servo motor curvilinear motion based on a CANOPEN protocol, which realizes that a plurality of servo motors drive a workpiece to complete curvilinear motion. According to the invention, independent servo motor drivers are controlled in a networking mode, periodic SYNC instructions are sent to read feedback information to form a closed-loop system, and the position of the next movement is adjusted according to the received position information in the movement process, so that the servo motor drives a workpiece to complete curvilinear movement. A CAN bus is adopted to establish cluster control of one master and a plurality of slaves, and a CANOPEN protocol is utilized to complete data interaction in a coordinated mode, so that the position synchronization of the servo motor is realized.

Description

Method for controlling servo motor curve motion based on CANOPEN protocol
Technical Field
The application belongs to the field of industrial control, and particularly relates to a method for controlling the curvilinear motion of a servo motor based on a CANOPEN protocol.
Background
CANOPEN is a high-level communication protocol over a Control Area Network (CAN), including communication sub-protocols and device sub-protocols, commonly used in embedded systems, and is also a field bus commonly used for industrial control. It implements agreements above (including at) the network layer in the OSI model. The CANOPEN standard includes an addressing scheme, several small communication sub-protocols, and an application layer defined by the device sub-protocols. CANOPEN supports network management, equipment monitoring and inter-node communications, including a simple transport layer that handles segmented delivery of data and combinations thereof. Typically, the data link layer and the physical layer are implemented using CAN. In addition to CANOPEN, there are other communication protocols (e.g., EtherCAT) that implement the CANOPEN device sub-protocol.
The servo interface buses widely adopted in the industry include CANOPEN, Powerlink, EtherCAT and the like, and the schemes can realize distributed multi-axis control through all-digital information transmission, so that the complexity of the system is reduced, and the expansion is easy. Although industrial ethernet such as EtherCAT and Powerlink has the advantages of high communication rate and large data transmission amount, the industrial ethernet is mostly realized by adopting special hardware or large-capacity FPGAs, and has the defects of high hardware cost, 100m maximum transmission distance and the like. However, at present, most of MCUs contain a CAN peripheral, and a CANOPEN network CAN be realized through the CAN peripheral, so that the cost of the system CAN be reduced, and the anti-interference capability of the system is increased.
In addition, in the industrial control, most of the traditional servo motors are independently operated at present, and the operation of a curve track is difficult to realize, so that certain limitation is brought to the industrial control processing.
Disclosure of Invention
The application aims to provide a method for controlling the curvilinear motion of a servo motor based on a CANOPEN protocol, which is used for networking and controlling independent servo motor drivers to realize the curvilinear motion of a workpiece.
In order to achieve the purpose, the technical scheme adopted by the application is as follows:
a method for controlling servo motor curvilinear motion based on CANOPEN protocol realizes that a plurality of servo motors drive workpieces to complete curvilinear motion, the CANOPEN protocol comprises a master station and a slave station, a plurality of servo drivers for controlling the motion of each servo motor are taken as master controllers, the slave stations are taken as slave controllers, and the method for controlling the servo motor curvilinear motion based on the CANOPEN protocol comprises the following steps:
step S1, the master station detects the on-line slave station in the current CAN bus;
step S2, the master station sends a broadcast instruction to inform each online slave station to enter a pre-operation mode;
step S3, the master station sends a TPDO instruction, configures communication parameters and mapping parameters of each online slave station, sends a broadcast instruction and informs each online slave station to control the servo motor to move to a zero position and enter an operation mode;
step S4, after receiving the displacement instruction, the master station analyzes the displacement instruction to obtain a target curve motion track contained in the displacement instruction, discretizes the target curve motion track into a plurality of small line segments, and sequentially takes the small line segments as the current ideal motion track;
step S5, the master station sends periodic SYNC commands, and the current position information (x) of the workpiece is obtained according to the feedback of each slave stationi,yi) Wherein i represents the current period and is based on the current position information (x)i,yi) Calculating a first predicted position (x)i+D0,yi) And a second predicted position (x)i+D0,yi+D0) Difference in vertical direction from the current ideal motion trajectory, where D0Taking the predicted position corresponding to the minimum difference value as a target position of the next period for the moving distance, and distributing the target position to a corresponding online slave station through a TPOD (transport format object) instruction until the workpiece moves to the tail end of the current ideal motion track;
step S6, judging whether the current ideal motion track is the last small line segment in the motion track of the target curve, if so, finishing and ending; if not, a small line segment is taken down as the current ideal motion track, and step S5 is executed again.
Preferably, the step S5 specifically includes the following steps:
s5.1, setting the trajectory equation of the current ideal motion trajectory as y ═ kx + b, sending SYNC instructions by the master station to obtain the positions fed back by the on-line slave stations, and combining to obtain the current position information (x) of the workpiecei,yi),i≥1;
S5.2, enabling the moving distance of the workpiece on the X axis in each period to be D0The distance of movement in the Y axis being 0 or D0Therefore, two predicted positions of the workpiece in the next cycle are obtained: first predicted position (x)i+D0,yi) And a second predicted position (x)i+D0,yi+D0);
S5.3, obtaining the trace position (x) of the workpiece in the next period according to a trace equationi+1′,yi+1') and y)i+1′=kxi+1′+b,xi+1′=xi+D0Wherein i +1 represents the next cycle;
s5.4, respectively calculating the distance between the predicted position and the track position:
d1=|yi+1′-yi|=|kxi+1′+b-yi|
d2=|yi+D0-yi+1′|=|yi+D0-kxi+1′-b|
s5.5 according to the distance d1、d2Determining a target position (x) for a next cyclei+1,yi+1) The method comprises the following steps:
if d is1>d2Indicates a second predicted position (x)i+D0,yi+D0) When the distance between the target position and the current ideal motion track is shorter, the second predicted position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi+D0
When d is1≤d2Indicates the first predicted position (x)i+D0,yi) When the distance between the target position and the current ideal motion track is shorter, the first prediction position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi
S5.6, the master station distributes the target position to the corresponding online slave station through the TPOD instruction, and controls the movement distance of the slave station in the next period to enable the workpiece to reach the target position in the next period;
and S5.7, repeatedly executing the step S5.1 to the step S5.6 until the workpiece moves to the tail end of the current ideal motion track.
Preferably, the step S5 specifically includes the following steps:
s5.1, setting the trajectory equation of the current ideal motion trajectory as y ═ kx + b, sending SYNC instructions by the master station to obtain the positions fed back by the on-line slave stations, and combining to obtain the current position information (x) of the workpiecei,yi),i≥1;
S5.2, enabling the moving distance of the workpiece on the X axis in each period to be D0The distance of movement in the Y axis being 0 or D0Therefore, two predicted positions of the workpiece in the next cycle are obtained: first predicted position (x)i+D0,yi) And a second predicted position (x)i+D0,yi+D0);
S5.3, obtaining the trace position (x) of the workpiece in the next period according to a trace equationi+1′,yi+1') and y)i+1′=kxi+1′+b,xi+1′=xi+D0Wherein i +1 represents the next cycle;
s5.4, respectively calculating the Y-axis position difference between the predicted position and the track position:
d3=yi+1′-yi=kxi+1′+b-yi
d4=yi+D0-yi+1′=yi+D0-kxi+1′-b
s5.5 according to the distance d3、d4Determining a target position (x) for a next cyclei+1,yi+1) The method comprises the following steps:
let Ci=Δx×(d3-d4)=2Δy×xi-2Δx×yi+f
Wherein Δ x ═ x2-x1),Δy=(y2-y1),(x1,y1) And (x)2,y2) The first point and the second point on the current ideal motion track are shown, and k is delta y/delta x, f is 2 delta y multiplied by D0+Δx(2b-D0);
For the i +1 th cycle, Ci+1=Δx×(d3-d4)=2Δy×xi+1-2Δx×yi+1+ f, and xi+1=xi+D0
Subtracting the two equations to obtain a recursion formula: ci+1=Ci+2Δy×D0-2Δx(yi+1-yi);
Assuming that the initial motion point of the workpiece is the first point on the current ideal motion track, the following conditions are satisfied: y is1=kx1+b;
Thus C1=2Δy×D0-Δx×D0
According to CiCan be known by the calculation formula of CiAnd d3-d4Have the same sign, so the following decision rule can be obtained: if k > 0, and CiWhen the value is more than or equal to 0, indicating the second prediction position (x)i+D0,yi+D0) When the distance between the target position and the current ideal motion track is shorter, the second predicted position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi+D0And C can be obtained according to a recurrence formulai+1=Ci+2D0(Δy-Δx);
When k > 0, and CiWhen < 0, the first predicted position (x) is indicatedi+D0,yi) When the distance between the target position and the current ideal motion track is shorter, the first prediction position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yiAnd C can be obtained according to a recurrence formulai+1=Ci+2Δy×D0
If k is less than 0, and CiWhen < 0, a second predicted position (x) is indicatedi+D0,yi+D0) When the distance between the target position and the current ideal motion track is shorter, the second predicted position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi+D0And C can be obtained according to a recurrence formulai+1=Ci+2D0(Δy-Δx);
When k > 0, and CiWhen the value is more than or equal to 0, the first prediction position (x) is indicatedi+D0,yi) Distance from current ideal fortuneIf the moving track is closer, the first predicted position is selected as the target position of the next period, i.e. the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yiAnd C can be obtained according to a recurrence formulai+1=Ci+2Δy×D0
S5.6, the master station distributes the target position to the corresponding online slave station through the TPOD instruction, and controls the movement distance of the slave station in the next period to enable the workpiece to reach the target position in the next period;
and S5.7, repeatedly executing the step S5.1 to the step S5.6 until the workpiece moves to the tail end of the current ideal motion track.
According to the method for controlling the servo motor to move in the curve based on the CANOPEN protocol, independent servo motor drivers are controlled in a networking mode, periodic SYNC instructions are sent to read feedback information to form a closed-loop system, the position of the next movement is adjusted according to the received position information in the movement process, and therefore the servo motor drives a workpiece to complete the curve movement. A CAN bus is adopted to establish cluster control of one master and a plurality of slaves, and a CANOPEN protocol is utilized to complete data interaction in a coordinated mode, so that the position synchronization of the servo motor is realized.
Drawings
FIG. 1 is a flow chart of a method for controlling a servo motor to move in a curve based on a CANOPEN protocol according to the present application;
fig. 2 is a schematic diagram of a current ideal motion trajectory in embodiment 1 of the present application;
fig. 3 is a schematic diagram of a current ideal motion trajectory in embodiment 2 of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
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. The terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
In one embodiment, a method for controlling the curvilinear motion of the servo motors based on the CANOPEN protocol is provided, so that a plurality of servo motors drive a workpiece to complete the curvilinear motion, and the problem that the traditional servo motors mostly operate independently and are difficult to realize the curvilinear motion is solved.
The CANOPEN protocol generally comprises a master station and a slave station, and has a communication function of one master station to a plurality of slave stations. In this embodiment, among a plurality of servo drivers for controlling the movement of each servo motor, a master controller is used as a master station, a slave controller is used as a slave station, the master station and the slave station are connected in parallel, and communication is performed based on the CANOPEN protocol in a CAN bus.
As shown in fig. 1, the method for controlling the curvilinear motion of the servo motor based on the CANOPEN protocol of the present embodiment includes the following steps:
and step S1, the master station detects the on-line slave station in the current CAN bus.
The master station is firstly electrified to configure peripheral parameters, and then the current online slave station is detected to finish preparation work. The peripheral configuration parameter is the conventional operation, and is mainly used for configuring the equipment into a required state, for example, the CAN is configured to work in a normal mode by power-on, the communication baud rate is 500kb, and the receiving interruption is enabled.
In step S2, the master station transmits a broadcast command to notify each online slave station to enter the pre-operation mode.
And step S3, the master station sends a TPDO instruction, configures communication parameters and mapping parameters of each on-line slave station, and sends a broadcast instruction to inform each on-line slave station to control the servo motor to move to the zero position and enter an operation mode.
It should be noted that the primary station needs to configure the TPDO and RPDO parameters of each secondary station through the SDO instruction, and send the TPDO instruction based on the configured TPDO and RPDO parameters. And the configuration or command transceiving between the master station and the slave station is the conventional operation of CANOPEN protocol communication, and the detailed description is omitted here.
And step S4, after the master station receives the displacement instruction, analyzing to obtain a target curve motion track contained in the displacement instruction, discretizing the target curve motion track into a plurality of small line segments, and sequentially taking the small line segments as the current ideal motion track.
It should be noted that, if the target motion trajectory is a straight-line segment, the discretization step may be omitted, and the straight-line segment is used as the current ideal motion trajectory for the subsequent operation.
Step S5, the master station sends periodic SYNC commands, and the current position information (x) of the workpiece is obtained according to the feedback of each slave stationi,yi) Wherein i represents the current period and is based on the current position information (x)i,yi) Calculating a first predicted position (x)i+D0,yi) And a second predicted position (x)i+D0,yi+D0) Difference in vertical direction from the current ideal motion trajectory, where D0And taking the predicted position corresponding to the minimum difference value as the target position of the next period for the movement distance, and distributing the target position to the corresponding on-line slave station through the TPOD instruction until the workpiece moves to the tail end of the current ideal motion track.
Step S6, judging whether the current ideal motion track is the last small line segment in the motion track of the target curve, if so, finishing and ending; if not, a small line segment is taken down as the current ideal motion track, and step S5 is executed again. It should be noted that, if the target motion trajectory is a straight line segment, the current ideal motion trajectory is the last small line segment in the target curved motion trajectory.
According to the servo motor control system, independent servo motor drivers are controlled in a networking mode, periodic SYNC instructions are sent to read feedback information to form a closed-loop system, the target position of the next periodic movement is adjusted according to the received position information in the movement process, therefore, the servo motor drives a workpiece to complete curvilinear movement, and the problem that multi-dimensional, high-precision and low-cost movement control of the motor is difficult to achieve in industrial control is solved.
The following further illustrates the process of adjusting the target position of the next periodic movement according to the received position information by the embodiment.
Example 1
As shown in fig. 2, step S5 specifically includes the following steps:
s5.1, setting the trajectory equation of the current ideal motion trajectory to be y ═ kx + b (shown in fig. 2 as a schematic diagram when k > 0), the master station sends a SYNC command to obtain the positions fed back by the online slave stations, and the positions are combined to obtain the current position information (x is x > 0) of the workpiecei,yi),i≥1
S5.2, enabling the moving distance of the workpiece on the X axis in each period to be D0The distance of movement in the Y axis being 0 or D0Therefore, two predicted positions of the workpiece in the next cycle are obtained: first predicted position (x)i+D0,yi) And a second predicted position (x)i+D0,yi+D0) (ii) a To reduce motion errors, D0Preferably one pixel point, i.e. D0=1。
S5.3, obtaining the trace position (x) of the workpiece in the next period according to a trace equationi+1′,yi+1') and y)i+1′=kxi+1′+b,xi+1′=xi+D0Wherein i +1 represents the next cycle;
s5.4, respectively calculating the distance between the predicted position and the track position:
d1=|yi+1′-yi|=|kxi+1′+b-yi|
d2=|yi+D0-yi+1′|=|yi+D0-kxi+1′-b|
s5.5 according to the distance d1、d2Determining a target position (x) for a next cyclei+1,yi+1) The method comprises the following steps:
if d is1>d2Indicates a second predicted position (x)i+D0,yi+D0) Distance from current ideal motion railIf the trace is closer, the second predicted position is selected as the target position of the next period, i.e. the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi+D0
When d is1≤d2Indicates the first predicted position (x)i+D0,yi) When the distance between the target position and the current ideal motion track is shorter, the first prediction position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi
S5.6, the master station distributes the target position to the corresponding online slave station through the TPOD instruction, and controls the movement distance of the slave station in the next period to enable the workpiece to reach the target position in the next period;
and S5.7, repeatedly executing the step S5.1 to the step S5.6 until the workpiece moves to the tail end of the current ideal motion track.
The method for determining the target position of the next period is simple, the deviation between the determined target position and the current ideal motion trajectory is small, and the target curvilinear motion trajectory can be restored to a higher degree. However, the above process is only a preferred method, and is not limited to the above process, for example, in another embodiment, in order to further increase the speed of determining the target position in the next period, increase the response capability of the servo motor, and reduce the operation error, the process of adjusting the target position of the next period movement according to the received position information may also be as follows.
Example 2
As shown in fig. 3, step S5 specifically includes the following steps:
s5.1, setting the trajectory equation of the current ideal motion trajectory to be y ═ kx + b (shown in fig. 2 as a schematic diagram when k > 0), the master station sends a SYNC command to obtain the positions fed back by the online slave stations, and the positions are combined to obtain the current position information (x is x > 0) of the workpiecei,yi),i≥1;
S5.2, enabling the moving distance of the workpiece on the X axis in each period to be D0The distance of movement in the Y axis being 0 or D0Therefore, two predicted positions of the workpiece in the next cycle are obtained: first predicted position (x)i+D0,yi) And a second predicted position (x)i+D0,yi+D0) (ii) a To reduce motion errors, D0Preferably one pixel point, i.e. D0=1。
S5.3, obtaining the trace position (x) of the workpiece in the next period according to a trace equationi+1′,yi+1') and y)i+1′=kxi+1′+b,xi+1′=xi+D0Wherein i +1 represents the next cycle;
s5.4, respectively calculating the Y-axis position difference between the predicted position and the track position:
d3=yi+1′-yi=kxi+1′+b-yi
d4=yi+D0-yi+1′=yi+D0-kxi+1′-b
s5.5 according to the distance d3、d4Determining a target position (x) for a next cyclei+1,yi+1) The method comprises the following steps:
let Ci=Δx×(d3-d4)=2Δy×xi-2Δx×yi+f
Wherein Δ x ═ x2-x1),Δy=(y2-y1),(x1,y1) And (x)2,y2) The first point and the second point on the current ideal motion track are shown, and k is delta y/delta x, f is 2 delta y multiplied by D0+Δx(2b-D0);
For the i +1 th cycle, Ci+1=Δx×(d3-d4)=2Δy×xi+1-2Δx×yi+1+ f, and xi+1=xi+D0
Subtracting the two equations to obtain a recursion formula: ci+1=Ci+2Δy×D0-2Δx(yi+1-yi);
Suppose thatThe initial motion point of the workpiece is the first point on the current ideal motion track, and then the following conditions are met: y is1=kx1+b;
Thus C1=2Δy×D0-Δx×D0
According to CiCan be known by the calculation formula of CiAnd d3-d4Have the same sign, so the following decision rule can be obtained: if k > 0, and CiWhen the value is more than or equal to 0, indicating the second prediction position (x)i+D0,yi+D0) When the distance between the target position and the current ideal motion track is shorter, the second predicted position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi+D0And C can be obtained according to a recurrence formulai+1=Ci+2D0(Δy-Δx);
When k > 0, and CiWhen < 0, the first predicted position (x) is indicatedi+D0,yi) When the distance between the target position and the current ideal motion track is shorter, the first prediction position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yiAnd C can be obtained according to a recurrence formulai+1=Ci+2Δy×D0
If k is less than 0, and CiWhen < 0, a second predicted position (x) is indicatedi+D0,yi+D0) When the distance between the target position and the current ideal motion track is shorter, the second predicted position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi+D0And C can be obtained according to a recurrence formulai+1=Ci+2D0(Δy-Δx);
When k > 0, and CiWhen the value is more than or equal to 0, the first prediction position (x) is indicatedi+D0,yi) From the current ideal motion trackAnd when the target position is closer, selecting the first predicted position as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yiAnd C can be obtained according to a recurrence formulai+1=Ci+2Δy×D0
S5.6, the master station distributes the target position to the corresponding online slave station through the TPOD instruction, and controls the movement distance of the slave station in the next period to enable the workpiece to reach the target position in the next period;
and S5.7, repeatedly executing the step S5.1 to the step S5.6 until the workpiece moves to the tail end of the current ideal motion track.
The parameter C in example 2 can be obtained from the above calculation processi+1The calculation can be completed by arithmetic left shift, so the calculation method has high speed and is easy to realize by hardware.
The method for controlling the curvilinear motion of the servo motor based on the CANOPEN protocol provided by the embodiment can realize multi-axis synchronous control, and the speed of determining the target position in the next period according to the current feedback position is high, and the error between the target position and the target motion trajectory is small, so that the displacement of the workpiece can be quickly and accurately completed.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (1)

1. A method for controlling servo motor curvilinear motion based on a CANOPEN protocol realizes that a plurality of servo motors drive workpieces to complete curvilinear motion, the CANOPEN protocol comprises a master station and a slave station, and is characterized in that a master controller is used as a master station and a slave controller is used as a slave station in a plurality of servo drivers for controlling the motion of each servo motor, and the method for controlling the servo motor curvilinear motion based on the CANOPEN protocol comprises the following steps:
step S1, the master station detects the on-line slave station in the current CAN bus;
step S2, the master station sends a broadcast instruction to inform each online slave station to enter a pre-operation mode;
step S3, the master station sends a TPDO instruction, configures communication parameters and mapping parameters of each online slave station, sends a broadcast instruction and informs each online slave station to control the servo motor to move to a zero position and enter an operation mode;
step S4, after receiving the displacement instruction, the master station analyzes the displacement instruction to obtain a target curve motion track contained in the displacement instruction, discretizes the target curve motion track into a plurality of small line segments, and sequentially takes the small line segments as the current ideal motion track;
step S5, the master station sends periodic SYNC commands, and the current position information (x) of the workpiece is obtained according to the feedback of each slave stationi,yi) Wherein i represents the current period and is based on the current position information (x)i,yi) Calculating a first predicted position (x)i+D0,yi) And a second predicted position (x)i+D0,yi+D0) Difference in vertical direction from the current ideal motion trajectory, where D0Taking the predicted position corresponding to the minimum difference value as a target position of the next period for the moving distance, and distributing the target position to a corresponding online slave station through a TPOD (transport format object) instruction until the workpiece moves to the tail end of the current ideal motion track;
step S6, judging whether the current ideal motion track is the last small line segment in the motion track of the target curve, if so, finishing and ending; if not, taking down a small line segment as the current ideal motion track, and re-executing the step S5;
wherein, the step S5 specifically includes the following steps:
s5.1, setting the trajectory equation of the current ideal motion trajectory as y ═ kx + b, sending SYNC instructions by the master station to obtain the positions fed back by the on-line slave stations, and combining to obtain the current position information (x) of the workpiecei,yi),i≥1;
S5.2, enabling the moving distance of the workpiece on the X axis in each period to be D0The distance of movement in the Y axis being 0 or D0Therefore, two predicted positions of the workpiece in the next cycle are obtained: first predicted position (x)i+D0,yi) And a second predicted position (x)i+D0,yi+D0);
S5.3, obtaining the trace position (x) of the workpiece in the next period according to a trace equationi+1′,yi+1') and Y)i+1yi+1′=kxi+1′+b,xi+1′=xi+D0Wherein i +1 represents the next cycle;
s5.4, respectively calculating the distance between the predicted position and the track position:
d1=|yi+1′-yi|=|kxi+1′+b-yi|
d2=|yi+D0-yi+1′|=|yi+D0-kxi+1′-b|
s5.5 according to the distance d1、d2Determining a target position (x) for a next cyclei+1,yi+1) The method comprises the following steps:
if d is1>d2Indicates a second predicted position (x)i+D0,yi+D0) When the distance between the target position and the current ideal motion track is shorter, the second predicted position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi+D0
When d is1≤d2Indicates the first predicted position (x)i+D0,yi) When the distance between the target position and the current ideal motion track is shorter, the first prediction position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi
S5.6, the master station distributes the target position to the corresponding online slave station through the TPOD instruction, and controls the movement distance of the slave station in the next period to enable the workpiece to reach the target position in the next period;
s5.7, repeatedly executing the step S5.1 to the step S5.6 until the workpiece moves to the tail end of the current ideal motion track;
alternatively, the step S5 specifically includes the following steps:
s5.1, setting the trajectory equation of the current ideal motion trajectory as y ═ kx + b, sending SYNC instructions by the master station to obtain the positions fed back by the on-line slave stations, and combining to obtain the current position information (x) of the workpiecei,yi),i≥1;
S5.2, enabling the moving distance of the workpiece on the X axis in each period to be D0The distance of movement in the Y axis being 0 or D0Therefore, two predicted positions of the workpiece in the next cycle are obtained: first predicted position (x)i+D0,yi) And a second predicted position (x)i+D0,yi+D0);
S5.3, obtaining the trace position (x) of the workpiece in the next period according to a trace equationi+1′,yi+1') and y)i+1′=kxi+1′+b,xi+1′=xi+D0Wherein i +1 represents the next cycle;
s5.4, respectively calculating the Y-axis position difference between the predicted position and the track position:
d3=yi+1′-yi=kxi+1′+b-yi
d4=yi+D0-yi+1′=yi+D0-kxi+1′-b
s5.5 according to the distance d3、d4Determining the next cycleTarget position (x)i+1,yi+1) The method comprises the following steps:
let Ci=Δx×(d3-d4)=2Δy×xi-2Δx×yi+f
Wherein Δ x ═ x2-x1),Δy=(y2-y1),(x1,y1) And (x)2,y2) The first point and the second point on the current ideal motion track are shown, and k is delta y/delta x, f is 2 delta y multiplied by D0+Δx(2b-D0);
For the i +1 th cycle, Ci+1=Δx×(d3-d4)=2Δy×xi+1-2Δx×yi+1+ f, and xi+1=xi+D0
Subtracting the two equations to obtain a recursion formula: ci+1=Ci+2Δy×D0-2Δx(yi+1-yi);
Assuming that the initial motion point of the workpiece is the first point on the current ideal motion track, the following conditions are satisfied: y is1=kx1+b;
Thus C1=2Δy×D0-Δx×D0
According to CiCan be known by the calculation formula of CiAnd d3-d4Have the same sign, so the following decision rule can be obtained: if k > 0, and CiWhen the value is more than or equal to 0, indicating the second prediction position (x)i+D0,yi+D0) When the distance between the target position and the current ideal motion track is shorter, the second predicted position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi+D0And C can be obtained according to a recurrence formulai+1=Ci+2D0(Δy-Δx);
When k > 0, and CiWhen < 0, the first predicted position (x) is indicatedi+D0,yi) When the distance between the target position and the current ideal motion track is shorter, the first prediction position is selected as the target position of the next period, namely the next periodTarget position (x) of one cyclei+1,yi+1) In xi+1=xi+D0,yi+1=yiAnd C can be obtained according to a recurrence formulai+1=Ci+2Δy×D0
If k is less than 0, and CiWhen < 0, a second predicted position (x) is indicatedi+D0,yi+D0) When the distance between the target position and the current ideal motion track is shorter, the second predicted position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yi+D0And C can be obtained according to a recurrence formulai+1=Ci+2D0(Δy-Δx);
When k > 0, and CiWhen the value is more than or equal to 0, the first prediction position (x) is indicatedi+D0,yi) When the distance between the target position and the current ideal motion track is shorter, the first prediction position is selected as the target position of the next period, namely the target position (x) of the next periodi+1,yi+1) In xi+1=xi+D0,yi+1=yiAnd C can be obtained according to a recurrence formulai+1=Ci+2Δy×D0
S5.6, the master station distributes the target position to the corresponding online slave station through the TPOD instruction, and controls the movement distance of the slave station in the next period to enable the workpiece to reach the target position in the next period;
and S5.7, repeatedly executing the step S5.1 to the step S5.6 until the workpiece moves to the tail end of the current ideal motion track.
CN202010349709.8A 2020-04-28 2020-04-28 Method for controlling servo motor curve motion based on CANOPEN protocol Active CN111522313B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010349709.8A CN111522313B (en) 2020-04-28 2020-04-28 Method for controlling servo motor curve motion based on CANOPEN protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010349709.8A CN111522313B (en) 2020-04-28 2020-04-28 Method for controlling servo motor curve motion based on CANOPEN protocol

Publications (2)

Publication Number Publication Date
CN111522313A CN111522313A (en) 2020-08-11
CN111522313B true CN111522313B (en) 2021-09-28

Family

ID=71902765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010349709.8A Active CN111522313B (en) 2020-04-28 2020-04-28 Method for controlling servo motor curve motion based on CANOPEN protocol

Country Status (1)

Country Link
CN (1) CN111522313B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055387B (en) * 2021-03-15 2023-03-17 西安热工研究院有限公司 Communication method for servo master-slave cards of steam turbine

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104290096A (en) * 2014-09-16 2015-01-21 湖南大学 CANopen based mechanical arm joint motor control method and system
CN104339354A (en) * 2014-11-20 2015-02-11 西安电子科技大学 Specialized sport controller hardware platform used for 6-degree-of-freedom parallel robot
WO2017068056A1 (en) * 2015-10-21 2017-04-27 Belden Deutschland Gmbh Distribution module with selector switch
CN109621231A (en) * 2017-12-29 2019-04-16 上海联影医疗科技有限公司 Track optimizing method, system, device and the storage medium that multicomponent moves synchronously

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104290096A (en) * 2014-09-16 2015-01-21 湖南大学 CANopen based mechanical arm joint motor control method and system
CN104339354A (en) * 2014-11-20 2015-02-11 西安电子科技大学 Specialized sport controller hardware platform used for 6-degree-of-freedom parallel robot
WO2017068056A1 (en) * 2015-10-21 2017-04-27 Belden Deutschland Gmbh Distribution module with selector switch
CN109621231A (en) * 2017-12-29 2019-04-16 上海联影医疗科技有限公司 Track optimizing method, system, device and the storage medium that multicomponent moves synchronously

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于CANopen的裁床运动控制系统设计与开发;徐鹏飞;《中国优秀硕士学位论文全文数据库 信息科技辑》;20170715(第07期);摘要、正文第9-42页 *

Also Published As

Publication number Publication date
CN111522313A (en) 2020-08-11

Similar Documents

Publication Publication Date Title
CN110989526B (en) double-AGV cooperative carrying control system and method
CN103025491B (en) The method of auto-control working cell
EP1464452B1 (en) Method and control system for controlling a plurality of robots
EP3770707B1 (en) Industrial control system with distributed motion planning
CN102985233B (en) Method for controlling an automated work cell
CN103425106A (en) Linux-based Ethercat maser/slave station control system and method
JP6411964B2 (en) Real-time interference confirmation system for machine tools and robots
CN108908851A (en) The electricity of injection molding machine penetrates platform servo-system and its data interaction process
CN102566511A (en) Five-shaft numerical control system cutter center point interpolation path interpolation method
JP2010170435A (en) System and method for instructing motion control, and motion control system
CN109834714B (en) Track control system and method for multiple robots
CN113021330B (en) Multi-robot synchronous follow-up control method under distributed network
CN111522313B (en) Method for controlling servo motor curve motion based on CANOPEN protocol
US7463643B2 (en) Applications of a switched data network for real-time and non-real time communication
CN109491251B (en) AC servo system model identification method and equipment considering data disturbance compensation
CN111352342A (en) Optimal control method of servo driver based on rotary table control
CN108818533A (en) Heterogeneous robot remote control system position and speed synchronisation control means
CN113485205B (en) CANBUS bus-based servo driver clock synchronization and position reconstruction method
CN103941646B (en) servo positioning control system and method
CN111552235B (en) Multi-axis synchronous error compensation method and system based on CANopen protocol
EP3851925B1 (en) A synchronised control system
CN108372502A (en) A kind of robot movement-control system and control method
CN110855537A (en) EtherCAT main station implementation method and system based on double MCUs
JP2008183685A (en) Robot control unit and robot position command value correcting method
US20230131842A1 (en) Multi-axis servo control system

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