Hi Gene.
Here is the spindle stuff I got working on Sunday.
Not sure it is exactly what you are looking for, but it may spark some
ideas for you.
Also, it may still need some work!

Ray

--J. Ray Mitchell Jr.
jrmitche...@gmail.com
(818)324-7573


The dogmas of the quiet past, are inadequate to the stormy present. The
occasion is piled high with difficulty, and we must rise with the occasion.
As our case is new, so we must think anew and act anew. We must disenthrall
ourselves, and then we shall save our country.*Abraham Lincoln
<http://www.quotationspage.com/quotes/Abraham_Lincoln/>*, *Annual message
to Congress, December 1, 1862*
*16th president of US (1809 - 1865)*

On Mon, Oct 23, 2017 at 6:06 PM, Gene Heskett <ghesk...@shentel.net> wrote:

> Greetings everybody;
>
> That new card works but in all my hacking on the hal file, I seem to have
> lost the feedback path to getting a true signal out of the near module
> so the code will actually run once the spindle has been started.
>
> So, I've looked thru the wiki without much luck in finding a good spindle
> velocity servo's 'net' stanza to use as a model.
>
> I know its different from the stepper driver stanza. But although I ran
> pncconf again, it generated the axis(now joint) settings ok, but not the
> spindle stuffs, in particular it just sets's spindle-at-speed true,
> without getting a near module involved, and thats where I am failing.
> Somehow I am not getting any signal to near.speed.in2.
>
> So does anyone here have a working spindle "net" stanza that runs it in
> velocity mode via a PDM signal? One you can post?
>
> I also note that in the pncconf generated ini and hal files it made
> today, there are only [Joint-N] stanza's, no axis assignments other than
> comments.  Did I miss the memo that /all/ of that was deprecated?
>
> I still have some of both in my configs. I can see what needs to be
> changed, so thats just an edit session to fix, and from my understanding
> of how that works, it won't actually change a thing as far as operation
> goes.  More a matter of getting us all on the same page.
>
> Thanks everybody.
>
> 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>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
#*******************
#  SPINDLE S
#*******************

setp   pid.s.Pgain     [SPINDLE_9]P
setp   pid.s.Igain     [SPINDLE_9]I
setp   pid.s.Dgain     [SPINDLE_9]D
setp   pid.s.bias      [SPINDLE_9]BIAS
setp   pid.s.FF0       [SPINDLE_9]FF0
setp   pid.s.FF1       [SPINDLE_9]FF1
setp   pid.s.FF2       [SPINDLE_9]FF2
setp   pid.s.deadband  [SPINDLE_9]DEADBAND
setp   pid.s.maxoutput [SPINDLE_9]MAX_OUTPUT
setp   pid.s.error-previous-target true

net spindle-index-enable  <=> pid.s.index-enable
net spindle-enable        =>  pid.s.enable
net spindle-vel-cmd-rps     => pid.s.command
net spindle-vel-fb-rps-abs      => pid.s.feedback
net spindle-output        <=  pid.s.output

# ---PWM Generator signals/setup---

setp   hm2_5i25.0.pwmgen.00.output-type 1
setp   hm2_5i25.0.pwmgen.00.scale  [SPINDLE_9]OUTPUT_SCALE

net spindle-output      => hm2_5i25.0.pwmgen.00.value
#net spindle-vel-cmd-rps      => hm2_5i25.0.pwmgen.00.value
net spindle-enable      => hm2_5i25.0.pwmgen.00.enable

# ---Encoder feedback signals/setup---

setp    hm2_5i25.0.encoder.03.counter-mode 0
setp    hm2_5i25.0.encoder.03.filter 1
setp    hm2_5i25.0.encoder.03.index-invert 0
setp    hm2_5i25.0.encoder.03.index-mask 0
setp    hm2_5i25.0.encoder.03.index-mask-invert 0
setp    hm2_5i25.0.encoder.03.scale  [SPINDLE_9]ENCODER_SCALE

net spindle-revs             <=   hm2_5i25.0.encoder.03.position
net spindle-vel-fb-rps       <=   hm2_5i25.0.encoder.03.velocity
net spindle-index-enable     <=>  hm2_5i25.0.encoder.03.index-enable

# ---setup spindle control signals---

net spindle-vel-cmd-rps        <=  motion.spindle-speed-out-rps
net spindle-vel-cmd-rps-abs    <=  motion.spindle-speed-out-rps-abs
net spindle-vel-cmd-rpm        <=  motion.spindle-speed-out
net spindle-vel-cmd-rpm-abs    <=  motion.spindle-speed-out-abs
net spindle-enable             <=  motion.spindle-on
net spindle-cw                 <=  motion.spindle-forward
net spindle-ccw                <=  motion.spindle-reverse
net spindle-brake              <=  motion.spindle-brake
net spindle-revs               =>  motion.spindle-revs
net spindle-at-speed           =>  motion.spindle-at-speed
net spindle-vel-fb-rps         =>  motion.spindle-speed-in
net spindle-index-enable      <=>  motion.spindle-index-enable

# ---Setup spindle at speed signals---

#sets spindle-at-speed true

#  Use ACTUAL spindle velocity from spindle encoder
#  spindle-velocity bounces around so we filter it with lowpass
#  spindle-velocity is signed so we use absolute component to remove sign
#  ACTUAL velocity is in RPS not RPM so we scale it.

setp     scale.spindle.gain 60
setp     lowpass.spindle.gain 1.000000
net spindle-vel-fb-rps        =>     scale.spindle.in
net spindle-fb-rpm               scale.spindle.out       =>   abs.spindle.in
net spindle-fb-rpm-abs           abs.spindle.out         =>   lowpass.spindle.in
net spindle-fb-rpm-abs-filtered  lowpass.spindle.out  

# connect one input to the commanded spindle speed
net spindle-vel-cmd-rpm-abs => near.0.in1

# connect one input to the encoder-measured spindle speed
net spindle-fb-rpm-abs-filtered => near.0.in2

# connect the output to the spindle-at-speed input
net spindle-at-speed motion.spindle-at-speed <= near.0.out

# set the spindle speed inputs to agree if within 5%
setp near.0.scale 1.05



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to