# Convert Transfer Function to Circuit

#### xdarkbee

Joined Dec 9, 2022
11

I have the following block diagram that asks me to model it in circuit with op amp, resistors, capacitors, to check through an oscilloscope that the PID controller managed to stabilize the plant, the problem is that they give me the PID circuit but I have no idea how to make the plant in electrical circuit.
If anyone can help me I would really appreciate it.

This would be my transfer function in closed loop, giving values to the zeros in 1 and 2.

#### crutschow

Joined Mar 14, 2008
33,977
If you have been taught nothing about op amp, integrators, and differentiators, then why are you in a class that assumes you know these things?

#### xdarkbee

Joined Dec 9, 2022
11
If you have been taught nothing about op amp, integrators, and differentiators, then why are you in a class that assumes you know these things?
With the pandemic, some academics did not teach anything by the online method and that affected, although it is not entirely their fault since I know that it is our duty to be self-taught, but I believe that there is no turning back and I suppose that I must learn what I lack

#### WBahn

Joined Mar 31, 2012
29,829
With the pandemic, some academics did not teach anything by the online method and that affected, although it is not entirely their fault since I know that it is our duty to be self-taught, but I believe that there is no turning back and I suppose that I must learn what I lack
Actually, there IS going back and sometimes that is the best route to take. If you do not understand the material that you were supposed to learn in Course X, then go back and retake Course X before taking any more courses that build upon it. Otherwise you will just be digging yourself a deeper and deeper hole that will become increasingly impossible to get yourself back out of.

#### Papabravo

Joined Feb 24, 2006
20,985
View attachment 282757
I have the following block diagram that asks me to model it in circuit with op amp, resistors, capacitors, to check through an oscilloscope that the PID controller managed to stabilize the plant, the problem is that they give me the PID circuit but I have no idea how to make the plant in electrical circuit.
If anyone can help me I would really appreciate it.

View attachment 282758

This would be my transfer function in closed loop, giving values to the zeros in 1 and 2.
For starters you need to label the diagram with U(s) and Y(s), because I can't see any connection between your diagram and the written transfer function. I could assume some things but has turned out to be a bad policy in most instances.

ETA: You do know that the positive real roots must disappear, or the system will. Right?

Last edited:

#### xdarkbee

Joined Dec 9, 2022
11
For starters you need to label the diagram with U(s) and Y(s), because I can't see any connection between your diagram and the written transfer function. I could assume some things but has turned out to be a bad policy in most instances.
Sorry, I forgot to clarify that, in this case, U(s) would be my input, which is a step function, and Y(s) would be the output of the system.

#### Papabravo

Joined Feb 24, 2006
20,985
Sorry, I forgot to clarify that, in this case, U(s) would be my input, which is a step function, and Y(s) would be the output of the system.
View attachment 282760
The system has a positive real root in the denominator, and it is inherently unstable. Are you aware of that?
So the other terms come from the PID(s) box. Is that correct?

#### xdarkbee

Joined Dec 9, 2022
11
The system has a positive real root in the denominator, and it is inherently unstable. Are you aware of that?
So the other terms come from the PID(s) box. Is that correct?
It is correct, the transfer function of my PID is I gave values to the zeros and then I took out the transfer function in closed loop

#### Papabravo

Joined Feb 24, 2006
20,985
OK, but what do you want to do about the pole in the right half plane?

#### xdarkbee

Joined Dec 9, 2022
11
OK, but what do you want to do about the pole in the right half plane?
Basically my question is how do I make the plant in an equivalent circuit, in the case of the PID I investigated and in books it looks like this

I want something similar but with the plant, so that I can do it physically and check that the PID controller can stabilize the plant.

#### Paul Dingo Denton

