Unable to Reverse the Spindle
09 Mar 2012 20:10 #18484
by thebuc
Unable to Reverse the Spindle was created by thebuc
Hey guys.
The new tap head i just bought needs me to reverse the spindle to come back out of the hole and not destroy the threads in one single code. Up until now, I assumed that when I originally coded the spindle in the HAL that i was able to go in reverse. Unfortunately that is not that case. After looking around for a few hours myself, testing a few things, and consulting the internet I come to you all for help again haha.
My spindle can't be reversed using the M4 command. M3 works just fine to go forward but then just stops when I ask it to go backwards.
I noticed in my hal file that the 'spindle-cw' is netted to the 'parport-16-out' and the 'spindle-ccw' is not attached to any parport pins. Instead 'spindle-ccw' just dead-ends after the or2 function.
So I figured, as a good test, I'd just rename the 'spindle-cw' to 'spindle-ccw' so spindle-ccw was connected to the parport instead. Luckily, and logically, enough that made the spindle go backwards when I used M3, but still nothing with M4 (I figured that would happen).
What i think I need is some logic that creates a new signal to send to parport-16 depending on if i want to use ccw or cw. I just don't know how to do it.
What I have in mind is something like:
If spindle-cw is true then newsignal=spindle-cw
If spindle-ccw is true then newsignal=spindle-ccw
and then
newsignal => parport.0.pin-16-out
Well I think that makes logical sense i just don't have any idea how to use If statements in the Hal file. Any one have any suggestions?
I have my Hal File attached. I have a Tormach pcnc 770 and I think I use EMC 2.2.8.
thanks everyone
The new tap head i just bought needs me to reverse the spindle to come back out of the hole and not destroy the threads in one single code. Up until now, I assumed that when I originally coded the spindle in the HAL that i was able to go in reverse. Unfortunately that is not that case. After looking around for a few hours myself, testing a few things, and consulting the internet I come to you all for help again haha.
My spindle can't be reversed using the M4 command. M3 works just fine to go forward but then just stops when I ask it to go backwards.
I noticed in my hal file that the 'spindle-cw' is netted to the 'parport-16-out' and the 'spindle-ccw' is not attached to any parport pins. Instead 'spindle-ccw' just dead-ends after the or2 function.
So I figured, as a good test, I'd just rename the 'spindle-cw' to 'spindle-ccw' so spindle-ccw was connected to the parport instead. Luckily, and logically, enough that made the spindle go backwards when I used M3, but still nothing with M4 (I figured that would happen).
What i think I need is some logic that creates a new signal to send to parport-16 depending on if i want to use ccw or cw. I just don't know how to do it.
What I have in mind is something like:
If spindle-cw is true then newsignal=spindle-cw
If spindle-ccw is true then newsignal=spindle-ccw
and then
newsignal => parport.0.pin-16-out
Well I think that makes logical sense i just don't have any idea how to use If statements in the Hal file. Any one have any suggestions?
I have my Hal File attached. I have a Tormach pcnc 770 and I think I use EMC 2.2.8.
thanks everyone
Please Log in or Create an account to join the conversation.
09 Mar 2012 20:47 #18485
by BigJohnT
Replied by BigJohnT on topic Re:Unable to Reverse the Spindle
My first question is what does your spindle drive expect to go fwd and rev?
John
John
Please Log in or Create an account to join the conversation.
09 Mar 2012 21:20 #18490
by thebuc
Replied by thebuc on topic Re:Unable to Reverse the Spindle
I'm not sure what you mean. It can go both ways. It probably expects to go clockwise i guess.
If you mean what tool do I need to go fwd and rev for; it is a tormach tension compression taping head
www.tormach.com/store/index.php?app=ecom&ns=prodshow&ref=31806
with a collet too
www.tormach.com/store/index.php?app=ecom...how&ref=TCTH-COLLETS
If you mean what tool do I need to go fwd and rev for; it is a tormach tension compression taping head
www.tormach.com/store/index.php?app=ecom&ns=prodshow&ref=31806
with a collet too
www.tormach.com/store/index.php?app=ecom...how&ref=TCTH-COLLETS
Please Log in or Create an account to join the conversation.
09 Mar 2012 21:22 #18491
by BigJohnT
Replied by BigJohnT on topic Re:Unable to Reverse the Spindle
No, what I mean is does it (the drive) have a CW input and a CCW input and a Speed input or does it use +-10v to determine direction?
John
John
Please Log in or Create an account to join the conversation.
09 Mar 2012 21:22 #18492
by cncbasher
Replied by cncbasher on topic Re:Unable to Reverse the Spindle
could you use a single pole changeover relay to switch between cw & ccw , if the parallel port pin is high then it will be ccw or low it would be cw
depend if your vfd starts depending on direction pin or only on signal , but a second relay could be incorporated to cure that
depend if your vfd starts depending on direction pin or only on signal , but a second relay could be incorporated to cure that
Please Log in or Create an account to join the conversation.
09 Mar 2012 21:36 #18496
by thebuc
Replied by thebuc on topic Re:Unable to Reverse the Spindle
Hmm i don't know much about my drive. I think it only uses one pin for everything spindle related. I'll look around in the information I have and post back here if I find anything.
@cnc basher. What you say sounds good but how can I make a relay? Or how do I write that into the Hal.
@cnc basher. What you say sounds good but how can I make a relay? Or how do I write that into the Hal.
Please Log in or Create an account to join the conversation.
09 Mar 2012 21:40 #18497
by BigJohnT
Replied by BigJohnT on topic Re:Unable to Reverse the Spindle
You will have to know what your drive wants before you can make that work. Second point for rigid tapping you need a spindle encoder with an index.
John
John
Please Log in or Create an account to join the conversation.
09 Mar 2012 21:47 #18499
by thebuc
Replied by thebuc on topic Re:Unable to Reverse the Spindle
Yeah you are probably right about that, rigid tapping that is. I really didn't even think going in reverse in my machine would be a problem. Some one else just suggested to me that i need to take the absolute value of my PWN outputs because they are negative when I say the spindle should go in reverse.
I think he might be right because I watched the signal go negative in the hal meter. I'm going to try that out too.
I think he might be right because I watched the signal go negative in the hal meter. I'm going to try that out too.
Please Log in or Create an account to join the conversation.
09 Mar 2012 22:20 #18501
by BigJohnT
Replied by BigJohnT on topic Re:Unable to Reverse the Spindle
I see your using PWM and have some gear change stuff in there, do you have a two speed spindle?
John
John
Please Log in or Create an account to join the conversation.
09 Mar 2012 22:25 #18502
by thebuc
Replied by thebuc on topic Re:Unable to Reverse the Spindle
Yes I have two gears. And that has been working fine.
Right now im trying to implement something like this:
loadrt abs
addf abs.0 servo-thread
net spindle-cmd <= motion.spindle-speed-out => abs.0.in
net spindle-abs-cmd <= abs.0.out => pwmgen.0.value
But the problem is pwmggen.0.value is already defined from the end of the gear change code. And it says pin spindle-cmd doesn't exist.
Right now im trying to implement something like this:
loadrt abs
addf abs.0 servo-thread
net spindle-cmd <= motion.spindle-speed-out => abs.0.in
net spindle-abs-cmd <= abs.0.out => pwmgen.0.value
But the problem is pwmggen.0.value is already defined from the end of the gear change code. And it says pin spindle-cmd doesn't exist.
Please Log in or Create an account to join the conversation.
Time to create page: 0.089 seconds