Spindle encoder issues
- Peter_Cassar
- Offline
- Senior Member
- Posts: 56
- Thank you received: 1
Please Log in or Create an account to join the conversation.
you have ... setp encoder.0.position-scale 1
this should be 100 for a 100 slot encoder
if you watch the encoder pin a you should be able to slowly rotate the spindle by hand and count each slot
the after each 100 the index pin should show a count .
are the index slot and a encoder slot in your disk in alignment , so they both give a signal at the same time ?
Please Log in or Create an account to join the conversation.
- Peter_Cassar
- Offline
- Senior Member
- Posts: 56
- Thank you received: 1
I've been rotating the spindle by hand and I can see that the spindle-index goes true but the spindle.index-enable and encoder.0.index-enable always remain false not matter what the phase-z signal is doing. The count and position still increment beyond 100 counts basically heading to infinity. Do you think the slot alignment has something to do with this?
I've run a successfull G76 test and verified that the pitch comes out as specified in the parameters. The tool appears to be synched correctly to the spindle if I change speed manually the Z axis speeds up and slows down following the spindle speed. Something is working but I still don't understand why the counts dont reset at 100 pulses of phase-a. It's proving to be something of a mystery at the moment.
G33 is very unpredictable , sometimes it synchs with the spindle, other times it does nothing or races at full velocity.
I've used a proper oscilloscope to check the for clean signals coming from the encoder and it all looks good to me, nice square waves at near 5v. I've used some IR leds , op-amps and schmidt trigger inverters to build the encoder, it works in quadrature but I only use 1 channel plus the index. I'll plug the index hole and lengthen another slot to get the index and phase synched on edges and see if that makes a difference to the counter resets.
Cheers,
Peter.
Please Log in or Create an account to join the conversation.
i'd go for having the index pulse in alignment with one of the encoder slots ,
i dont expect the counts to reset as if it did positional information would be lost , but i must admit iv'e not checked , i'd expect an internal count to produce the rpm and an internal value to count the indexes and positional count , i.e 4 index counts and 450 encoder counts = 4 turns of 360 degrees + half a turn ( 50 counts ) ( put simply i will admit ) which would give the position exactly for screw cutting
i use a mesa card for my interface , so it just works ,
Please Log in or Create an account to join the conversation.
Have you tried just having this in your hal file
loadrt 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-not => encoder.0.phase-Z
net spindle-pulse parport.1.pin-10-in => encoder.0.phase-A
comment out
setp encoder.0.latch-input 1
setp encoder.0.index-enable 1
and anything else relating to the encoder
That is all I have in mine and it works perfectly.
I don't really understand why you want to set encoder.0.index-enable when you have linked it already or
why you are setting latch-input with both latch-rising and latch-falling TRUE (the default) when you are not
reading counts-latched anyway.
Regards alignment of index with a pulse, mine is not perfectly aligned and makes no difference to operation.
My index is a completely separate hall effect switch and the pulse is an optical disc.
regards
Please Log in or Create an account to join the conversation.
spindle-index-enable only goes true at the beginning of a spindle-synched motioncncbasher, I was experimenting with the position-scale but have since changed it back to 100. The spindle index isn't aligned with a slot or put another way the rising edges are not synchronised. I slotted an aluminum disk and lengthened one of the slots to create the index but since then I drilled it out to make the index signal duration longer. I could always plug it and lengthen another slot to fix that.
I've been rotating the spindle by hand and I can see that the spindle-index goes true but the spindle.index-enable and encoder.0.index-enable always remain false not matter what the phase-z signal is doing. The count and position still increment beyond 100 counts basically heading to infinity. Do you think the slot alignment has something to do with this?
until the index pulse is seen. At that moment, the encoder count is zeroed, and then
it counts in synch with the spindle until the operation is completed. So, the count will
again count up past 100. This is normal.
Synch between the index and the encoder pulses is not real critical, or at least it
shouldn't be. One possibility is that if the index pulse was shorter than one
base-period it could be missed. But, I think that is pretty unlikely.
It is not supposed to reset in normal operation, only at the beginning of a spindle-synchI've run a successfull G76 test and verified that the pitch comes out as specified in the parameters. The tool appears to be synched correctly to the spindle if I change speed manually the Z axis speeds up and slows down following the spindle speed. Something is working but I still don't understand why the counts dont reset at 100 pulses of phase-a. It's proving to be something of a mystery at the moment.
move.
That is odd. If G76 works, I can't see why G33 would not work.G33 is very unpredictable , sometimes it synchs with the spindle, other times it does nothing or races at full velocity.
Jon
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.
- Peter_Cassar
- Offline
- Senior Member
- Posts: 56
- Thank you received: 1
Peter.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Bad_German
- Offline
- New Member
- Posts: 6
- Thank you received: 0
I am trying to get my spinlde feedback setup correctrly so that I can make use of closed loop control.
The problem is the spindle-velocity is not constant and jumps arround allot (Screenshot 2).
Does anyone know what I have done wrong or can do to improve the consistency?
I have a 360ppr encoder with index pin, which appear to have minimal interference (Screenshot3).
I am on version 2.5.3,
my lathe config is attached, HAL - standard_pinout.hal.
my spindle position also keeps increasing without resetting every revolution.
I have tried ArcEyes exact code and various other thing with no success.
Please Log in or Create an account to join the conversation.