Unity 3D-based machine tool dynamic cutting simulation system and simulation method

文档序号:85251 发布日期:2021-10-08 浏览:24次 中文

阅读说明:本技术 一种基于Unity3D的机床动态切削模拟系统及模拟方法 (Unity 3D-based machine tool dynamic cutting simulation system and simulation method ) 是由 连昕群 张全條 连永景 于 2021-07-08 设计创作,主要内容包括:本发明提出了一种基于Unity3D的机床动态切削模拟系统,包括切削机床总装,及上位机,以及三维模型,所述切削机床总装包括旋转夹头组件,顶尖组件以及切削刀组件,还包括与旋转夹头组件对应设置的旋转夹头组件调速组件,所述旋转夹头组件调速组件包括若干调速开关,所述调速开关通讯连接上位机,上位机根据调速开关信号,确定三维模型中对应旋转夹头组件的动作;本申请解决了在纯软件实验做完实验后无法进行真实的调试,从没接触过任硬件设备的虚幻感;同时又避免了纯硬件模拟实验现像的不直观问题;避免了纯硬件真实模型实验机构成本高、易损坏、不直观、存在安全事故等问题。做到了虚拟与现实的完美结合。(The invention provides a dynamic cutting simulation system of a machine tool based on Unity3D, which comprises a cutting machine tool assembly, an upper computer and a three-dimensional model, wherein the cutting machine tool assembly comprises a rotating chuck component, a top component and a cutting knife component, and further comprises a rotating chuck component speed regulation component arranged corresponding to the rotating chuck component, the rotating chuck component speed regulation component comprises a plurality of speed regulation switches, the speed regulation switches are in communication connection with the upper computer, and the upper computer determines the action of the corresponding rotating chuck component in the three-dimensional model according to a speed regulation switch signal; the method and the device solve the problems that after a pure software experiment is finished, real debugging cannot be carried out, and the illusion of any hardware equipment is never touched; meanwhile, the problem of non-intuition of a pure hardware simulation experiment image is avoided; the problems that a pure hardware real model experiment mechanism is high in cost, easy to damage, not intuitive, safe in accidents and the like are solved. The perfect combination of virtual and reality is achieved.)

1. A dynamic cutting simulation system of a machine tool based on Unity3D is characterized in that: the cutting machine tool assembly comprises a rotary chuck assembly, a top assembly, a cutting tool assembly and a rotary chuck assembly speed regulation assembly, wherein the rotary chuck assembly speed regulation assembly is arranged corresponding to the rotary chuck assembly and comprises a plurality of speed regulation switches;

the center assembly left-right adjusting assembly comprises a first rotating hand wheel, the first rotating hand wheel is connected with a first encoder, the first encoder is connected with a data acquisition board card, and the data acquisition board card transmits acquired data to the upper computer through a serial port; the upper computer analyzes the data to determine the action of the corresponding centre assembly in the three-dimensional model;

the cutting tool assembly front-back adjusting assembly is corresponding to the cutting tool assembly, and the cutting tool assembly left-right coarse adjusting assembly and the cutting tool assembly left-right fine adjusting assembly are arranged on the cutting tool assembly front-back adjusting assembly;

the front-back adjusting assembly of the cutting knife assembly comprises a first rotating hand wheel, and the first rotating hand wheel is connected with a first encoder; the left and right coarse adjustment assembly of the cutting knife assembly comprises a third rotating hand wheel, and the third rotating hand wheel is connected with a third encoder; the second encoder and the third encoder are connected with a data acquisition board card, and the data acquisition board card transmits acquired data to the upper computer through a serial port; the upper computer analyzes the data to determine the action of the front and back adjusting assembly and the left and right rough adjusting assembly of the corresponding cutting knife assembly in the three-dimensional model;

the left and right fine adjustment assembly of the cutting knife assembly comprises a fourth rotating hand wheel; the fourth rotating hand wheel is in communication connection with the upper computer, and the upper computer determines the action of the left and right fine adjustment assemblies corresponding to the cutting knife assembly in the three-dimensional model according to the speed regulation switch signal.

2. The Unity 3D-based machine tool dynamic cutting simulation system according to claim 1, wherein: the cutting knife assembly comprises a rotating shaft body, a knife rest mounting frame is fixed on the rotating shaft body, and a rotating handle is arranged at the top end of the rotating shaft body; the cutter mounting frame comprises an upper pressing plate and a lower pressing plate and comprises four cutters, the four cutters are fixed between the upper pressing plate and the lower pressing plate, and cutter heads of the cutters face to the left, the right, the front and the back directions respectively; the cutting tool assembly is characterized by also comprising a cutting tool assembly mounting plate, wherein three sensors are arranged on the cutting tool assembly mounting plate; the four end corners of the bottom surface of the lower pressing plate are provided with induction pieces which are arranged regularly; when the rotating handle is rotated, the currently used cutter is judged by identifying the sensing pieces which are arranged according to different rules.

