encoder configuration help for threading

More
3 years 11 months ago #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.

Please Log in to join the conversation.

More
3 years 11 months ago #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

Please Log in to join the conversation.

More
3 years 11 months ago #256536 by Ismacr63
thanks for your reply. I have to add that line to the main file hal?

Please Log in to join the conversation.

More
3 years 11 months ago #256538 by PCW
Its possibly already there (though set to 0 or false)

Please Log in to join the conversation.

More
3 years 11 months ago #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.

Please Log in to join the conversation.

More
3 years 11 months ago #256547 by PCW
Can you verify that the "A" pin (encoder.0.phase-A)
toggles when you rotate the spindle slowly?

Please Log in to join the conversation.

More
3 years 11 months ago #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.

Please Log in to join the conversation.

More
3 years 11 months ago #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

Please Log in to join the conversation.

More
3 years 11 months ago #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?

Please Log in to join the conversation.

More
3 years 11 months ago #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)

Please Log in to join the conversation.

Time to create page: 0.102 seconds
Powered by Kunena Forum