Method and system for realizing dynamic adjustment of electronic cam

文档序号:1686599 发布日期:2020-01-03 浏览:21次 中文

阅读说明:本技术 一种实现电子凸轮动态调整的方法及系统 (Method and system for realizing dynamic adjustment of electronic cam ) 是由 王晓宇 高朝阳 陈雨 于 2019-09-12 设计创作,主要内容包括:本发明属于凸轮自动化控制领域,并具体公开了一种实现电子凸轮动态调整的方法及系统。所述方法包括:准备多个任务的主轴CAD连续轨迹文件,主控程序以此依次生成多个任务的缓冲表数据,然后根据置位信号将所述缓冲表数据进行数据移植,生成轴控制任务的当前表数据,并将其读取的当前表数据进行插值处理,以获取主轴的置位信号,然后再将所述主轴的置位信号进行轴脉冲转换,获得从轴的脉冲信号,控制电机执行从轴动作。所述系统包括CAD连续轨迹文件、表读写模块、主控模块、伺服驱动器和电机。本发明利用动态更改数据表或参数的方式实现凸轮的动态调整,提高了电子凸轮功能的灵活性,拓展了其应用范围。(The invention belongs to the field of automatic control of cams, and particularly discloses a method and a system for realizing dynamic adjustment of an electronic cam. The method comprises the following steps: preparing a main shaft CAD continuous track file of a plurality of tasks, sequentially generating buffer table data of the plurality of tasks by a main control program, then carrying out data transplantation on the buffer table data according to a setting signal to generate current table data of a shaft control task, carrying out interpolation processing on the read current table data to obtain a setting signal of the main shaft, then carrying out shaft pulse conversion on the setting signal of the main shaft to obtain a pulse signal of a driven shaft, and controlling a motor to execute driven shaft action. The system comprises a CAD continuous track file, a table read-write module, a main control module, a servo driver and a motor. The invention realizes the dynamic adjustment of the cam by dynamically changing the data table or the parameters, improves the flexibility of the function of the electronic cam and expands the application range of the electronic cam.)

1. A method for realizing dynamic adjustment of an electronic cam is characterized by comprising the following steps:

s1, preparing a main shaft CAD continuous track file of a plurality of tasks;

s2, the main control program reads and writes the data of the main shaft CAD continuous track files of a plurality of tasks by adopting a multitask mechanism, buffer table data of the plurality of tasks are sequentially generated according to the data, and then the buffer table data are transplanted according to a setting signal to generate the current table data of the shaft control task;

s3, the main control program adopts a multitask mechanism to sequentially read the current table data, carries out interpolation processing on the read current table data to obtain a set signal of the main shaft, and then carries out shaft pulse conversion on the set signal of the main shaft to obtain a pulse signal of the auxiliary shaft;

s4, the servo driver receives the slave shaft pulse signal and controls the motor to execute the slave shaft action;

s5 repeats steps S2 to S4 to realize dynamic adjustment of the electronic cam during a plurality of task switching.

2. The method for implementing dynamic adjustment of an electronic cam according to claim 1, wherein in step S2, before reading and writing the data of the continuous track file of the main shaft CAD for the plurality of tasks, the continuous track file of the main shaft CAD for the plurality of tasks needs to be segmented according to a preset task amount.

3. The method according to claim 1, wherein in step S2, the buffer table data includes buffer table front position data and buffer table rear position data, wherein the buffer table front position data fills the buffer table rear position data as the buffer table front position data into the buffer table front position data during the migration process, and reads and writes data of the spindle CAD continuous track files of multiple tasks at the same time to generate the buffer table rear position data.

4. The method of claim 1, wherein in step S2, the current table data includes current pre-table position data and current post-table position data, and the current pre-table position data is filled as pre-table position data into the current pre-table position data during reading, and the buffer table data is migrated to generate the current post-table position data.

