## Finding the control signal in a loop

## Finding the control signal in a loop

(OP)

Hello. I'm sorry this post is so wordy, but I wanted to make sure I explained myself as well as I could.

I am trying to clear some of the cobwebs and re-learn some of the controls material from my school days. I'm using Octave to run step tests on systems.

So far, I've been able to plot the step response of a hypothetical DC motor:

P (plant): Angle/Voltage = 1/(s(s+1))

When I plot the step response, the angle increases in a straight line (after acceleration is done) as one would expect. So far so good.

I then put this transfer function in a closed loop with a controller:

C (controller): C = 1

The resulting closed loop transfer function is:

Angle/Reference = CP/(1 + CP)

I then ran a step test on this transfer function and the system is indeed stabilised. The system overshoots, but settles to the value. It looks like a standard second order system. Once again, so far so good.

Finally, I changed the controller to a parallel form PID.

C = 3 + s + 1/s

I then ran a step test on the new closed loop transfer function, and I got a better response. The PID is working. It's not optimised at all, but it's working none the less.

Now here is where I run into trouble. I want to plot the output signal from the controller. A controller is no good if the simulation is assuming you can send infinite voltage to the DC motor!

So I solved the transfer function for controller output:

Cout/Reference = C / (1 + CP)

However, when I run the step test on this transfer function, Octave gives me an error:

error: ss: dss2ss: descriptor matrice "e" singular

My guess is that it's because the transfer function has a higher order polynomial for the numerator than the denominator, but I don't know for sure. I've reached the limits of my memory.

When I did this sort of thing in school, I had access to Simulink. That was easy because I could just throw in an oscilloscope at the controller output and look at the result.

So, my question is, what approach should I take for plotting the controller output using Octave?

Thanks for any help!

I am trying to clear some of the cobwebs and re-learn some of the controls material from my school days. I'm using Octave to run step tests on systems.

So far, I've been able to plot the step response of a hypothetical DC motor:

P (plant): Angle/Voltage = 1/(s(s+1))

When I plot the step response, the angle increases in a straight line (after acceleration is done) as one would expect. So far so good.

I then put this transfer function in a closed loop with a controller:

C (controller): C = 1

The resulting closed loop transfer function is:

Angle/Reference = CP/(1 + CP)

I then ran a step test on this transfer function and the system is indeed stabilised. The system overshoots, but settles to the value. It looks like a standard second order system. Once again, so far so good.

Finally, I changed the controller to a parallel form PID.

C = 3 + s + 1/s

I then ran a step test on the new closed loop transfer function, and I got a better response. The PID is working. It's not optimised at all, but it's working none the less.

Now here is where I run into trouble. I want to plot the output signal from the controller. A controller is no good if the simulation is assuming you can send infinite voltage to the DC motor!

So I solved the transfer function for controller output:

Cout/Reference = C / (1 + CP)

However, when I run the step test on this transfer function, Octave gives me an error:

error: ss: dss2ss: descriptor matrice "e" singular

My guess is that it's because the transfer function has a higher order polynomial for the numerator than the denominator, but I don't know for sure. I've reached the limits of my memory.

When I did this sort of thing in school, I had access to Simulink. That was easy because I could just throw in an oscilloscope at the controller output and look at the result.

So, my question is, what approach should I take for plotting the controller output using Octave?

Thanks for any help!

## RE: Finding the control signal in a loop

xnuke

"Live and act within the limit of your knowledge and keep expanding it to the limit of your life." Ayn Rand,

Atlas Shrugged.Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.

## RE: Finding the control signal in a loop

Your reply has given me enough info to move forward and continue my re-learning.

Thanks again!

## RE: Finding the control signal in a loop

When you said "Kf=10 gives pretty good results with the PID you have above", did you mean Kf=0.1? At Kf=10 the cutoff is 0.1 [rads/s] which is pretty low. My system shows an unstable response at that value, but good performance at Kf = 0.1.

Thanks again for your help! Things are moving along now.

## RE: Finding the control signal in a loop

xnuke

"Live and act within the limit of your knowledge and keep expanding it to the limit of your life." Ayn Rand,

Atlas Shrugged.Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.

## RE: Finding the control signal in a loop