On Sunday, 6 March 2022 16:55:09 EST Ralph Stirling wrote:
> I'm helping a friend with a TMC1000 retrofit, and we
> put a nice brushless servo on the spindle instead of
> the old universal motor.  He is using LCNC with
> plain parallel port stepper control.  I'm setting up the
> spindle as step/dir, since he doesn't have analog output.
> He especially wants to be able to do rigid tapping.
> 
> I believe I can use the stepgen counts or position-fb
> in place of a spindle encoder, since his parallel port
> won't count pulses from the 10k/rev encoder on the
> motor very well.

How much of that is the parport, and how much of that is the glacial 
opto's or noise filters in the breakout boards inputs?  I am useing a 
setup that almost resembles that except my parport is the p2 output on a 
5i25. The 5i25 encoder can follow that count rate, but the $20 breakout 
board had to have its input noise filters excised before that signal rate 
even thought of getting thru that cheap card.  Some of those cards use 
filters, and some will use opto's, neither of which is fast enough to 
work at those speeds w/o bypassing the opto's or excising the filters.
All can be made to work, but this is not something a so-called tv service 
type can do unless he knows lots more. Enough to design and build a card 
from scratch. I am a CET, and even I have trouble figureing out what 
these guys will to to save 3 cents a card.

> My question is about scaling.
> 
> I have set the servo drive to be 3600 pulses/rev.
> I put the stepgen into velocity mode, then net
> stepgen velocity-cmd to motion.spindle.speed-out.
> Now I need to connect the stepgen position to
> motion.spindle.revs, but what scaling is needed?
> Should I set stepgen position-scale to 3600 and
> net stepgen position-fb to motion.spindle.speed-out?

When I have such a question I always fall back to the home switch idea, 
and keep a bunch of stuff in my hal files that I can enable to determine 
that scale factor. I load a couple counters and comparators, enable a 
sample-hold of the encoders count as the 2nd or third home switch or 
index pulse from the spindle goes by and saves it, another comparator 
then watches that index or home switch count, grabs the spindles encoder 
count after 100 more index or home switches have come in. Those samples 
are presented to a sum2, with one input set for a gain of 1, the other 
set for a gain of -1 and that input gets the first count, the gain of 1 
gets the second count, the output you watch with a halmeter, is the econd 
count minus the first count. Then since you have a figure, divide it by 
100, to get a scale in machine units to use in your .ini file for that 
axis. in this case the spindle. So you now have a scale you can use to 
set the spindle within 3.6 degrees of where you want it, regardless of 
the gear ratio between the motor and the spindle. The actual resolution 
is even better.

It gets a bit more complex if you have a multigear spindle and use LCNC's 
tach display in that you'll need tally switches on the gear shift to tell 
LCNC the gear its in, and adjust the gain of the tach display 
accordingly. I do have that working also.  It would be nice if the tach 
had the ability to switch full scale ranges, but it doesn't. I think it 
could be added but I'm not the coder to do that.
 
> Will this work, or are there other problems I haven't thought of?

I've tried to broadly cover it, but need more data, so:

Please describe your "chain of command" from the pc data to the breakout 
board(s) used.
 
> Thanks,
> -- Ralph

Take care and stay well Ralph.

Cheers, 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, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis





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

Reply via email to