On Sunday 16 December 2012 21:15:17 andy pugh did opine:

> On 17 December 2012 00:28, Gene Heskett <[email protected]> wrote:
> > I can carve code in
> > assembly or in the C we have on a 6309 or 6809 cpu running Nitros9,
> 
> Actually, that's probably quite a good basis for writing HAL components.
> HAL component C is rather closer to embedded code than anything else.
> 
> http://www.linuxcnc.org/docs/html/hal/comp.html
> 
> If you can understand the examples near the bottom then you might find
> yourself wondering why you are trying to string together long chains
> of standard HAL blocks.

Maybe.  Looks like a heavy learning curve for an old fart that doesn't have 
a lot of knowledge about higher math.

Basically, what I am looking for is a "gamma1" module, with perhaps 3, 
maybe 4 knobs, 2 'pins, in & out'.  The knobs would need to be offset, 
scale, scale reference (where the i/o gain is 1.0), and gamma correction to 
apply.

The math I was able to find seems complex, some of it might even have had a 
very time consuming power series.  I don't think we have, in a millisecond 
time frame of the servo-thread, enough time to fool around doing even a 
lookup table method of doing the nominally 2.5 power multiplier, hence my 
effort to arrive at something similar with pure 32 bit multiplies and 
additions which supposedly are fairly fast.

There were no C code examples in what I was able to find in the first 5 or 
so google hits for 'luminance gamma'.  Since my original experiment of 
squaring the feedback was way too much, now my thoughts are on stringing 2 
scales, one of them feeding a mult2 to get the square, the other one 
feeding a scaled value straight to the sum2, and the mult2 feeding the 
other input to the sum2, and that then handed back to pid.feedback, should 
allow me to come up with almost any sort of a gamma curve from 1.0 on to a 
full square law.  Some additional time might be wasted in a limit2 between 
the enc.velocity and the scales for noise reasons, but the time wasted here 
doing that would only be another millisecond max.

Barring the spindle bending over the bit so it digs in another 40 thou and 
locking up in 10 degrees of rotation, something this wet noodle framed toy 
can and has done a hundred dollars of fuses times, it seems like I should 
be able to arrive at settings where I can say s400 or s700 in the gcode and 
get withing 5% of that at the spindle.  For the dug in bit situation, a 
limit2 between the pid.error to absorb normal startups and the bit entering 
the work, feeding both inputs of a mult2, which in turn feeds a comp hooked 
to motion.enable, ought to be able to shut it down fast enough to reduce 
the fuse budget to a manageable size.  What I did have before starting on 
this linearization project probably cut that item by 80%.

Now, if somebody has some code we could call a gamma module, it sure would 
get tested here.  I believe it would find its way into quite a few .hal 
files if it was available.

I have emailed Chris Woods at LMS, asking if he has any better method of 
adjusting the 3 pots on that controller card for more linear response.  
What comes with it is at best Chinglish, and bears only passing resemblance 
my Iowa farm boy turned broadcast engineer English.  Even the 3 pots aren't 
well identified in what I was able to translate.

Thanks Andy.

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
<Espy> you are baked
<knghtbrd> Espy: only half so
I was taught to respect my elders, but its getting 
harder and harder to find any...

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to