PID controller in Discrete mode
1 view (last 30 days)
I've a simulink model where I am controlling my plant with a PI Controller in Discrete mode. I am planning to bring the model to FPGA. Currently I am simulating the model at same sampling time & it runs perfectly. But in practice, my controller speed is slower by a factor of 10000 sampling time steps. i.e. My plant will update 10000 before my controller gives an output. I tried doing this by changing the sampling time of the PID Block to 10000 & kept the sampling time of the rest of the blocks as 1 (same as before). However, my controller is not able to control the error. Can anyone give me Info regarding this? I'm new in discrete simulations with Simulink. Thank you in advance.
Tanmay Das on 18 Jun 2020
I have the understanding that you have a hardware PID controller which has a delay of 10000 * Ts (where Ts is the sampling time) i.e. u(t-10000*Ts) is fed as input to the plant. In that case you just need to add a ‘Delay’ of 10000 just after the PID controller and before the Plant.
You can refer to Delay block in order to know more.
However as per my theoretical knowledge, in case of unstable system (e.g. Water-tank, magnetic levitation etc), if control input is delayed into the plant then error signal will increase constantly, and the system will eventually become out of control. So, you may get some error in Simulink after a certain time in case you are handling unstable system. So, I will recommend you go for a stable system if you want to use the same PID controller.