5. The method according to claim 1, wherein in step S3, the setting signal of the spindle includes a spindle front setting signal and a spindle rear setting signal, wherein the spindle front setting signal changes the spindle rear setting signal during the process of performing the spindle pulse conversion, and uses the changed spindle rear setting signal as the spindle front setting signal, and at the same time, sequentially reads the current table data, and performs interpolation processing on the read current table data to obtain the spindle rear setting signal, and performs the zero clearing processing after the spindle front setting signal has been subjected to the spindle pulse conversion.

6. The method for implementing dynamic adjustment of an electronic cam according to any one of claims 1-5, wherein the buffer table data stores a larger amount of data than the current table data.

7. A system for realizing dynamic adjustment of an electronic cam, which is used for realizing the dynamic adjustment method of the electronic cam according to any one of claims 1 to 6, and is characterized by comprising a CAD continuous track file (100), a table read-write module (200), a main control module (300), a servo driver (400) and a motor (500),

the CAD continuous track file (100) is used for storing a track curve of the electronic cam main shaft;

the input end of the table read-write module (200) is connected with the CAD continuous track file (100), and the output end of the table read-write module is connected with the input end of the main control module (300) and is used for reading data from the CAD continuous track file (100) in a segmented manner so as to continuously obtain buffer table data and a current data table;

the output end of the main control module (300) is connected with the input end of the servo driver (400) and is used for sequentially checking the current data table, interpolating to obtain a set signal of the main shaft, and performing shaft pulse conversion according to the set signal of the main shaft to obtain a pulse signal of the auxiliary shaft;

and the servo driver (400) receives the slave axis pulse signal and controls the motor (500) to execute slave axis action so as to realize dynamic adjustment of the electronic cam.

8. The system for realizing the dynamic adjustment of the electronic cam is characterized in that the table read-write module (200) comprises a partial track data storage unit (204), a shaft position data storage unit (203), an electronic cam buffer table unit (202) and an electronic cam current table unit (201) which are sequentially connected in a communication manner.

9. The system for realizing the dynamic adjustment of the electronic cam according to claim 7, wherein the master control module (300) comprises a master program table look-up unit (301) and an axis pulse buffer storage unit (302).

Technical Field

The invention belongs to the field of automatic control of cams, and particularly relates to a method and a system for realizing dynamic adjustment of an electronic cam.

Background

The electronic cam is a software system which simulates a mechanical cam by utilizing a constructed cam curve so as to achieve the same relative motion between a cam shaft and a main shaft of the mechanical cam system. Compared with a mechanical cam, the electronic cam has higher flexibility, is realized by curve modeling practical software, has low cost, reusability and high precision, and can be widely applied to the machining industry, the water conservancy and hydropower industry, the printing industry and the sewing industry instead of the mechanical cam.

Under the industrial automation process, the performances of a control system and a servo are widely improved, the requirements of higher speed, higher precision and higher stability are provided for industrial control in various light and heavy industrial fields, the traditional electronic cam implementation scheme based on the combination of a motion control card and a servo motor is difficult to finish calculation or obtain the next task in a short time, or a load is additionally added to the task needing main control, the dynamic adjustment of the electronic cam is difficult to realize, and the requirements of more fields on the dynamic control of a shaft are difficult to meet.

Therefore, in the field, a new method for implementing dynamic adjustment of the electronic cam is provided to solve the problem of the dynamic adjustment of the existing electronic cam, so as to improve the flexibility of the electronic cam function and expand the application range of the electronic cam.

Disclosure of Invention

The invention provides a method and a system for realizing dynamic adjustment of an electronic cam, wherein the method is correspondingly designed by combining the characteristics of the electronic cam and the characteristics of a multitask mechanism, the method comprises the steps of generating buffer data from data of a main shaft CAD continuous track file of a plurality of tasks, then carrying out data transplantation on the buffer table data according to a setting signal, sequentially reading the current table data by adopting the multitask mechanism, carrying out interpolation processing on the read current table data to obtain the setting signal of a main shaft, and then carrying out shaft pulse conversion on the setting signal of the main shaft to obtain a pulse signal of a driven shaft. The invention realizes the dynamic adjustment of the cam by dynamically changing the data table or the parameters, and realizes that the electronic cam can be generated in an off-line or on-line mode, thereby improving the flexibility of the function of the electronic cam and expanding the application range of the electronic cam.

