- Posts: 97
- Thank you received: 0
Spindle speed feedback
Please Log in to join the conversation.
This would be more correct, but encoder velocity output is in units/s and you probably want your display in RPM. Using a scale component can multiply the value by 60. That should be in your HAL already if you used stepconf or pncconf.
Note that in the first line we assign the encoder velocity value to motion.spindle-speed-in. In doing so, the signal of spindle-velocity holds that value, so that you can assign it to other inputs. (pins can't connect directly to other pins. signals are the interfaces between them)
encoder.00.velocity is an output, as documented here: linuxcnc.org/docs/html/man/man9/hostmot2.9.html#encoder
motion.spindle-speed-in is an input, as documented here: linuxcnc.org/docs/html/man/man9/motion.9.html#PINS
Please Log in to join the conversation.
Please Log in to join the conversation.
NPN prox can be fairly-easily connected to 5V inputs. PNP are a little harder
Basically an NPN prox can be considered as a switch to the 0V line, and a PNP is a switch to the +24V line.
www.mesanet.com/pdf/parallel/7i77man.pdf
Says that the encoder inputs are OK to 12V. Most prox switches need at least 6V, so there is an ovelap there.
Please Log in to join the conversation.
Attachment not found
Please Log in to join the conversation.
andypugh wrote: Is it a PNP or an NPN prox?
NPN prox can be fairly-easily connected to 5V inputs. PNP are a little harder
Basically an NPN prox can be considered as a switch to the 0V line, and a PNP is a switch to the +24V line.
www.mesanet.com/pdf/parallel/7i77man.pdf
Says that the encoder inputs are OK to 12V. Most prox switches need at least 6V, so there is an ovelap there.
Its an NPN.
Please Log in to join the conversation.
(You might need to invert the input too)
Please Log in to join the conversation.
EDIT: I moved the gmoccapy line from the main hal file to the postgui hal file and the errors went away. everything starts up and I can start hal show and see the spindle speed change there, it just doesn't update in the gui for some reason. I suspect that a gmoccapy specific problem to pursue. As long as I can see the value updating in hal show I should be able to continue on with setting up the servo for the closed-loop control, correct?
Please Log in to join the conversation.
Please Log in to join the conversation.
biqut2 wrote: however, the pulse rate is way off by the same amount. Setting the encoder scale to 1 results in the display reading roughly half the actual spindle speed. the problem is I can clearly count approximately 34-36 teeth on the spindle looking through the sensor hole. Its worth noting as well that the scope shows a nice stable signal, I'm stumped on this one.
Is it possible that the readout is showing 34/60 of the true speed?
It sounds a lot like a confusion between encoder velocity (RPS) and spindle speed (RPM)
Please Log in to join the conversation.
