This is my code

spindle.hal

loadrt threads name1=slow-thread period1=100000000
loadrt ddt count=1
addf ddt.0 slow-thread
net SpindleRevs m5i20.0.enc-03-position => motion.spindle-revs ddt.0.in
net SpindleSpeedRps ddt.0.out => motion.spindle-speed-in


# VFD spindle 0-10V control absolute
# route speed command through abs block to get 0-10V
loadrt abs
addf abs.0 servo-thread
net spindle-rpm-cmd motion.spindle-speed-out => abs.0.in
net spindle-rpm-cmd-abs abs.0.out => m5i20.0.dac-03-value
# scale factor converts RPM into DAC volts
setp m5i20.0.dac-03-gain [SPINDLE]DAC_SCALE

net spindle-on motion.spindle-on => m5i20.0.dac-03-enable

#pid spindle speed
net spindle-rpm-cmd => pid.3.command
net SpindleSpeedRps <= pid.3.feedback
net spindle-on => pid.3.enable

#turning pid parameters
setp pid.3.Pgain [SPINDLE]P
setp pid.3.Igain [SPINDLE]I
setp pid.3.Dgain [SPINDLE]D
setp pid.3.deadband [SPINDLE]DEADBAND
setp pid.3.maxoutput [SPINDLE]MAX_OUTPUT

net spindle-rpm-cmd-abs => pid.3.output

m5i20.ini

[SPINDLE]
# Encoder
INPUT_SCALE =                   -4096
# DAC output to VFD
DAC_SCALE =                     -0.04
OUTPUT_OFFSET =                 0
MAX_OUTPUT =                    10
# PID tuning params
DEADBAND =              1.0000
P =                     0
I =                     0
D =                     0


Would this work or it woun't, becouse spindle-speed-in is in
rev/second and not in rev/minute?

Will i have to use gain and multiply spindle-speed-in * 60 ?

I would like to thank you all to help me configure ' absolute spindle
output 0 - 10 Volt ' my last question .

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to