To achieve the above object, according to one aspect of the present invention, there is provided a method for implementing dynamic adjustment of an electronic cam, comprising the steps of:

s1, preparing a main shaft CAD continuous track file of a plurality of tasks;

s2, the main control program reads and writes the data of the main shaft CAD continuous track files of a plurality of tasks by adopting a multitask mechanism, buffer table data of the plurality of tasks are sequentially generated according to the data, and then the buffer table data are transplanted according to a setting signal to generate the current table data of the shaft control task;

s3, the main control program adopts a multitask mechanism to sequentially read the current table data, carries out interpolation processing on the read current table data to obtain a set signal of the main shaft, and then carries out shaft pulse conversion on the set signal of the main shaft to obtain a pulse signal of the auxiliary shaft;

s4, the servo driver receives the slave shaft pulse signal and controls the motor to execute the slave shaft action;

s5 repeats steps S2 to S4 to realize dynamic adjustment of the electronic cam during a plurality of task switching.

Further, in step S2, before reading and writing the data of the spindle CAD continuous track files of the plurality of tasks, the spindle CAD continuous track files of the plurality of tasks need to be segmented according to a preset task amount.

Further, in step S2, the buffer table data includes buffer table front position data and buffer table rear position data, where in the migration process of the buffer table front position data, the buffer table rear position data is filled into the buffer table front position data as buffer table front position data, and data of the spindle CAD continuous track file of the multiple tasks is read and written at the same time, so as to generate buffer table rear position data.

Further, in step S2, the current table data includes current pre-table position data and current post-table position data, where in the reading process of the current pre-table position data, the current post-table position data is filled into the current pre-table position data as the pre-table position data, and the buffer table data is subjected to data migration to generate the current post-table position data.

Further, in step S3, the setting signal of the spindle includes a spindle front setting signal and a spindle rear setting signal, where the spindle front setting signal changes the spindle rear setting signal during the process of performing the spindle pulse conversion, and uses the changed spindle rear setting signal as the spindle front setting signal, and at the same time, sequentially reads the current table data, and performs interpolation processing on the read current table data to obtain the spindle rear setting signal, and performs the zero clearing processing after the spindle front setting signal completes the spindle pulse conversion.

Further, the data size of the buffer table data is larger than that of the current table data.

According to another aspect of the present invention, there is provided a system for implementing dynamic adjustment of an electronic cam, comprising a CAD continuous track file, a table read/write module, a main control module, a servo driver and a motor, wherein,

the CAD continuous track file is used for storing a track curve of the electronic cam main shaft;

the input end of the table read-write module is connected with the CAD continuous track file, and the output end of the table read-write module is connected with the input end of the main control module and used for reading data from the CAD continuous track file in a segmented manner so as to continuously obtain buffer table data and a current data table;

the output end of the main control module is connected with the input end of the servo driver and is used for sequentially checking the current data table, interpolating to obtain a set signal of the main shaft, and performing shaft pulse conversion according to the set signal of the main shaft to obtain a pulse signal of the auxiliary shaft;

and the servo driver receives the slave shaft pulse signal and controls the motor to execute slave shaft action so as to realize dynamic adjustment of the electronic cam.

Furthermore, the meter reading and writing module comprises a partial track data storage unit, an axis position data storage unit, an electronic cam buffer meter unit and an electronic cam current meter unit which are sequentially in communication connection.

Furthermore, the main control module comprises a main control program table look-up unit and an axis pulse buffer storage unit.

Generally, compared with the prior art, the above technical solution conceived by the present invention mainly has the following technical advantages:

1. the method is based on a multitask mechanism, sequentially generates buffer table data of a plurality of tasks from data of a main shaft CAD continuous track file of the plurality of tasks, performs data transfer on the buffer table data according to a setting signal to generate current table data of an axis control task, and then converts the current table data into an impulse signal of an auxiliary axis. The method enables the electronic cam to be generated in an off-line or on-line mode, thereby improving the flexibility of the function of the electronic cam and expanding the application range of the electronic cam.

2. The invention adopts a multitask mechanism, uses another task with a larger period to finish reading and writing the table, and the method basically has no extra load on the main control task and can finish the automatic control of the auxiliary table reading and writing task only by changing the global setting signal in a specific time.

3. After the global variable main shaft rear setting signal is set, the read-write task is triggered, corresponding area data in the buffer table is transplanted into the current table rear position data, the rear part of the electronic cam table data of the next track point is generated and written into the area of the buffer table rear position data, and at the moment, the slave shaft reads the pulse signal of the slave shaft obtained by conversion according to the current table front position data, so that collision cannot occur.

4. In order to ensure the accuracy and stability of data interaction, a trigger replacement signal in a control period needs to be set, the time requirement of a read-write task and the execution period of the read-write task need to be considered, when the speed of a main shaft and the period of the read-write task meet the requirement that the main shaft does not move to another part before a set signal is triggered and the next part of the read-write task is completed, the multi-task is just the multi-task framework, the read-write task can be ensured to fully complete data exchange and data generation without worrying about errors in the midway, and the flexibility of an electronic cam is realized, so that the generation of an online track can be supported, and the online control is realized.

5. The system sequentially generates the buffer table data of a plurality of tasks from the data of the main shaft CAD continuous track file of the plurality of tasks based on a multitask mechanism, performs data transfer on the buffer table data according to a setting signal to generate the current table data of the shaft control task, and then converts the current table data into the pulse signal of the driven shaft. The method enables the electronic cam to be generated in an off-line or on-line mode, thereby improving the flexibility of the function of the electronic cam and expanding the application range of the electronic cam.

Drawings

FIG. 1 is a general flow chart of a method for implementing dynamic adjustment of an electronic cam according to an embodiment of the present invention;

FIG. 2 is a flowchart illustrating a table read/write task and an axis control task of a method for implementing dynamic adjustment of an electronic cam according to an embodiment of the present invention;

FIG. 3 is a schematic diagram illustrating a signal triggered stop state in a method for implementing dynamic adjustment of an electronic cam according to an embodiment of the present invention;

FIG. 4 is a schematic diagram illustrating a signal triggering state in a method for implementing dynamic adjustment of an electronic cam according to an embodiment of the present invention;

FIG. 5 is a schematic diagram illustrating a shaft cross cycle motion state in a method for implementing dynamic adjustment of an electronic cam according to an embodiment of the present invention;

FIG. 6 is a schematic diagram of a system for implementing dynamic adjustment of an electronic cam according to an embodiment of the present invention;

fig. 7 is an electronic cam state table according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

As shown in fig. 1, the electronic cam dynamic adjustment system of the present invention includes an electronic cam state machine module, a cam table data structure module, and a read/write module.

As shown in fig. 7, the electronic cam state machine module includes a disengaged state and an engaged state, wherein the disengaged state includes a Disabled state at initial power-on, an initialized state StandStill, a stopped state ErrorStop due to an error, and an intermediate state Stopping of a normal stop. Further, the transition of the Disabled state to the StandStill state requires the initialization of the initial cam parameters, which includes identifying the source of the cam table data, determining the cam operating state, preparing for inter-axle engagement, and adjusting the slave-axle state to the following state. Once initialized, the operating state of the electronic cam is determined and no transition to other operating states is possible. The meshing state comprises three states, one is a Signal state, namely a Signal mechanism is introduced into a normally working electronic cam system, the motion of a driven shaft can be changed (stopped or started) by triggering of an external Signal, the second is used as a synchronous link between shaft groups, complex motion between different shaft groups can be defined by tracks, a section of complete coordinate motion of the shaft groups, such as point position motion of XYZ coordinates of an end executing part, can be expanded into a section of point position motion curve of the driven shaft through an electronic cam, and a main shaft generates a linear corresponding motion curve, so that synchronous motion between the shaft groups can be completed between two pairs of shaft groups. The third is an operation in which the slave axis cycle spans a plurality of master axis cycles, that is, the master axis completes N cycles of operations, and the slave axis performs different operations in N cycles. To achieve this, another set of electronic cams can be used, but the method can freely change the span without stopping the machine, or freely increase the motion, without introducing additional cam relationship, so that the method is more convenient.