3. A dynamic cutting simulation method of a machine tool based on Unity3D is characterized in that: the method comprises the following steps:

the method comprises the following steps: under a Unity3D development environment, a virtual machine tool component three-dimensional model corresponding to an actual machine tool component is created, and a virtual turning workpiece body is modeled by adopting a circular table discrete method;

step two: establishing an action relation between a centre assembly in the actual machine tool assembly and a centre assembly of a virtual lathe in a virtual machine tool assembly model; the device is used for simulating the fixing action of the virtual turning workpiece;

step three: determining the rotating speed of a main shaft of a machine tool in the virtual machine tool component model; and associating into said virtual machine tool component model;

determining the rotating speed of a machine tool spindle in the virtual machine tool component model by adopting a formula (1):

m=0.12n°/t (1)

wherein t is 20ms, n is the actual machine tool rotating speed, and m is the virtual machine tool rotating speed;

step four: determining the angle of a virtual machine tool cutter in the virtual machine tool component model; and associating into said virtual machine tool component model;

step five: determining the current position of a virtual machine tool cutter relative to a virtual machine tool spindle in the virtual machine tool component model; and associating into said virtual machine tool component model;

step six: judging whether the virtual machine tool cutter in the model collides with a virtual machine tool spindle;

step seven: if collision occurs, the outer diameter of the contact point of the virtual machine tool main shaft and the virtual machine tool is continuously reduced; until the virtual machine tool cutter is separated from the virtual machine tool spindle.

4. The dynamic cutting simulation method of the machine tool based on the Unity3D as claimed in claim 3, wherein: in the first step, the method for modeling the virtual turning workpiece body by adopting the circular truncated cone discrete method comprises the following steps:

s1: establishing a unit slice, wherein the shape of the unit slice is determined according to the section shape of the cutting workpiece;

s2: stacking a plurality of unit sheets in a fixed direction with the unit sheets established in step S1 as base points; and forming a turning workpiece to be machined.

5. The dynamic cutting simulation method of the machine tool based on the Unity3D as claimed in claim 3, wherein: the method for judging whether the virtual machine tool cutter in the model collides with the virtual machine tool spindle comprises the following steps;

a1: adding a first trigger in each unit sheet;

a2: adding rigid body attribute and a second trigger on the tool nose of the virtual machine tool;

a3: if the tool nose of the virtual machine tool collides with one unit slice, triggering collision detection, and acquiring the object attribute of the collided unit slice in the collision detection;

a4: narrowing down the collided unit sheets in the step A3 according to the object attributes of the unit sheets;

wherein, a coordinate system is established by taking the central point of the unit slice as the center of a circleSetting the initial value of the unit sheet in the X-axis and Y-axis directions to X0And y0(ii) a Setting the current values of the unit sheets in the X-axis and Y-axis directions to XnAnd ynAnd the variation of the unit slice on the X axis and the Y axis is used as the index of the reduction of the unit slice;

simulating a cutting process; every other T1ms, detecting the object attribute of the collided unit slice once;

if it is a collision state, and xn>When 0, the unit sheet has a value of Y in the X-axis and Y-axis directionsn=xn=xn-1-0.008。

6. The dynamic cutting simulation method of the machine tool based on the Unity3D as claimed in claim 3, wherein: the method comprises the following steps of establishing an action relation between a centre assembly in the actual machine tool assembly and a centre assembly of a virtual machine tool in a virtual machine tool assembly model:

d1, in the actual machine tool, a first encoder is arranged on a moving hand wheel for controlling the tailstock center, and the front and back movement of the center can be determined according to the value of the first encoder.

D2: reading the current value D of the first encodernIt is compared with the last value Dn-1The comparison is carried out to obtain the delta D,

d3, the moving distance D of the virtual machine tool tailstock center is obtained by the following formula (2):

d=△D*0.00003 (2)

d4 reading the position E of the current tailstock center in the three-dimensional modeln(ii) a The final position E is obtained by the formula (3)n+

En+1=En+d; (3)

D5, calculating the rotation angle of a control center moving hand wheel in the three-dimensional model; the specific method comprises the following steps: setting the angles of a control center moving hand wheel in the three-dimensional model at present as (alpha 3, beta 3, gamma 3) in the xyz direction; the rotary handle only changes in the x-direction, so alpha 3 ═ Dn(ii) a Continuously changing, and finally rotating the handle to an angle of (-D)n,β3,γ3)。

