On Saturday 14 January 2017 07:55:45 Jan Bos wrote:

> Hello everybody,
>
> Thanks for your replies, much appreciated but I got stuck with the
> scaling. Since I already use one scaling component for the spindle
> speed display, I need to add the scaling function for my
> 'spindle-load' signal. The analog input works fine and reads the 5 or
> 10V from the VFD simulated by a potentiometer on the desk very
> accurately.
> I connected this 'spindle-load' signal to the Glade panel in a 'h-bar'
> and set the maximum for the h-bar to 100 representing 100% max for
> spindle load. The potentiometer is hooked up the 12V and I can see the
> h-bar happily displaying a value between 0 and 10 when I turn the
> potentiometer.
>
> Now I need to scale this up and multiply the value read from the
> analog input by 20 to get to the 100 I need for the h-bar.
>
> Sound simple right? Well I have been trying to get it to work but I
> need to throw the towel in the for now because whatever I do, it shows
> a stubborn zero and it wont budge.
>
This is generally an indication that you did not addf that module 
someplace between the read of the data from the interface to the write 
of the processed data back to the interface.

Be aware that for maximum propagation velocity, that these addf's are 
executed in the thread loop in the order of the addf's. Its generally 
ordered in this list of addf's so that if the data is massaged by more 
than on function, such as your 2 scale's to arrive at the various scales 
needed, its best to put them in order so the data falls thru in the 
correct order such that its all done in one execution cycle of the 
thread.

I have done it in backwards order where I wanted to filter, such as using 
a fifo of sample-holds, constructed out of mux2's, so the the data 
marched thru the 4 stage fifi in 4 servo-thread cycles, and each packet 
was fed to a sum2 whose gain was set at .500, using 2 sum2's, and their 
output was fed to a final sum2, also gain set at .500, arriving at a 4 
sample average of the spindle speed, reducing the quadrature noise by 
a /4, but with a gain of 1 thru the chain going back to the spindles 
PID.feedback.

> When I use the scale function the analog value goes into the scale
> component and 0 (zero) comes out.
> I am doing something wrong but I cant figure out where it goes wrong.
>
> First of all I added in my HAL file:
>
> loadrt scale names=scale.spindle,scale.spindle-load
>
> When I do this I can see the 2 scale components.
>
> Then I added this to the same HAL file:
>
> # Spindle load set-up
> setp scale.spindle-load.gain 20
> net spindle-load => scale.spindle-load.in
> net spindle-load-scaled => scale.spindle-load.out
>
> And I connect the 'spindle-load-scaled to the Gladevcp panel and I got
> nothing. Zero.
> Attached the screenshot from the HAL configuration showing what
> happens.
>
> I do get an error when I add this to my HAL:
>
> addf scale.spindleload        servo-thread
unknown name here, missing the -, s/b scale.spindle-load.

The names are arbitrary, but must be consistent. This is your real error.

