|
|
On Fri, 18 Apr 2003, tylu wrote:
> Can ADSP do "integral" or "derivative"? by assembly language?
> I am trying to implent a PI-controller on ADSP-2189m
> Does anyone has any experiences or ideas?
> thx~
> :)
Sure you can! It's just summing and differencing. The trick
is to make sure everything scales correctly. So if you know you
will be adding 16 terms for an integral, make sure you have 4 overflow
bits to spare, or else do everything with double width and then
scale up. Also with taking differences you want to filter or
average because the noise level is much higher. If things get
close to zero you need to take the background noise level of
your system into account so you don't use the derivative signal
when it's in the noise.
Make sure you use good coding practice. Comment everything heavily
so you can remember why you did things a month before, and then when
you go back to fix them you can fix the right thing :-) Use lots
of subroutines too, once each one works you can pretty much forget
about it and concentrate on higher level (system) processing rather
than low level math.
And have fun!
Patience, persistence, truth,
Dr. mike
E-mail: info@telesys.ru