On Tue, 14 Jan 2020, Brent Loschen wrote:
Date: Tue, 14 Jan 2020 20:06:36 -0700
From: Brent Loschen <brent.losc...@gmail.com>
Reply-To: "Enhanced Machine Controller (EMC)"
<emc-users@lists.sourceforge.net>
To: "Enhanced Machine Controller (EMC)" <emc-users@lists.sourceforge.net>
Subject: [Emc-users] help with spindle speed
Almost a year ago I converted my servo'd Bridgeport/Boss to LinuxCNC and it
works sooo much better than that old and slow 68000 control that I've been
reluctant to change anything. The only remaining todo is to convert the
spindle speed control from the current mechanical switch to machine/digital
control, and it's a perfect winter project.
To that end I've set up as a small test bed in the comfort of my home with a
5i25/7i76 controlling 3 steppers, 3 home switches, and a PWM driven DC motor.
I configured LCNC-2.7.14 with pncConf using "5i25-internal Data" and "7i76x2
- With one 7i76". All steppers, switches, homing, etc work as expected.
I've fabricated a rotary encoder with slots and an IR sensor for the motor
that outputs +5v pulses and verified it with an oscilloscope. The DC motor
speed is currently controlled with a pot wiper on a small PWM driver board.
The goals of this test bed are to show spindle RPM , control the DC motor
with 0-5vdc from the 7i76 , and use knowledge gained to convert the BP.
My first goal was to simply show the RPM on the Pyvcp spindle speed panel, so
in addition to the 3 stepgens, I also enabled encoder 0 in pncConf by
selecting the "i/o connector 3" tab, and changed the "unused Spindle Encoder
0" dropdown to "Spindle Encoder 0". I then attached the output of my encoder
to TB3 pin 7, which according to the 7i76 manual, should be ENCA+. Got no
RPM indication on the panel, so I verified that I had pulses on TB3-7 with my
scope. Next I did a dmesg and saw that encoder #0 had been instantiated on
Port 3-13, and checked my .hal file to make sure that encoder.00.counter-mode
was set to 1, (as I only have an A input). I then looked at the hal
configuration and put a watch (also halmeter) on a number of pins associated
with spindle and encoder to ensure machine was homed, spindle was enabled,
and to look for any changes on hm2_5i25.encoder.00.input-a, but nothing.
Toggling the home switches, and the axis spindle enable button showed that my
pin watches were working as expected, and that the spindle was truly enabled.
All good. I'm to the point where I'm wondering if TB3 pin 7 is the correct
input, or if I should be using a different 7i76 input pin.
I'm somewhat of a hal newby, and although I feel I understand the basics, I
have a lot more to learn. Thanks in advance for any help you can offer. Hal
and ini files attached.
Brent
Is the 7I76's encoder input set for Single ended inputs?
If not, you will not get any signal from a single ended source
Peter Wallace
Mesa Electronics
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users