Hello Guest it is March 29, 2024, 06:17:39 AM

Author Topic: How to execute MDI?  (Read 954 times)

0 Members and 1 Guest are viewing this topic.

How to execute MDI?
« on: December 14, 2021, 11:26:59 AM »
Recently I made the move from Mach3 to Mach4 with a hardware upgrade. Since the upgrade, I have been unable to use the MDI commands. I see the window. I cant type in the window, but enter and ctrl+enter won't move the machine. Am I missing something?
Re: How to execute MDI?
« Reply #1 on: December 14, 2021, 11:43:31 AM »
Did you press Cycle Start?
Re: How to execute MDI?
« Reply #2 on: December 14, 2021, 12:03:27 PM »
I am half way through a program and trying to move the head. Cycle Start will restart the program. Is MDI only aloud while not running a program?
Re: How to execute MDI?
« Reply #3 on: December 14, 2021, 12:11:14 PM »
If you have selected the MDI tab to enter commands into the MDI screen, you will notice the button name changes to Cycle Start MDI and clicking on that button will run ALL the lines currently in the MDI window but will not resume the program.
Steve Stallings
www.PMDX.com
Re: How to execute MDI?
« Reply #4 on: December 14, 2021, 03:21:23 PM »
Hi,

Quote
I am half way through a program and trying to move the head. Cycle Start will restart the program. Is MDI only aloud while not running a program?

That is correct.

When you are running a Gcode program the Gcode interpreter/trajectory planner is assigned to the Gcode job. If you wish to use the trajectory planner to jog or MDI it
must be decoupled from the running job, and then coupled to either the jog buttons or the MDI panel.

The trajectory planner is not and cannot be schizophrenic, it can have one and only one master at a time.

You may have noted that the Lua screen script, that is the totality of the screen, alternates control with the Gcode interpreter. This allows for things like the DROs and the toolpath display
to update while a Gcode job is running, otherwise the screen would sit idle and not change until the Gcode file had completed. This is not a multi threaded process however, it uses the
Coroutines feature of Lua. Thus the control passes back and forth between the Gcode interpreter or 'chunk' and the screen script or 'chunk'.

The question that occurs to me is that 'if Mach can alternate between chunks using coroutines, could the trajectory planner alternate between Gcode and MDI?'

The first thing that comes to mind it that because Mach is buffered the trajectory planner has sent P(osition)V(elocity) over T(ime) data to the motion controller. Should you wish to jog
or MDI you would HAVE to wait until the motion buffer in the motion controller drained otherwise PVT data would be lost and Mach would lose reference.

The second issue that comes to mind is what happens to the Gcode job while its suspended?

For instance lets say that the Gcode has called a  g90 g1 move to x1,y1,z1 location. The machine moves there and the DROs reflect that location. Then you issue a jog or MDI instruction
to move an additional 20mm of the x axis. Then the Gcode job resumes but the location of the machine is not x1,y1,z1 anymore but is x1+20,y1,z1. What should be the next move?
Should it be to location x2,y2,z2.......or should it be to x2+20,y2,z2?

This later alternative is suggestive of a work coordinate shift....which sort of makes sense. But what happens if you change mode during you MDI excursion?
In the example above the movement mode is g90 g1 as established by the Gcode job, but if your MDI instruction is g91 g0 x20, now when the Gcode job resumes its motion mode is
g0 incremental, rather than g1 absolute. That's going to screw up bigtime. You need some way of reliably resetting the mode such that a clash did not occur.

The last thing that occurs to me is that the vast majority of mc.mcMotion APIs,  mc.mcMotionCyclePlanner() for example, is listed as an API but does not have any Lua syntax, it has C/C++ syntax only.
This would suggest that this is not something you can program yourself, but rather the API was and is intended for use by device plugins. You'd be a game man to get involved with that.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: How to execute MDI?
« Reply #5 on: December 16, 2021, 12:17:24 AM »
Thank you for all the information!
It was absolutely user error. Flipping to the MDI tab and using Cycle Start was my issue.

@joeaverage what a deep dive, awesome!

Offline thosj

*
  •  532 532
    • View Profile
Re: How to execute MDI?
« Reply #6 on: December 16, 2021, 08:20:45 AM »
This is the FIRST thing that gets us when switching from Mach3 to Mach4. No more hitting ENTER to execute MDI!!!
--
Tom