7. The dynamic cutting simulation method of the machine tool based on the Unity3D as claimed in claim 3, wherein: the method of determining the current position of the virtual machine tool relative to the virtual machine tool spindle comprises the following:

b1: determining the front-back movement current position of the virtual machine tool, specifically comprising the following substeps:

a1, in the practical machine tool, a second encoder is connected on a hand wheel for controlling the cutter to move forward and backward, and the forward and backward trend of the cutter is determined according to the signal of the second encoder, namely the cutter moves forward or backward;

a2 reading the current value of the second encoder as anIt is compared with the last value an-1The comparison is carried out to obtain the delta a,

a3, in the actual machine tool, controlling a tool to move back and forth and rotating a hand wheel for one circle, wherein the moving distance of a tool workbench is 80 mm; the virtual tool movement distance b is obtained by equation (4):

b=△a*0.000025 (4)

a4 reading the position c of the existing tool in the three-dimensional modeln(ii) a Obtaining a final position c in the three-dimensional model by the formula (5)n+1

I.e. cn+1=cn+b; (5)

a5, calculating the rotation angle of a hand wheel for controlling the forward and backward movement of the cutter in the three-dimensional model; the specific method comprises the following steps: setting the angles of the front and back moving hand wheel of the control cutter in the three-dimensional model to be (alpha 1, beta 1, gamma 1) in the xyz direction; the rotary handle only changes in the x direction, so alpha 1 ═ an(ii) a Continuously changing, and finally rotating the handle to an angle of (-a)n,β1,γ1)。

B2: determining the current left-right movement position of the virtual machine tool, specifically comprising the following substeps:

b1, in the actual machine tool, a hand wheel for controlling the left and right movement of the cutter is connected with a third encoder, and the left and right trend of the cutter is determined according to the signal of the third encoder, namely the left movement or the right movement;

b2 reading the current value of the third encoder as AnIt is compared with the last value An-1The comparison is carried out to obtain the delta A,

b3, controlling a tool to move back and forth and rotating a hand wheel for one circle in an actual machine tool, wherein the moving distance of a tool workbench is 100 mm; the virtual tool movement distance B is obtained by equation (6):

B=△A*0.0001 (6)

b4 reading the position C of the existing tool in the three-dimensional modeln(ii) a Obtaining the final position C in the three-dimensional model by the formula (7)n+1

I.e. Cn+1=Cn+B; (7);

b5, calculating the rotation angle of a hand wheel for controlling the left and right movement of the cutter in the three-dimensional model; the specific method comprises the following steps: setting the angles of the hand wheel for controlling the cutter to move back and forth in the three-dimensional model at present as (alpha 2, beta 2, gamma 2) in the xyz direction; the rotary handle only changes in the x direction, so alpha 2 ═ -an(ii) a Continuously changing, and finally rotating the handle to an angle of (-A)n,β1,γ1)。

Technical Field

The invention belongs to the technical field of practical training systems, and particularly relates to a Unity 3D-based dynamic cutting simulation system and method for a machine tool.

Background

The cutting practical training equipment of the numerical control lathe is mainly used for teaching of vocational schools and vocational education training institutions, generally comprises entity units such as a numerical control system, a servo unit, logic control and a low-voltage electric appliance, and has the problems of large occupied volume, high cost, easiness in damage, invisibility, safety accidents and the like; the device also comprises a pure software training device which has the defects that real debugging can not be carried out after an experiment is finished, and the illusion that any hardware equipment is not contacted exists; therefore, how to combine the physical device with the virtual simulation model is a problem to be solved;

for a simulation system of a simulated lathe, dynamic simulation mainly comprises two aspects: one aspect is motion simulation of moving parts, mainly motion relations among a main shaft, a tool rest and a tailstock of a machine tool, and motion forms comprise rotation and speed regulation of the main shaft, translation and automatic feeding of the tool rest and translation of the tailstock. The other aspect is mainly dynamic cutting process animation and material forming. The animation relates to real-time cutting effect display, and the similarity of the animation is consistent with the similarity of an actual processing system, so that the real-time performance is high; therefore, in order to realize the combination of the real machine tool cutting practical training equipment and the virtual three-dimensional practical training model, the above aspects are the technical problems to be solved urgently.

Disclosure of Invention

The invention provides a Unity 3D-based machine tool dynamic cutting simulation system and a simulation method, which solve the defects in the prior art in the background technology.

The technical scheme of the invention is realized as follows:

