Hello Guest it is March 18, 2024, 10:24:52 PM

Author Topic: DRO for axis target value?  (Read 2279 times)

0 Members and 1 Guest are viewing this topic.

DRO for axis target value?
« on: April 03, 2018, 03:46:51 AM »
Hi there,

i'm trying to set up an own screen set for Mach3 representing 3 values per axis: current position, distance to go and target position.
So i added a DRO for every X,Y and Z-axis with the current position (OEM DRO 800-803) and the distance to go (OEM DRO 196-199). But which DRO shoud i use for the target value of the current step in the G-Code?

If there is not such a value: How do i set up a user DRO to read this value?

Kind regards
Marian

Re: DRO for axis target value?
« Reply #1 on: April 03, 2018, 05:16:02 AM »
Hi,
thats what Machs Gcode interpreter does. You'd have to read the Gcode and display those in DROs, which will be hard enough for linear coordinates as a real mission
when you encounter circular moves.

I think you are looking at some very serious programming. Good luck.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: DRO for axis target value?
« Reply #2 on: April 03, 2018, 06:06:39 AM »
Hi Craig,

do you really think, that this is necessary? As the DRO for "distance to go" already exists for every axis, then - in my opinion - there has to be a (internal) value from which it's calculated.

To look forward: do you think it's possible to simply add the "current position" and the "distance to go" in a new user DRO? Maybe in a regular triggered macro (macro pump)?

Marian
Re: DRO for axis target value?
« Reply #3 on: April 03, 2018, 08:46:37 AM »
Hi,
as I said that is what the Gcode interpreter does. In order to formulate 'Distance To Go' Mach must have a destination in mind. To my knowledge it is not available for inspection.

I changed to Mach4 about 18 months ago and it has an API call:
Quote
LUA Syntax:
pos, rc = mc.mcCntlGcodeInterpGetPos(
      number mInst,
      number axisId)

Description:
Retrieves the current G code interpreter position for the given axis.
Which returns exactly what you wish. Presumably internal to Mach3 there must be an equivalent but if there is I'm not familiar with it.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: DRO for axis target value?
« Reply #4 on: April 17, 2018, 08:20:31 AM »
Update here - using Macropump.m1s may solve the problem.

Code: [Select]
'Macro for target coordinates
'
Option Explicit
Dim XPOS,YPOS,ZPOS,XGO,YGO,ZGO

XPOS = GetOEMDRO(800)
YPOS = GetOEMDRO(801)
ZPOS = GetOEMDRO(802)

XGO = GetOEMDRO(196)
YGO = GetOEMDRO(197)
ZGO = GetOEMDRO(198)

SetUserDRO(1050, XPOS+XGO)
SetUserDRO(1051, YPOS+YGO)
SetUserDRO(1052, ZPOS+ZGO)

Simply use the User DRO Variables 1050-1052 in your custom screenset, enable "Run macro pump" in General config and restart Mach3.

BUT: the values may flicker and - especially on short tracks - don't represent the correct value...
Re: DRO for axis target value?
« Reply #5 on: April 17, 2018, 08:54:22 PM »
Hi,
I suspect the reason is that Mach cues up moves in advance. You may recall seeing a setting called
'look ahead'. That will determine the number of moves that are cued up and ready to go.

If you think that you can set it to one the think again. Mach runs in small busrts when Windows decides it
time for the 'Mach application' to get some CPU service. If you have no cue then the motion controller runs out of
data and the machine stalls BEFORE Mach can replenish the data. When Windows is described as 'not a realtime
system' this is what it means...Mach does not get continuous CPU service. That Mach and associated motion controller
work as well as they do was, at the time, considered a major achievment by the computing community... make a realtime
motion controller out of a Windows PC....no not possible!. We're glad Art Fennerty thougt otherwise.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'