Tuesday 22 December 2015

Step response of a RLC series circuit

Today I am going to make a brief description of the step response of a RLC series circuit. This is the schematic made with LTspice

Immagine 1

As you can see the components used are a resistor, an inductor and a capacitor connected in series. By applying Kirchhoff voltage law we obtain the following equation

$$u(t) = R x(t) + L\frac{dx(t)}{dt} + \frac{1}{C} \int x(t)dt $$

where x is the current through the circuit and u is the applied voltage. This equation may look a little bit hard to solve, thankfully the Laplace transform comes to rescue. If I apply the Laplace integral transform to both sides this is what I get

$$U(s) = RX(s) + LsX(s) + \frac{X(s)}{Cs}$$

This equation is much easier to work with. We can then solve by X and obtain the transfer function for our system.

$$X(s) = \frac{s/L}{s^2 + \frac{R}{L}s + \frac{1}{LC}} U(s) = G(s) U(s)$$

As expected we obtained a transfer function for a second order system with resonance frequency at

$$\omega_0  = \frac{1}{\sqrt{LC}} rad/s$$

Frequency response

We can use Matlab for calculating these quantities and simulating a step response of the system

The resonance frequency is about 15.9 kHz. Remember that at this frequency we expect the current to have a maximum, that is, the current amplitude should be at its highest if we apply a sinusoidal voltage (u) whose frequency is the same as the resonance frequency. Be careful not to forget that we are analysing an AC circuit so all the physical quantities will be sine (or cosine) waves since this is the input signal. The bode plot confirms this behaviour

untitled

Note that the horizontal axis in Matlab is in radiant per second. We can make the same simulation with LTspice using the .ac spice directive and setting a 1 voltage signal amplitude

Immagine 4

Immagine 3

As expected, there is a peak in the absolute value of the response at the resonance frequency while on the more extreme ends of the frequency spectrum the response tends to zero. As far as the phase shift is concerned, we start from a 90 degree phase shift because the transfer function has a zero in the origin of the s plane, then there is 180 degree phase shift as the frequency increase, however near the resonance frequency we can expect a small phase shift of the response signal.

Step response

This is the response to a sine wave, however, if we suddenly turn on the voltage to a constant value (say 1 Volt) what would our system do?

Well, in order to know this we need to simulate this behaviour. The circuit needed is the following

Immagine 5

As you can see the voltage source is set to provide a 1 Volt signal for 0.5 milliseconds and then the voltage is suddenly turned off. By running the simulation we obtain the following response signal

Immagine 6

Note that the current is oscillating, this is due to the fact that in the circuit there is a capacitor and the inductor. Note also that the voltage goes on at time 0 and off at time 0.5ms, the current behaviour is mirrored. In the first half of the transitory, the current flows up to the point the capacitor is fully charged then it stops. Later, when the voltage is switched off, the capacitor discharges.

Variable parameters simulation

It may be a good idea to simulate different scenario using variable parameters. The first obvious simulation is to apply a variable resistor as follows

Immagine 8

By setting a range of possible values (from 250 to 1000 Ohms with steps of 250 Ohms) LTspice will simulate the circuit behaviour for for each resistor.

Immagine 7

It is immediate to note that only the amplitude of the current is changing in the step response: the higher the resitance, the lower the current passing through.

A simulation with a variable capacitor may be more interesting, let’s make the capacitance value range from 10 nF to 510 nF with a step of 100 nF

Immagine 9

Immagine 10

Immagine 11

As you can see, this simulation looks a bit more interesting. By increasing the value of the capacitance, we are reducing the oscillating behaviour of the circuit up to the point where there are basically no more oscillation and the voltage on the capacitor is behaving similarly as if only the capacitor and the resistor were plugged in.

I suggest to try and vary the inductance and compare the behaviour to the case above. Have fun!

The LTspice schematics are available at this address.

1 comment:

  1. Is there a way to control the parameters using Python?

    For example I need to simulate the nominal pi-model, then be able to change the RLC parameters to observe the change in voltages at the source or at the end of the transmission line(load side)

    ReplyDelete