MDI values not reflected in DROs

Mach3 and Mach4 from Artsoft questions or tips can be posted to this forum.
Post Reply
Blackslacks
Posts: 11
Joined: Mon Apr 16, 2018 10:16 pm

MDI values not reflected in DROs

Post by Blackslacks » Thu Jul 18, 2019 1:03 pm

Something I noticed after entering Gcode on the MDI page of Mach3 is that my dros do not show the values input. For example I zero the axis, enter and execute G1 x-3 y-5 the DROs read -2.9993 and -4.9996. If I repeat the same input again I'll get a different set of numbers but they are always a few ten thousands off. Why is this? Thanks in advance.

User avatar
djreiswig
Elite Contributing Member
Elite Contributing Member
Posts: 700
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: MDI values not reflected in DROs

Post by djreiswig » Thu Jul 18, 2019 1:25 pm

Maybe the steps don't work out correctly to get the move to the exact ten thousand. Mach doesn't work in inches so much as it does in steps. If the inches aren't evenly divisible by the steps then it won't come out even.
Could also be the feedrate or motor settings causing it to not stop exactly.
2014 Bulltear (StarLab) 4x8
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)

robertspark
Elite Contributing Member
Elite Contributing Member
Posts: 481
Joined: Mon Jun 12, 2017 6:43 pm
Location: nr Liverpool, UK

Re: MDI values not reflected in DROs

Post by robertspark » Thu Jul 18, 2019 2:04 pm

as posted below, how many steps per unit are you using for each axis, if they are not round numbers you won't get round numbers displayed
UCCNC,
Sheetcam
Hypertherm Powermax 45 (nonXP)
Neuron Lite THC
Hobby user (4x4 home table)

Blackslacks
Posts: 11
Joined: Mon Apr 16, 2018 10:16 pm

Re: MDI values not reflected in DROs

Post by Blackslacks » Thu Jul 18, 2019 2:55 pm

Ok thanks but what if I follow G1 x-3 y-5 with G92 x0 y0. That should zero the dros should it not? It does on the MDI but not when I enter it as a button script, which is my purpose for this. Its still a few 10thou off.
Capture.JPG

You do not have access to view or download this file.
Become a Contributing Member to gain access to this feature. Click Here


User avatar
djreiswig
Elite Contributing Member
Elite Contributing Member
Posts: 700
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: MDI values not reflected in DROs

Post by djreiswig » Thu Jul 18, 2019 3:19 pm

Put a while ismoving loop after your move. It's trying to zero the dro before it is done with the move. I ran into the same thing before.
2014 Bulltear (StarLab) 4x8
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)

robertspark
Elite Contributing Member
Elite Contributing Member
Posts: 481
Joined: Mon Jun 12, 2017 6:43 pm
Location: nr Liverpool, UK

Re: MDI values not reflected in DROs

Post by robertspark » Thu Jul 18, 2019 3:36 pm

as said in the previous post, you need to give the code time to finish before the next line especially if you are trying to do something (like set a temporary offset)
UCCNC,
Sheetcam
Hypertherm Powermax 45 (nonXP)
Neuron Lite THC
Hobby user (4x4 home table)

Blackslacks
Posts: 11
Joined: Mon Apr 16, 2018 10:16 pm

Re: MDI values not reflected in DROs

Post by Blackslacks » Thu Jul 18, 2019 3:53 pm

Thanx all.I rounded off my steps and my button seems to be working now.
Can someone please elaborate on the "while is moving loop"? I'm unfamiliar with it and may come in handy in the future. How is it done?

User avatar
djreiswig
Elite Contributing Member
Elite Contributing Member
Posts: 700
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: MDI values not reflected in DROs

Post by djreiswig » Thu Jul 18, 2019 4:53 pm

Put this between the two lines of code
While (IsMoving())
'Sleep, so other threads can run while we’re waiting
Sleep(100)
Wend

You can experiment with the 100. It's time in milliseconds. I have gone down to 1.
It loops while the axis is moving, and when the move is complete it goes to the next line.
2014 Bulltear (StarLab) 4x8
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)

Post Reply

Return to “Mach3 & Mach4 CNC”

Easyscriber engrave attachment for Hypertherm plasma cutters.