Hi, We are working on state space controllers with observers etc & also Hoo controllers to position a 300kg load. We use a difference equation formulation of the transfer functions and implement them as IIR filters complete with circular buffers (translates directly to DSP controlers). The RTL part is invoked via interrupts (5ms) from an external clock, and IIR filter weights are from an array in a shared memory block. Sample time, input & output are stored in 2 separate arrays so that std Linux (L) can unload responses etc. for use in other processes. The RTL part alternates between the buffers and overwrites the oldest one (unless blocked out). A logic flag is set to indicate to both RTL & L which buffer is being used by RTL. Similarly the IIR filter weights are stored in 2 common memory arrays with one being used by RTL while the other is updated by L which sets a flag when it finishes. RTL picks this up on the next sample time interrupt, selects the new IIR weights and sets a flag to say they are in use. Model ID is via matlab running under L and we are still experimenting with this part. I'd be interested in hearing from others doing similar things. Reg Dunlop -----Original Message----- From: Bernhard Kuhn [mailto:[EMAIL PROTECTED]] Sent: Monday, 23 August 1999 08:52 To: [EMAIL PROTECTED] Cc: Martin Schacher Subject: Re: [rtl] Restore Values Martin Schacher wrote: > > Hi > i'm programming a PID-controller in RTLinux. > Now my problem is that i have about 10 diffrent Variables that changes > with every step of controlling. I's it a good idea to store the > Variables in a Fifo before leaving the RT Task and restore them at the > begin of the RT Task ? For the first initialisation i tought i can write > the start values from the Linux app in the Fifo, so the RT Task get > these values for the first step of controlling. > > That do you think about it ? I think the "good way" would be to implement an ioctl-function within the standard-kernel side of the module. Then you could have something like this in your controlling application: struct my_variables { int x,y,z } myvar = {1,2,3}; int fd=open("/dev/mypid",O_RDRW); ioctl(fd,PUTVARS,&myvar); ioctl(fd,STARTPID,0); /* wait until user decides to end task */ ioctl(fd,STOPPID,0); ioctl(fd,GETVARS,&myvar); close(fd); comments? --- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] ---- For more information on Real-Time Linux see: http://www.rtlinux.org/~rtlinux/ --- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] ---- For more information on Real-Time Linux see: http://www.rtlinux.org/~rtlinux/