On Thursday 29 November 2018 00:52:38 David Berndt wrote:

> Alright, Dragging this back up.
>
> A knockoff Omron encoder showed up in the mail, well I assume It's a
> knockoff at this price. Mounted it, wired it up. But it's on the back
> of the mill and geared 68/55 to the actual spindle output.
>
> So now the question is, what do I setup scaling to? Set scaling so
> that X pulses = one rotation? That seems to be the correct thing based
> on my reading. What if anything do I do with my index pulse then? It
> fires every 2000 counts, which is useful for keeping track of lost
> counts perhaps but not much else, as it doesn't repeat based on
> physical location on the spindle every rotation. Disconnect it and run
> a real once per rotation index? Contrive some sort of index scaling
> using oneshot or something crazy like that?
>
> Regards,
>
> Dave
>
I have a somewhat similar setup on my Grizzly G0704 mill. I started out 
with an optical disk with opto-interruptors, but at 268 edges per 
spindle rev, quantization noise was horrible and the effect on the motor 
gave the gears and bearings in the head such a beating that I wondered 
where the corn cobs came out. So I bought a $20 Omron, drilled and 
tapped the rear end of the motor shaft and made a small brass shaft 
extension to drive this encoder off the rear of the motor. I do not use 
the Omrons idx output for anything, continueing to use the idx from my 
old optical encoder which is on the mills spindle. The encoder turned 
out to be a diff output model, and I used a pair of ttl<->rs485 
translators tp make ttl out of it, then had to bypass the opto-isolators 
in those two channels of the bob as they weren't anywhere near fast 
enough 

This meant I had to develop my own scale factor, and since the mill has a 
2 speed head, the scale would change with the gear selected.

So I wrote some hal code and counted the new encoders output pulses from 
100 revs after a reset to 200 revs as counted by the old idx pulses, 
there by determining a value for 100 active  turns of the spindle, for 
both gears, and divided those counts by 100 to get the actual scale  
count. At that point, you need to do one of two ways to use it, I chose 
to install switches on the gear change knob to tell hal which gear it is 
in.  Once hal knows that, and the ratio between the the gears, a mux4 
can be used to apply a scale of one to the high gear scale factor, or 
multiply the scale by the ratio to get the other scale to use when in 
the slower gear where the motor is, in this case turning nearly 2x 
faster.  Once that was determined, that code was commented out in the 
hal file but still exists. I cut 1/4" notches about 1/8" deep in the rim 
of the gear shift knob, and 2 small roller tipped microswitches are 
mounted in a half moon shaped sandwich such that the nc contacts of the 
switches drive the address lines of the mux4 only in the 3 or so degrees 
the knob can turn before the switch opens.

Why a mux4?  So when the knob is being shifted, I can feed a very slow 
signal, about 20 rpms, to the motor so when it is being shifted, the 
next gear will mesh w/o having to grab the spindle and turn it by hand 
as there doesn't seem to be any entrance ramps  molded into the plastic 
gears.  The end result is theres no quantization noise to hammer the 
gears so the spindle runs very quietly, and I was able to raise its 
PID's PGain from 3 to 20+, getting an extremely stiff speed control, so 
stif and yet quiet that I cannot judge how hard its working to do a 
rigid tap until the Pico pwm-servo amp I am driving the motor with 
actually goes into current limiting at about 150% of the motors 
nameplate amps, I can hear the chirp of it going into current limit.

So to summerize, I use the old idx from the shop made encoder on the 
spindle as the encoders index feed, and the new encoders A/B is fed to 
the encoder. With a bit of additional hal, my pyvcp tach reads the 
actual spindle rpm regarless of which gear its in. If you want to see 
this code so you can borrow bits of it, I just put copies of both 
the .ini and .hal files up on my web page in the sig, follow the 
Genes-os9-stf/GCode links, as GO704fast.ini and GO704fast.hal.

Be my guest. These were written when the interface card was a 5i25, with 
prob-rfx2 firmware in it. But a 2 dollar voltage regulator failed 
shorted, blowing itself to smithereens, taking the bob with it, and I am 
now in the process of rewriting the hal file to use a Mesa 7i76 with the 
5i25 with 5i25_7i76_7i78 firmware in it as I need more i/o anyway.

With this text and that code, you can cobble up something that will work 
for you I think.

[...]

-- 
Cheers David Berndt, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>


_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to