The structure of the electronic cam table is divided into two parts, one part is a data storage area, and the other part is cam working state information. The size of the data storage area has no clear upper limit and is used only to store data. Taking signal access as an example, if the working slave shaft has more than one other state besides the normal working state, action curves corresponding to the other states are stored in other cam tables, the tables are stored during initialization, when the cam tables work in the normal state, the signal state and the current cam position are firstly verified at the beginning of each period, and when the signals are triggered, data exchange between the two tables is executed by another task with a longer working period. As shown in fig. 3 and 4, in the third period, the signal is triggered, and in the next period, the electronic cam takes the action of triggering, and when the signal disappears, the replaced data is replaced from another table. Another portion of the cam table is present in the state machine after initialization as cam relationship data that instructs the reading program to parse the cam table.

In order to ensure the stability and safety of the movement of the driven shaft, the electronic cam meter reading method comprises the following steps: each change introduced will only come into effect the next spindle cycle to prevent the unpredictable consequences of abrupt changes in the curve to the system. In the process of reading the cam table, firstly, the working type of the cam table is read, then the current position of the spindle is read, and if the position is at the head of the table, whether table switching or data switching is carried out needs to be judged.

The method comprises the following specific steps: as shown in fig. 1, 2, 3, 4, 5, and 6, first, a plurality of tasks of the spindle CAD continuous track file are prepared, and before reading and writing data of the plurality of tasks of the spindle CAD continuous track file, the plurality of tasks of the spindle CAD continuous track file are segmented according to a preset task amount. Because the main shaft and the slave shaft control programs need high synchronism in actual control, the control period can reach 1ms or even lower, if calculation or other tasks need to be completed in such a short control period, the hardware requirement of the system is improved, the cost is increased, and because the uncertainty of the calculation task causes the downtime of the control task, a multi-task mechanism is adopted, another task with a larger period is used for completing the reading and writing of the meter, so that basically no extra load is caused to the main control task, and the automatic control of the auxiliary meter reading and writing task can be completed only by changing the global setting signal in a specific time. Therefore, in the invention, the main shaft CAD continuous track files of a plurality of tasks can be prepared simultaneously according to the task requirements, and then the tasks are arranged according to the requirements and are sequentially recorded into the system.

Then, the main control program reads and writes data of the main shaft CAD continuous track files of a plurality of tasks by adopting a multitask mechanism, buffer table data of the plurality of tasks are sequentially generated according to the data, and then data transplantation is carried out on the buffer table data according to a setting signal to generate current table data of the shaft control task; the data of the buffer table comprises data of a position before the buffer table and data of a position after the buffer table, wherein the data of the position before the buffer table is used as the data of the position before the buffer table to be filled into the data of the position before the buffer table in the transplanting process, and the data of the main shaft CAD continuous track files of a plurality of tasks are read and written simultaneously to generate the data of the position after the buffer table. The current table data comprises current pre-table position data and current post-table position data, wherein in the reading process of the current pre-table position data, the current post-table position data is filled into the current pre-table position data as the pre-table position data, and meanwhile, the buffer table data is subjected to data transplantation to generate the current post-table position data. Then, the main control program sequentially reads the current table data by adopting a multitasking mechanism, performs interpolation processing on the read current table data to obtain a set signal of the main shaft, and then performs shaft pulse conversion on the set signal of the main shaft to obtain a pulse signal of the auxiliary shaft; and simultaneously, sequentially reading the current table data, and performing interpolation processing on the read current table data to obtain a main shaft rear setting signal, and performing zero clearing processing after the main shaft front setting signal is subjected to shaft pulse conversion.

