BachPhi
Member
Below is how I set my PID LoopUpdate time, feel free to make suggestion or comments.
The PID loop is used to regulate water back pressure. Since it is a fast response loop, it use a PI controller (Kd=0).
Normally a PID is used in a periodic task or with a timer, but here I selected to use its analog module TimeStamp.
You can see that my LoopUpdateTime is set at 43ms. The reason for this is because my input module RTS is 43ms
Since this is a local module , we only concern with RTS and not RPI, so set your RPI to something bigger than RTS.
Now, how did I arrive at 43ms for RTS? well, I am using a filter of 100HZ, therefore its step response takes 42ms, and since I am using filter, for each channel it will takes a 200 µs , plus I also use output ( 100 µs).
The PID loop is used to regulate water back pressure. Since it is a fast response loop, it use a PI controller (Kd=0).
Normally a PID is used in a periodic task or with a timer, but here I selected to use its analog module TimeStamp.
You can see that my LoopUpdateTime is set at 43ms. The reason for this is because my input module RTS is 43ms
Since this is a local module , we only concern with RTS and not RPI, so set your RPI to something bigger than RTS.
Now, how did I arrive at 43ms for RTS? well, I am using a filter of 100HZ, therefore its step response takes 42ms, and since I am using filter, for each channel it will takes a 200 µs , plus I also use output ( 100 µs).