Getting the current axes coordinates - DDCSV2.1 - Standalone CNC Motion Controller - Digital Dream Technology support
12Next
Return to List Add thread
View: 32116|Reply: 13
Print Previous Topic Next Topic

Getting the current axes coordinates

[Copy Link]

15

Threads

139

Posts

517

Credits

Senior Member

Rank: 4

Credits
517
Jump to the specified floor
Landlord
Posted at 2018-10-17 18:48:54 | Only Author Replies reward |Descending browser |Read mode
Last edited by Nikolay81 In 2018-10-17 18:50 Editor

Please tell me how you can get the current coordinates of the axes in G54
This is needed to create more convenient postprocessors.

For example, I write:
G90
G1X0.1F1000
M110(move axies and press START)
(Manually move the axis to a saved position.)
G4P0
#21=#451 (getting x coordinates)
#22=#452 (getting y coordinates)
#23=#453 (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

I tried the variables # 451- # 453; # 572- # 574; # 804- # 806; # 864- # 866. They do not work.
Please tell me in which variables the information about the current position of the axes is stored.
And in which variables, it is better to save it (# 21- # 23 are used in slib.nc).
Reply

Use props Report

1

Threads

27

Posts

1166

Credits

Gold member

Rank: 6Rank: 6

Credits
1166
Sofa
Posted at 2018-10-19 13:59:05 | Only Author
UP. That sounds interesting
Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

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

Use props Report

15

Threads

139

Posts

517

Credits

Senior Member

Rank: 4

Credits
517
Floor
 Author| Posted at 2018-10-19 21:28:41 | Only Author
Last edited by Nikolay81 In 2018-10-19 21:34 Editor

Many thanks for your help. Have a good trip.
Reply Support Opposition

Use props Report

9

Threads

53

Posts

669

Credits

Senior Member

Rank: 4

Credits
669
5#
Posted at 2018-10-20 17:36:20 | Only Author
What I have found out:

Current tool position in current Workspace (eg G54) at start of processing g-code file!:
But not fully understood!                                    ======================

X = #451
Y = #452
Z = #453

These are where the tool is at the start of a gcode file.


For G54 current position:
#840 X machine tool position of coordinate system
#841 Y machine tool position of coordinate system
#842 Z machine tool position of coordinate system

In order to "read out" the value of a parameter I just use it to set the spindle speed in a simple gcode test file (sometimes multiply it by 10 or 100).
Reply Support Opposition

Use props Report

8

Threads

333

Posts

1040

Credits

Super Moderator

Rank: 8Rank: 8

Credits
1040
6#
Posted at 2018-10-28 07:25:05 | Only Author
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
7#
Posted at 2018-10-28 07:51:12 | Only Author
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
8#
Posted at 2018-10-28 08:27:22 | Only Author
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
9#
Posted at 2018-10-28 08:29:52 | Only Author
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

15

Threads

139

Posts

517

Credits

Senior Member

Rank: 4

Credits
517
10#
 Author| Posted at 2018-10-29 22:30:54 | Only Author
Last edited by Nikolay81 In 2018-10-29 22:53 Editor

Many thanks Ytliu.
How can the settings values be used in G-code, for example:
G1 X100 F # 80 (should work similarly to G0)
What variables are not busy (that is, available to the user) except # 21 - # 24?
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