Joined Jul 10, 2020
6
"xdarkbee, post: 1784408, member: 892990"]
I understand the need to do some catchup (our local TAFE course can't get lecturers for all units of the courses) and the "no going back" (some of our foreign students face deportation if they dont continue or complete all units of thier course).
There are some very good resources on the web if you need to do some catch up learning and plenty of "PID" circuit diagrams to learn from, just Google "PID as electronic circuit" and look at the images returned, most are very similar and you can pretty well model anything with OP amps and a bunch of resistors and capacitors.
For modelling and learning about circuits in general, try looking at articles in Wikipedia and verify your an proposed circuit with an free online simulator such as Falstad Circuit Simulator Applet (falstad.com) which is very fast to learn and has plenty of example circuits, including OP amp integral/differential. You can either use the Web based applet or download a desktop version.

Last edited by a moderator:

#### Paul Dingo Denton

Joined Jul 10, 2020
6
Sorry, I forgot to clarify that, in this case, U(s) would be my input, which is a step function, and Y(s) would be the output of the system.
View attachment 282760
This is typically how to form your annotation, Block-diagram-of-PID-controller.png (555×232) (researchgate.net) with the set point and error before the PID controller and the input signal (Us) before the plant measurement device.
Nice article about devising an electronic model of a closed loop system is at Analog Electronic PID Controllers | Closed-loop Control Systems | Automation Textbook

#### xdarkbee

Joined Dec 9, 2022
11
Esta es típicamente la forma de formar su anotación, Block-diagram-of-PID-controller.png (555×232) (researchgate.net) con el punto de ajuste y el error antes del controlador PID y la señal de entrada (Us) antes de la planta dispositivo de medición
Un buen artículo sobre cómo diseñar un modelo electrónico de un sistema de circuito cerrado se encuentra en Controladores PID electrónicos analógicos | Sistemas de control de circuito cerrado | Libro de texto de automatización
[/COTIZAR]
Muchas gracias, me será de mucha ayuda para poder entender el montaje del PID, aunque aun así sigo sin poder modelar mi planta

#### xdarkbee

Joined Dec 9, 2022
11
This is typically how to form your annotation, Block-diagram-of-PID-controller.png (555×232) (researchgate.net) with the set point and error before the PID controller and the input signal (Us) before the plant measurement device.
Nice article about devising an electronic model of a closed loop system is at Analog Electronic PID Controllers | Closed-loop Control Systems | Automation Textbook
Thank you very much, it will be very helpful for me to understand the assembly of the PID, although even so I still cannot model my plant

#### MrAl

Joined Jun 17, 2014
11,250
Thank you very much, it will be very helpful for me to understand the assembly of the PID, although even so I still cannot model my plant
Hello there,

Why dont you just take the generic route and do the implementation as simple as possible.
To do it this way first get rid of the step response step by multiplying the right side (only) by 's'.
Then, multiply both sides of your function by the denominators of both sides giving you two sides with no denominators.
Then, divide both sides by the highest power of 's', then expand. You'll get a form with several fractions with powers of 's' in the denominators.
What this does is allows you to determine the integrators needed by visual inspection.
For example, a term with K1/s is a single integration, a term with K1/s^2 represents two integrations, etc.
You can then draw the integrators in series and route the signals using summers and/or subtractors to achieve the desired output.
Since you were given part of the response already, you will have to fit that into the circuit or perhaps start with that first.

See if that helps, if not i guess we'll have to go to an example. I dont want to give too much out just yet this is the homework section.
What this method does is gets you to a generic implementation and you can then go on to try to simplify it if you need to. If you are not given any specs on what you can use to implement this though and any specs on maximum quantities you may not even have to bother with that.

What you should try to do first though is get to the generic implementation of the system and dont worry about the PID function yet, that will illustrate how this works.

#### Paul Dingo Denton

Joined Jul 10, 2020
6
Cicuit lab have some quite good demos, these might help to visulaise the plant, once you can model the plant then you can think about what the PID controller might have to do to try and keep the system as stable as possible.
Laplace transform step response and Bode plot (circuitlab.com) , you can put your own transfer function in by editing LB1 then see responses. Unfortunatley the free demo version of cuircuitlab is very limited, and anoying, but if you are going to have to do a lot of simulation in your course work it might be worth buying something like a hobby license.
Models of loop control systems can be studied, e.g. Mechanical spring dashpot Laplace model (circuitlab.com)
There is also a section on op amps, from which you can model PID. Other softwares like "Falstad" and "Tina" might be easier for modeling the PID part, they are free and you can save your work. (Texas Instrument "Tina" is 100% free and might cover most of what you want to do in your course work, "LTspice" is also worth a look)

#### MrAl

Joined Jun 17, 2014
11,250
Hello again,

To see how easy this is i'll provide a 2nd order system example.

Say we have (this is entirely made up):
Vout/Vin=(s+a)/(s^2+s+b)

The first thing is to multiply the two denominators out and get:
Vout*(s^2+s+b)=Vin*(s+a)

Next expand both sides:
Vout*s^2+Vout*s+Vout*b=Vin*s+Vin*a

Now divide by s^2:
Vout+Vout/s+Vout*b/s^2=Vin/s+Vin*a/s^2

Now subtract everything except the Vout on the left and get:
Vout=Vin/s+Vin*a/s^2-Vout/s-Vout*b/s^2

and now this almost falls right into an implementation all by itself.

The next step is to recognize terms with an 's' in the denominator as integrations: one integration for each power of 's', and to also recognize the terms on the right with 'Vin' in them are feed forward gain blocks and terms with Vout in them are feedback gain blocks.

Next you can draw two integrators in tandem so that the output of the 1st goes into the input of the 2nd integrator.
Now the terms on the right with 'Vin' have to be routed into one of the integrators depending on the power of 's' it also contains.
Each term on the right is part of the sub of the output Vout, including those with Vout in them. So we must sum to get the output on the left.
To do that, the term Vin/s would be routed to the second integrator so that if you trace the signal path it only goes through one integrator, so Vin would be added using a summing junction to sum the first integrator output and the signal Vin.
The term Vin*a/s^2 has to go though two integrators so it has to sum into the first integrator.
The term Vout/s has to have the very output of the second integrator (the total output) sum back into the second integrator so when you trace that signal path you see that Vout gets integrated once.
The term Vout*b/s^2 has to feed back to the input of the first integrator, so you have to sum that with the other signals going to that input also.
When you are done you have an actual implementation that follows the original transfer function, ideally. You do have to check that none of the signals will be too high for the components being used, such as op amps. You'll have to modify the circuit if that comes up by scaling the signals, then making up for it with some extra gain at the output (typically).
The integrators obviously become op amp integrators so you have to watch bandwidth also, and you may have to mitigate any inversions that come about.

So it's just a matter of changing the equation a little and drawing a circuit with integrators in tandem. For a second order system there will be two integrators, and for a third order system three integrators, and so on. You then use summing junctions at the input of each integrator so you can sum the forward terms and the feedback terms you need.
When you go to implement the summing junctions it helps to realize that the inverting input acts as a summing junction. With two or more resistors connected to the inverting input the currents will add. To subtract you need an inverter stage unless the signal is already inverted.