Gene Heskett <gene.hesk...@...> writes:
...

> Speed display widget in axis?  Any thoughts, suggestions?
> 
> Thanks.
> 
Gene,

I am using a pyVCP panel in Axis that has a spindle rpm bar, lifted from
Anders Wallins generously provided ini and hal files on his web page here:
http://www.anderswallin.net/category/cnc/emc/
Thus far, I can display 0 to 4000 rpm in a nice steady green bar, but as 
the spindle speed increases above that point (my spindle goes up to
6000 rpm), the bar (and the floating point value of the "rev-scaled" 
hal pin that it is linked to) starts to bounce between extreme negative 
and positive integers. My diagnosis was that the frequency of the incoming pulse
stream (m5i20.0.enc-03-position) was too great (120kHz) to be scaled accurately
in a slow thread. 
Here is the hal file configuration as provided by Anders:

# load ddt for rpm calc
loadrt ddt count=1
loadrt scale count=2

addf ddt.0 slow-thread
addf scale.0 slow-thread
addf scale.1 servo-thread

# 500-line encoder gives 2000 pulses per rev
setp m5i20.0.enc-03-scale -2000


# RPM = revolutions per minute
net ddt-scale scale.0.gain
sets ddt-scale 60


net spindle-pos m5i20.0.enc-03-position 
net spindle-pos ddt.0.in

# spindle position to motion-control for threading
net spindle-pos motion.spindle-revs
net spindle-index-en motion.spindle-index-enable m5i20.0.enc-03-index-enable

net rev-count  ddt.0.out
net rev-count  scale.0.in
net rev-scaled scale.0.out


# 2000 Hz corresponds to 5400 RPM
# so scale Hz values by 1/2.7
net rpm-scale scale.1.gain
sets rpm-scale 0.37037037

Stephen and Sebastian suggested using a new pin in Hostmot2 (ver.2.2.8) 
called "encoder.03.velocity" instead of the "m5i20.0.enc-03-position" pin 
used in the example above. That should alleviate having to sample/scale 
it in a slow thread.
I will try that tomorrow.  

Tom



------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to