Spindle control config.
14 Nov 2012 22:48 #26582
by tommy
Spindle control config. was created by tommy
I recently added
C6 - Variable Speed Control Board
from cnc4pc. I also inserted those lines in hal, so spindle is (manually) up and running.
Now, where I'm a bit lost is how to proper setup scaling etc...
From VFD side is already set 18000rpm for max at 10V reference, and about 12000rpm for minimum reference (don't need slower speeds).
For now I have directly copied "template" parameters in hal and are this:
setp scale.0.in 0
setp scale.0.gain 0.36
setp scale.0.offset 60.0
addf scale.0 servo-thread
setp stepgen.3.position-scale 1
setp stepgen.3.maxvel 2400 <- HERE I INCREASED VALUE TO REACH NEARLY 10V output on C6 board
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 0
setp stepgen.3.dirhold 20000
setp stepgen.3.dirsetup 20000
setp stepgen.3.maxaccel 200
Now, where I'm a bit lost is how to proper setup scaling etc...
From VFD side is already set 18000rpm for max at 10V reference, and about 12000rpm for minimum reference (don't need slower speeds).
For now I have directly copied "template" parameters in hal and are this:
setp scale.0.in 0
setp scale.0.gain 0.36
setp scale.0.offset 60.0
addf scale.0 servo-thread
setp stepgen.3.position-scale 1
setp stepgen.3.maxvel 2400 <- HERE I INCREASED VALUE TO REACH NEARLY 10V output on C6 board
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 0
setp stepgen.3.dirhold 20000
setp stepgen.3.dirsetup 20000
setp stepgen.3.maxaccel 200
Please Log in or Create an account to join the conversation.
14 Nov 2012 22:58 #26584
by ArcEye
Replied by ArcEye on topic Spindle control config.
Hi
This is a direct lift from the hal file for my small mill with a very similar board, run through a DIYCNC 0-10v Speed Board
I got the exact figures from a digital tachometer and played around until actual speed matched commanded speed
regards
This is a direct lift from the hal file for my small mill with a very similar board, run through a DIYCNC 0-10v Speed Board
I got the exact figures from a digital tachometer and played around until actual speed matched commanded speed
regards
####################################################################
#
# This section enables the Spindle2 board to produce
# 0-10v scaled upon steps from axis4 and direction of
# rotation from Dir signal
####################################################################
# 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.44 # gives true at 1000
setp scale.0.offset 0.0
addf scale.0 servo-thread
#
# Initialise the stepgen for the spindle
#
setp stepgen.4.position-scale 1
setp stepgen.4.maxvel 2400
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
net spindle-enable <= motion.spindle-on => stepgen.4.enable
net spindle-cmd motion.spindle-speed-out => scale.0.in
net spindle-freq <= scale.0.out => stepgen.4.velocity-cmd
net spindle-out <= stepgen.4.step => parport.0.pin-09-out
net spindle-cw <= stepgen.4.dir => parport.0.pin-08-out
##########################################################################
# This produces an absolutely accurate RPM reading
setp encoder.0.position-scale 1
setp encoder.0.counter-mode 1
net spindle-position encoder.0.position-interpolated => motion.spindle-revs
net spindle-velocity encoder.0.velocity => motion.spindle-speed-in
net spindle-index-enable encoder.0.index-enable <=> motion.spindle-index-enable
net spindle-index parport.0.pin-15-in => encoder.0.phase-Z encoder.0.phase-A
##########################################################################
Please Log in or Create an account to join the conversation.
15 Nov 2012 02:05 #26592
by tommy
Replied by tommy on topic Spindle control config.
The main thing what is "confusing" me is gain value, which is in my case by calculation 10V/18000rpm=0.00055 so if I set this value, how high I should go then with maxvel, or if someone explain me how is this velocity related to gain or scale....
Please Log in or Create an account to join the conversation.
15 Nov 2012 07:44 #26600
by BigJohnT
Replied by BigJohnT on topic Spindle control config.
A quick visit to the man page...
out = in * gain + offset
linuxcnc.org/docs/html/man/man9/scale.9.html
John
out = in * gain + offset
linuxcnc.org/docs/html/man/man9/scale.9.html
John
Please Log in or Create an account to join the conversation.
Time to create page: 0.075 seconds