machine coordinate's

If you have a question about the software please ask it here.

machine coordinate's

Postby Dan911 » Wed Oct 10, 2018 2:33 am

I'm trying to capture machine coordinate's on the start of current gcode line before movement or the end 0f previous. I monitored the obvious available fields/functions but always slightly units ahead, a routine with DTG fields come close but still not 100% reliably accurate. Any Suggestions?

Thanks,
Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: machine coordinate's

Postby Robertspark » Wed Oct 10, 2018 6:39 am

double WorkCoordA = exec.Wa;
double WorkCoordB = exec.Wb;
double WorkCoordC = exec.Wc;
double WorkCoordX = exec.Wx;
double WorkCoordY = exec.Wy;
double WorkCoordZ = exec.Wz;
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: machine coordinate's

Postby Robertspark » Wed Oct 10, 2018 6:49 am

Oh, are you doing this on the fly?

if the machine is moving then you would need to use stream reader to read the current or next gcode line, and also the current work coordinates,

subtract the current work from machine coordinates to give you the current offset, and the subtract that from the gcode coordinates

dont forget uccnc buffers data and shifts it to the motion controller so that the motion controller will do all the timing, and the buffer allows for any windows delays,

windows is not real time, and does not have a real time kernel. Linuxcnc does .... but technically there is still a delay.... just its very small (subject to pc, network connection, processor etc)

in uccnc you only read the data as available which will always be off a bit. I think there is a buffer delay variable somewhere which is used for diagnostics in uccnc that yoy may be able to use to estimate a closer actual prediction using a predictive filter like kalman
Attachments
2018-10-10 07_57_29-UCCNC software _ Running in demo mode....png
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: machine coordinate's

Postby Dan911 » Wed Oct 10, 2018 8:57 pm

Hi Robert.
The exec.Wa; etc... functions don't seem to be available in plugins, but your reply did put things in perspective for me.

Thank you,
Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: machine coordinate's

Postby Robertspark » Wed Oct 10, 2018 8:58 pm

They should be available try uc.Wa etc
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: machine coordinate's

Postby Dan911 » Wed Oct 10, 2018 9:14 pm

Yes of course....UC.Wa
Also UC.ArcstartposX, they don't show up in my list of functions. Were they added after 1.2105?
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: machine coordinate's

Postby Robertspark » Wed Oct 10, 2018 9:20 pm

Err.... There are a few undocumented ones ....

I've been holding out a bit as they are not official... I'll add some to the new (macro) manual in a specific section.... Just substitute exec for UC and they should work fine
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm


Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 24 guests