Spindle indexing signal direction

More
04 Feb 2022 15:19 - 04 Feb 2022 15:28 #233973 by PCW
Yes, SPINDLE.0.INDEX-ENABLE is only set true when a spindle synchronized motion
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.
Last edit: 04 Feb 2022 15:28 by PCW.

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

More
04 Feb 2022 15:51 #233974 by rider-83
Just A + Z

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.

More
04 Feb 2022 16:13 #233977 by PCW
Right, so you would either need to implement the workaround in the forum link
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.

More
04 Feb 2022 17:35 #233984 by rider-83
OK. I shall look into this. Thanks for the good info ..

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

More
05 Feb 2022 14:24 #234025 by rider-83
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 ?

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

More
05 Feb 2022 14:55 #234026 by rider-83
I've just found this:

ebay item: 125055080648

Would the 100ppr version be an option?

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

More
05 Feb 2022 16:56 #234032 by Clive S

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.

More
12 Feb 2022 14:42 #234641 by rider-83
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 & 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 ?

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

More
12 Feb 2022 15:58 - 12 Feb 2022 16:01 #234644 by Clive S

rider-83 post=234641 userid=29035&lt;/cite&gt;&lt;div&gt;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;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

File Attachment:

File Name: Boxford_20...2-12.tar
File Size:48 KB
Attachments:
Last edit: 12 Feb 2022 16:01 by Clive S.

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

More
13 Feb 2022 14:54 #234697 by rider-83
Clive,
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.

Time to create page: 0.086 seconds
Powered by Kunena Forum