ednspace: you can get a variable-frequency output from stepgen (ctrl_mode=v) but you can't do this within stepconf (and because you have to modify the 'loadrt stepgen' line, you can't do it simply with an add-on line in custom.hal) if you need a 50% duty cycle, I think you use step_type=2 (quadrature); either phase is a square wave at half the desired frequency otherwise, you get "on" for a set time then "off" for nearly the requested frequency still I am confused can I vary frequency on the fly and have it connected to the spindle control so when I issue an M3 command I get a different frequency out of the control pin I am pretty sure 50% duty is what I need, just need to keep that duty cycle constant and vary frequency I could just wire this up to an external circuit to control spindle speed but it would be oh so nice to have it controlled by emc * IRSeekBot3 (n=IRSeekLo@ip-68-178-158-148.ip.secureserver.net) has joined #emc * acemi has quit (Read error: 104 (Connection reset by peer)) * pjm_ (n=pjmarsh@host81-146-71-253.btremoteinternet-dsl.bt.net) has joined #emc ednspace: yes, you can convert the spindle S-number into a variable-frequency signal. but you'll have to learn a bit of hal to do it. ednspace: this shows the changes I made in my .hal file to get a variable-frequency output: http://rafb.net/p/z1hxiz94.html (- for lines that are removed, + for lines that are added) ednspace: to control the relationship between RPM and Hz you would setp stepgen.3.position-scale -- the default setting of 1.0 will give .5Hz per RPM, a higher setting will give more Hz per RPM. to control the maximum signal in Hz, you would setp stepgen.3.maxvel -- a setting of 800.0 would give a maximum of 400Hz, a higher setting will give a higher Hz limit. * pjm has quit (Read error: 113 (No route to host)) +++ my-mill.hal 2008-06-23 19:59:56.000000000 -0500 @@ -6,12 +6,10 @@ loadrt probe_parport loadrt hal_parport cfg=0x378 setp parport.0.reset-time 5000 -loadrt stepgen step_type=0,0,0 -loadrt pwmgen output_type=0 +loadrt stepgen step_type=0,0,0,2 ctrl_type=p,p,p,v addf parport.0.read base-thread addf stepgen.make-pulses base-thread -addf pwmgen.make-pulses base-thread addf parport.0.write base-thread addf parport.0.reset base-thread @@ -19,15 +17,10 @@ addf motion-command-handler servo-thread addf motion-controller servo-thread addf stepgen.update-freq servo-thread -addf pwmgen.update servo-thread -net spindle-cmd <= motion.spindle-speed-out => pwmgen.0.value -net spindle-enable <= motion.spindle-on => pwmgen.0.enable -net spindle-pwm <= pwmgen.0.pwm -setp pwmgen.0.pwm-freq 100.0 -setp pwmgen.0.scale 1166.66666667 -setp pwmgen.0.offset 0.114285714286 -setp pwmgen.0.dither-pwm true +net spindle-cmd <= motion.spindle-speed-out => stepgen.3.value +net spindle-enable <= motion.spindle-on => stepgen.3.enable +net spindle-pwm <= stepgen.3.phase-A net spindle-cw <= motion.spindle-forward net probe-in => motion.probe-input