a dynamic cutting simulation system of a machine tool based on Unity3D comprises a cutting machine tool assembly, an upper computer and a three-dimensional model, wherein the cutting machine tool assembly comprises a rotating chuck component, a tip component and a cutting knife component, and further comprises a rotating chuck component speed regulation component which is arranged corresponding to the rotating chuck component, the rotating chuck component speed regulation component comprises a plurality of speed regulation switches, the speed regulation switches are in communication connection with the upper computer, and the upper computer determines the action of the corresponding rotating chuck component in the three-dimensional model according to the speed regulation switch signal;

the center assembly left-right adjusting assembly comprises a first rotating hand wheel, the first rotating hand wheel is connected with a first encoder, the first encoder is connected with a data acquisition board card, and the data acquisition board card transmits acquired data to the upper computer through a serial port; the upper computer analyzes the data to determine the action of the corresponding centre assembly in the three-dimensional model;

the cutting tool assembly front-back adjusting assembly is corresponding to the cutting tool assembly, and the cutting tool assembly left-right coarse adjusting assembly and the cutting tool assembly left-right fine adjusting assembly are arranged on the cutting tool assembly front-back adjusting assembly;

the front-back adjusting assembly of the cutting knife assembly comprises a first rotating hand wheel, and the first rotating hand wheel is connected with a first encoder; the left and right coarse adjustment assembly of the cutting knife assembly comprises a third rotating hand wheel, and the third rotating hand wheel is connected with a third encoder; the second encoder and the third encoder are connected with a data acquisition board card, and the data acquisition board card transmits acquired data to the upper computer through a serial port; the upper computer analyzes the data to determine the action of the front and back adjusting assembly and the left and right rough adjusting assembly of the corresponding cutting knife assembly in the three-dimensional model;

the left and right fine adjustment assembly of the cutting knife assembly comprises a fourth rotating hand wheel; the fourth rotating hand wheel is in communication connection with the upper computer, and the upper computer determines the action of the left and right fine adjustment assemblies corresponding to the cutting knife assembly in the three-dimensional model according to the speed regulation switch signal.

Preferably, the cutting blade assembly comprises a rotating shaft body, a blade carrier mounting frame is fixed on the rotating shaft body, and a rotating handle is arranged at the top end of the rotating shaft body; the cutter mounting frame comprises an upper pressing plate and a lower pressing plate and comprises four cutters, the four cutters are fixed between the upper pressing plate and the lower pressing plate, and cutter heads of the cutters face to the left, the right, the front and the back directions respectively; the cutting tool assembly is characterized by also comprising a cutting tool assembly mounting plate, wherein three sensors are arranged on the cutting tool assembly mounting plate; the four end corners of the bottom surface of the lower pressing plate are provided with induction pieces which are arranged regularly; when the rotating handle is rotated, the currently used cutter is judged by identifying the sensing pieces which are arranged according to different rules.

A dynamic cutting simulation method of a machine tool based on Unity3D comprises the following steps:

the method comprises the following steps: under a Unity3D development environment, a virtual machine tool component three-dimensional model corresponding to an actual machine tool component is created, and a virtual turning workpiece body is modeled by adopting a circular table discrete method;

step two: establishing an action relation between a centre assembly in the actual machine tool assembly and a centre assembly of a virtual lathe in a virtual machine tool assembly model; the device is used for simulating the fixing action of the virtual turning workpiece;

step three: determining the rotating speed of a main shaft of a machine tool in the virtual machine tool component model; and associating into said virtual machine tool component model;

determining the rotating speed of a machine tool spindle in the virtual machine tool component model by adopting a formula (1):

m=0.12n°/t (1)

wherein t is 20ms, n is the actual machine tool rotating speed, and m is the virtual machine tool rotating speed;

step four: determining the angle of a virtual machine tool cutter in the virtual machine tool component model; and associating into said virtual machine tool component model;

step five: determining the current position of a virtual machine tool cutter relative to a virtual machine tool spindle in the virtual machine tool component model; and associating into said virtual machine tool component model;

step six: judging whether the virtual machine tool cutter in the model collides with a virtual machine tool spindle;

step seven: if collision occurs, the outer diameter of the contact point of the virtual machine tool main shaft and the virtual machine tool is continuously reduced; until the virtual machine tool cutter is separated from the virtual machine tool spindle.

Preferably, the method for modeling the virtual turning workpiece body by adopting the circular truncated cone discretization method in the first step comprises the following steps:

s1: establishing a unit slice, wherein the shape of the unit slice is determined according to the section shape of the cutting workpiece;

s2: stacking a plurality of unit sheets in a fixed direction with the unit sheets established in step S1 as base points; and forming a turning workpiece to be machined.

