Mesa 7i37 - how to set pin between enable/brake?

More
08 Oct 2013 03:36 - 08 Oct 2013 03:39 #39625 by greenbuggy
Ok so here's my setup: Lagun FTV-3 mill, Mesa 5i20, 2x 7i29 drives, 7i37TA opto IO board

I've recently begun integrating some SSR's into the mill in order to control various tasks. To that end I've now got the 7i37 wired to 6 SSR's that control my servo power supply, enable the switches and contactors for the spindle motor, spindle brake, coolant pump, lube pump and a light mounted on the head.

Now, at current time I don't have the spindle really controlled by linuxCNC and while I have plans for a VFD in the future, I'm still a few months away from buying one. So I have an SSR which is tied in PNCConf to "machine enable" which controls power to the contactors that run spindle motor forward and reverse. That way, even though I must manually start the spindle, if I hit the Estop my spindle motor power is interrupted.

The downside of using "machine enable" however is that when I get to the end of a program, my spindle brake turns on but since the machine hasn't E-stopped or been turned off, my spindle is still running! Obviously this is NOT what I want to be doing, so is there an easy way to make sure that when spindle brake is on, the pin running to the spindle enable contactor is off, and vise versa, but can only enable when "machine enable" is also on? Thanks!
Last edit: 08 Oct 2013 03:39 by greenbuggy.

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

More
08 Oct 2013 06:00 #39628 by andypugh

is there an easy way to make sure that when spindle brake is on, the pin running to the spindle enable contactor is off, and vise versa, but can only enable when "machine enable" is also on? Thanks!


Yes, but I don't quite follow your description.
Can you write out a little table of what output you want for each of the combination of inputs, and then we can figure out the logic?

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

More
08 Oct 2013 06:12 #39629 by BigJohnT
First off if your spindle motor is 3hp or less you can power it with 220v single phase to an Automation Direct GS-2 VFD and control that with LinuxCNC via the gs2 component.

Machine Enable just sounds wrong for spindle control. I would resist having the brake come on automagicly until your controlling the spindle with LinuxCNC. When you have the spindle under control use motion.spindle.on and motion.spindle.brake to control your spindle.

I does sound like it is time to leave pncconf and start learning HAL. It is very simple with very few commands.

www.linuxcnc.org/docs/html/hal/basic_hal.html

JT

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

More
08 Oct 2013 08:26 #39632 by greenbuggy
Thanks for the heads up on the VFD. Although, the reason I'm not running with a VFD yet is simply because I don't have the money right now, which is why I think its a few months out (maybe tax return time?)

I have a _very_ limited understanding of HAL and was hoping there would be a simple PNCConf way to do this because I'm annoyed by having to go thru my backup files and swap stuff back over every damn time I use PNCConf! But if there's no simple way I'll figure out a way to link them together using HAL, I wasn't sure if I should be using HAL or the classicladder to accomplish this task.

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

More
08 Oct 2013 08:28 #39633 by greenbuggy

is there an easy way to make sure that when spindle brake is on, the pin running to the spindle enable contactor is off, and vise versa, but can only enable when "machine enable" is also on? Thanks!


Yes, but I don't quite follow your description.
Can you write out a little table of what output you want for each of the combination of inputs, and then we can figure out the logic?


Ok here goes:
Machine Enable + spindle brake on = pin off
machine enable + spindle brake off = pin on
machine disable + spindle brake on = pin off
machine disable + spindle brake off = pin off

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

More
08 Oct 2013 11:50 #39637 by cmorley
I think if you used spindle on and an edge controlled timer to turn off for a second would do what you want.

make it so when the spindle-on goes true to false, it uses the timer to break power.

You could use classicladder or HAL components to do this.

If I understand what your asking for :)

Chris M

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

More
08 Oct 2013 12:04 - 08 Oct 2013 12:08 #39638 by cmorley
This is a sample CL program I was thinking of.
the input is connected to spindle-on. It is edge sensitive - true only when going from true to false.
the output is connected to your spindle drive contactor. It is inverted so is normally closed, so you can turn the spindle on
The monostable is set for 1 second, which breaks the contact for 1 second.

Chris M
Attachments:
Last edit: 08 Oct 2013 12:08 by cmorley.

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

More
08 Oct 2013 17:41 #39649 by andypugh

Machine Enable + spindle brake on = pin off
machine enable + spindle brake off = pin on
machine disable + spindle brake on = pin off
machine disable + spindle brake off = pin off


In terms of logic that is "Machine enable AND NOT Brake"
www.linuxcnc.org/docs/html/man/man9/not.9.html
www.linuxcnc.org/docs/html/man/man9/and2.9.html
This assumes that the signals "brake", "spindle-on" and "enable" are defined elsewhere in the HAL.
loadrt not count=1
loadrt and2 count=1
...
addf not.0 servo-thread
addf and2.0 servo-thread
...
net brake not.0.in
net not-brake not.0.out =>  and2.0.in0
net enable and2.0.in1
net spindle and2.0.out

If you need delays, then look at www.linuxcnc.org/docs/html/man/man9/timedelay.9.html
For example, this would wait for half a second after the brake went off before starting the spindle but would turn off the spindle immediately that the brake came on.
loadrt not count=1
loadrt and2 count=1
loadrt timedelay count=1
...
addf not.0 servo-thread
addf and2.0 servo-thread
addf timedelay.0 servo-thread
...
setp timedelay.0.on-delay 0.5
setp timedelay.0.off-delay 0
net brake not.0.in
net not-brake not.0.out =>  timedelay.0.in
net not-brake-delayed timedelay.0.out => and2.0.in0
net enable and2.0.in1
net spindle and2.0.out

I have a vague feeling that I have reversed the sequence of events, but this matches the logic as you defined it.

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

More
19 Oct 2013 10:34 - 19 Oct 2013 10:35 #40058 by greenbuggy
Got it!
For this example, on the 5i20 GPIO pin 40 is the spindle brake and GPIO pin 44 is the SSR that allows power to the forward/reverse contactor buttons and also the machine light (makes it simple to tell if I can start the spindle or not)

# in Lagun.hal
setp hm2_5i20.0.gpio.040.is_output true
net spindle-brake hm2_5i20.0.gpio.040.out
setp hm2_5i20.0.gpio.040.invert_output true

# in custom.hal
setp hm2_5i20.0.gpio.044.is_output true

loadrt not count=1
loadrt and2 count=1

net spindle-brake not.0.in
net not-spindle-brake not.0.out =>  and2.0.in0
net machine-is-enabled and2.0.in1
net spindle-is-enabled and2.0.out

Last edit: 19 Oct 2013 10:35 by greenbuggy.

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

Time to create page: 0.099 seconds
Powered by Kunena Forum