Spindle encoder issues
- Peter_Cassar
- Offline
- Senior Member
- Posts: 56
- Thank you received: 1
#### SPINDLE ENCODER
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
setp encoder.0.position-scale 100.
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 => encoder.0.phase-Z
net spindle-pulse parport.0.pin-10-in => encoder.0.phase-A
Please Log in or Create an account to join the conversation.
linuxcnc.org/docview/html/examples/spind...d_spindle_feedback_a
John
Please Log in or Create an account to join the conversation.
My lathe with 120 hole optical disc has the below hal listing, which is ALMOST identical to yours;
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
The difference is that I set phase-Z to pin-11-in-not because otherwise the BOB inverted the signal and had index permanently on and just off once per rev.
Is this what is happening to you?
regards
Please Log in or Create an account to join the conversation.
- Peter_Cassar
- Offline
- Senior Member
- Posts: 56
- Thank you received: 1
Cheers,
Peter.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Peter_Cassar
- Offline
- Senior Member
- Posts: 56
- Thank you received: 1
Please Log in or Create an account to join the conversation.
- Peter_Cassar
- Offline
- Senior Member
- Posts: 56
- Thank you received: 1
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Hi All, I've tried inverting the index signal and it makes no difference. I'm not sure about the index-enable signal either. They way I understand the documentation is that the counts and position are supposed to be reset to 0 on the rising edge of the index signal. I don't see this happening at all. The counts and position keep incrementing as seen through the HAL meter. I've set up the HAL scope to monitor the signals and I see that the index and phase A signals are clean and regular.
encoder.N.index-enable bit i/o
When true, counts and position are reset to zero on the next rising edge of Phase-Z. At the same time, index-enable is reset to zero to indicate that the rising edge has occurred.
Otherwise it is not reset.
linuxcnc.org/docview/html/man/man9/encoder.9.html
John
Please Log in or Create an account to join the conversation.
- Peter_Cassar
- Offline
- Senior Member
- Posts: 56
- Thank you received: 1
I've attached my hal and ini files. I've checked things in the HAL components window and unlinked encoder.0.index-enable then executed setp encoder.0.index-enble and I can see the count and position reset to 0 but I don't know why it doesn't work when linked to spindle-index-enable and motion.spindle-index-enable using
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable
also if I have
setp encoder.0.index-enable 1
in the HAL file I don't see this set to true in the HAL Meter as it always remains false even at start up.
Thanks for looking,
Peter.
Please Log in or Create an account to join the conversation.