Getting the current axes coordinates - On 2 Page - DDCSV2.1 - Standalone CNC Motion Controller - Digital Dream Technology support
Author: Nikolay81
Print Previous Topic Next Topic

Getting the current axes coordinates

[Copy Link]

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
Landlord
Posted at 2018-10-19 21:02:22 | All floors
Sorry, I am on a business trip these days. I will reply to you when I go back.
Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
Sofa
Posted at 2018-10-28 07:25:05 | All floors
Last edited by ytliu In 2018-10-28 07:31 Editor

The DDCSV system supports user-defined G code (G100-G199). The user can add the corresponding subroutine in slib.nc to customize the G code. The subroutine O9100-O9199 corresponds to G100-G199.

The following macro variables provide support for user-defined G code:

#451-#454 is the position of the workpiece coordinate system at the end of the current Gcode line

#448 is used to identify G20/G21 mode, #448=25.4 in G20 mode, #448=1 in G21 mode
#449 is used to identify G98/G99 mode, #449=1 in G99 mode, #449=-1 in G98 mode
#450 is used to identify G90/G91 mode, #450=1 in G90 (G90.1) mode, #450=-1 in G91 (G91.1) mode

#420 is used to identify whether there is X size word in the current Gcode line. If it exists, #420=1, otherwise #420=0
#421 is used to identify whether there is Y size word in the current Gcode line. If it exists, #421=1, otherwise #421=0
#422 is used to identify whether there is Z size word in the current Gcode line. If it exists, #422=1, otherwise #422=0
#423 is used to identify whether there is A size word in the current Gcode line. If it exists, #423=1, otherwise #423=0
#424 is used to identify whether there is B size word in the current Gcode line. If it exists, #424=1, otherwise #424=0
#425 is used to identify whether there is C size word in the current Gcode line. If it exists, #425=1, otherwise #425=0
#426 is used to identify whether there is I size word in the current Gcode line. If it exists, #426=1, otherwise #426=0
#427 is used to identify whether there is J size word in the current Gcode line. If it exists, #427=1, otherwise #427=0
#428 is used to identify whether there is K size word in the current Gcode line. If it exists, #428=1, otherwise #428=0
#429 is used to identify whether there is R size word in the current Gcode line. If it exists, #429=1, otherwise #429=0
#430 is used to identify whether there is L size word in the current Gcode line. If it exists, #430=1, otherwise #430=0
#431 is used to identify whether there is H size word in the current Gcode line. If it exists, #431=1, otherwise #431=0
#432 is used to identify whether there is P size word in the current Gcode line. If it exists, #432=1, otherwise #432=0
#433 is used to identify whether there is Q size word in the current Gcode line. If it exists, #433=1, otherwise #433=0

#484 is used to record the current Gcode line P size word
#485 is used to record the current Gcode line Q size word
#486 is used to record the current Gcode line F size word
#487 is used to record the current Gcode line S size word
#488 is used to record the current Gcode line X size word, if it is in G90 (G90.1) mode, #488=#451, otherwise #488 is the X input value
#489 is used to record the current Gcode line Y size word, if it is in G90 (G90.1) mode, #489=#452, otherwise #489 is Y input value
#490 is used to record the current Gcode line Z size word, if it is in G90 (G90.1) mode, #490=#453, otherwise #490 is Z input value
#491 is used to record the current Gcode line A size word, if it is in G90 (G90.1) mode, #491=#454, otherwise #491 is the A input value.
#492 is used to record the current Gcode line B size word
#493 is used to record the current Gcode line C size word
#494 is used to record the current Gcode line I size word
#495 is used to record the current Gcode line J size word
#496 is used to record the current Gcode line K size word
#497 is used to record the current Gcode line R size word
#498 is used to record the current Gcode line L size word
#499 is used to record the current Gcode line H size word

Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
Bench
Posted at 2018-10-28 07:51:12 | All floors
Last edited by ytliu In 2018-10-28 08:12 Editor

DDCSV will pre-read GCode for parsing, so the parsing process is out of sync with the machining process. #451-#454 is not machine tool position of coordinate system, but the expected position of the currently parsed Gcode line.
Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
Floor
Posted at 2018-10-28 08:27:22 | All floors
As Will_D said, you can get machine tool position of G54 coordinate system with #840-#842.

G90
G1X0.1F1000
M110(move axies and press START)
(Manually move the axis to a saved position.)
G4P0
#21=#840 (getting x coordinates)
#22=#841 (getting y coordinates)
#23=#842 (getting z coordinates)
G4P0
G0 X50 Y50 Z10
G1 X#21 Y#22 Z#23 F1000 (Now, the axes should return to the saved position.)
M110(Right?)
G0X0Y0Z0
#21=0
#22=0
#23=0
Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
5#
Posted at 2018-10-28 08:29:52 | All floors
Last edited by ytliu In 2018-10-28 08:34 Editor

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 find the position of the tool 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 find the position of the tool in the G53 coordinate system.

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 adjust these parameters to reconstruct the G54-G59 coordinate system; 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 find the position of the tool in the G54-G59 coordinate system.

#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.
Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
6#
Posted at 2018-10-30 06:42:48 | All floors
#0-#49 is a subroutine local variable that you can use at will. If you need to use system parameters in GCode, you can use #2400-#2500, you can modify them in the configuration page to change the behavior of GCode, of course you need to add relevant parameter configuration in eng (rus, chs) file .
Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
7#
Posted at 2018-10-30 18:34:00 | All floors
Nikolay81 Posted at 2018-10-30 17:43
Thanks Ytliu.
And the value of the system parameters can be read from the G-code, or not?
For exam ...

Correspondence between parameter number and macro variable:
The 0-499 parameter corresponds to the #500-#999 macro variable;
The 2000-2499 parameter corresponds to the #2000-#2499 macro variable;
Reply Support Opposition

Use props Report

You need to log in before you can reply Login | Register now

This forum Credits Rules

Shenzhen Digital Dream Numerical Technology Co., Ltd. support
Adress:507,A Building,Leibo Industry Zone,No. 22 Jinxiu East Road,Kengzi Street,Pingshan district,Shenzhen City,P.R. of China
Phone:13244704799
E-mail:info@ddcnc.com

TEL

0755-87654321

Wchat

Website designed by DigitalDream Technology Support
Quick Reply Back to top Back to list