Spindle index-enable for threading repeat passes.

More
17 Oct 2011 13:00 #13981 by NICKKINSMAN
I wanted to repost this question here since it seems to be moving into a config probem possibly?

So, I've got spindle encoder feedback seems to be working - I've got EMC RPM meter running, and in the Machine -config the spindle-revs pin is counting up at a lot of decimal places to 1 count per revolution. The spindle index-enable pin is red, false, as expected. I believe the coutning means the A/B encoder on the spindle is working, I guess I am not sure if this means the I-channel is working too? Or how to test that? I re-checked my wiring and pinout and it should be going in the right place! This is the first time running this machine, so it is possible the encoder is not working right.

I ran a G76 threading cycle and found that it would index and start, but only after stopping the spindle at each pass. So, it would not start a pass with spindle moving, but once I stopped and restarted it would right away sync and do a pass, then rapid return Z and move in X for next pass, but would not start cutting. Once I stopped and re-started the spindle, it would then sync (you could see the hesitation while it waited for the spot to come around, running spindle slow) complete the next pass, return, etc and stop. Stop spindle, restart, Etc, etc....until completed passes.

For some reason it is not giving the spindle enable signal allowing it to sync and start the pass. Is there a setting in EMC that would cause this to happen? I was not turning the spindle very fast either, 500 rpm. I did not try it on really slow speeds. I've got axis acceleration at like 1.5 in/s^2.

Thanks!
Nick

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

More
17 Oct 2011 13:04 #13982 by NICKKINSMAN
Andy, just noticed you had replied prior, thanks -

I scrapped using the BobCAD g-code and just ran a test G76 cycle right out of the EMC manual to see what was going on and the above described is what I was finding - some sort of index-enable problem. As expected, the EMC G-code string seems to be executing perfectly. Just getting that index-enable signal....

Thanks!

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

More
17 Oct 2011 13:31 #13986 by BigJohnT

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

More
17 Oct 2011 13:46 #13987 by andypugh
NICKKINSMAN wrote:

I ran a G76 threading cycle and found that it would index and start, but only after stopping the spindle at each pass. So, it would not start a pass with spindle moving, but once I stopped and restarted it would right away sync and do a pass, then rapid return Z and move in X for next pass, but would not start cutting. Once I stopped and re-started the spindle, it would then sync (you could see the hesitation while it waited for the spot to come around, running spindle slow) complete the next pass, return, etc and stop. Stop spindle, restart, Etc, etc....until completed passes.


This seems very strange. One possibility is that the index sensor is too slow to pick up a state change at normal RPM, or that there is a debounce in the HAL file making it too slow.

It is relatively easy to test. Start EMC2, then open the machine->show hal config window.

In the box at the bottom of the right-hand pane (you might need to expand the window to see it) type the following (using the correct number for your spindle encoder in place of "N")

unlinkp encoder.N.index-enable

This unlinks the encoder index-enable pin from Axis, so that you can set it by hand.
Now, type
setp encoder.N.index-enable true

and you should see the pin change state.
You can then turn the spindle by hand and verify that it goes false when the index mark goes through the sensor.

Now try the same thing at a range of spindle speeds, and see if it stops working at some speed.

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

More
17 Oct 2011 18:05 #13993 by NICKKINSMAN
OK, thanks for the reply, I will give those both a try and see what I can get!

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

More
18 Oct 2011 02:39 - 18 Oct 2011 02:42 #14000 by NICKKINSMAN
OK, so I went thru and tested as you suggested, Andy.

The pin state was showing 'FALSE at start. I was able to unlink the encoder, although the thread turned out to be unlinkp hm2_5i20.0.encoder.04.index-enable. Not sure if the hm2 is significant or not, but thats what it would accept. It also shows <=> motion.spindle-index-enable linked up as well (left that linked to begin with).

I then ran the setp hm2......... true and the command box showed it had been set to true. However, the 'value' still remained at 'FALSE', even when rotating the spindle. Same with the red dot on the 'watch' tab. Tried clicking in and out/etc, rotating spindle/etc but no change. Checked the spindle rev counts/etc and everything was counting up as expected.

Also tried unlinking the motion.spindle-index-enable as well, and setting to 'true' again, but still no change (despite saying it had changed)

I don't understand this one!

As an FYI I did notice some lowpass filtering in the postgui HAL file, it is setup for the GS2 RPM meter widgit I added to Axis. Not sure if that would affect this?

I also tried putting in the code as John suggested, but it would not accept the lines, I guess it may already be linked up? I find some index-enable code in the spindle seciton, although it does not look like what you posted. (it was setup by PnCConf, I did not change anything). Here is the HAL spindle code:

