Encoder Index

More
23 Nov 2020 07:46 #190101 by Stigoe
Encoder Index was created by Stigoe
Hi, all.

I'm running PP 2.5.1 on a modified WM290 (same as PM1127VF-LB) and I tried to do threading for the first time yesterday, but it just stops on the threading line. My suspicion is that it is waiting for the index signal. I've tried to check that the index signal is coming in using Halscope and to me it looks to come in as it should. Another possibility is that the index signal is wrong polarity. What polarity is the index signal supposed to be? Mine is active low (the Index led on the Status page is lit all the time). Could this be the problem?

From a post by PCW in the thread about fitting an encoder to a 1100 ( Link ) it seems the index signal is active high. It also says to check that the index signal is working by doing "halcmd sets index_enable" and rotating the spindle to see if it clears. Some handholding on how to do this?

Br,
Stig

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

More
23 Nov 2020 14:30 - 23 Nov 2020 14:30 #190118 by PCW
Replied by PCW on topic Encoder Index
With Mesa hardware the index polarity doesn't matter (its edge triggered)
You can change the polarity in hal but this will only change which edge
is active.

To know which signal you need to "sets" you would need to look at your hal file
and see which signal the low level hardware index pin is "net"ed to.

The you would run halcmd (not sure how you do this on PP) and halshow
to sets and watch this signal on a running PP system.
Last edit: 23 Nov 2020 14:30 by PCW.

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

More
23 Nov 2020 17:08 #190125 by Stigoe
Replied by Stigoe on topic Encoder Index
Thanks, PCW.

This is the encoder part of my .hal-file:
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.scale [SPINDLE]ENCODER_SCALE
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.counter-mode 0

# see 'man hostmot2' for descriptions
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-mask 0

net spindle-position hm2_[HOSTMOT2](BOARD).0.encoder.00.position => motion.spindle-revs
net spindle-raw-velocity hm2_[HOSTMOT2](BOARD).0.encoder.00.velocity => motion.spindle-speed-in lowpass.0.in
net spindle-velocity lowpass.0.out
net spindle-index-enable hm2_[HOSTMOT2](BOARD).0.encoder.00.index-enable <=> motion.spindle-index-enable

# note: gpio pins only read at servo thread frequency
# these nodes are only for driving diagnostic "LEDs" in the UI
# this is only going to be useful when the spindle is rotated by hand slowly
net spindle-phase-A hm2_[HOSTMOT2](BOARD).0.gpio.016.in
net spindle-phase-B hm2_[HOSTMOT2](BOARD).0.gpio.015.in
net spindle-phase-Z hm2_[HOSTMOT2](BOARD).0.gpio.014.in_not

net spindle-encoder-count hm2_[HOSTMOT2](BOARD).0.encoder.00.count

So I guess I would need to sets spindle-index-enable? Or would it be motion.spindle-index-enable?

I tried halcmd in a terminal, but the command was unknown. I found it in operator/tmc/bin. When I tried ./halcmd on spindle-index-enable, it complained about needing 2 arguments, while only 1 was given. Tried with "./halcmd sets spindle-index-enable 1", which worked, and when I checked both in halshow, they were both high and turned low after I had rotated the spindle some.

Any idea what to check next?

Br,
Stig

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

More
23 Nov 2020 21:58 #190152 by snowgoer540
Replied by snowgoer540 on topic Encoder Index
Did you see this post: forum.linuxcnc.org/pathpilot/34005-fitti...1100?start=60#166309

Clive basically laid out all the changes that need to happen to make this work. I am sure you can adapt it around what you've done...
The following user(s) said Thank You: Clive S

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

More
23 Nov 2020 23:41 #190164 by PCW
Replied by PCW on topic Encoder Index
OK so that indicates that index works.

Another possibility is that you don't have a valid spindle at speed signal

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

