Tom wrote:
> Marko Bukovinsky <bukovinsk...@...> writes:
> 
>> how to change this code into abosolute 0 - 10 Volt output?
> ...
> 
> Mark, 
> Here is the abs statement from my m5i20_io.hal file, this might help you get 
> the
> wording right:
> 
> loadrt abs count=2
> addf abs.0 servo-thread
> net spindle-rpm-cmd motion.spindle-speed-out
> newsig abs-spindle float
> linkps abs.0.in <= spindle-rpm-cmd
> linkps abs.0.out => abs-spindle 
> linksp abs-spindle => m5i20.0.dac-03-value
> setp m5i20.0.dac-03-offset 0
> net SpindleOn motion.spindle-on
> linksp SpindleOn => m5i20.0.dac-03-enable
> setp m5i20.0.dac-03-gain [SPINDLE]DAC_SCALE
> 
> I don't think it was necessary to load 2 abs realtime components, but that is
> what is in my file right now.


If you are only using one abs component, then you should say "count=1" 
(or leave "count" out - I'm about 99% sure the default is 1).  If you do 
need more than one, remember to have an addf command for each one.

The example above uses a mix of the old-style newsig/link notation and 
the current net notation, which I think makes it a bit confusing.  Here 
is the same thing using only net notation:

# 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
setp m5i20.0.dac-03-offset 0
net spindle-on motion.spindle-on => m5i20.0.dac-03-enable

I made a couple changes to signal names.  Signal names can be whatever 
you want, so make life easy for yourself.  The new names for the three 
signals all start with "spindle", so when you do a "halcmd show sig" 
they will all be grouped together.  The would also appear close together 
in a halscope or halmeter dialog box.  The old ones started with 
"spindle", "Spindle", and "abs", and would appear far apart in the 
listing or dialog.

The most important change is that I added a couple comments - some 
people may have perfect memory, but I don't.  When I want to change 
something on my machine a year or two after I did the initial config, 
comments will be vital to help me understand what I did back then.  The 
second comment is a bit lame, but that's because I don't actually know 
anything about this setup.  If it was my own machine, I would probably 
spell out the details, maybe something like:

# 10V to the VFD gives 60Hz = 1780 motor RPM, belt ratio is 2:1
# so 10V = 890 RPM at the spindle.  So 1V = 89 RPM.  When speed
# command is 89 RPM, I want 1V, so scale factor is 1/89 = 0.01123
setp m5i20.0.dac-03-gain 0.01123

Sure, if I can figure it out once, I can figure it out again later, but 
why?  Write it down while you are doing it, then you'll never have to
guess later.

Regards,

John Kasunich


------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to