Spindle encoder connections
- andypugh
-
- Offline
- Moderator
-
- Posts: 23558
- Thank you received: 4858
Pathpilot drops tracking the spindle over 1200 rpm.
You might need to turn off the encoder filter.
linuxcnc.org/docs/2.7/html/man/man9/hostmot2.9.html#encoder
15 clocks at 33Mhz = 2.2 Mhz
1024 counts @ 1200 rpm = 81kHz. So there should be lots of headroom even with the filter on.
Please Log in or Create an account to join the conversation.
- remartinez
- Offline
- Junior Member
-
- Posts: 39
- Thank you received: 1
Is there a guide or an easy way to do this?
Regards
Raul
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
- Posts: 17899
- Thank you received: 4774
since the 7I76/FPGA card will count quadrature signals up to a few MHz with the encoder filter on.
I suspect your encoder count rate problem is either an encoder / encoder electrical interface issue or some hal file
setup issue.
Can you post your current hal/ini files here? That would help see if its a setup issue
Please Log in or Create an account to join the conversation.
- remartinez
- Offline
- Junior Member
-
- Posts: 39
- Thank you received: 1
Thanks again
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
- Posts: 17899
- Thank you received: 4774
just delete this entire section from the hal file:
# as per Peter Wallace to reduce encoder errors from noise
# use the 'raw' interface to set the encoder filter higher to ignore more noise
# this sets how long an encoder signal needs to be stable to be accepted
# register 0x3400 is QfilterRate decimal 13312
# count rate is ClockLow/(QfilterRate + 2)
# ClockLow is 33 MHz
# setting the filter to 38 (decimal) will allow the encoder to function well past 100 kHz
# lathe encoder is 1200 pulses per rev, 3000 RPM is 60 kHz
#
setp hm2_5i25.0.raw.write_address 13312
setp hm2_5i25.0.raw.write_data 38
setp hm2_5i25.0.raw.write_strobe TRUE
Please Log in or Create an account to join the conversation.
- remartinez
- Offline
- Junior Member
-
- Posts: 39
- Thank you received: 1
Pathpilot now tracks spindle above 1200 rpm.
The issue that I need to figure out now is that it will not cut threads. I programed a threading cycle on the conversation but it stops right before its going to start to cut threads. I did noticed that the Z index light does not blink when i turn the spindle by hand. Is this normal? I did test out if I had the right terminal. I grounded the terminal for the Z index and I did see it blink on the screen. I guessing that maybe I have an issue with the encoder but i am not sure. Any ideas.
Second question: How can i change the limit on the spindle. It only goes up to 2500 rpm. In the ini file I have the spindle max rpm at 3850.
Thanks again,
Raul
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23558
- Thank you received: 4858
Is motion.spindle-revs counting _up_. If it is counting down, then the the threading won't start.The issue that I need to figure out now is that it will not cut threads. I programed a threading cycle on the conversation but it stops right before its going to start to cut threads.
I did noticed that the Z index light does not blink when i turn the spindle by hand. Is this normal?
It might be. Index pulses can be very short.
The best way to test is to set the index-enable of the encoder counter, then rotate the spindle by hand and see if it goes back to zero.
Please Log in or Create an account to join the conversation.
- remartinez
- Offline
- Junior Member
-
- Posts: 39
- Thank you received: 1
What do you mean to set the index-enable of the encoder counter?
Below is how the hal file shows the encoder
set hm2_5i25.0.encoder.00.counter-mode 0
set hm2_5i25.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE
set hm2_5i25.0.encoder.00.filter 1
# see 'man hostmot2' for descriptions
set hm2_5i25.0.encoder.00.index-mask
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 <=>emotion.spindle-index-enable
net spindle-phase-A hm2_5i25.o.gpio.016.in
net spindle-phase-A hm2_5i25.o.gpio.015.in
net spindle-phase-A hm2_5i25.o.gpio.014.in
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23558
- Thank you received: 4858
right now the encoder numbers climb as i turn the spindle one way and decrease as i tun it the other way. I does not go to zero if i make a full turn. The numbers just keep on going.
That is as it should be. But does the number climb in the FWD direction and reduce in REV?
net spindle-index-enable hm2_5i25.0.encoder.00.index-enable <=>emotion.spindle-index-enable
net spindle-phase-A hm2_5i25.o.gpio.016.in
net spindle-phase-A hm2_5i25.o.gpio.015.in
net spindle-phase-A hm2_5i25.o.gpio.014.in
Is that copy-paste or did you re-type it?
To check the index, open a terminal window then.
loadusr halmeter signal spindle-index-enable
sets spindle-index-enable 1
Please Log in or Create an account to join the conversation.
- remartinez
- Offline
- Junior Member
-
- Posts: 39
- Thank you received: 1
when i put in the command is the terminal it gives me an error
Loadusr: command not found
Please Log in or Create an account to join the conversation.