# How to convert PI controller in to differential equation?

I want to convert PI controller into Differential Equation form. How should I do this? Please help me.

• Is this a homework question? What have you tried so far ? Split the block $k_p + K_i/s$ into two blocks and a summing junction. Then only a single item in the whole diagram will have anything to do with differential equations (and it is the simplest kind; all other equations are algebraic).
– AJN
Commented Feb 18, 2023 at 7:17
• @AJN This is not a homework question. I am writing a ODE equation in MATLAB but my derivation is not matched with the given. That's why I asked here. I am attaching the solution. Commented Feb 18, 2023 at 8:08
• Try splitting the block into two as mentioned above and give a name to each (unique) signal line. I think you will be able to find out where you made the mistake once you do both steps. Not marking the signal $u$ in the diagram has made it difficult to find the mistake.
– AJN
Commented Feb 18, 2023 at 8:38

Consider the block diagram

x(t) --> [k/s] --> y(t)


It means (Laplace transform details from Wikipedia) $$y_{(t)} = k\ \int{x_{(\tau)}d\tau}$$

Corresponding differential equation is $$\frac{d y(t)}{dt} = k\ x(t)$$

• Not matched with the solution that's why I asked here. Commented Feb 18, 2023 at 8:11
• What is not matching with the solution? Do you have a wrong solution and a right solution with you? If so please post both in the question and label them. Please post the steps that led you to the wrong solution so that we can identify the error.
– AJN
Commented Feb 18, 2023 at 8:45
• Then you need to edit your question. This is the correct solution mathematically; presumably you're having trouble implementing this in Matlab, so you should edit your question to say so, and to say what seems to be wrong. Commented Feb 20, 2023 at 21:41