10rpm Spindle Encoder

More
29 May 2014 03:21 #47482 by Poma
Replied by Poma on topic 10rpm Spindle Encoder

There is a way to software generate an index, iirc?

You would then need to export that pulse as an output to a hardware pin and back into the encoder counter..

Is this to prevent the error "motion.spindle-index-enable already has an output bitslice.0.out"?motion.spindle-index-enable is an I/O bit, whereas bitslice.0.out is an OUT.

Seems like a known bug? I don't understand why an OUT cannot be connected to this pin. How else does one get information into it?

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

More
29 May 2014 04:01 #47487 by andypugh
Replied by andypugh on topic 10rpm Spindle Encoder

Seems like a known bug? I don't understand why an OUT cannot be connected to this pin. How else does one get information into it?


It's not a bug, it's an (annoying) feature. If you connect an "out" to an "io" then the signal always takes the value of the out, so the "io-ness" is lost.

Have a look at linuxcnc.org/docs/html/man/man9/tristate_bit.9.html for one solution.

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

More
29 May 2014 06:04 #47491 by Poma
Replied by Poma on topic 10rpm Spindle Encoder
Works like a charm, thanks.

Except... index-enable doesn't work. I'll save that for another thread.

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

More
06 Jan 2015 23:19 - 06 Jan 2015 23:31 #54666 by Poma
Replied by Poma on topic 10rpm Spindle Encoder
Looking back through this I realize I didn't leave other users with a very good idea of my solution, if someone should ever need to do what I did. I'll put my chunk of code here and hope that is enough:
# Compute the spindle speed using derivative, multipy, and absolute functions
setp motenc.0.enc-02-scale 5220
setp mult2.0.in1 60
setp lowpass.0.gain 0.002

net spindle-position motenc.0.enc-02-position => lowpass.0.in
net spindle-position-lowpass lowpass.0.out => motion.spindle-revs ddt.0.in
net spindle-enc-rps abs.0.in <= ddt.0.out
net spindle-abs  mult2.0.in0  motion.spindle-speed-in  <= abs.0.out
# pyvpc.hal
net spindle-rpm-filtered mult2.0.out  => pyvcp.spindle-speed

As for the indexing, I finally added a prox switch to the low-speed side of the spindle to get the best accuracy.
Last edit: 06 Jan 2015 23:31 by Poma. Reason: Clarifications and simplifications

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

More
07 Jan 2015 02:37 #54681 by Poma
Replied by Poma on topic 10rpm Spindle Encoder
Actually, I would like some advice on my spindle encoder resolution, and I would appreciate any input.

Let's assume I will be threading on a 2-meter diameter drum. I have an index prox switch and a 1024 encoder on the drum. That gives 6.283m circum and when divided by 1024 is 6.136mm per encoder pulse. Actually, I think this is a 4x quadrature encoder and decoder, so I have 4096 pulses which gives 1.5mm per pulse. It will probably be running at 20 RPM max, which gives a 4x encoder frequency of about 1.4 KHz.

Does anyone think I need a better encoder in order to be threading at this diameter? Or do you think it should be sufficient?

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

Time to create page: 0.127 seconds
Powered by Kunena Forum