ppmc_io.hal - Rotary encoder

# HAL config file for Pico Systems USC board

#

# Connect motion controller I/Os

#

# connect limit/home switch outputs to motion controller

#newsig Xminlim bit # X Axis.0

newsig Xhome bit

net Xminlim ppmc.0.din.00.in axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in

linksp Xminlim <= ppmc.0.din.00.in # Conn ST1, Pin 1, (Digital input 0) one limit switch, trip on the negative and positive end of travel

linksp Xminlim => axis.0.neg-lim-sw-in

linksp Xhome <= ppmc.0.din.01.in # Conn ST1, Pin 2, (Digital input 1)

linksp Xhome => axis.0.home-sw-in

newsig Yminlim bit # Y Axis.1

newsig Yhome bit

linksp Yminlim <= ppmc.0.din.02.in # Conn ST1, Pin 3, (Digital input 2) one limit switch, trip on the negative and positive end of travel

linksp Yminlim => axis.1.neg-lim-sw-in

linksp Yhome <= ppmc.0.din.03.in # Conn ST1, Pin 4, (Digital input 3)

linksp Yhome => axis.1.home-sw-in

newsig Zminlim bit # Z Axis.2

newsig Zhome bit

linksp Zminlim <= ppmc.0.din.04.in # Conn ST1, Pin 5, (Digital input 4) two limit switches wire in series

linksp Zminlim => axis.2.neg-lim-sw-in

linksp Zhome <= ppmc.0.din.05.in # Conn ST1, Pin 6, (Digital input 5)

linksp Zhome => axis.2.home-sw-in

# connect index pulses to motion controller

# do these when index pulsing is figured out

newsig Xindex bit

newsig Yindex bit

newsig Zindex bit

linksp Xindex <= ppmc.0.encoder.00.index-enable

linksp Xindex => axis.0.index-enable

linksp Xindex => pid.0.index-enable

linksp Yindex <= ppmc.0.encoder.01.index-enable

linksp Yindex => axis.1.index-enable

linksp Yindex => pid.1.index-enable

linksp Zindex <= ppmc.0.encoder.02.index-enable

linksp Zindex => axis.2.index-enable

linksp Zindex => pid.2.index-enable

#

# Connect I/O controller I/Os

#

# connect e-stop write/sense to I/O controller

# and ppmc's fault with estop's output, so estop FF is reset, but

# prevent continued estop signal from ppmc from holding FF cleared

newsig ppmcEstop bit

linksp ppmcEstop ppmc.0.din.estop.in

linksp ppmcEstop and2.0.in0

newsig EstopOkIn bit

linksp EstopOkIn estop-latch.0.fault-in

linksp EstopOkIn and2.0.out

newsig EstopOkOut bit

#linksp EstopOkOut ppmc.0.dout.07.out

linksp EstopOkOut ppmc.0.dout.Estop.out

linksp EstopOkOut iocontrol.0.emc-enable-in

linksp EstopOkOut estop-latch.0.ok-out

linksp EstopOkOut and2.0.in1

newsig emc-estop-out bit

linksp emc-estop-out iocontrol.0.user-enable-out

linksp emc-estop-out estop-latch.0.ok-in

newsig emc-estop-reset bit

linksp emc-estop-reset iocontrol.0.user-request-enable

linksp emc-estop-reset estop-latch.0.reset

#newsig EstopSense bit

#newsig EstopWrite bit

#linksp EstopSense <= ppmc.0.din.estop.in-not

#linksp EstopSense => iocontrol.0.emc-enable-in

#linksp EstopWrite <= ppmc.0.dout.07.out

#linksp EstopWrite => iocontrol.0.user-enable-out

#estop may need to be inverted

# connect spindle fwd/rev to I/O controller

newsig SpindleFwd bit

newsig SpindleRev bit

linksp SpindleFwd <= ppmc.0.dout.00.out

linksp SpindleFwd => motion.spindle-forward

linksp SpindleRev <= ppmc.0.dout.01.out

linksp SpindleRev => motion.spindle-reverse

# connect spindle speed up/down to I/O controller

#newsig SpindleUp bit

#newsig SpindleDown bit

#linksp SpindleUp <= ppmc.0.dout.06.out

#linksp SpindleUp => motion.spindle-incr-speed

#linksp SpindleDown <= ppmc.0.dout.05.out

#linksp SpindleDown => motion.spindle-decr-speed

# connect spindle brake to I/O controller

newsig SpindleBrakeOn bit

linksp SpindleBrakeOn <= ppmc.0.dout.02.out

linksp SpindleBrakeOn => motion.spindle-brake

# connect mist/flood coolant to I/O controller

newsig MistOn bit

newsig FloodOn bit

linksp MistOn <= ppmc.0.dout.03.out

linksp MistOn => iocontrol.0.coolant-mist

linksp FloodOn <= ppmc.0.dout.04.out

linksp FloodOn => iocontrol.0.coolant-flood

# Servo Enable from amp enable

linksp Xenable ppmc.0.dout.07.out

#linksp Xenable ppmc.0.dout.05.out