Kasey Matejcek wrote: > I'm using a johns univ pico controller and his dc servo amps > > I'm trying to use one of his amps to drive the dc servo motor on my lathe > For open-loop speed control, see http://pico-systems.com/codes/minimill/
This is my minimill configuration, so it has some stuff that eventually needs to come out, namely the Y axis. But, it has axis 3 PWM output driving my PWM servo amp to the spindle motor, and axis 3 encoder input sensing the spindle for a speed display and for threading. It is capable of reversing the spindle for rigid tapping. spindle.hal and spindle.xml are entirely for on-screen display through a pyvcp panel. in univpwm_motion.hal, there is : setp ppmc.0.encoder.03.scale 6912 This sets the encoder to read 1.000 for one full revolution, so if you have a 100 cycle/rev encoder that gives 400 counts/rev, put 400 there. and then all of this for the spindle encoder: newsig spindle-sync bit newsig spindle-index-en bit linksp spindle-index-en => ppmc.0.encoder.03.index-enable # hook up motion controller's sync output linkps motion.spindle-index-enable => spindle-index-en # report rev count to motion controller newsig spindle-pos float linkps ppmc.0.encoder.03.position => spindle-pos linksp spindle-pos => motion.spindle-revs Here's what connects the servo drive, a lot of this is to filter the speed changes to limit acceleration to what is possible. You will have to find the right values for your machine. The mult2.1.in1 sets the speed calibration, you will need a different number for each gear or belt setting. lowpass.0.gain sets the filtering constant, I think smaller numbers make speed changes more gradual. # set up 4th PWM generator as a spindle speed control newsig spindle-speed float newsig spindle-pwm-cmd float newsig spindle-pwm-filt float linkps motion.spindle-speed-out => spindle-speed linksp spindle-speed => mult2.1.in0 setp mult2.1.in1 0.0009018 linkps mult2.1.out => spindle-pwm-cmd linksp spindle-pwm-cmd => lowpass.0.in linkps lowpass.0.out => spindle-pwm-filt linksp spindle-pwm-filt => ppmc.0.pwm.03.value setp lowpass.0.gain 0.005 And, this part enables the PWM output when the spindle is set for either forward or reverse operation. newsig spindle-enable bit # SpindleFwd and SpindleRev come from univpwm_io.hal linksp SpindleFwd => or2.0.in0 linksp SpindleRev => or2.0.in1 linkps or2.0.out => spindle-enable linksp spindle-enable ppmc.0.pwm.03.enable # spindle speed display This scales the display for readout in RPM, the spindle scale factor above at ppmc.0.encoder.03.scale reads our in RPS, this just converts RPS to RPM. net spinraw ppmc.0.encoder.03.delta conv-s32-float.0.in net spinfloat conv-s32-float.0.out mult2.0.in0 setp mult2.0.in1 8.6805555 newsig SpindleRPM float linkps mult2.0.out => SpindleRPM ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users