More
24 Nov 2020 03:25 #190187 by smgvbest
Replied by smgvbest on topic Encoder Index
I believe a ADMIN HALCMD ... will work from the MDI
for HALSHOW there are instructions for this one in the forum but I recall Tormach may have fixed this and it works now. I'm not where I can test and be sure but you can try ADMIN HALSHOW and see if it works

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

More
24 Nov 2020 19:40 #190216 by Stigoe
Replied by Stigoe on topic Encoder Index

Did you see this post: forum.linuxcnc.org/pathpilot/34005-fitti...1100?start=60#166309

Clive basically laid out all the changes that need to happen to make this work. I am sure you can adapt it around what you've done...

Thanks. Yes, I've seen this thread earlier (I even mentioned this thread in my original post), but there are quite a few differences between the 1100 mill and the SL15 lathe. I see that he has a "net spindle-at-speed" in his .hal-file, but this is commented out both in my .hal-file and in the original file from Tormach (as being not tested and not enabled).

OK so that indicates that index works.

Another possibility is that you don't have a valid spindle at speed signal

As stated above, I have a commented-out line about spindle-at-speed in my .hal-file, but this is also commented out in the original file from Tormach, and I believe threading works out of the box on a Tormach SL15. If not, I would be very surprised.
The code from the original (v2.2.4) .hal-file
##################################################
# SPINDLE-AT-SPEED - NOT YET TESTED - NOT ENABLED
##################################################
## for at-speed detection
## +/- 5% for true
#setp near.0.scale 1.05
## or with 25 RPM of commanded
#setp near.0.difference 25
#net spindle-cmd => near.0.in1
#net spindle-velocity => near.0.in2
#net spindle-at-speed near.0.out motion.spindle-at-speed
Is the commented-out parts why I wouldn't have a valid spindle at speed signal? If so, why would it work on an original SL15?

I believe a ADMIN HALCMD ... will work from the MDI
for HALSHOW there are instructions for this one in the forum but I recall Tormach may have fixed this and it works now. I'm not where I can test and be sure but you can try ADMIN HALSHOW and see if it works

Nothing happened when I tried ADMIN HALCMD (as far as I could tell), but ADMIN HALSHOW (and ADMIN HALMETER) works. halcmd works when run from ยจ/tmc/bin

Br,
Stig

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

More
24 Nov 2020 22:55 #190226 by snowgoer540
Replied by snowgoer540 on topic Encoder Index
My apologies, I missed that WM290 was a lathe.

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

More
25 Nov 2020 16:26 #190265 by Stigoe
Replied by Stigoe on topic Encoder Index

My apologies, I missed that WM290 was a lathe.

No problem. Thanks for the attempt. Appreciated.

I've tried to enable spindle-at-speed (uncommented the part of the .hal-file) without any change in behavior, except an entry on the Status page about synchronized motion waiting for the spindle, so it seems to be a problem with spindle at speed indication. When I ran the threading program, the speed was 477-479 RPM, while commanded was 500. I tried to set near.0.scale to both 1.05 (5%) and 1.10 (I guess this is 10%), and near.0.difference of both 25 RPM and 50 RPM. Same behavior for both settings.

I also checked motion.spindle-at-speed. Before I uncommented Spindle-at-speed in the .hal-file, I think it was showing true the whole time, both with and without the spindle running. After it was uncommented, it was showing false the whole time. Speed was 500 commanded, 477-479 actual.

The attached screen dumps show the message on the Status tab and where it stops in the program. The threading program was made with the Conversational programming.

Br,
Stig
Attachments:

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

More
25 Nov 2020 16:40 - 25 Nov 2020 16:42 #190267 by Aciera
Replied by Aciera on topic Encoder Index
If you want to force motion.spindle-at-speed to true you would comment out all lines it appears in your HAL and add this

setp motion.spindle-at-speed true

This way you would actually know that it is true and rule this out. Then you could move on to the next thing.
Last edit: 25 Nov 2020 16:42 by Aciera.

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

Moderators: cncbasher
Time to create page: 0.094 seconds
Powered by Kunena Forum