pyvcp tachometer

More
23 Feb 2012 14:23 #17960 by jbraun
pyvcp tachometer was created by jbraun
Is it possible to have tachometer with only an index pulse ?
ie: the spindle control is manual.

A pulse can be seen on pin 10 but I'm unsure how to make the software connections
or whether this is even practical using only parallel port.

btw: the spindle has a belt driven quad encoder fed to a DOS program but a 1 ppr disk is being
added. I believe 1 ppr will be needed for future thread cutting ?

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

More
23 Feb 2012 15:19 - 23 Feb 2012 15:50 #17961 by ArcEye
Replied by ArcEye on topic pyvcp tachometer
Hi

You can certainly have a spindle rpm meter with just an index signal.
That is all you need.

This is pretty much what you need in your hal for the encoder
loadrt encoder num_chan=1
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
setp encoder.0.position-scale 1
net spindle-position encoder.0.position-interpolated => motion.spindle-revs
net spindle-velocity encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=>motion.spindle-index-enable
net spindle-pulse-and-index parport.0.pin-NN-in => encoder.0.phase-A encoder.0.phase-Z 
(should all be on one line)

and this in your custom_gui.hal for the RPM meter
loadrt scale count=1
loadrt abs count=1
loadrt lowpass count=1

addf scale.0 servo-thread
addf abs.0 servo-thread
addf lowpass.0 servo-thread

setp lowpass.0.gain 0.01
###############################################
# Display spindle speed in pyvcp bar
###############################################
setp scale.0.gain 60.0 #convert velocity per sec into rpm
net spindle-velocity => lowpass.0.in
net filtered-spindle-velocity <= lowpass.0.out => abs.1.in
net absolute-spindle-velocity <= abs.1.out => scale.1.in
net scaled-spindle-velocity <= scale.1.out  => pyvcp.spindle-speed

This index signal will be fine for threading too, but you will require a separate pulse (encoder A channel) to thread properly.

I have a hall effect switch for my index and an optical switch and 120 hole disc for pulse on my lathe, which works fine.

(only Mach tries to kid people that you can thread with just one reference per revolution)

regards
Last edit: 23 Feb 2012 15:50 by ArcEye.

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

More
24 Feb 2012 01:19 #17997 by andypugh
Replied by andypugh on topic pyvcp tachometer
jbraun wrote:

Is it possible to have tachometer with only an index pulse ?

Yes, just use an encoder counter with that pulse wired to ChanA, and set to "counter mode"

btw: the spindle has a belt driven quad encoder fed to a DOS program but a 1 ppr disk is being
added. I believe 1 ppr will be needed for future thread cutting ?


You need an index for threading, but a quadrature encoder is also usual.
You _can_ thread with 1 ppr, but it isn't a good idea, or likely to give very good threads.
Mach3 requires 1ppr, because it can't use an encoder for threading. LinuxCNC needs an index pulse to align the thread starts, then a quadrature encoder to control the feed. Normally the index comes from the encoder Z channel.

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

More
26 Feb 2012 00:39 #18087 by jbraun
Replied by jbraun on topic pyvcp tachometer
Yes that worked. Thank you.

I'm thinking of ditching the belt driven encoder and going with the more common multi-hole disk.

2 questions:
What's realistic with software counting ? 100 holes ? Does it matter ?
Excluding the disk, are there bolt-on electronic kits available or do most people roll their own ?

(okay that's more than 2 questions) ;)

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

More
26 Feb 2012 10:00 - 26 Feb 2012 10:01 #18093 by ArcEye
Replied by ArcEye on topic pyvcp tachometer
Hi

I'm thinking of ditching the belt driven encoder and going with the more common multi-hole disk.

If you have a working belt driven encoder, I would keep it if possible.

I had one but it was fried, along with many other components in a power outrage at some point before i bought it.
Thats the reason I went to other indexing methods

This is my set up, as posted previously.
www.linuxcnc.org/index.php/english/compo...imit=6&start=6#14832

What's realistic with software counting ? 100 holes ? Does it matter ?
Excluding the disk, are there bolt-on electronic kits available or do most people roll their own ?

There are no kits I am aware of, but the components are simple and quite easy to put together.
This is the circuit I use, kindly supplied by Andy Pugh some years ago.



I have a 120 hole disc, which is approaching the limit of practicality in terms of disc diameter and the number of holes that can be drilled along its circumference, for the space available to me. The holes are 3mm and 3mm ish spacing between.
I chose to work in multiples of 60 for sheer convenience of calculation, both with spindle velocity and the initial PCD calculations for making it.

I also hypothesised that if all calculations within software as to the exact position of the spindle were in numbers that divided exactly into 360, the accuracy must be better.
Whether this is true I don't know, but it threads very smoothly.

regards
Attachments:
Last edit: 26 Feb 2012 10:01 by ArcEye. Reason: put image where it should be!

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

More
26 Feb 2012 10:09 #18094 by cncbasher
Replied by cncbasher on topic pyvcp tachometer
i'd go with ArcEye's suggestion , iv'e used various sizes of disks , from 48 hole to 120 , the 120 hole does appear to work better , or at least shows smoother running

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

More
26 Feb 2012 11:38 #18096 by BigJohnT
Replied by BigJohnT on topic pyvcp tachometer
jbraun wrote:

What's realistic with software counting ? 100 holes ? Does it matter ?
Excluding the disk, are there bolt-on electronic kits available or do most people roll their own ?


The speed at which you can count with software depends on the speed of the base thread. The number of holes will be dependent on your RPM and the speed at which you can count them. I'm not sure but I assume it takes two ticks of the base period to count a pulse, one to see it on and one to see it off.

John

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

More
25 Mar 2012 17:50 #18785 by jbraun
Replied by jbraun on topic pyvcp tachometer
ArcEye wrote

If you have a working belt driven encoder, I would keep it if possible.


I'll give it a try.

The manual page for encoder reads "phase B is ignored" for unidirectional threading with software counter.
So only index and phase A need to be connected in Hal ? In what situation would phase B be used ?

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

More
25 Mar 2012 18:15 #18786 by BigJohnT
Replied by BigJohnT on topic pyvcp tachometer
A B and index are needed for rigid tapping.

John

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

Moderators: piasdom
Time to create page: 0.118 seconds
Powered by Kunena Forum