NEWS
LinuxCNC 2.5.2 Release
There are no translations available.

LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release
There are no translations available.

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
There are no translations available.

New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 

Welcome, Guest
Username: Password: Remember me

TOPIC: Spindle encoder issues

Spindle encoder issues 10 Apr 2012 04:13 #19087

I've upgraded to linuxcnc 2.5 and returned to configure the spindle encoder. Looking at the HAL meter I don't see the spindle position reset to zero it just keeps incrementing the position values with each clock pulse on phase A. I've obviously got something wrong here see below. Even the spindle velocity looks dodgy, it shows a random value in the HAL meter. My encoder is a 100 slot disk with index (optical) G33 just gives me maximum velocity regardless of the spindle speed.

#### SPINDLE ENCODER

addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread

setp encoder.0.position-scale 100.
setp encoder.0.counter-mode 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-index parport.0.pin-11-in => encoder.0.phase-Z
net spindle-pulse parport.0.pin-10-in => encoder.0.phase-A
The administrator has disabled public write access.

Re:Spindle encoder issues 10 Apr 2012 05:49 #19089

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4955
  • Thank you received: 87
  • Karma: 134
The example in the manual doesn't use position-interpolated...

linuxcnc.org/docview/html/examples/spind...d_spindle_feedback_a

John
The administrator has disabled public write access.

Re:Spindle encoder issues 10 Apr 2012 06:29 #19090

  • ArcEye
  • ArcEye's Avatar
  • OFFLINE
  • Moderator
  • Posts: 1335
  • Thank you received: 102
  • Karma: 129
Hi

My lathe with 120 hole optical disc has the below hal listing, which is ALMOST identical to yours;
setp encoder.0.position-scale 120
setp encoder.0.counter-mode 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-index parport.0.pin-11-in-not => encoder.0.phase-Z
net spindle-pulse parport.1.pin-10-in => encoder.0.phase-A

The difference is that I set phase-Z to pin-11-in-not because otherwise the BOB inverted the signal and had index permanently on and just off once per rev.

Is this what is happening to you?

regards
The administrator has disabled public write access.

Re:Spindle encoder issues 10 Apr 2012 15:16 #19111

I don't think so . The HAL scope shows the index is low for most of the cycle. I did look at your config and got some ideas. I think I've missed setp encoder.0.index-enable 1 so the count isn't resetting after each 100 pulses. I'm going to make this change and try again.

Cheers,
Peter.
The administrator has disabled public write access.

Re:Spindle encoder issues 11 Apr 2012 00:30 #19122

  • cncbasher
  • cncbasher's Avatar
  • OFFLINE
  • Moderator
  • Posts: 683
  • Thank you received: 30
  • Karma: 53
yea i'd say the they need reversing , they should be high , then drop low on pulse , what sensors are you using ? , if you have any other opto's in the signal path they will invert the signal
The administrator has disabled public write access.

Re:Spindle encoder issues 11 Apr 2012 01:23 #19124

I'm using a homemade encoder but I'll try inverting the index signal.
The administrator has disabled public write access.
Time to create page: 1.102 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.