Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the control signal in a loop 1

Status
Not open for further replies.

dmorrish

Electrical
Mar 1, 2012
6
CA
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!
 
Replies continue below

Recommended for you

Everything above looks okay except the PID. The parallel form PID you've specified isn't something that can be implemented as it's non-causal. If you set it up as a ratio of polynomials, you have (s^2+3s+1)/s, and since the numerator is second-order and the denominator is first-order, it is non-causal, which leads to singularity as you suspected. Real PIDs will often have a high cutoff-frequency low-pass filter included for causality. Try a PID of the form (Kds^2+Kps+Ki)/[s(Kfs+1)], where Kf is a higher frequency than any of the zeros in the numerator (Kf=10 gives pretty good results with the PID you have above). Change C to (s^2+3s+1)/[s(10s+1)], form Tur=C/(1+CP), and get the step response of Tur. You're results should be okay.

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 for tips on how to make the best use of Eng-Tips.
 
Thank you for the helpful response! Although I don't remember all the details surrounding causality, linearity, time invariance, phase and gain margins, root locus analysis, etc, I do remember the overarching themes of the controls classes I took.

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

Thanks again!
 
Ok, so I got a chance to play around with adding the lowpass filter. I can now plot the controller output, which is great!

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.
 
Yes, I did mean 0.1. That was a transposition error on my part. I set the LPF pole at -10, which gives a Kf = 0.1. My mistake.

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 for tips on how to make the best use of Eng-Tips.
 
It's no problem at all. Luckily I do remember enough to have a certain amount of intuition about the topic!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top