PID - Velocity control of a mass on a spring.

spread sheet

Peter when I enter the #`s in B27 or B28 the spread sheet
goes to pot. Is this where you change the #`s? Can even
change -1 to -1.1 no beuno,No se que pasa. :confused:
 
Oooh, Nooo!!!!

I forgot, I have the imaginary numbers add in installed. You must go to TOOLS ADDINS and select the analysis ToolPak. You must have the Excel CD. The add in lets the spread sheet do complex math. I must use the

=IMEXP() instead of =EXP()
=IMREAL() to get the real part of a complex number
=IMAGINARY() to get the imaginary part of a complex number.

I didn't really need the IMABS() and IMARGUMENT() functions.
The IM???() function are not supported by normal installations of Excel. You must add the add in. I will try think of another way of describing how complex numbers work, but this sheet is pretty good.
It uses Euler's equation. This is in my high school math book.

exp(c*t)=exp(real(c)*t)*(cos(imag(c)*t)+j*sin(imag(c)*t)

Where c is the complex number and t is continous time.

for calculation purposes one must substitute n*T for t.

exp(c*n*T)=exp(real(c)*n*T)*(cos(imag(c)*n*T)+j*sin(imag(c)*n*T)

n is the period number
T is the period between updated.

The problem with the high school math book is that it just presents the formula and doesn't say why it is useful. I can see why we all forgot about this equation when there are so many more 'important' things to think about in high school.
 
PID tuning

Kp 64
Ki 1012
Kd 1.27

Integrated squared error or ISE. 50.900
Integrated Time Absolute Error ITAE 23.87855288

Peter, my results were as follows. I could tune the system "hotter" and achieve a lower ISE at the penality of a higher ITAE. My best effort in this regard yielded an ISE below 48 but the ITAE rose to 26+.
 
If fixed the Complex.zip file

The complex.zip files now uses a simpler formula that doesn't require complex numbers to show a complex response.

Michael, your tuning results got the ISE and ITAE low but I wouldn't tune the system like that. Your solution is a little too 'hot'. I would give priority to tuning the step changes with the ITAE properly. I know this means that the sine wave graph will not tune up as well but it is important that the system be stable. There are ways of getting the sine wave to tune up perfectly and still keep the system stable.

Notice the sinewave seems to allow the gains to be much higher that just making step changes. Do you think that maybe smooth ramps are better than step changes? The problem with step changes is that it excites the system with all the odd harmonics. The sine wave has only one basic frequency at 2 hz.
 
imaginary

Thanks Peter the spread sheet helps to understand.
1 radian = 180/pi()degrees 1 degree = pi()/180 radians
Norman this is where i`ll start and try to understand.
Si dios quiere. Necesito estudiar mucho a entender.
Thanks again đź“š
 

Similar Topics

Hello All, This is more of a sanity check then anything. I have a project that I need to control the velocity of a fan based on the pressure...
Replies
65
Views
20,610
So you thought you would take the weekend off! No way. The link below is saying download me! Give me a try! The link is to a spreadsheet that...
Replies
15
Views
23,561
Hello, I have a reactor with a cascaded PID control for control of the batch and jacket inlet temperature. We throw in all the required...
Replies
6
Views
1,726
Hi folks, I am upgrading a SLC to a ControlLogix platform. The goal of the project isn't simply to get the same program to run on different...
Replies
7
Views
2,843
I'm using a three term equation to control position, but the velocity profile from point A to B is failing expectation. I'm assuming the...
Replies
3
Views
1,418
Back
Top Bottom