software index signal with comp file. Good Idea? Spindle Encoder

More
30 Apr 2023 15:33 - 20 May 2023 20:16 #270311 by chili023
Hi. I am working on the spindle encoder on a early German CNC Lathe.
The encoder used is a 4800p/rev encoder as a quadratur but has no index signal. It came with the lathe and works fine.
The move G33 uses the index signal for the start of the move. 
Would it be ok to generate a software index. I could write a comp that reads the counts of the encoder and sets a index signal every 4800 counts.
Is there a easier way?

Thanks
Andreas
Last edit: 20 May 2023 20:16 by chili023.

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

More
30 Apr 2023 16:38 #270315 by andypugh
A better and more reliable way would be to add a separate index sensor that reads something directly connected to the spindle. (A bolt head, keyway, something like that)

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

More
20 May 2023 20:08 #271775 by chili023
Hello,
I added a light switch and wired it to GPIO:
hm2_7i95.0.gpio.052.in
when I want to link it to
net spindle-index-enable hm2_7i95.0.gpio.052.in spindle.0.index-enable
at startup the error shows:

./RoteRakete.hal:185: Signal 'spindle-index-enable' can not add I/O pin 'spindle.0.index-enable', it already has OUT pin 'hm2_7i95.0.gpio.052.in'
Shutting down and cleaning up LinuxCNC...

Do I need to wire the light switch signal to the encoder.02.index-in pin?

Thanks
Attachments:

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

More
20 May 2023 21:20 #271778 by PCW
What are you trying to accomplish?

Index enable pins are bi-directional or tri-state so you cannot
wire them directly to output pins (like hm2_7i95.0.gpio.052.in)

If you want the switch input to set index-enable you need to feed it
through the tri-state component:

loadrt tristate_bit
addf tristate_bit.0 servo-thread
setp tristate-bit.0.enable true
# may need some logic to drive enable depending on what you are trying to do

net switchxx hm2_7i95.0.gpio.052.in tristate_bit.0.in
net spindle.0.index-enable tristate_bit.0.out

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

More
20 May 2023 21:29 #271779 by chili023
I wired the Sensor sig to encoder.2.index-input
and used the config from the Spindle example.
net spindle-index-enable encoder.2.index-enable <=> spindle.0.index-enable
It works now. Thank you.

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

Time to create page: 0.092 seconds
Powered by Kunena Forum