Spindle indexing signal direction
is started (which requires spindle at speed and perhaps other gcode specific conditions to be correct)
BTW the linked thread needs workarounds because the encoder is running in counter mode.
do you have a quadrature encoder ( A+B )? If so the hal workarounds should not be needed.
Please Log in or Create an account to join the conversation.
Below is my .hal regarding this :
loadrt encoder
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
# set the HAL encoder to 100 pulses per revolution.
setp encoder.0.position-scale 100
#set the HAL encoder count mode
setp encoder.0.counter-mode true
# connect the HAL encoder outputs to LinuxCNC.
net spindle-position encoder.0.position => spindle.0.revs
net spindle-velocity encoder.0.velocity => spindle.0.speed-in
#Z-strobe pulse
net spindle-index-enable encoder.0.index-enable <=> spindle.0.index-enable
#Connect HAL Encoder to Parallel Port
net spindle-phase-a encoder.0.phase-A <= parport.1.pin-10-in
net spindle-phase-b encoder.0.phase-B
#Z-Strobe pulse
net spindle-index encoder.0.phase-Z
net spindle-index <= parport.1.pin-11-in
#SPINDLE AT SPEED DETAIL
# load a near component and attach it to a thread
loadrt near
addf near.0 servo-thread
# connect one input to the commanded spindle speed
net spindle-cmd-rps-abs => near.0.in1
# connect one input to the encoder-measured spindle speed
net spindle-velocity => near.0.in2
# set the spindle speed inputs to agree if within 1%
setp near.0.scale 1.333
# connect the output to the spindle-at-speed input
net spindle-at-speed spindle.0.at-speed <= near.0.out
Please Log in or Create an account to join the conversation.
or use a full A/B encoder so you get the expected count direction in reverse
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I currently have a 100 slot wheel with two sensors collecting the A & Z.
Could I simply add another of the same sensor and offset it by hand slightly to obtain the 'B' phase?
Or, recently the old DC spindle motor failed and was replaced for a modern AC Servo that has A+/A- , B+/B- & Z+/Z- encoder feedback. Could I use this or would I have to start adding special electronics to count the signals from this method?
Or something else ?
I'm looking for the most cost effective solution that fits with my basic knowledge that's not going to take an age to set up.
What would you advise ?
Please Log in or Create an account to join the conversation.
ebay item: 125055080648
Would the 100ppr version be an option?
Please Log in or Create an account to join the conversation.
What would be my most practical & cost effective hardware solution here to obtain A/B & Z.
I currently have a 100 slot wheel with two sensors collecting the A & Z.
Could I simply add another of the same sensor and offset it by hand slightly to obtain the 'B' phase?
Or, recently the old DC spindle motor failed and was replaced for a modern AC Servo that has A+/A- , B+/B- & Z+/Z- encoder feedback. Could I use this or would I have to start adding special electronics to count the signals from this method?
Or something else ?
I'm looking for the most cost effective solution that fits with my basic knowledge that's not going to take an age to set up.
What would you advise ?
Yes you can just put another sensor on the slotted disc for the B just make sure you can slide it around the disc a little to get a 90' shift (it does not have to be next to the other sensor)
Or you can use the ABZ encoder you liked to. as long as the Z is 1:1 to the spindle.
If the servo encoder is 1:1 to the spindle you could use that as well.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
rider-83 post=234641 userid=29035</cite><div>I've now set up my Phase 'B' encoder, and using Halshow the signal is present and the sensor is functioning. I'm struggling to find any where any examples of a HAL configuration for a lathe using A/B &amp; Z. I'm looking through the manual/doc pages etc, but with out an example to follow it makes it very difficult to work out what is actually required. Can any one point me in the correct direction ?
This might help I did this for a small Boxford with a pport
Attachments:
Please Log in or Create an account to join the conversation.
This is extremely use full. I now have screw cutting working with M4 !
Thank you so much !!
I now have an issue with the thread pitch.
The pitch appears to be half that of what is requested (but that may just be coincidental).
However, its not correct.
When I look at the encoder velocity-rpm via HALshow, it is jumping all over.
At a commanded 100rpm we see readings jump down to 89 then upto 225.
I may have missed something in the HAL file, but I can't see the wood for the trees. What would cause this sort of reading?
Please Log in or Create an account to join the conversation.