Preferably, the method for judging whether the virtual machine tool in the model collides with the virtual machine tool spindle in the fourth step comprises the following steps;

a1: adding a first trigger in each unit sheet;

a2: adding rigid body attribute and a second trigger on the tool nose of the virtual machine tool;

a3: if the tool nose of the virtual machine tool collides with one unit slice, triggering collision detection, and acquiring the object attribute of the collided unit slice in the collision detection;

a4: narrowing down the collided unit sheets in the step A3 according to the object attributes of the unit sheets;

wherein, a coordinate system is established by taking the central point of the unit slice as the center of a circle, and the initial value of the unit slice in the X-axis and Y-axis directions is set as X0And y0(ii) a Setting the current values of the unit sheets in the X-axis and Y-axis directions to XnAnd ynAnd the variation of the unit slice on the X axis and the Y axis is used as the index of the reduction of the unit slice;

simulating a cutting process; every other T1ms, detecting the object attribute of the collided unit slice once;

if it is a collision state, and xn>When 0, the unit sheet has a value of Y in the X-axis and Y-axis directionsn=xn=xn-1-0.008。

Preferably, the method for establishing the action relationship between the center assembly in the actual machine tool assembly and the center assembly of the virtual machine tool in the virtual machine tool assembly model comprises the following steps:

d1, in the actual machine tool, a first encoder is arranged on a moving hand wheel for controlling the tailstock center, and the front and back movement of the center can be determined according to the value of the first encoder.

D2: reading the current value D of the first encodernIt is compared with the last value Dn-1The comparison is carried out to obtain the delta D,

d3, the moving distance D of the virtual machine tool tailstock center is obtained by the following formula (2):

d=△D*0.00003 (2)

d4 reading the current tailstock center in the three-dimensional modelPosition E ofn(ii) a The final position E is obtained by the formula (3)n+

En+1=En+d; (3)

D5, calculating the rotation angle of a control center moving hand wheel in the three-dimensional model; the specific method comprises the following steps: setting the angles of a control center moving hand wheel in the three-dimensional model at present as (alpha 3, beta 3, gamma 3) in the xyz direction; the rotary handle only changes in the x-direction, so alpha 3 ═ Dn(ii) a Continuously changing, and finally rotating the handle to an angle of (-D)n,β3,γ3)。

Preferably, the method of determining the current position of the virtual machine tool relative to the virtual machine tool spindle comprises the following:

b1: determining the front-back movement current position of the virtual machine tool, specifically comprising the following substeps:

a1, in the practical machine tool, a second encoder is connected on a hand wheel for controlling the cutter to move forward and backward, and the forward and backward trend of the cutter is determined according to the signal of the second encoder, namely the cutter moves forward or backward;

a2 reading the current value of the second encoder as anIt is compared with the last value an-1The comparison is carried out to obtain the delta a,

a3, in the actual machine tool, controlling a tool to move back and forth and rotating a hand wheel for one circle, wherein the moving distance of a tool workbench is 80 mm; the virtual tool movement distance b is obtained by equation (4):

b=△a*0.000025 (4)

a4 reading the position c of the existing tool in the three-dimensional modeln(ii) a Obtaining a final position c in the three-dimensional model by the formula (5)n+1

I.e. cn+1=cn+b; (5)

a5, calculating the rotation angle of a hand wheel for controlling the forward and backward movement of the cutter in the three-dimensional model; the specific method comprises the following steps: setting the angles of the front and back moving hand wheel of the control cutter in the three-dimensional model to be (alpha 1, beta 1, gamma 1) in the xyz direction; the rotary handle only changes in the x direction, so alpha 1 ═ an(ii) a Continuously changing, and finally rotating the handle to an angle of (-a)n,β1,γ1)。

B2: determining the current left-right movement position of the virtual machine tool, specifically comprising the following substeps:

b1, in the actual machine tool, a hand wheel for controlling the left and right movement of the cutter is connected with a third encoder, and the left and right trend of the cutter is determined according to the signal of the third encoder, namely the left movement or the right movement;

b2 reading the current value of the third encoder as AnIt is compared with the last value An-1The comparison is carried out to obtain the delta A,

b3, controlling a tool to move back and forth and rotating a hand wheel for one circle in an actual machine tool, wherein the moving distance of a tool workbench is 100 mm; the virtual tool movement distance B is obtained by equation (6):

B=△A*0.0001 (6)

b4 reading the position C of the existing tool in the three-dimensional modeln(ii) a Obtaining the final position C in the three-dimensional model by the formula (7)n+1

I.e. Cn+1=Cn+B; (7);