In the process, taking a continuous non-circulating working state as an example, in order to realize synchronization, one group of cam relations correspond to two cam tables, one is a table read by the slave shaft at present, the other is a table used as data buffer, after power is on, the electronic cam is initialized, and the initialized data filling of the two tables is completed. After the working state is entered, as shown in fig. 5, the slave axis always reads the pulse signal of the slave axis obtained by converting the current position data before the table, and then issues a position instruction to control the motion of the slave axis, and meanwhile, in order to prepare the position curves of different tracks of the next period, the main axis pre-setting signal needs to be set to 1, and the main axis pre-setting signal needs to be cleared. After the global variable main shaft rear setting signal is set, the read-write task is triggered, corresponding area data in the buffer table are transplanted into the current table rear position data, the rear part of the electronic cam table data of the next track point is generated and written into the area of the buffer table rear position data, at the moment, the slave shaft reads the pulse signal of the slave shaft obtained through conversion according to the current table front position data, and therefore collision cannot occur. When the main shaft runs to the rear half part, the main shaft front setting signal is set to be 1, the main shaft rear setting signal is set to be 0, the read-write task receives signal triggering, the data of the front position of the buffer table is transplanted to the data of the rear position of the current table, the data of the rear half area of the buffer area is regenerated, and the steps are repeated in a circulating mode. In order to ensure the accuracy and stability of data interaction, a trigger replacement signal in a control period needs to be set, the time requirement of a read-write task and the execution period of the read-write task need to be considered, when the speed of a main shaft and the period of the read-write task meet the requirement of triggering a set signal and before the next part of the read-write task is completed, the main shaft does not move to the other part, and the multitask is the multi-task framework, so that the read-write task can fully complete data exchange and data generation without worrying about errors in the midway, the flexibility of an electronic cam is realized, the generation of an online track can be supported, and the online control is further realized.

Then, the servo driver receives the slave axis pulse signal and controls the motor to execute the slave axis action.

And finally, repeating the steps to realize the dynamic adjustment of the electronic cam in the process of switching a plurality of tasks.

The invention also provides a system for realizing dynamic adjustment of the electronic cam, which comprises a CAD continuous track file 100, a table read-write module 200, a main control module 300, a servo driver 400 and a motor 500, wherein the CAD continuous track file 100 is used for storing a track curve of a main shaft of the electronic cam; the input end of the table read-write module 200 is connected with the CAD continuous track file 100, and the output end thereof is connected with the input end of the main control module 300, and is used for reading data from the CAD continuous track file 100 in a segmented manner so as to continuously obtain buffer table data and a current data table; the output end of the main control module 300 is connected to the input end of the servo driver 400, and is configured to sequentially look up the current data table, perform interpolation to obtain a set signal of the main shaft, and perform shaft pulse conversion according to the set signal of the main shaft to obtain a pulse signal of the auxiliary shaft; the servo driver 400 receives the slave axis pulse signal and controls the motor 500 to execute the slave axis action, thereby realizing the dynamic adjustment of the electronic cam.

Further, the table read-write module 200 includes a partial trajectory data storage unit 204, a shaft position data storage unit 203, an electronic cam buffer table unit 202, and an electronic cam current table unit 201, which are sequentially connected in a communication manner.

Further, the main control module 300 includes a main control program look-up table unit 301 and an axis pulse buffer storage unit 302.

Further, when the user has different requirements, the meter reading and writing module 200 may select different reading and writing methods according to specific situations, the system method is developed based on the IEC61131 platform, includes a multitask model, and does not limit a hardware platform, in this example, the main control module 300 is implemented by using an SFC of a standard language, but an actual implementation manner is not limited.

It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:压力触动型弧线运动控制系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类