On Tuesday 29 December 2015 09:59:34 lloyd wilson wrote:

> I'm trying to add a pyvcp panel to control a spindle vfd. To take
> advantage of the 'at-speed' signal from the vfd to inhibit motion
> until ready, the motion component of LCNC needs to be aware of the
> spindle command state- from the documentation:
>
> *motion.spindle-at-speed* IN BIT
>
> Motion will pause until this pin is TRUE, under the following
> conditions: before the first feed move after each spindle start or
> speed change; before the start of every chain of spindle-synchronized
> moves; and if in CSS mode, at every rapid->feed transition.
>
> but I can't find a reference to HAL input pins for spindle control in
> the motion control component documentation. Is that communication done
> by other methods (NML??- gasp!).
>
> Can someone point me to a sample configuration that properly
> integrates an 'at-speed' signal into LCNC?
>
> Thanks in advance
>
> -ldw

I used a near module to develop an at-speed on my lathe.

Grepping for near in the .hal files shows this:
gene@lathe:~/linuxcnc/configs/my_LinuxCNC_machine2$ grep near *.hal
my_LinuxCNC_machine2.hal:loadrt near                    names=near.speed
my_LinuxCNC_machine2.hal:addf   mult2.buttonscale       servo-thread    # s/b 
in front of near.speed
my_LinuxCNC_machine2.hal:addf   near.speed              servo-thread
my_LinuxCNC_machine2.hal:net    spindle-velocity        sumenc.out      
pid.s.feedback near.speed.in2
my_LinuxCNC_machine2.hal:net    spindle-drive0          
motion.spindle-speed-out-rps    rvsaccel.in near.speed.in1
my_LinuxCNC_machine2.hal:net    spindle-at-speed        near.speed.out  
motion.spindle-at-speed
my_LinuxCNC_machine2.hal:# near.speed.in1 is from pid.s.command
my_LinuxCNC_machine2.hal:net    spindle-at-speed       <=  near.speed.out
my_LinuxCNC_machine2.hal:setp   near.speed.scale        [SPINDLE_9]NEAR_SCALE
my_LinuxCNC_machine2.hal:setp   near.speed.difference   [SPINDLE_9]NEAR_TOL

and a grep for at-speed:

gene@lathe:~/linuxcnc/configs/my_LinuxCNC_machine2$ grep at-speed *.hal
Gearchange_snippet.hal:#            sets spindle-at-speed true
my_LinuxCNC_machine2.hal:net    spindle-at-speed        near.speed.out  
motion.spindle-at-speed
my_LinuxCNC_machine2.hal:net    spindle-at-speed       <=  near.speed.out
pyvcp_options.hal:net spindle-at-speed        =>    pyvcp.spindle-at-speed-led

sumenc.out is the output stage of a lashup that sums the last 4 encoder 
samples and outputs the average, a de-noising technique I have cobbled up.
It lets me run higher gains in pid.s and results in a quite stiff
maintenance of the spindle speed even at speeds down to about 60 rpm
without rattling the gear clearances in the backgear too badly as the 
encoder slots go by.  The fly in that soup is there is not a signal I
can get directly from a Mesa 5i25 card that indicates an edge has gone 
by, so I save the last velocity reading, and declare an edge clocking 
pulse if the next reading has changed by more than a couple counts. 
It probably miss-fires at the higher rpms, missing an edge here and 
there as the shop made encoders slots are going by faster than the 
servo-thread can read it, but by 500 rpm, inertia takes over and the 
speed control remains quite stiff.

I hope its helpfull.

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)
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