Choice of encoder for 7i76 + Pathpilot

More
8 years 6 months ago #109088 by Robi63
Hi,

I have to choose an encoder (spindle speed) for converting a CNC lathe.
I have to mount it on a 7i76 board with Pathpilot.
I attach files with features (I thought 1000 P / R)

Attachment not found



Thanks
Roberto

Please Log in to join the conversation.

More
8 years 6 months ago #109089 by PCW
In general you are much better of with line driver (differential) outputs so I would not chose that type of
encoder but rather one with line driver outputs. These will have 2 signals for A, B and Z, often named A,/A B,/B and Z,/Z

Please Log in to join the conversation.

More
8 years 6 months ago #109120 by Robi63
Hi,

This seems to be right.
500 PPR is the resolution (it's OK)

Thanks
Roberto

FEATURES:
- 500 PPR
- INDEX SIGNAL.
- +5VDC TTL SIGNALS
- QUADRATURE / DIFFERENTIAL OUTPUT
- 30mm body and 4mm shaft.

Attachment not found

Attachment not found

Please Log in to join the conversation.

More
8 years 6 months ago #109124 by PCW
That looks good.

Please Log in to join the conversation.

More
8 years 4 months ago #111791 by Robi63
Hi,
I connected the ecoder in TB3 between 7 and 14.

7 Green A
8 Brown A-
9 Black GND
10 White B
11 Gray B-
12 Red Vcc
13 Yellow Z
14 Orange Z-

In the HAL file I set this way:

# Spindle Encoder
setp hm2_5i25.0.encoder.00.counter-mode 0

# setting scale negative makes spindle position increase in CW
# and decrease in CCW - if this not done threading and rigid tapping stall
# perhaps swapping the A-B encoder inputs would have the same effect
setp hm2_5i25.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE
setp hm2_5i25.0.encoder.00.filter 1

# see 'man hostmot2' for descriptions
setp hm2_5i25.0.encoder.00.index-mask 0

# LinuxCNC
setp hm2_5i25.0.encoder.00.index-mask-invert 0
setp hm2_5i25.0.encoder.00.index-invert 0
net spindle-revs <= hm2_5i25.0.encoder.00.position
net spindle-vel-fb-rps <= hm2_5i25.0.encoder.00.velocity
net spindle-index-enable <=> hm2_5i25.0.encoder.00.index-enable

##net spindle-position hm2_5i25.0.encoder.00.position => motion.spindle-revs
##net spindle-raw-velocity hm2_5i25.0.encoder.00.velocity => motion.spindle-speed-in lowpass.0.in
net spindle-velocity lowpass.0.out
net spindle-index-enable hm2_5i25.0.encoder.00.index-enable <=> motion.spindle-index-enable

# note: gpio pins only read at servo thread frequency
# these nodes are only for driving diagnostic "LEDs" in the UI
# this is only going to be useful when the spindle is rotated by hand slowly
net spindle-phase-A hm2_5i25.0.gpio.016.in
net spindle-phase-B hm2_5i25.0.gpio.015.in
net spindle-phase-Z hm2_5i25.0.gpio.014.in

##################################################I
Problem :
Signal A and B is read well.
While the Z signal is not read.
I tried with another encoder of different brands, but the problem is the same.
Where am I wrong?

Thanks
Roberto

Please Log in to join the conversation.

More
8 years 4 months ago #111792 by PCW
How did you check the index?
On the LinuxCNC side one easy way to test the index is to (with LinuxCNC running)

halmeter signal spindle-index-enable &
halcmd sets spindle-index-enable true

Then rotate the spindle slowly by hand and see if spindle-index-enable is cleared at the index position

Please Log in to join the conversation.

More
8 years 4 months ago #111849 by Robi63
Hi,

I have tested in PP with Halmeter
in pins hm2-5i25.0.gipo.015.in / 016.in are OK 014.in no signal
in signal I tested spindle-phase-A / B are OK Z no signal even spindle-index-enable no signal.

Thanks

Please Log in to join the conversation.

More
8 years 4 months ago #111868 by PCW
I would not expect to see the index signal, that's why you must test for it in the way I indicated

This is because the index signal is a very short pulse on a high resolution encoder and its easy to miss
because of both the 1 KHz servo thread sampling and the fact that halmeter or "show" are only sample
hal data at about a 10 Hz rate

Please Log in to join the conversation.

More
8 years 4 months ago #111934 by Robi63
Hi PCW,

As always, you're right.
I have done your test and one point passes from true to false.
In PP A and B they count + or - according to the rotation.
What role does Z have to reset this count?

Thanks

Please Log in to join the conversation.

More
8 years 4 months ago #111943 by PCW
Ha! not always right and sometimes crazy wrong...

The encoder scaled position is cleared on index (Z)

( The low level count is not cleared because this would break the velocity estimation so what the hardware
does is latch the count at index and this count is scaled and used as a position offset to set the position count to 0 at index )

Please Log in to join the conversation.

Time to create page: 0.097 seconds
Powered by Kunena Forum