Major accomplishment. (For me anyway...) :laugh:
I have 4 inputs from the "
real world"... if any one or more fails (
goes low) then the machine MUST stop...
ESTOP active.
- ERR Signal from X-Axis Gecko Drive
- ERR Signal from Y-Axis Gecko Drive
- ERR Signal from Z-Axis Gecko Drive
- A Big RED ESTOP SWITCH mounted on the mill
Additionally... there is a button on the pyVCP panel called
GECKO-RESET, if pressed, the system should switch on a relay attached to the second parallel port, pin 14,
parport.1.pin-14-out... then hold this relay active for
at least 5 seconds to reset all the Geckodrives.
It took some fiddling... but I got it... and it works well. I needed to use the "
NOT" and the "
LOGIC" functions together to make it happen.
Code:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Geckodrive Error Reporting and Reset System
# --------------------------------------------------------------------------------------------------
loadrt not count=1 # Load 1 instance of the "NOT" routine.
addf not.0 servo-thread # Apply to servo-thread
loadrt timedelay count=1 # Load 1 instance of the "TIMEDELAY" routine.
addf timedelay.0 servo-thread # Apply to servo-thread
setp timedelay.0.on-delay 0.05 # Set delay to determine switch push to 0.05 sec.
setp timedelay.0.off-delay 5.0 # Set the delay time to 5.0 sec.
# --------------------------------------------------------------------------------------------------
# read the "gecko-clear" button and apply it to the time delay input, then invert and
# send the signal to the parallel port #2, pin 14... hold it for the full time delay.
net gecko-clear-in <= timedelay.0.in <= pyvcp.GECKO-RESET
net gecko-post-timer <= timedelay.0.out
net gecko-post-timer => not.0.in
net gecko-post-invert <= not.0.out => parport.1.pin-14-out
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
net panel-GECKO-X <= parport.1.pin-10-in => pyvcp.GECKO-X
net panel-GECKO-Y <= parport.1.pin-11-in => pyvcp.GECKO-Y
net panel-GECKO-Z <= parport.1.pin-12-in => pyvcp.GECKO-Z
# --------------------------------------------------------------------------------------------------
# Geckodrive Error to ESTOP system
# --------------------------------------------------------------------------------------------------
net estop-switch <= parport.0.pin-13-in
net estop-ext => iocontrol.0.emc-enable-in
net estop-out <= iocontrol.0.user-enable-out
# --------------------------------------------------------------------------------------------------
# Use the "LOGIC" function to evaluate four (4) inputs... if any fail, act accordingly.
loadrt logic count=1 personality=0x104 # 1xx is AND, 2xx is OR, and 3xx is XOR logic sets.
addf logic.0 servo-thread
net panel-GECKO-X => logic.0.in-00 # Input 1 of 4 from X-Axis
net panel-GECKO-Y => logic.0.in-01 # Input 2 of 4 from Y-Axis
net panel-GECKO-Z => logic.0.in-02 # Input 3 of 4 from Z-Axis
net estop-switch => logic.0.in-03 # Input 4 of 4 from Big Red Button on Mill
net estop-ext <= logic.0.and # Apply the final output to the ESTOP system
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# End of Configuration
I want to personally thank
Andy Pugh for all his help... I could not have figured it out on my own... THANKS!
I hope this helps someone else with their system too!
Jerry