I got my filtered speed feedback working by copying and modifying parts 
of nist lathe and sim lathe.  Tonight I tried to add PID control to the 
spindle and can't get it to run.  I get this error -

HAL: ERROR: bad position: 0

Here is what I added tonight (beside adding another PID loop (count=4) 
and such to core servo.hal).

#### Start of drive speed control
loadrt limit2 count=1
addf limit2.0 servo-thread # Limit spindle rpm rate of change to 300 RPM 
per sec

setp limit2.0.min 0
setp limit2.0.max 3000
setp limit2.0.maxv 10 # For testing, I plan to change to around 
300rpm/sec later,
                      # this is so I can watch with hal tools

newsig spindle-ramp float
linksp motion.spindle-speed-out => limit2.0.in
linkps limit2.0.out => spindle-ramp

newsig vfd-command float

linksp spindle-rpm-filtered => pid.3.feedback
linksp vfd-command <= pid.3.output
setp pid.3.maxoutput 10

# Tune gains to minimize following error but be slow responding to
#  the huge negative spike when threading resets spindle position
# I plan to use mostly I gain to
setp pid.3.Pgain 1
setp pid.3.Igain .01
setp pid.3.Dgain 0
setp pid.3.bias 0
setp pid.3.FF0 0
setp pid.3.FF1 0
# deadband should be just over 1 count
setp pid.3.deadband 5
linksp spindle-ramp => pid.3.command
linksp motion.spindle-on => pid.3.enable

###################################

Does anyone here know what I did wrong?

Thanks!
Roger Neal


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to