Digital Dream Technology support

Title: Save current coords to file [Print This Page]

Author: cnc-kursk    Time: 2018-11-26 20:34
Title: Save current coords to file
Hello.

I need to write script for scanning surface by touch probe.
May I save touching coordinates to file?

It is possible?
Will it possible in new firmware versions?



Author: ytliu    Time: 2018-11-26 21:07
Currently, this function is not supported by the system. If you need to save the coordinates to a file, does the file name have a fixed name? Can you provide more detailed examples?
Author: cnc-kursk    Time: 2018-12-13 14:58
File name does not matter. I need to add current coordinates to a file by G-code command. I can write a script in a loop to get the coordinate cloud of the object. Format of records - comma delim X,Y,Z then new line. Next G-Code append next line in file.

Author: cnc-kursk    Time: 2018-12-13 15:08
Autoleveling, like this:
https://youtu.be/6WNE3E1ZZYY?t=530

Author: cnc-kursk    Time: 2019-3-12 22:10
UP. Any suggestions?
Author: ytliu    Time: 2019-3-14 07:02
I can provide you with a macro function, such as recordc. When using it in G code, the system will append the current coordinate information to a specific file. I don't know if this will meet your requirements.
Author: ytliu    Time: 2019-3-14 12:46
Sorry,  due to the illness of my wife , I did not respond in time recentely.
Hi 71taa,Thank you for your suggestion. Could you explain your ideas more detail?
Author: ytliu    Time: 2019-3-15 17:09
Hi,71taa!
Thank you for your proposal. After I have integrated the opinions of Mr. cnc-kursk, I will confirm the solution and ask for your suggestions.
Author: ytliu    Time: 2019-5-3 20:34
In the attachment, I added two macro functions:
1.RecordCoords[], which can append 4 floating point numbers to the specified file on the USB flash drive. The first parameter is the file serial number, and the next 4 parameters are the recorded data.
E.g:
RecordCoords[3,10.2,5.3,0,0]
"10.2000, 5.3000, 0.0000, 0.0000" will be added to the "ProbeMap3.txt" file of the USB flash drive.
2.ClearCoords[], used to clear the contents of the coordinate file.
E.g:
ClearCoords[2]
The contents of the "ProbeMap2.txt" file of the USB flash drive will be erased.

I think that using these two macro functions, as well as the macro variables associated with the coordinate system, should be able to implement the function of plane probe.



DDCSV Coordinate System Description:

The coordinate systems in DDCSV system include machine coordinate system, G53 coordinate system and G54-G59 coordinate system.

The machine coordinate system is established by home operation or zero under MACH. Read # 864- # 867 (X, Y, Z, A) to get the position in the machine coordinate system.

G53 is based on the machine coordinate system. # 800- # 803 (X, Y, Z, A) describes the distance from the origin of the G53 coordinate system to the origin of the machine coordinate system. Adjusting these parameters can reconstruct the G53 coordinate system. Read # 868- # 871 (X, Y, Z, A) to get the position in G53.

The G54-G59 coordinate system is based on the G53 coordinate system. # 804- # 807 (G54 X, Y, Z, A), # 808- # 811 (G55 X, Y, Z, A), # 812- # 815 (G56 X, Y, Z, A), # 816- # 819 (G57 X, Y, Z, A), # 820- # 823 (G58 X, Y, Z, A) , # 824- # 827 (G59 X, Y, Z, A) respectively describe the distance from the origin of G54-G59 coordinate system to the origin of G53 coordinate system, and you can adjust these parameters to reconstruct the G54-G59;

Read #840-#843(G54 X、Y、Z、A)、#844-#847(G55 X、Y、Z、A)、#848-#851(G56 X、Y、Z、A)、#852-#855(G57 X、Y、Z、A)、#856-#859(G58 X、Y、Z、A)、#860-#863(G59 X、Y、Z、A) to get the position in G54-G59.

#516 describes the system currently working coordinate system, 0 corresponds to the G53 coordinate system, 1-6 corresponds to the G54-G59 coordinate system, 7 corresponds to the machine coordinate system.

Reading #699-#702 can get the coordinates in the current workpiece coordinate system.

test.zip

294 Bytes, Down times: 1381

install.zip

586.4 KB, Down times: 2245


Author: ytliu    Time: 2019-5-4 08:49
this is script for scanning surface by touch probe.You can modify the parameters in this file (#2038-#2047) to customize it. You can also add these parameters to the parameter file (such as eng) so that you can modify it on the parameter page.

scanning_surface.nc content:
O0001(Probe subroutine)
G90G0Z#2044
M101
G91G01Z-#2045F#2046
M102
G04P0
RecordCoords[#2047,#699,#700,#701,#702]
G90G0Z#2043
M99

O0000
#2038=5;Steps every
#2039=0;X-axis start at
#2040=0;Y-axis start at
#2041=100;X-axis end at
#2042=50;Y-axis end at
#2043=3;Clearance height
#2044=0.5;Start probing
#2045=1;Max probe distance
#2046=50robe feedrate
#2047=1;Record file serial number

ClearCoords[#2047]

G0Z#2043
G0X#2039Y#2040

IF [#2041-#2039]>=0 GOTO1
#1=-#2038
GOTO2
N1 #1=#2038
N2 IF [#2042-#2040]>=0 GOTO3
#2=-#2038
GOTO4
N3 #2=#2038
N4 #3=[#2041-#2039]/#1
#4=[#2042-#2040]/#2
#6=0

N5 #6=#6+1
#5=0
N6 #5=#5+1
M98P0001
IF #5>#3 GOTO7
G91G0X#1
GOTO6
N7 IF #6>#4 GOTO8
#1=-#1
G91G0Y#2
GOTO5
N8 G90G0X#2039Y#2040
M99



scanning_surface.zip

580 Bytes, Down times: 2630


Author: ytliu    Time: 2019-5-6 18:38
thank you. If the DDCS processing speed is sufficient, I am going to try to increase the auto level function on the DDCSV.




Welcome Digital Dream Technology support (http://bbs.ddcnc.com/) Powered by Discuz! X3