Motenc spindle / std quad encoder.
18 Sep 2018 16:36 #117722
by dextaca
Motenc spindle / std quad encoder. was created by dextaca
Gents me again..
Trying to get the threading done.. not as easy as it seems..
have a 1024p/r encoder on the main spindle, going to chanel 3 on them motenc card. What pins / config should I be looking for.
Right now the lathe sits ide on the g76 line..
Thank you
ps . I've found this , I've coppied it but nothing..
# ********************************************************************************
# Spindle Synchronized Motion
# ********************************************************************************
# General spindle speed setpoint
net spindle-speed-DAC motion.spindle-speed-out => motenc.0.dac-03-value
# Compute the spindle speed using derivative, multipy, and absolute functions
loadrt ddt count=1
loadrt mult2 count=1
loadrt abs count=1
addf ddt.0 servo-thread
addf mult2.0 servo-thread
addf abs.0 servo-thread
setp motenc.0.enc-02-scale 1
setp mult2.0.in1 60
net spindle-position motenc.0.enc-02-position => motion.spindle-revs ddt.0.in
net spindle-enc-rps mult2.0.in0 <= ddt.0.out
net spindle-ABS abs.0.in <= mult2.0.out
# Spindle Feedback for Sync and Feed Per Revolution
net spindle-enc-rpm motion.spindle-speed-in <= abs.0.out
net spindle-index-enable motenc.0.enc-02-index-enable <=> motion.spindle-index-enable
# Spindle at Speed signal generator
loadrt near
addf near.0 servo-thread
net spindle-cmd-rps => near.0.in1
net spindle-enc-rps => near.0.in2
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
Trying to get the threading done.. not as easy as it seems..
have a 1024p/r encoder on the main spindle, going to chanel 3 on them motenc card. What pins / config should I be looking for.
Right now the lathe sits ide on the g76 line..
Thank you
ps . I've found this , I've coppied it but nothing..
# ********************************************************************************
# Spindle Synchronized Motion
# ********************************************************************************
# General spindle speed setpoint
net spindle-speed-DAC motion.spindle-speed-out => motenc.0.dac-03-value
# Compute the spindle speed using derivative, multipy, and absolute functions
loadrt ddt count=1
loadrt mult2 count=1
loadrt abs count=1
addf ddt.0 servo-thread
addf mult2.0 servo-thread
addf abs.0 servo-thread
setp motenc.0.enc-02-scale 1
setp mult2.0.in1 60
net spindle-position motenc.0.enc-02-position => motion.spindle-revs ddt.0.in
net spindle-enc-rps mult2.0.in0 <= ddt.0.out
net spindle-ABS abs.0.in <= mult2.0.out
# Spindle Feedback for Sync and Feed Per Revolution
net spindle-enc-rpm motion.spindle-speed-in <= abs.0.out
net spindle-index-enable motenc.0.enc-02-index-enable <=> motion.spindle-index-enable
# Spindle at Speed signal generator
loadrt near
addf near.0 servo-thread
net spindle-cmd-rps => near.0.in1
net spindle-enc-rps => near.0.in2
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
Please Log in or Create an account to join the conversation.
18 Sep 2018 17:09 #117723
by dextaca
Replied by dextaca on topic Motenc spindle / std quad encoder.
still testing and got the index and spindle position working, still no luck on the g76 exec..
Please Log in or Create an account to join the conversation.
20 Sep 2018 12:03 #117781
by andypugh
Replied by andypugh on topic Motenc spindle / std quad encoder.
The HAL looks right for threading to work, so my guess would be that the encoder is counting backwards.
Does the encoder position increase when the spindle is turning clockwise?
If not, set the scale negative.
setp motenc.0.enc-02-scale -1
Though, actually, I really would expect
setp motenc.0.enc-02-scale 1024
So perhaps G76 simply thinks that the spindle is turning far too fast for it to synch to.
Does the encoder position increase when the spindle is turning clockwise?
If not, set the scale negative.
setp motenc.0.enc-02-scale -1
Though, actually, I really would expect
setp motenc.0.enc-02-scale 1024
So perhaps G76 simply thinks that the spindle is turning far too fast for it to synch to.
Please Log in or Create an account to join the conversation.
Time to create page: 0.068 seconds