> I don't know why I get this error but I think this is why it does not
> work, there are no updates being made to the scale component with my
> spindle-load signal when the servo thread is running.
> Where and how to add this to the servo-thread? I tried all the things
> I could find and think of but nothing. I am lost here, cant find
> anything to read about it anymore.
>
> Could anybody have a quick look and help me getting this simple
> scaling thing to work? I read all I could about it, tried for days and
> running out of ideas. I do get the concept but the actual
> implementation is not quite clear.
>
> Sure hope is a simple syntax error or something like this.
>
> Attached some screenshots of my files. Linux does start normally and
> all is working fine except this load-meter.
>
> Thanks a lot in advance and best regards,
>
> G21
>
> On Wed, Jan 4, 2017 at 12:51 AM, Gene Heskett <ghesk...@shentel.net> 
wrote:
> > On Monday 02 January 2017 22:01:16 Jan Bos wrote:
> > > Hello Peter,
> > >
> > > It works and I can read the value now. How can I scale this
> > > correctly? I have a 0-5V input and need my GladeVcp bar to show
> > > Maximum at 5V input but at 5V input it does not show maximum.
> > > I looked at the 'scale' command but all examples and descriptions
> > > I could find are for outputs and not for inputs.
> > >
> > > Here is what I did: *net spindle-load 
> > > hm2_5i25.0.7i76.0.0.analogin0 and connected this to the Glade
> > > panel bar.*
> >
> > I'm not using glade to do it, but pyvcp, for a tachometer dial on my
> > mill. That is configured by an .xml file, and this can probably be
> > fixed in a similar place in the glade file. In the .xml, 
> > <max_>2750</max_> sets the value at the top or CW end of the scale,
> > and if using a bar indicator in glade, there should be a value that
> > sets full scale for the bar. In my case I don't recall the actual
> > value fed to the meter pin, only that in the normal .hal, I have a
> > scale module with a gain of 60 to convert the RPS out of the
> > encoders velocity pin to RPM that I feed the tach with. ISTR I also
> > have a lowpass module in that path to give a tach needle thats
> > mearly nervous rather than completely spastic because of the
> > quadrature noise from the encoder.
> >
> > What I am saying is put the scale module in that signal path, and
> > use a setp to set the scale gain in the hal file to make it read
> > full scale when it is supposed to read full scale.  Because you are
> > looking at the drive TO the spindle with that sample line above, I
> > would verify that it is going to the full 5 volts. Something in the
> > driver hardware may be giving you less than unity gain. So verify
> > with a halmeter, that is is indeed reaching 5 volts. It may not be.
> >
> > > *Could you explain how to use 'scale' correctly to scale this
> > > input to read 5V as maximum value for the Glade bar if needed at
> > > all.*
> > >
> > > *Thanks,*
> > >
> > > *G21*
> > >
> > > On Wed, Dec 28, 2016 at 12:00 PM, Jan Bos <rappyrip...@gmail.com> 
wrote:
> > > > Thanks Peter, will free up these and try again. Will let you
> > > > know if I have more issues getting this to work.
> > > >
> > > > G21
> > > >
> > > > On Wed, Dec 28, 2016 at 11:48 AM, Peter C. Wallace
> > > > <p...@mesanet.com>
> > > >
> > > > wrote:
> > > >> On Wed, 28 Dec 2016, Jan Bos wrote:
> > > >> > Date: Wed, 28 Dec 2016 10:49:33 +0800
> > > >> > From: Jan Bos <rappyrip...@gmail.com>
> > > >> > Reply-To: "Enhanced Machine Controller (EMC)"
> > > >> >     <emc-users@lists.sourceforge.net>
> > > >> > To: "Enhanced Machine Controller (EMC)"
> > > >> > <emc-users@lists.sourceforge.n
> > > >>
> > > >> et>
> > > >>
> > > >> > Subject: [Emc-users] read analog input 7I76
> > > >> >
> > > >> > I am trying to read an analog input from a digital I/O pin on
> > > >> > my 7I76. According to the manual this is possible albeit in 8
> > > >> > bit mode only
> > > >>
> > > >> which is
> > > >>
> > > >> > fine for me. I have a spindle drive that provides a 0 5V
> > > >> > output for
> > > >>
> > > >> spindle
> > > >>
> > > >> > load and I want to read this and show this in my Glade
> > > >> > sidepanel.
> > > >> >
> > > >> > The manual says:
> > > >> > All field input pins are capable of reading the input
> > > >> > voltage. These are not highly
> > > >> > accurate or high resolution but can be useful for things like
> > > >>
> > > >> potentiometer
> > > >>
> > > >> > inputs. Input resolution is 8 bits and input full scale value
> > > >> > is 36.3V. Accuracy is +-5%. Software process data modes 1 and
> > > >> > 2 allow reading the analog voltage on inputs 0 through 3, in
> > > >> > addition to the 32 digital bit inputs.
> > > >> >
> > > >> > I already used my 0 through 3 so I need to use one of my free
> > > >> > inputs
> > > >>
> > > >> left
> > > >>
> > > >> > on the 7I76 and 8 bit resolution is fine for this.  I looked
> > > >> > at PncConf
> > > >>
> > > >> and
> > > >>
> > > >> > there is no option to select an analog input for a digital
> > > >> > I/O. I run
> > > >>
> > > >> the
> > > >>
> > > >> > card in mode 2 combined with a 6I25.
> > > >> >
> > > >> > How do I go about this and read an analog voltage from a
> > > >> > digital I/O
> > > >>
> > > >> pin on
> > > >>
> > > >> > my 7I76?
> > > >>
> > > >> With standard 7I76 firmware you can only read analog data from
> > > >> inputs 0..3 so its easier to move some digital inputs around to
> > > >> free up 0..3
> > > >>
> > > >> > Thanks,
> > > >> >
> > > >> > G21
> > > >> > ------------------------------------------------------------
> > > >>
> > > >> ------------------
> > > >>
> > > >> > Check out the vibrant tech community on one of the world's
> > > >> > most engaging tech sites, SlashDot.org!
> > > >> > http://sdm.link/slashdot
> > > >> > _______________________________________________
> > > >> > Emc-users mailing list
> > > >> > Emc-users@lists.sourceforge.net
> > > >> > https://lists.sourceforge.net/lists/listinfo/emc-users
> > > >>
> > > >> Peter Wallace
> > > >> Mesa Electronics
> > > >>
> > > >> (\__/)
> > > >> (='.'=) This is Bunny. Copy and paste bunny into your
> > > >> (")_(") signature to help him gain world domination.
> > > >>
> > > >>
> > > >> ------------------------------------------------------------
> > > >> ------------------
> > > >> Check out the vibrant tech community on one of the world's most
> > > >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > > >> _______________________________________________
> > > >> Emc-users mailing list
> > > >> Emc-users@lists.sourceforge.net
> > > >> https://lists.sourceforge.net/lists/listinfo/emc-users
> > >
> > > ------------------------------------------------------------------
> > >---- -------- Check out the vibrant tech community on one of the
> > > world's most engaging tech sites, SlashDot.org!
> > > http://sdm.link/slashdot
> > > _______________________________________________
> > > Emc-users mailing list
> > > Emc-users@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/emc-users
> >
> > Cheers, Gene Heskett
> > --
> > "There are four boxes to be used in defense of liberty:
> >  soap, ballot, jury, and ammo. Please use in that order."
> > -Ed Howdershelt (Author)
> > Genes Web page <http://geneslinuxbox.net:6309/gene>
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to