b5, calculating the rotation angle of a hand wheel for controlling the left and right movement of the cutter in the three-dimensional model; the specific method comprises the following steps: setting the angles of the hand wheel for controlling the cutter to move back and forth in the three-dimensional model at present as (alpha 2, beta 2, gamma 2) in the xyz direction; the rotary handle only changes in the x direction, so alpha 2 ═ -an(ii) a Continuously changing, and finally rotating the handle to an angle of (-A)n,β1,γ1)。

In summary, the invention has the advantages that:

according to the dynamic cutting simulation system and the dynamic cutting simulation method for the machine tool based on the Unity3D, the combination of the entity practical training machine tool and the three-dimensional simulation model is realized according to the simulation of the state of the main shaft of the machine tool, the simulation of the current state of the cutter and the simulation of cutting of a workpiece to be cut, so that the problem that the real debugging cannot be carried out after a pure software experiment is finished is solved, and the unreal sense of any hardware equipment is never contacted; meanwhile, the problem of non-intuition of a pure hardware simulation experiment image is avoided; the problems that a pure hardware real model experiment mechanism is high in cost, easy to damage, not intuitive, safe in accidents and the like are solved. The perfect combination of virtual and reality is achieved.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.

FIG. 1 is a schematic structural diagram of a dynamic cutting simulation system of a machine tool based on Unity3D according to the present invention;

FIG. 2 is an enlarged schematic view of A of FIG. 1;

fig. 3 is a partially disassembled schematic view of the cutting blade assembly of fig. 1.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.

Example 1

As shown in fig. 1-3, a Unity 3D-based machine tool dynamic cutting simulation system comprises a cutting machine tool assembly 1, an upper computer 2 and a three-dimensional model, wherein the cutting machine tool assembly comprises a rotating chuck component 3, a tip component 4, a cutting tool component 5 and a rotating chuck component speed regulation component 6 which is arranged corresponding to the rotating chuck component, the rotating chuck component speed regulation component comprises a plurality of speed regulation switches 7, the speed regulation switches are in communication connection with the upper computer, and the upper computer determines the action of the corresponding rotating chuck component in the three-dimensional model according to a speed regulation switch signal;

the center assembly left-right adjusting assembly corresponds to the center assembly and comprises a first rotating hand wheel 8, the first rotating hand wheel is connected with a first encoder, the first encoder is connected with a data acquisition board card, and the data acquisition board card transmits acquired data to the upper computer through a serial port; the upper computer analyzes the data to determine the action of the corresponding centre assembly in the three-dimensional model;

the cutting tool assembly front-back adjusting assembly is corresponding to the cutting tool assembly, and the cutting tool assembly left-right coarse adjusting assembly and the cutting tool assembly left-right fine adjusting assembly are arranged on the cutting tool assembly front-back adjusting assembly;

the front and rear adjusting assembly of the cutting knife assembly comprises a second rotating hand wheel 9 which is connected with a second encoder; the left and right coarse adjustment component of the cutting knife component comprises a third rotating hand wheel 10 which is connected with a third encoder; the second encoder and the third encoder are connected with a data acquisition board card, and the data acquisition board card transmits acquired data to the upper computer through a serial port; the upper computer analyzes the data to determine the action of the front and back adjusting assembly and the left and right rough adjusting assembly of the corresponding cutting knife assembly in the three-dimensional model;

the left and right fine adjustment assembly of the cutting knife assembly comprises a fourth rotating hand wheel 11; the fourth rotating hand wheel is in communication connection with the upper computer, and the upper computer determines the action of the left and right fine adjustment assemblies corresponding to the cutting knife assembly in the three-dimensional model according to the speed regulation switch signal.

The cutting blade assembly comprises a rotating shaft body 12, a blade carrier mounting frame is fixed on the rotating shaft body, and a rotating handle 14 is arranged at the top end of the rotating shaft body; the cutter mounting frame comprises an upper pressing plate 15 and a lower pressing plate 16 and comprises four cutters 17, the four cutters are fixed between the upper pressing plate and the lower pressing plate, and cutter heads of the cutters face to the left, the right, the front and the back directions respectively; the device also comprises a cutting knife component mounting plate 19, wherein three sensors 20 are arranged on the cutting knife component mounting plate; the four end corners of the bottom surface of the lower pressing plate are provided with induction pieces 21 which are arranged regularly; when the rotating handle is rotated, the currently used cutter is judged by identifying the sensing pieces which are arranged according to different rules. Specifically, three sensors 20 are arranged on one end corner of the cutting knife assembly mounting plate; at least one sensing piece is arranged on each of the four end corners of the bottom surface of the lower pressing plate, and the arrangement of the sensing pieces on each end corner is different.

