Spindle Orient
Commanding a Spindle Orient
M19 M Code
You can command an orient using the M19
M code or by invoking the spindleorient.mcs
macro.
M19 [S<stopping_angle>]
Orient the spindle and move it to the specified angle. If no angle is specified, 0 is used.
UserGUIModule.m19( hVars )
This hook script is invoked (if it exists) before the M19 M code begins the orient process.
It is a standard MachMotion hook function.
spindleorient Macro
spindleorient( [<stopping_angle>[, <orient_direction>]] )
This is the macro Mach 4 invokes when performing a spindle orient (e.g. for a tool change).
UserGUIModule.spindleorient( [<stopping_angle>[, <orient_direction>]] )
This hook script is invoked (if it exists) before the orient is attempted. It is a standard MachMotion hook function.
UserGUIModule.MacroOrient()
This hook script is invoked (if it exists) at the beginning of the macro orient process.
It is a standard MachMotion hook function.
UserGUIModule.spindleorientcancel()
This hook script is invoked if a spindle orient is cancelled, before any automatic cancellation behavior takes place.
It is a standard MachMotion hook function.
UserGUIModule.MacroOrientCancel()
This hook script is invoked if a spindle orient is cancelled, before any automatic cancellation of macro orient behavior takes place.
It is a standard MachMotion hook function.
Spindle Orient (MachMotion User Command)
There is a user command named Spindle Orient, that can be invoked (e.g. assigned to a function button) that invokes the spindleorient macro.
Configuration
There are a number of configurable parameters for orienting the spindle.
MachMotion Parameters
Spindle Orient Type
Manual
When an orient is commanded, the spindle will be free to move and must be oriented by the operator physically rotating it to the correct position.
Auto
When an orient is commanded, the CNC software will perform an orient routine, waiting until it is complete.
Spindle Orient Macro Sensor Timeout
the timeout (in milliseconds) used to wait for an orient operation to complete
Spindle Orient Style
PLC
The orient is performed by invoking PLC sequence #50.
Macro
The orient is performed by the module/macro code.
Spindle Orient Macro Output
The output set to start the orient.
Spindle Orient Macro Input
The input waited on that indicates that the orient is complete.
Spindle Orient Control Mode
Spindle On
The spindle is commanded forward while orienting.
Spindle Stop
The spindle is commanded to stop before attempting to orient, but doesn't wait for it to be stopped before proceeding.
Spindle Stop Wait
The spindle is stopped before attempting to orient, waiting for the stop before attempting the orient.
Spindle Stop Start
The spindle is stopped before attempting to orient, then commanded forward while orienting.
Spindle Orient Speed
When using Spindle On or Spindle Stop Start control modes, this is the speed to which the spindle is commanded while orienting.
For example, if using a PLC, these are common Orient settings:
Orient uses IO to start the spindle and not an actual spindle command so your FWD and REV outputs must be mapped to the VFD as shown for a Yaskawa Modbus VFD:
For a Hitachi Modbus VFD (Hitachi uses Spindle On and REV), you need a custom MCode module to orient.
Wiring
If using a PLC for pin lock orient, the PLC must be able to command the VFD to stop immediately. Wire the PLC to a Fast Stop input on the VFD. Wire it in series with the safety relay.
You also may need to run a wire to command DC injection breaking to hold while the spindle is orienting.