spindle speed
12 Oct 2020 22:22 #185890
by depronman
spindle speed was created by depronman
I am struggling to get spindle speed dislayed in Gmoccapy
I have a disc with a slot and many holes on the spindle and a single light sensor set up to read when the slot passes the sensor.
This is confirmed working via Hal show, the sensor is hooked up to par port 1 pin15
My simple question is what do I need to do in order to get the spindle rotaional speed showing in Gmoccapy
(I have spindle start / stop and speed control all working correctly, speed is via step/direction not PWM)
running LCNC V2.8
Thanks
Paul
I have a disc with a slot and many holes on the spindle and a single light sensor set up to read when the slot passes the sensor.
This is confirmed working via Hal show, the sensor is hooked up to par port 1 pin15
My simple question is what do I need to do in order to get the spindle rotaional speed showing in Gmoccapy
(I have spindle start / stop and speed control all working correctly, speed is via step/direction not PWM)
running LCNC V2.8
Thanks
Paul
Please Log in or Create an account to join the conversation.
13 Oct 2020 00:36 #185899
by JohnnyCNC
Replied by JohnnyCNC on topic spindle speed
I don't know if this will help but this is how mine is done in Axis.
Main .hal file
# Use ACTUAL spindle velocity from spindle encoder
# spindle-velocity bounces around so we filter it with lowpass
# spindle-velocity is signed so we use absolute component to remove sign
# ACTUAL velocity is in RPS not RPM so we scale it.
setp scale.0.gain 60
setp lowpass.0.gain .007
setp lowpass.0.load false
net spindle-vel-fb-rps hm2_5i25.0.encoder.00.velocity => scale.0.in
net spindle-fb-rpm scale.0.out => abs.0.in
net spindle-fb-rpm-abs abs.0.out => lowpass.0.in
net spindle-fb-rpm-abs-filtered <= lowpass.0.out
custom_postgui.hal
net spindle-fb-rpm-abs-filtered => pyvcp.spindle-speed
Main .hal file
# Use ACTUAL spindle velocity from spindle encoder
# spindle-velocity bounces around so we filter it with lowpass
# spindle-velocity is signed so we use absolute component to remove sign
# ACTUAL velocity is in RPS not RPM so we scale it.
setp scale.0.gain 60
setp lowpass.0.gain .007
setp lowpass.0.load false
net spindle-vel-fb-rps hm2_5i25.0.encoder.00.velocity => scale.0.in
net spindle-fb-rpm scale.0.out => abs.0.in
net spindle-fb-rpm-abs abs.0.out => lowpass.0.in
net spindle-fb-rpm-abs-filtered <= lowpass.0.out
custom_postgui.hal
net spindle-fb-rpm-abs-filtered => pyvcp.spindle-speed
Please Log in or Create an account to join the conversation.
13 Oct 2020 08:20 #185945
by Aciera
Replied by Aciera on topic spindle speed
This is what I do in gmoccapy:
#--- Spindle speed display
setp lowpass.spindle.gain 0.01
net spindle-rpm-raw => lowpass.spindle.in
net spindle-rpm-filtered <= lowpass.spindle.out => gmoccapy.spindle_feedback_bar
#--- Spindle speed display
setp lowpass.spindle.gain 0.01
net spindle-rpm-raw => lowpass.spindle.in
net spindle-rpm-filtered <= lowpass.spindle.out => gmoccapy.spindle_feedback_bar
Please Log in or Create an account to join the conversation.
13 Oct 2020 15:45 #185994
by newbynobi
Replied by newbynobi on topic spindle speed
And please remember, that all connections to gmoccapy Hal pin must be made in postgui.hal file!
Norbert
Norbert
The following user(s) said Thank You: Aciera
Please Log in or Create an account to join the conversation.
01 Sep 2022 14:49 #250928
by CNC_Tux
Replied by CNC_Tux on topic spindle speed
Hello Norbert,
i know you did a pretty well work in Gmoccapy, i got a smal problem with the Spindle Speed in Manual mode.
I suppose the problem is in front of the PC, but i need an idea to locate the problem.
Now whats wrong....
i switch the spindle turn right on, and i can change the spindle speed with the speed bar up and down ... its working perfect.
I switch spindle off and switch spindle turn left on ... spindle is working well, if i try to change the spindle speed, go the spindle to S0 and i cant restart the spindle again, i swicht Gmoccapy off and leave, and start it again, it will works all things normal again.
just by spindle turn left and to change something with the speed, happens the same procedure again.
I check it at the Gmoccapy sim ... its for me a test to see whats happend really.
in the Sim, switch spindle turn right on and change the speed, its working perfect with speed up and down.
switch i to spindle turn right and i try to change something, its impossible something to change, the spindle works left very well.
I suppose, i have a mistake in my configuration ..... do you have an idea for me whats my mistake?
Thank you so much in advance
Cheers
Reinhard
i know you did a pretty well work in Gmoccapy, i got a smal problem with the Spindle Speed in Manual mode.
I suppose the problem is in front of the PC, but i need an idea to locate the problem.
Now whats wrong....
i switch the spindle turn right on, and i can change the spindle speed with the speed bar up and down ... its working perfect.
I switch spindle off and switch spindle turn left on ... spindle is working well, if i try to change the spindle speed, go the spindle to S0 and i cant restart the spindle again, i swicht Gmoccapy off and leave, and start it again, it will works all things normal again.
just by spindle turn left and to change something with the speed, happens the same procedure again.
I check it at the Gmoccapy sim ... its for me a test to see whats happend really.
in the Sim, switch spindle turn right on and change the speed, its working perfect with speed up and down.
switch i to spindle turn right and i try to change something, its impossible something to change, the spindle works left very well.
I suppose, i have a mistake in my configuration ..... do you have an idea for me whats my mistake?
Thank you so much in advance
Cheers
Reinhard
Please Log in or Create an account to join the conversation.
01 Sep 2022 18:49 #250939
by HansU
Replied by HansU on topic spindle speed
What do you mean with "change the spindle speed with the speed bar up and down"?
How do you change the speed actually? The speed bar is only a display and the slider with the buttons is for the override...
Maybe it's related to github.com/LinuxCNC/linuxcnc/issues/1181 ?
Otherwise it would be helpful if you post your config. If I understood it right, it works in the sim config but not in your config, right?
How do you change the speed actually? The speed bar is only a display and the slider with the buttons is for the override...
Maybe it's related to github.com/LinuxCNC/linuxcnc/issues/1181 ?
Otherwise it would be helpful if you post your config. If I understood it right, it works in the sim config but not in your config, right?
Please Log in or Create an account to join the conversation.
01 Sep 2022 22:33 #250951
by CNC_Tux
Replied by CNC_Tux on topic spindle speed
Hello HansU,
yes thats right, i changed the speed with the slider (percent up and down)
The matter with MDI i know.
In the sim config works if the spindle turn right, in the left direction is impossible to change with the slider.
In my configuration works pretty well in the right direction, but in the left direction i move the slider or press the button (100%) go the spindle to S0 and i cant switch on again.
I suppose i have to do something in the postgui.hal
I will post my configuration tomorrow.
yes thats right, i changed the speed with the slider (percent up and down)
The matter with MDI i know.
In the sim config works if the spindle turn right, in the left direction is impossible to change with the slider.
In my configuration works pretty well in the right direction, but in the left direction i move the slider or press the button (100%) go the spindle to S0 and i cant switch on again.
I suppose i have to do something in the postgui.hal
I will post my configuration tomorrow.
Please Log in or Create an account to join the conversation.
02 Sep 2022 05:44 #250976
by CNC_Tux
Replied by CNC_Tux on topic spindle speed
Good morning HansU
now my HALs of the configuation.
Cheers
Reinhard
now my HALs of the configuation.
Cheers
Reinhard
Attachments:
Please Log in or Create an account to join the conversation.
04 Sep 2022 13:36 #251167
by HansU
Replied by HansU on topic spindle speed
It was a bug in gmoccapy. So not in front of the PC
I pushed a fix to 2.8 and master as well.
I pushed a fix to 2.8 and master as well.
Please Log in or Create an account to join the conversation.
04 Sep 2022 17:35 #251177
by CNC_Tux
Replied by CNC_Tux on topic spindle speed
Hello HansU
what can i do, to fix this problem?
what can i do, to fix this problem?
Please Log in or Create an account to join the conversation.
Time to create page: 0.097 seconds