PID controller using pic f877

Status
Not open for further replies.

zoubir

Junior Member level 1
Joined
Apr 18, 2007
Messages
17
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,370
Hi everybody,
I want a clue to calculate the pic 16f877 computation time for the processing of an input sample with the filtering diff equation:eg.
y=0.123*x+0.223*x(n-1)+0.08*x(n-2)+.....
The diff equation I manipulated is order 9 and so there is much time consuming in the pic algorithm which I fear will not work properly for real time processes.
Kind regard,
 



I have no better ideea than measuring the computational time for every constant multiplication on every sample. Limit the number of samples to a reasonable value. Use this trick for multiplication with a constant:
http://www.piclist.com/techref/piclist/codegen/constdivmul.htm
 


hi pal, i know i am just a beginner but i am very sure i have seen something like that in this link. **broken link removed** i hope you it helps. pls anyway to make grow in microcontroller programing and interfacing will be apprciate. cheers

Added after 8 minutes:

here is another for you but this is based on the avr microcontroller
**broken link removed**
have fun
 

mathematical computation time in pic based digital filters is a an important issue.
I myself confronted this problem and to answer your question I recommend that you follow the following steps.
1-In a loop under ASM or C language set port B pin 1 as output
2-set port B pin 1 to HIGH
3-compute your diff equation y=sum{ai*x(n-i)+bj*y(n-j)} or any expression
4-set port B pin 1 to LOW
5-go to step 1
After compiling and loading the hex code into your PIC platform or simulator such as Proteus (ISIS),you use the oscilloscope to display the square wave at pin 1 and measure the period.You will notice that duty cycle is important; the ON-TIME or high state of the output of port B pin1 will correspond to the math computation time.
robertdesantos@yahoo.fr
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…