The above parts are hardware structures of the present application; the process of simulating the cutting action of the machine tool mainly comprises three states needing to be simulated; the method comprises the steps of (1) simulating the rotating speed of a main shaft; (2) simulating the current position and action of the cutting knife assembly; (3) during cutting, simulating the form change of the workpiece; the specific simulation method is as follows:

a dynamic cutting simulation method of a machine tool based on Unity3D comprises the following steps:

the method comprises the following steps: under a Unity3D development environment, a virtual machine tool component three-dimensional model corresponding to an actual machine tool component is created, and a virtual turning workpiece body is modeled by adopting a circular table discrete method;

step two: establishing an action relation between a centre assembly in the actual machine tool assembly and a centre assembly of a virtual lathe in a virtual machine tool assembly model; the device is used for simulating the fixing action of the virtual turning workpiece;

step three: determining the rotating speed of a main shaft of a machine tool in the virtual machine tool component model; and associating into said virtual machine tool component model;

determining the rotating speed of a machine tool spindle in the virtual machine tool component model by adopting a formula (1):

m=0.12n°/t (1)

wherein t is 20ms, n is the actual machine tool rotating speed, and m is the virtual machine tool rotating speed;

step four: determining the angle of a virtual machine tool cutter in the virtual machine tool component model; and associating into said virtual machine tool component model;

step five: determining the current position of a virtual machine tool cutter relative to a virtual machine tool spindle in the virtual machine tool component model; and associating into said virtual machine tool component model;

step six: judging whether the virtual machine tool cutter in the model collides with a virtual machine tool spindle;

step seven: if collision occurs, the outer diameter of the contact point of the virtual machine tool main shaft and the virtual machine tool is continuously reduced; until the virtual machine tool cutter is separated from the virtual machine tool spindle.

The method for modeling the virtual turning workpiece body by adopting the circular truncated cone discrete method in the first step comprises the following steps:

s1: establishing a unit slice, wherein the shape of the unit slice is determined according to the section shape of the cutting workpiece;

s2: stacking a plurality of unit sheets in a fixed direction with the unit sheets established in step S1 as base points; and forming a turning workpiece to be machined.

The turning workpiece body model created in this embodiment is a cylinder with a diameter of 200 and a height of 600, and the dividing method is to divide the whole cylinder into 600 slices equally along the height direction, so that, as each slice is a small cylinder with a diameter of 200 and a height of 1, the larger the number of slices divided by this method, the higher the processing accuracy of the virtual turning simulation is, but the larger the influence on the speed of image rendering is.

The method for judging whether the virtual machine tool cutter in the model collides with the virtual machine tool spindle comprises the following steps;

a1: adding a first trigger in each unit sheet;

a2: adding rigid body attribute and a second trigger on the tool nose of the virtual machine tool;

a3: if the tool nose of the virtual machine tool collides with one unit slice, triggering collision detection, and acquiring the object attribute of the collided unit slice in the collision detection;

a4: narrowing down the collided unit sheets in the step A3 according to the object attributes of the unit sheets;

wherein, a coordinate system is established by taking the central point of the unit slice as the center of a circle, and the initial value of the unit slice in the X-axis and Y-axis directions is set as X0And y0(ii) a Setting the current values of the unit sheets in the X-axis and Y-axis directions to XnAnd ynAnd the variation of the unit slice on the X axis and the Y axis is used as the index of the reduction of the unit slice;

simulating a cutting process; detecting the object attribute of the collided unit sheet once every 20 ms;

if it is a collision state, and xn>When 0, the unit sheet has a value of Y in the X-axis and Y-axis directionsn=xn=xn-1-0.008。

The method comprises the following steps of establishing an action relation between a centre assembly in the actual machine tool assembly and a centre assembly of a virtual machine tool in a virtual machine tool assembly model:

d1, in the actual machine tool, a first encoder is arranged on a moving hand wheel for controlling the tailstock center, and the front and back movement of the center can be determined according to the value of the first encoder.

D2: reading the current value D of the first encodernIt is compared with the last value Dn-1The comparison is carried out to obtain the delta D,

d3, the moving distance D of the virtual machine tool tailstock center is obtained by the following formula (2):

d=△D*0.00003 (2)

d4 reading the position E of the current tailstock center in the three-dimensional modeln(ii) a The final position E is obtained by the formula (3)n+

En+1=En+d; (3)

D5, calculating the rotation angle of a control center moving hand wheel in the three-dimensional model; the specific method comprises the following steps: setting the angles of a control center moving hand wheel in the three-dimensional model at present as (alpha 3, beta 3, gamma 3) in the xyz direction; the rotary handle only changes in the x-direction, so alpha 3 ═ Dn(ii) a Continuously changing, and finally rotating the handle to an angle of (-D)n,β3,γ3).

