05-07-2014 09:26 AM
Hello guys,
Could i use pid control in producer/consumer mode ?
Now in our lab, we use pid control the fuel pressure in producer/consumer mode.
I put the data acquisition in the producer loop and the pid control in consumer mode.
I found there will be delay between the value acquired in the producer loop and the value sent to pid.
Is that because there are delay between the producer/consumer ?
Thanks.
05-07-2014 10:41 AM
There is a lot of things that could cause delay. Is your PID loop running slower than your acquisition loop? Does the consumer loop start later than the producer loop? It could just be that the system is slow.
To me, your PID should only care about the last value, so I would use the Master/Slave, which uses Notifiers instead of Queues. This is assuming that the two loops need to run at different rates. If they are running at the same rate, I would just put them both in the same loop. That way you just use the wire instead of a queue/notifier.
05-08-2014 07:41 AM
Hi Proven
Thank you for your post.
I already sloved this problem.
Yes, you are right put the producer loop and the PID loop in one loop the problem will be solved if they run at the same rate.