MDI values not reflected in DROs

Mach3 and Mach4 questions, tips and topics can be posted here
Post Reply
User avatar
Blackslacks
2 Star Member
2 Star Member
Posts: 87
Joined: Mon Apr 16, 2018 10:16 pm

MDI values not reflected in DROs

Post by Blackslacks »

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
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1929
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: MDI values not reflected in DROs

Post by djreiswig »

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
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1806
Joined: Mon Jun 12, 2017 6:43 pm

Re: MDI values not reflected in DROs

Post by robertspark »

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
User avatar
Blackslacks
2 Star Member
2 Star Member
Posts: 87
Joined: Mon Apr 16, 2018 10:16 pm

Re: MDI values not reflected in DROs

Post by Blackslacks »

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
Capture.JPG (28.86 KiB) Viewed 413 times
User avatar
djreiswig
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1929
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: MDI values not reflected in DROs

Post by djreiswig »

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
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1806
Joined: Mon Jun 12, 2017 6:43 pm

Re: MDI values not reflected in DROs

Post by robertspark »

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)
User avatar
Blackslacks
2 Star Member
2 Star Member
Posts: 87
Joined: Mon Apr 16, 2018 10:16 pm

Re: MDI values not reflected in DROs

Post by Blackslacks »

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
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1929
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: MDI values not reflected in DROs

Post by djreiswig »

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”