× Forum Header

Configuring Spindle Feedback with Proximity Sensor

More
28 Apr 2011 12:41 #9458 by Rick4004
I have been trying to get this same setup to work. I contacted Russ offline and he sent me a copy of his HAL file that I have tried to incorporate into my own.

The only thing that gives me a problem is the line "net spindle-position encoder.0.position-interpolated => motion.spindle-revs". If I leave out the word "interpolated", then EMC will start and run. If I include the word,
then I get an error message when I try to start EMC "spinle-test.hal:31:pin encoder.0.position-interpolated does not exist"

When I run EMC without the "interpolated" statement, I think EMC is finding the index position, but I don;t think it is registering the speed. I cannot get the speed to register in the Spindle Speed dialoge box in Axis.
(Although this may be because I am not using the right output statement in the spindle_to_pyvcp.hal file)

This is what I currently have "linksp spindle-speed pyvcp.spindle-speed"

If I open up the Show Hal Configuration dialogue box and watch what is happening, this is what I get:

> Spindle-CMD - toggles between 0 and 1 when I toggle F9
> Spindle-index-enable - The icon stays brown all the time
> Spindle-Phase-a - The icon is yellow
> Spindle-Position - The number starts at 1 and then changes as the spindle turns
> Spindle-Velocity - Stays at 0

My spindle motor is not connected to the computer, I manually start it. If I first I issue a spindle speed command (M3 S100), then I issue a command (G33 Z-1 k.0625) the machine will move from Z0 to Z-1 in a series of jerks, (I am guessing a series of .0625" jerks).

So, it would seem to me that maybe EMC is registering the spindle
position, but not the spindle speed.

Thanks for any help you can provide, I think I am close, but close only counts in horseshoes and hand-grenades,,,

I have attached my Hal file,

Rick

File Attachment:

File Name: spinle_test.hal
File Size:3 KB
Attachments:

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

More
28 Apr 2011 13:16 #9460 by andypugh
Your problem is that spindle-position only updates when the edge is detected, whereas position-interpolated updates every servo cycle (with a best-guess value).

If you don't have position-interpolated it probably means that you are using an old version of EMC2. I would suggest an upgrade (you don't have to change the OS, the fact that the 2.4 LiveCD is on Ubuntu 10.04 is a coincidence, not a necessity.

2.4.6 is the current latest release. You should be able to update through apt.

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

More
29 Apr 2011 09:20 #9497 by ArcEye
Hi,

For what it is worth I will share my experience on a similar vein.

I have a spindle index provided by a hall effect switch triggered by a rare earth magnet embedded in the aluminium spindle pulley.
So it is pretty much similar to yours, by a slightly different path.

It provides a very good and accurate RPM reading and I wanted to see if I could thread with it alone.

With some help from Andy I set up the .hal so that the output was fed to encoder.0.phase-A and ..phase-Z and EMC thought it had all it needed for threading.

In practice however it just didn't work. Despite giving it a long feed in to stabilise Z axis speed before reaching the thread, after a few passes, if that, the Z feed would stutter as it struggled to match position with index and errors occurred.

So I made a 120 hole indexing disc, used with an optical switch. Again with Andy's help, I built a comparator circuit to give a clean on and off signal, which is very necessary when you are talking about 3mm holes with approx 3mm spacing between them turning at several hundred RPM

The result was perfect threading and a smooth perfectly timed Z axis movement.

I have pasted the relevant section from my .hal file along with the comment I made at the time after the first test.
If this is of any interest I can forward the remainder of my setup.

regards

##########################################################################
# Had several tries to get proper index for threading
# Eventually used a 120mm PCD 120 hole disc, with optical sensor through
# comparator, for clean on/off
# spindle index is still provided by a single rare earth magnet via a hall-effect.
# At first test, cut a perfect 1.5mm pitch thread using a tool steel cutter
# presented at 90deg to the billet!
# Optimal pulses appears to be around 120, 60 works but 120 is better, 240 is too high
############################################################################

setp encoder.0.position-scale 120
setp encoder.0.counter-mode 1
net spindle-position encoder.0.position-interpolated => motion.spindle-revs
net spindle-velocity encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable

net spindle-index parport.0.pin-11-in-not => encoder.0.phase-Z
net spindle-pulse parport.1.pin-10-in => encoder.0.phase-A

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

More
23 Jul 2018 13:05 #114703 by russkinch
Hi. Not sure how old this thread is but found it extremely usefull as I think the issue I am having is with the sensors themselves. Anything below 350rpm is fine, after that the steppers stutter and stall. Any chance of sending me a diagram or build instructions on yours? I have a 45 hole discs but screw cutting is VERY slow.

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

Time to create page: 0.092 seconds
Powered by Kunena Forum