NEWS
LinuxCNC 2.5.4 Release
There are no translations available.

LinuxCNC 2.5.4 Update Released (changelog).
 
LinuxCNC 2.5.3 Release
There are no translations available.

LinuxCNC 2.5.3 Update Released (changelog).
 
LinuxCNC 2.5.2 Release
There are no translations available.

LinuxCNC 2.5.2 Update Released (changelog).
 
Home Forum Configuring LinuxCNC HAL Components Unable to Reverse the Spindle

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Unable to Reverse the Spindle

Unable to Reverse the Spindle 09 Мар 2012 12:10 #18484

  • thebuc
  • thebuc's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
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 :) This attachment is hidden for guests. Please log in or register to see it.
Attachments:
  • Attachment This attachment is hidden for guests. Please log in or register to see it.
The administrator has disabled public write access.

Re:Unable to Reverse the Spindle 09 Мар 2012 12:47 #18485

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 5806
  • Thank you received: 232
  • Karma: 155
My first question is what does your spindle drive expect to go fwd and rev?

John
The administrator has disabled public write access.

Re:Unable to Reverse the Spindle 09 Мар 2012 13:20 #18490

  • thebuc
  • thebuc's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
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
The administrator has disabled public write access.

Re:Unable to Reverse the Spindle 09 Мар 2012 13:22 #18491

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 5806
  • Thank you received: 232
  • Karma: 155
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
The administrator has disabled public write access.

Re:Unable to Reverse the Spindle 09 Мар 2012 13:22 #18492

  • cncbasher
  • cncbasher's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1062
  • Thank you received: 94
  • Karma: 60
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
The administrator has disabled public write access.

Re:Unable to Reverse the Spindle 09 Мар 2012 13:36 #18496

  • thebuc
  • thebuc's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
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.
The administrator has disabled public write access.

Re:Unable to Reverse the Spindle 09 Мар 2012 13:40 #18497

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 5806
  • Thank you received: 232
  • Karma: 155
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
The administrator has disabled public write access.

Re:Unable to Reverse the Spindle 09 Мар 2012 13:47 #18499

  • thebuc
  • thebuc's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
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.
The administrator has disabled public write access.

Re:Unable to Reverse the Spindle 09 Мар 2012 14:20 #18501

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 5806
  • Thank you received: 232
  • Karma: 155
I see your using PWM and have some gear change stuff in there, do you have a two speed spindle?

John
The administrator has disabled public write access.

Re:Unable to Reverse the Spindle 09 Мар 2012 14:25 #18502

  • thebuc
  • thebuc's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
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.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 1.684 seconds
Powered by Kunena Forum
© 2014 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.