Preferably, the method of determining the current position of the virtual machine tool relative to the virtual machine tool spindle comprises the following:

b1: determining the front-back movement current position of the virtual machine tool, specifically comprising the following substeps:

a1, in the practical machine tool, a second encoder is connected on a hand wheel for controlling the cutter to move forward and backward, and the forward and backward trend of the cutter is determined according to the signal of the second encoder, namely the cutter moves forward or backward;

a2 reading the current value of the second encoder as anIt is compared with the last value an-1The comparison is carried out to obtain the delta a,

a3, in the actual machine tool, controlling a tool to move back and forth and rotating a hand wheel for one circle, wherein the moving distance of a tool workbench is 80 mm; the virtual tool movement distance b is obtained by equation (4):

b=△a*0.000025 (4)

a4 reading the position c of the existing tool in the three-dimensional modeln(ii) a Obtaining a final position c in the three-dimensional model by the formula (5)n+1

I.e. cn+1=cn+b;(5)

a5, calculating the rotation angle of a hand wheel for controlling the forward and backward movement of the cutter in the three-dimensional model; the specific method comprises the following steps: setting the angles of the front and back moving hand wheel of the control cutter in the three-dimensional model to be (alpha 1, beta 1, gamma 1) in the xyz direction; the rotary handle only changes in the x direction, so alpha 1 ═ an(ii) a Continuously changing, and finally rotating the handle to an angle of (-a)n,β1,γ1)。

B2: determining the current left-right movement position of the virtual machine tool, specifically comprising the following substeps:

b1, in the actual machine tool, a hand wheel for controlling the left and right movement of the cutter is connected with a third encoder, and the left and right trend of the cutter is determined according to the signal of the third encoder, namely the left movement or the right movement;

b2 reading the current value of the third encoder as AnIt is compared with the last value An-1The comparison is carried out to obtain the delta A,

b3, controlling a tool to move back and forth and rotating a hand wheel for one circle in an actual machine tool, wherein the moving distance of a tool workbench is 100 mm; the virtual tool movement distance B is obtained by equation (6):

B=△A*0.0001 (6)

b4 reading the position C of the existing tool in the three-dimensional modeln(ii) a Obtaining the final position C in the three-dimensional model by the formula (7)n+1

I.e. Cn+1=Cn+B; (7);

b5, calculating the rotation angle of a hand wheel for controlling the left and right movement of the cutter in the three-dimensional model; the specific method comprises the following steps: setting the angles of the hand wheel for controlling the cutter to move back and forth in the three-dimensional model at present as (alpha 2, beta 2, gamma 2) in the xyz direction; the rotary handle only changes in the x direction, so alpha 2 ═ -an(ii) a Continuously changing, and finally rotating the handle to an angle of (-A)n,β1,γ1)。

The application has the following advantages: the shape is visual: the three-dimensional model design is the same as a real mechanism, and operations such as zooming, dragging, rotating, visual angle restoring and the like can be carried out. The special parts are subjected to transparent processing, amplification processing, visualization processing, slow motion processing and the like, and are more visual in shape compared with a real object mechanism; safe and reliable: through three-dimensional simulation operation, the same experiment with a real mechanism is completed, and meanwhile, safety accidents such as personal electric shock safety accidents, hand clamping collision during mechanical operation and the like are avoided; no abrasion, failure and the like caused by long-time operation of equipment; equipment damage and the like caused by misoperation of students do not exist; the device is an experimental mechanism with no failure and no safety accident; the expansibility is strong: other experimental projects can be expanded according to the needs of schools only by software definition without hardware upgrading, and the schools are supported to carry out personalized function customization; perfect combination of deficiency and excess: the mechanism which is easy to damage is simulated through software, the phenomenon that naked eyes cannot observe conveniently is simulated, and the mechanism with safety accident risk is simulated. The data acquisition output card is connected with a hardware PLC, a singlechip and other objects, so that actual connection, programming and debugging can be manually carried out, the authenticity and the embodiment sense of an experiment are ensured, and the manual ability of students is exercised. The problem that real debugging cannot be carried out after a pure software experiment is finished and the illusion of any hardware equipment is never contacted is solved; meanwhile, the problem of non-intuition of a pure hardware simulation experiment image is avoided; the problems that a pure hardware real model experiment mechanism is high in cost, easy to damage, not intuitive, safe in accidents and the like are solved. The perfect combination of virtual and reality is achieved.

The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于递推最小二乘法的铣削力在线识别方法及系统

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!

技术分类