Arturo,

As promised, I tried to use stepgen to control the analog voltage. Below
are the changes I did to the hal file. This seems to work ok, the
spindle speeds indicated by emc are quite equal to the speeds indicated
by the sherline DRO speed indicator.

I quit my tests to use the solid state relay for controlling the mains
sherline input. I now use the normal relay on pin 16 to short-circuit I1
and I2 of the sherline kbic.

Regards and have a nice weekend,

Geert

#
#   5th stepgen for controlling the spindle.
#   Type must be set to velocity
#
loadrt stepgen step_type=0,0,0,0,0 ctrl_type=p,p,p,p,v
#
#   Use a scale module for offset and scaling of the stepgen
#   Offset and scale are determined by first calculating and testing
#
setp scale.0.in 0
setp scale.0.gain 0.36
setp scale.0.offset 60.0
addf scale.0 servo-thread
#
#   Initialise the stepgen for the spindle
#
setp stepgen.4.position-scale 1
setp stepgen.4.maxvel 1300
setp stepgen.4.steplen 1
setp stepgen.4.stepspace 0
setp stepgen.4.dirhold 20000
setp stepgen.4.dirsetup 20000
setp stepgen.4.maxaccel 200
#
#   Enable
#
net spindle-enable <= motion.spindle-on => stepgen.4.enable
#
#   Connect spindle speed to scaler
#
net spindle-cmd motion.spindle-speed-out => scale.0.in
#
#   Connect scaler output to stepgen velocity
#
net spindle-freq <= scale.0.out => stepgen.4.velocity-cmd
#
#   Connect output to the pin for the analog voltage of cnc4pc board
#
net spindle-out <= stepgen.4.step => parport.0.pin-14-out
#
#   Control of spindle on/off (I1/I2 of KBIC speed controller over the
#   relay instead of triac
#
net spindle-cw => parport.0.pin-16-out

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to