Lagunmatic 3516-SX Retrofit
giz wrote: I cannot for the life of me figure out how to incorporate it into the logic. Because I have the velocity-mode signal connected to motion.spindle-on I don't seem to be able to drive hm2_5i25.0.7i77.0.1.spinena with motion.spindle-on (through the spindle-enable signal that is standard).
Maybe use the OR2 HAL component to enable the drove from motion.spindle-on _or_ motion.spindle-orient.
# this switches modes net orient-mode motion.spindle-orient orient.0.enable pid.1.enable mux2.0.sel net velocity-mode motion.spindle-on pid.s.enable #hm2_5i25.0.7i77.0.1.spinena net orient-dir motion.spindle-orient-mode orient.0.mode
I am interpreting your suggest as this:
net spindle-enable => hm2_5i25.0.7i77.0.1.spinena loadrt or2 addf or2.0 servo-thread net velocity-enable or2.0.in0 motion.spindle-on net position-enable or2.0.in1 motion.spindle-orient net spindle-enable or2.0.out
In other news, I have my spindle VFD running in closed-loop vector mode now. I connected the built-in encoder signals from the spindle motor to the VFD to close the loop at the VFD, and I will pass the external encoder signals directly to LinuxCNC.
I'm assuming I should remove the spindle velocity PID component from my hal now?
I've tested the VFD down to 1Hz which is about 33RPM so if Orient-Mode wasn't working because of VFD issues, that won't be the case any longer.
When I run an M19 code I get VERY SLIGHT movement of the spindle (probably less than 1 degree) and the spindle softly resists my attempts to move it by hand.
The issue now may be scaling? John's schematic has different scales for Position vs. Velocity mode - is that necessary?
Also I kept the velocity mode PID for now.
net spindle-index-enable <=> pid.s.index-enable net spindle-enable => hm2_5i25.0.7i77.0.1.spinena hm2_5i25.0.7i77.0.0.output-06 ##### net spindle-pos pid.1.feedback orient.0.position net spindle-vel pid.s.feedback hm2_5i25.0.encoder.05.velocity net spindle-vel-cmd motion.spindle-speed-out pid.s.command #net spindle-vel-cmd motion.spindle-speed-out-rps pid.s.command net spindle-vel-pid pid.s.output mux2.0.in0 net spindle-pos pid.1.feedback orient.0.position near.0.in1 hm2_5i25.0.encoder.05.position net spindle-pos-cmd orient.0.command pid.1.command near.0.in2 net spindle-angle motion.spindle-orient-angle orient.0.angle net spindle-pos-pid pid.1.output mux2.0.in1 setp near.0.difference 0.0005 net spindle-in-pos-raw near.0.out edge.0.in #not needed v2.8+, use orient.0.is-oriented net spindle-in-pos edge.0.out motion.spindle-is-oriented # this switches modes loadrt or2 count=2 addf or2.0 servo-thread net orient-mode motion.spindle-orient orient.0.enable pid.1.enable mux2.0.sel or2.0.in1 net velocity-mode motion.spindle-on pid.s.enable or2.0.in0 net orient-dir motion.spindle-orient-mode orient.0.mode net spindle-enable or2.0.out #####