Encoder Velocity

More
28 Jun 2014 00:05 #48275 by Tom_R2E3
Encoder Velocity was created by Tom_R2E3
Hopefully this is an easy one.

I've mounted a Spindle encoder on my mill. It is 500ppr A,B and index. I have connected it to my mesa 7i77 as encoder 3.

If I launch Linuxcnc and view watch the encoder counts in halconfig, it counts 500 for one revolution of the spindle - good. If I then set the spindle going at 1000rpm (already calibrated) and watch the encoder velocity, it varies wildly up and down between -0.05 and -2. I was expecting it to show me rps? Changing the encoder scale will scale the velocity up or down, but the variation when running at a steady speed is still huge.

This is what I have in my .hal for the spindle:

#********************************************************************************
# SPINDLE S
#********************************************************************************
# ---Encoder feedback signals/setup---

setp hm2_5i25.0.encoder.03.counter-mode 1
setp hm2_5i25.0.encoder.03.filter 1
setp hm2_5i25.0.encoder.03.index-invert 0
setp hm2_5i25.0.encoder.03.index-mask 0
setp hm2_5i25.0.encoder.03.index-mask-invert 0
setp hm2_5i25.0.encoder.03.scale 500 #[SPINDLE_9]ENCODER_SCALE

net spindle-position hm2_5i25.0.encoder.03.position => motion.spindle-revs
net spindle-velocity hm2_5i25.0.encoder.03.velocity => motion.spindle-speed-in
net spindle-index-enable hm2_5i25.0.encoder.03.index-enable <=> motion.spindle-index-enable

Not sure what to check?

Thanks in advance, tom.

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

More
28 Jun 2014 00:09 #48276 by PCW
Replied by PCW on topic Encoder Velocity
counter mode should be 0 for quadrature

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

More
28 Jun 2014 01:56 #48279 by Tom_R2E3
Replied by Tom_R2E3 on topic Encoder Velocity
Hi.

Just tried with mode 0 and it does nothing, not registering any counts..

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

More
28 Jun 2014 02:07 #48280 by PCW
Replied by PCW on topic Encoder Velocity
That likely indicates that the encoder counter is not getting valid A and B signals

I would check that both A and B inputs on the 7I77 toggle and
that the 7I77 encoder input is jumpered properly for the encoder type
(TTL or differential)

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

More
28 Jun 2014 02:35 #48281 by Tom_R2E3
Replied by Tom_R2E3 on topic Encoder Velocity
Thanks for getting back to me.

All three encoder 3 jumpers are set for differential (RH position ref 7i77 manual).

How can I check if A&B toggle?

When I had it set to count mode 1 (and the 7i77 still jumpered for differential), it counted 500 pulses for one revolution, which means that A&B worked I think?

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

More
28 Jun 2014 02:42 #48282 by PCW
Replied by PCW on topic Encoder Velocity
If it does not count up (and down) in mode 0 there is likely a connection issue

ENC 7I77
A, /B ==> A,/A
/A,B ==> B./B

is a common type of error

velocity will not be valid in count mode 1 (step/dir) with quadrature input

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

More
28 Jun 2014 03:43 #48286 by Tom_R2E3
Replied by Tom_R2E3 on topic Encoder Velocity
Thank you. I played around with combinations of A, B /A and /B and could only ever get it to either count up or down. B wasn't reading anything, checked my wiring and there was a break in my joint to the encoder plug.

So with that fixed it counts up and down and shows reasonable velocity whilst turning the spindle by hand (now counts 2000/rev). However, when I power the spindle at some speed (500 rpm) it all goes wrong, velocity flicks on and off and it counts sporadically!

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

More
28 Jun 2014 04:22 - 28 Jun 2014 04:24 #48289 by PCW
Replied by PCW on topic Encoder Velocity
Sounds like a noise or interface issue. Noise is usually not an issue with differential
encoder wiring so I would first verify that you have working differential outputs from
your encoder.

You can do this by measuring from A to /A and from B to /B with a DVM
you should measure a minimum of about 3V between them and it should be say +3V and -3V
depending on the encoder position.
Last edit: 28 Jun 2014 04:24 by PCW.

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

Time to create page: 0.157 seconds
Powered by Kunena Forum