toggle2nist question

More
10 Jul 2012 15:18 #21745 by clkeck1
toggle2nist question was created by clkeck1
I'm trying to get the foot switch on the lathe programmed. I'm using a toggle2nist and a set of edge detectors to output a m100 or m101 code to clamp and unclamp the chuck. The problem is the foot switch momentarily hits the toggle2nist.0.in pin but the on and off pins do not change. Do i have something setup wrong?


#foot switch for clamp/unclamp
net foot-switch toggle2nist.0.in

net on-edge toggle2nist.0.on edge.1.in
net off-edge toggle2nist.0.off edge.2.in

#link from toggle2nist to 100 and 101 mcodes
net chuck-clamp-from-foot-switch halui.mdi-command-00 edge.1.out
net turret-unclamp-foot-switch halui.mdi-command-01 edge.2.out

Also how do i put a delay in a custom M code for speed changes i want to do something like listed below

#!/bin/bash
# file Low gear
halcmd sets high-gear false
"delay .5 sec"
halcmd sets low-gear true
"delay .5 sec"

exit 0


Thanks
Cory

Please Log in or Create an account to join the conversation.

More
10 Jul 2012 16:11 #21749 by BigJohnT
Replied by BigJohnT on topic Re:toggle2nist question
This thread should explain how toggle2nist works. It even has a diagram...

John

Please Log in or Create an account to join the conversation.

More
10 Jul 2012 16:23 #21750 by ArcEye
Replied by ArcEye on topic Re:toggle2nist question
Hi

Just realised JT has just answered whilst I was doing my Mavis Beacon bit!

Regards a pause, easiest way from a M Code file might be to set one of your halui.mdi-command-XX commands
to G4 P0.5 and call that.

regards

Please Log in or Create an account to join the conversation.

More
10 Jul 2012 16:27 #21751 by clkeck1
Replied by clkeck1 on topic Re:toggle2nist question
I would like to include the delay inside the Mcode file.

Thanks
Cory

Please Log in or Create an account to join the conversation.

More
10 Jul 2012 16:35 #21752 by andypugh
Replied by andypugh on topic Re:toggle2nist question
clkeck1 wrote:

I'm trying to get the foot switch on the lathe programmed. I'm using a toggle2nist

I think the problem is that toggle2nist requires the is-on input to be wired, so it knows which state to toggle from.
In your case your M100 and M101 should contain:
halmd setp toggle2nist.0.is-on 1
(or 0 for the complimentary function)

Are you sure you need the M100 / M101? It seems like this is something which could be handled entirely within HAL, unless you want the G-code to also have the ability to open/close the collet.

Please Log in or Create an account to join the conversation.

More
10 Jul 2012 16:45 #21753 by clkeck1
Replied by clkeck1 on topic Re:toggle2nist question
I want the option for the gcode. should never need it but you never know.

Ill add the toggle2nist.0.is-on line to the files and see what happens.

Thanks

Cory

Please Log in or Create an account to join the conversation.

More
11 Jul 2012 08:15 #21781 by ArcEye
Replied by ArcEye on topic Re:toggle2nist question

I would like to include the delay inside the Mcode file.

If your M Code file is a bash script just use sleep
See man sleep

regards

Please Log in or Create an account to join the conversation.

More
11 Jul 2012 13:30 #21784 by clkeck1
Replied by clkeck1 on topic Re:toggle2nist question
Thanks guys that fixed those 2 issues

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum