Table of Contents
1 EMC2 and HAL
See also the manual pages motion(9) and iocontrol(1).
1.1 motion (realtime)
These pins, parameters, and functions are created by the real time motmod module.
1.1.1 Pins
- motion.adaptive-feed IN float
- When adaptive feed is enabled with M52 P1 (See the G Code Manual), the commanded velocity is multiplied by this value. This effect is multiplicative with the NML-level feed override value and motion.feed-hold.
- motion.digital-out-NN OUT bit
- These pins are controlled by the M62 through M65 words.
- motion.enable IN bit
- If this bit is driven FALSE, motion stops, the machine is placed in the “machine off” state, and a message is displayed for the operator. For normal motion, drive this bit TRUE.
- motion.feed-hold IN bit
- When Feed Stop Control is enabled with M53 P1 (See the G Code Manual), and this bit is TRUE, the feed rate is set to 0.
- motion.motion-inpos OUT bit
- TRUE if the machine is in position.
- motion.probe-input IN bit
- G38.2 uses the value on this pin to determine when the probe has made contact. TRUE for probe contact closed (touching), FALSE for probe contact open.
- motion.spindle-brake OUT bit
- TRUE when the spindle brake should be applied
- motion.spindle-forward OUT bit
- TRUE when the spindle should rotate forward
- motion.spindle-reverse OUT bit
- TRUE when the spindle should rotate backward
- motion.spindle-on OUT bit
- TRUE when spindle should rotate
- motion.spindle-speed-out OUT float
- Desired spindle speed in rotations per minute
- motion.spindle-index-enable I/O bit
- For correct operation of spindle synchronized moves, this signal must be hooked to the index-enable pin of the spindle encoder.
- motion.spindle-revs IN float
- For correct operation of spindle synchronized moves, this signal must be hooked to the position pin of the spindle encoder.
1.1.2 Parameters
Many of these parameters serve as debugging aids, and are subject to change or removal at any time.
- motion.coord-error
- TRUE when motion has encountered an error, such as exceeding a soft limit
- motion.coord-mode
- TRUE when motion is in “coordinated mode”, as opposed to “teleop mode”
- motion.in-position
- Same as the pin motion.motion-inpos
- motion.motion-enabled
- TRUE when motion is enabled
- motion.servo.last-period
- The number of CPU cycles between invocations of the servo thread. Typically, this number divided by the CPU speed gives the time in seconds, and can be used to determine whether the real time motion controller is meeting its timing constraints
- motion.servo.overruns
- By noting large differences between successive values of motion.servo.last-period, the motion controller can determine that there has probably been a failure to meet its timing constraints. Each time such a failure is detected, this value is incremented.
- motion.debug-bit-0
- motion.debug-bit-1
- motion.debug-float-0
- motion.debug-float-1
- These values are used for debugging purposes.
1.1.3 Functions
Generally, these functions are both added to the servo-thread in the order shown.
- motion-command-handler
- Processes motion commands coming from user space
- motion-controller
- Runs the EMC motion controller
1.2 axis.N (realtime)
These pins and parameters are created by the real time motmod module. These are actually joint values, but the pins and parameters are still called “axis.N”.1 They are read and updated by the motion-controller function.
1.2.1 Pins
- axis.N.amp-enable-out OUT bit
- TRUE if the amplifier for this joint should be enabled
- axis.N.amp-fault-in IN bit
- Should be driven TRUE if an external fault is detected with the amplifier for this joint
- axis.N.home-sw-in IN bit
- Should be driven TRUE if the home switch for this joint is closed
- axis.N.homing OUT bit
- TRUE if the joint is currently homing
- axis.N.pos-lim-sw-in IN bit
- Should be driven TRUE if the positive limit switch for this joint is closed
- axis.N.neg-lim-sw-in IN bit
- Should be driven TRUE if the negative limit switch for this joint is closed
- axis.N.index-enable IO BIT
- Should be attached to the index-enable pin of the joint's encoder to enable homing to index pulse
- axis.N.jog-counts IN s32
- Connect to the “counts” pin of an external encoder to use a physical jog wheel.
- axis.N.jog-enable IN bit
- When TRUE (and in manual mode), any change in “jog-counts” will result in motion. When false, “jog-counts” is ignored.
- axis.N.jog-scale IN float
- Sets the distance moved for each count on “jog-counts”, in machine units.
- axis.N.jog-vel-mode IN bit
- When FALSE (the default), the jog wheel operates in position mode. The axis will move exactly jog-scale units for each count, regardless of how long that might take. When TRUE, the wheel operates in velocity mode - motion stops when the wheel stops, even if that means the commanded motion is not completed.
- axis.N.motor-pos-cmd OUT float
- The commanded position for this joint.
- axis.N.motor-pos-fb IN float
- The actual position for this joint.
- axis.N.joint-pos-cmd
- The joint (as opposed to motor) commanded position. There may be an offset between the joint and motor positions--for example, the homing process sets this offset.
- axis.N.joint-pos-fb
- The joint (as opposed to motor) feedback position.
1.2.2 Parameters
Many of these parameters serve as debugging aids, and are subject to change or removal at any time.
- axis.N.active
- TRUE when this joint is active
- axis.N.backlash-corr
- Backlash or screw compensation raw value
- axis.N.backlash-filt
- Backlash or screw compensation filtered value (respecting motion limits)
- axis.N.backlash-vel
- Backlash or screw compensation velocity
- axis.N.coarse-pos-cmd
- axis.N.error
- TRUE when this joint has encountered an error, such as a limit switch closing
- axis.N.f-error
- The actual following error
- axis.N.f-error-lim
- The following error limit
- axis.N.f-errored
- TRUE when this joint has exceeded the following error limit
- axis.N.free-pos-cmd
- The “free planner” commanded position for this joint.
- axis.N.free-tp-enable
- TRUE when the “free planner” is enabled for this joint
- axis.N.free-vel-lim
- The velocity limit for the free planner
- axis.N.home-state
- Reflects the step of homing currently taking place
- axis.N.homed
- TRUE if the joint has been homed
- axis.N.in-position
- TRUE if the joint is using the “free planner” and has come to a stop
- axis.N.joint-vel-cmd
- The joint's commanded velocity
- axis.N.neg-hard-limit
- The negative hard limit for the joint
- axis.N.neg-soft-limit
- The negative soft limit for the joint
- axis.N.pos-hard-limit
- The positive hard limit for the joint
- axis.N.pos-soft-limit
- The positive soft limit for the joint
1.3 iocontrol (userspace)
These pins are created by the userspace IO controller, usually called io.
1.3.1 Pins
- iocontrol.0.coolant-flood
- TRUE when flood coolant is requested
- iocontrol.0.coolant-mist
- TRUE when mist coolant is requested
- iocontrol.0.emc-enable-in
- Should be driven FALSE when an external e-stop condition exists
- iocontrol.0.lube
- iocontrol.0.lube_level
- Should be driven TRUE when
- iocontrol.0.tool-change
- TRUE when a tool change is requested
- iocontrol.0.tool-changed
- Should be driven TRUE when a tool change is completed
- iocontrol.0.tool-prep-number
- The number of the next tool, from the RS274NGC T-word
- iocontrol.0.tool-prepare
- TRUE when a tool prepare is requested
- iocontrol.0.tool-prepared
- Should be driven TRUE when a tool prepare is completed
- iocontrol.0.user-enable-out
- FALSE when an internal e-stop condition exists
- iocontrol.0.user-request-enable
- TRUE when the user has requested that e-stop be cleared
Index
Footnotes
1
In “trivial kinematics” machines, there is a one-to-one correspondence between joints and axes. back