- User Interfaces
- Gmoccapy
- Frustrated - cant figure out how to display encoder speed on any gui for lathe
Frustrated - cant figure out how to display encoder speed on any gui for lathe
- ffffrf
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 1
29 Apr 2025 21:19 #327316
by ffffrf
Frustrated - cant figure out how to display encoder speed on any gui for lathe was created by ffffrf
So...I am not 100% sure if this is a gmoccapy issue or a deeper linuxcnc issue but I suspect it is something with the GUI.
A long time ago, I made a generic XZ lathe + analog motor + external incremental rotary encoder HAL/INI via AXIS gui. All worked well, and the side of the AXIS GUI displayed the spindle speed bar plus the red button indicating if spindle was at speed or not. It worked correctly.
However, now I have build a different machine: a custom XZC lathe with a STEPGEN controlled servo spindle, and I am trying to simply have the same thing work where when I run the servo motor, I see the RPM based on what the encoder sees. The wiring of this machine is all the same as the last one minus a C axis and servo.
BUT... NOTHING I do allows me to see this information and I cant figure out what it is. Axis GUI does not display any spindle speed displays. I thought maybe it was an AXIS issue and switched to gmocappy, which I atleast was now seeing a spindle speed bar. However, when i turn the spindle on, I just see the default comanded rpm instead of what the encoder sees.
This is the relevant section of the HAL:
#Original 4 lines from "MODLATHE" working hal/ini
setp lowpass.spindle.gain 1.000000
net spindle-vel-fb-rpm => abs.spindle.in
net spindle-vel-fb-rpm-abs abs.spindle.out => lowpass.spindle.in
net spindle-fb-rpm-abs-filtered lowpass.spindle.out
net spindle-actual-rpm spindle-fb-rpm-abs-filtered => gmoccapy.spindle_feedback_bar
net spindle-actual-rpm spindle-fb-rpm-abs-filtered => gmoccapy.spindle_at_speed_led
#above 2 lines added in attempt to get gmocappy to display the correct
HOWEVER, any time I try to run the program, I get "spindle-fb-rpm-abs-filtered" but no matter what input i place into those two lines it says that pin does not exist
HALMETER: IN halmeter, I see abs.spindle.out and abs.spindle.in working correctly. Also, if I remove the belt from my encoder and monitor spindle-at-speed, if I command the spindle to move and then manually rotate the encoder, I get the value to change from true to false - which makes me think my setup is working and its more of a GUI issue?
Can someone help me figure out what I am doing wrong and how I can get gmoccapy to display my encoder RPM and if the spindle is at speed or not correctly?
my MODLATHE hal/ini is my original machine that had the working gui to show the encoder rpm and if the spindle was at speed or not.
my C+TURN axis hal/ini is my new custom machine i am trying to set up
A long time ago, I made a generic XZ lathe + analog motor + external incremental rotary encoder HAL/INI via AXIS gui. All worked well, and the side of the AXIS GUI displayed the spindle speed bar plus the red button indicating if spindle was at speed or not. It worked correctly.
However, now I have build a different machine: a custom XZC lathe with a STEPGEN controlled servo spindle, and I am trying to simply have the same thing work where when I run the servo motor, I see the RPM based on what the encoder sees. The wiring of this machine is all the same as the last one minus a C axis and servo.
BUT... NOTHING I do allows me to see this information and I cant figure out what it is. Axis GUI does not display any spindle speed displays. I thought maybe it was an AXIS issue and switched to gmocappy, which I atleast was now seeing a spindle speed bar. However, when i turn the spindle on, I just see the default comanded rpm instead of what the encoder sees.
This is the relevant section of the HAL:
#Original 4 lines from "MODLATHE" working hal/ini
setp lowpass.spindle.gain 1.000000
net spindle-vel-fb-rpm => abs.spindle.in
net spindle-vel-fb-rpm-abs abs.spindle.out => lowpass.spindle.in
net spindle-fb-rpm-abs-filtered lowpass.spindle.out
net spindle-actual-rpm spindle-fb-rpm-abs-filtered => gmoccapy.spindle_feedback_bar
net spindle-actual-rpm spindle-fb-rpm-abs-filtered => gmoccapy.spindle_at_speed_led
#above 2 lines added in attempt to get gmocappy to display the correct
HOWEVER, any time I try to run the program, I get "spindle-fb-rpm-abs-filtered" but no matter what input i place into those two lines it says that pin does not exist
HALMETER: IN halmeter, I see abs.spindle.out and abs.spindle.in working correctly. Also, if I remove the belt from my encoder and monitor spindle-at-speed, if I command the spindle to move and then manually rotate the encoder, I get the value to change from true to false - which makes me think my setup is working and its more of a GUI issue?
Can someone help me figure out what I am doing wrong and how I can get gmoccapy to display my encoder RPM and if the spindle is at speed or not correctly?
my MODLATHE hal/ini is my original machine that had the working gui to show the encoder rpm and if the spindle was at speed or not.
my C+TURN axis hal/ini is my new custom machine i am trying to set up
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18501
- Thank you received: 5065
29 Apr 2025 21:37 #327317
by PCW
Replied by PCW on topic Frustrated - cant figure out how to display encoder speed on any gui for lathe
# ---Setup spindle at speed signals---
net spindle-vel-cmd-rps => near.0.in1
net spindle-vel-fb-rps => near.0.in2
net spindle-at-speed <= near.0.out
setp near.0.scale 1.000000
setp near.0.difference 3.333333
#THESE 4 LINES BELOW WERE ADDED FROM MODLATHE TO TRY AND FIX encoder
setp lowpass.spindle.gain 1.000000
net spindle-vel-fb-rpm => abs.spindle.in
net spindle-vel-fb-rpm-abs abs.spindle.out => lowpass.spindle.in
net spindle-fb-rpm-abs-filtered lowpass.spindle.out
net spindle-fb-rpm-abs-filtered => gmoccapy.spindle_feedback_bar
net spindle-at-speed => gmoccapy.spindle_at_speed_led
net spindle-vel-cmd-rps => near.0.in1
net spindle-vel-fb-rps => near.0.in2
net spindle-at-speed <= near.0.out
setp near.0.scale 1.000000
setp near.0.difference 3.333333
#THESE 4 LINES BELOW WERE ADDED FROM MODLATHE TO TRY AND FIX encoder
setp lowpass.spindle.gain 1.000000
net spindle-vel-fb-rpm => abs.spindle.in
net spindle-vel-fb-rpm-abs abs.spindle.out => lowpass.spindle.in
net spindle-fb-rpm-abs-filtered lowpass.spindle.out
net spindle-fb-rpm-abs-filtered => gmoccapy.spindle_feedback_bar
net spindle-at-speed => gmoccapy.spindle_at_speed_led
Please Log in or Create an account to join the conversation.
- ffffrf
- Offline
- Junior Member
-
Less
More
- Posts: 32
- Thank you received: 1
29 Apr 2025 23:22 - 29 Apr 2025 23:24 #327319
by ffffrf
Replied by ffffrf on topic Frustrated - cant figure out how to display encoder speed on any gui for lathe
Thank you, I just ended up figuring it out and went to check the thread - what PCW wrote is exactly what i did (for others who stumble on this thread)!
Last edit: 29 Apr 2025 23:24 by ffffrf.
Please Log in or Create an account to join the conversation.
Moderators: newbynobi, HansU
- User Interfaces
- Gmoccapy
- Frustrated - cant figure out how to display encoder speed on any gui for lathe
Time to create page: 0.060 seconds