Lagunmatic 3516-SX Retrofit

11 Aug 2018 21:13 #115917 by andypugh

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.
11 Aug 2018 21:51 #115922 by giz
Replied by giz on topic Lagunmatic 3516-SX Retrofit
Hey andy - the issue I run into is that both of those pins are already connected to signals. I'm using code from your vmc_toolchanger config:
# 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.
13 Aug 2018 04:51 #115987 by giz
Replied by giz on topic Lagunmatic 3516-SX Retrofit
Alright! I finally figured out the logic needed to enable the spindle in both velocity and position modes. Moving the or2 inputs did the trick - seems obvious now but I stared at this code for hours today.

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 orient.0.position

net spindle-vel 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 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 #not needed v2.8+, use
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

Moderators: cncbasher
Time to create page: 0.068 seconds
Powered by Kunena Forum