encoder configuration help for threading

More
12 Nov 2022 19:47 - 12 Nov 2022 19:48 #256524 by Ismacr63
Hello, I am trying to configure an encoder and an index sensor to be able to make a thread on my lathe converted to cnc.

I am very new to linuxcnc, I am having a hard time understanding the linuxcnc environment and I would need a little help to configure it.

I am using a 600prr 2 phase (A - B ) encoder and an inductive proximity sensor as the index sensor.

I have the encoder connected to pin 12 as phase A and the proximity sensor to pin 13 as spindle index.

in gmoccapy it doesn't show anything in rpm. in hal meter it shows as true and false when moved.

forgive my bad english

Thanks. All the best.
Last edit: 12 Nov 2022 19:48 by Ismacr63.

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

More
12 Nov 2022 20:58 #256535 by PCW
If you have a single pin encoder (just "A") you need to
set the encoder into counter mode, something like:

setp encoder.N.counter-mode true
The following user(s) said Thank You: Ismacr63

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

More
12 Nov 2022 21:02 #256536 by Ismacr63
thanks for your reply. I have to add that line to the main file hal?

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

More
12 Nov 2022 21:18 #256538 by PCW
Its possibly already there (though set to 0 or false)
The following user(s) said Thank You: Ismacr63

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

More
12 Nov 2022 21:31 - 12 Nov 2022 21:39 #256541 by Ismacr63
I think it appears correctly.
attached my hal file.

in the file it appears with "N" but it was with 0. with N it does not start the program.
Attachments:
Last edit: 12 Nov 2022 21:39 by Ismacr63.

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

More
12 Nov 2022 23:01 #256547 by PCW
Can you verify that the "A" pin (encoder.0.phase-A)
toggles when you rotate the spindle slowly?
The following user(s) said Thank You: Ismacr63

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

More
13 Nov 2022 00:43 #256552 by Ismacr63

Can you verify that the "A" pin (encoder.0.phase-A)
toggles when you rotate the spindle slowly?



As you can see in the screenshots, the value changes when I move the spindle slowly. the other catch the spindle was turning.
Attachments:

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

More
13 Nov 2022 00:49 - 13 Nov 2022 00:53 #256553 by PCW
OH, OK, I misunderstood, the encoder is working but just not displayed in gmoccapy

looking at:

linuxcnc.org/docs/html/gui/gmoccapy.html#_spindle_feedback_pins

it seems you must connect the pin gmoccapy.spindle_feedback_bar to the spindle RPM signal
in a hal file
Last edit: 13 Nov 2022 00:53 by PCW.
The following user(s) said Thank You: Ismacr63

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

More
13 Nov 2022 01:02 - 13 Nov 2022 01:05 #256554 by Ismacr63

OH, OK, I misunderstood, the encoder is working but just not displayed in gmoccapy

looking at:

linuxcnc.org/docs/html/gui/gmoccapy.html#_spindle_feedback_pins

it seems you must connect the pin gmoccapy.spindle_feedback_bar to the spindle RPM signal
in a hal file


These would be the 2 lines that must be put in postgui or are they incomplete?

gmoccapy.spindle_feedback_bar

gmoccapy.spindle_at_speed_led

On the other hand, the index sensor also returns true and false, but what is its function? or how do I know that it is doing its job?
Last edit: 13 Nov 2022 01:05 by Ismacr63.

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

More
13 Nov 2022 01:15 #256555 by PCW
Yes, these need to be connected in your postgui.hal file with net statements

probably something like

net spindle-at-speed => gmoccapy.spindle_at_speed_led


the gmoccapy.spindle_feedback_bar connection in the postgui.hal file needs
a new signal in the normal hal file:

net spindle-velocity-feedback-rpm encoder.0.velocity-rpm

and then

net spindle-velocity-feedback-rpm => gmoccapy.spindle_feedback_bar

in the postgui.hal file


The index connection resets the spindle position to 0 when
LinuxCNC requires a spindle synchronized move (like threading)
The following user(s) said Thank You: Ismacr63

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

Moderators: newbynobiHansU
Time to create page: 0.084 seconds
Powered by Kunena Forum