#*******************
# SPINDLE S
#*******************

# ---Encoder feedback signals/setup---

setp hm2_5i20.0.encoder.04.counter-mode 0
setp hm2_5i20.0.encoder.04.filter 1
setp hm2_5i20.0.encoder.04.index-invert 0
setp hm2_5i20.0.encoder.04.index-mask 0
setp hm2_5i20.0.encoder.04.index-mask-invert 0
setp hm2_5i20.0.encoder.04.scale [SPINDLE_9]INPUT_SCALE

net spindle-revs <= hm2_5i20.0.encoder.04.position
net spindle-vel-fb <= hm2_5i20.0.encoder.04.velocity
net spindle-index-enable <=> hm2_5i20.0.encoder.04.index-enable

# ---setup spindle control signals---

net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
net spindle-vel-cmd <= motion.spindle-speed-out
net spindle-enable <= motion.spindle-on
net spindle-cw <= motion.spindle-forward
net spindle-ccw <= motion.spindle-reverse
net spindle-brake <= motion.spindle-brake
net spindle-revs => motion.spindle-revs
net spindle-at-speed => motion.spindle-at-speed
net spindle-vel-fb => motion.spindle-speed-in
net spindle-index-enable <=> motion.spindle-index-enable

# ---Setup spindle at speed signals---

net spindle-vel-cmd-rps => near.0.in1
net spindle-vel-fb => near.0.in2
net spindle-at-speed <= near.0.out
setp near.0.scale 1.1

Thanks for the help!!
Nick
Last edit: 18 Oct 2011 02:42 by NICKKINSMAN.

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

More
18 Oct 2011 03:50 #14003 by PCW
Replied by PCW on topic Re:Tested, no change in Value!!
If you unlink the index enable signal (hm2_5i20.0.encoder.04.index-enable)
you should be able to manually setp it true
and see it get cleared (become false) at one point
of the spindle shaft rotation. If its immediately cleared, regardless of shaft position
you probably need to invert the index polarity
(man HostMot2)

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

More
18 Oct 2011 09:18 #14008 by andypugh
As Pete has said, you probably need to invert the index polarity ( setp hm2_5i20.0.encoder.04.index-invert 1 )
It might be instructive to look at the gpio pin that corresponds to the encoder.04.index. You can figure that out from the dmesg output, which will list all the Mesa card pins along with their function and associated gpio pin number.
You can then look at the value of that pin with halmeter or halscope and check that it does momentarily change state once per rev, and see which way it moves. If the pin is normally high but goes low, you need to set index-invert. If it is always high and never goes low, there is a different problem.

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

More
20 Oct 2011 01:58 #14069 by NICKKINSMAN
OK, thanks I will try the invert trick and see if that works. I don' t think it is a problem with the hardware as I have a spare encoder and I tried that too. However, it could be a problem with the encoder wire itself, possibly. But, I will try this first and see if it works!

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

More
24 Oct 2011 11:56 #14160 by NICKKINSMAN
Replied by NICKKINSMAN on topic More testing...
I did some further testing, found Hal Meter & Hal Scope to be pretty useful!

On Hal Meter, pin 29 in (spindle index in my case) the value comes up as 'FALSE' to start with and I was able to watch it switch to 'TRUE' when hitting the index mark. The problem is it does not seem to do this consistently - I can get it to swap back and forth if I move it VERY slowly back and forth over the index mark, but at even a slow (20 RPM) continuous speed it does not seem to pick it up (or at least show it) except occasionally.

So then I was suspecting a connection problem and I ran the Hal Scope to check it out. Monitoring pin 29, it starts low, and seems to be getting a signal every time - it jumps up by one division each revolution, even at fast speeds (I ran it at 500 RPM). If I turn it very slowly the jumps are much longer on the X axis, and if very fast they are just lines, but still there - and they jump fully 1 division vertically on the scope each time, even at 500 RPM. So in this case I don't think this is an invert problem, and it seems to be putting out signal at each revoluiton, so why is EMC not getting/using that signal?

I tried going back to the calibration screen and unlinking the signals again and turning the encoder to true, but again I can't get it to change value on the screen.

Now I'm really confused, because the hardware seems to be putting out a signal to the software, so either it is a poor signal or it is not getting pickud up consistently or something similar??

And I checked the threading cycle again and I still have to do that stop between each pass in order to get it to proceed. It tired slowing it down to a crawl and still could not get it to go.

Thanks for the help!
Nick

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

Time to create page: 0.339 seconds
Powered by Kunena Forum