PID to 1Hz Sine wave

Thread Starter

rbpassos

Joined Mar 22, 2015
8
I am building an aplication to track a sinusoidal wave, frequencies can vary from 1 to 3 Hz.

I only know PID as the control solution and tried to implement it in Labview.

The video bellow shows the plant i am tring to control.

Is the PID a possible solution? I have been experince wave forms very diferente than sine.

Thanks a lot for your attention!!
 

crutschow

Joined Mar 14, 2008
34,417
What do you mean "track a sinusoidal wave"?
Are you trying to have that actuator follow the sine-wave?
At what point does this fail?
 

Thread Starter

rbpassos

Joined Mar 22, 2015
8
Hello Mr. crutschow. Firstly, thank you for your reply.

Yes, I want the actuator to follow a sine wave form.

My inputs are the amplitude and frequency The PID should control speed (RPM) of the motor. A transducer LVDT is feeding back linear position.

I do not think the real position is near sine form. Peaks are usually higher than the sine set point.

As I do not have experience in control, I thought the PID would not aplly to my case.
 

Thread Starter

rbpassos

Joined Mar 22, 2015
8
The real problem I am facing is that the position (green line) and the control (red line) are not sinusoidal, although the set point is (white line)


Captura de tela 2015-03-23 12.33.01.png
 

crutschow

Joined Mar 14, 2008
34,417
The control signal won't necessarily be sinusoidal since it is trying to do whatever is needed to keep the movement sinusoidal also.
Show your complete circuit.
So what have you done to tune the PID in your system?
 

GopherT

Joined Nov 23, 2012
8,009
The real problem I am facing is that the position (green line) and the control (red line) are not sinusoidal, although the set point is (white line)


View attachment 82632
This looks more like P control. You need to adjust the importance of P, I and D ("tuning"). There is a co-efficent that you need to enter for each. You can look at over-shoot, error and tracking. You track fairly well but with a time lag (error = integral). You are also overshooting your target (d/dt = derivative). Increase the coefficients (gain) of I and D.
 

Thread Starter

rbpassos

Joined Mar 22, 2015
8
Mr. crutschow.
Thank you for your help.

You are right. I should not expect sinusoidal wave form for control signal.

Following my complete loop.

To tune the PID what I have been doing is the following:
1) Eliminate de I and D gains;
2) start with small Kc gain;
3) give a STEP perturbation to the system;
4) increase the Kc till the response is oscillatory with constant amplitude.
I read this would be Ziegler-Nichols tuning, but really dont know if apply to my case, cause my system never reach the set point in oscillatory motion.
block_diagram.jpg
 

Thread Starter

rbpassos

Joined Mar 22, 2015
8
Dear GopherT,
I am starting with the Ziegler-Nichols tuning to figure out P, I and D gains. I proceed with your recommendations and what I get better is the following.

The time lag error is not a problem to me, because I have sufficient time to star acting, and so I would send the control signal in advance.

What I really want in my application is a Process Variable tha is more near the sine form than I reaching by now.
If anyone has any suggestion, please feel free.
Thanks.

Captura de tela 2015-03-23 17.15.14.png
 

t_n_k

Joined Mar 6, 2009
5,455
Zeigler-Nichols is a heuristic method of controller tuning and works effectively with certain systems. Such as first order lag plus transport delay (dead time). There's no guarantee it will produce optimum performance.
Have you considered developing a system transfer function model from experimental data? You may obtain better performance if you have the transfer function and use that as the basis of the overall control design.
 

t_n_k

Joined Mar 6, 2009
5,455
You mean input a sine wave control and measuare the output in a open loop?
Along those lines.
Initially focussing on the "plant" open loop TF. You could presumably do a amplitude-phase response vs frequency using sinusoidal stimulus to the open loop plant.
 

GopherT

Joined Nov 23, 2012
8,009
Dear GopherT,
I am starting with the Ziegler-Nichols tuning to figure out P, I and D gains. I proceed with your recommendations and what I get better is the following.

The time lag error is not a problem to me, because I have sufficient time to star acting, and so I would send the control signal in advance.

What I really want in my application is a Process Variable tha is more near the sine form than I reaching by now.
If anyone has any suggestion, please feel free.
Thanks.

View attachment 82666

Check your equipment, it looks like you may have a sensor that is not fastened tightly and it is bouncing as the actuator reaches its end - that may be why you are seeing a double peak instead of sign-looking wave.
upload_2015-3-24_9-32-6.png

Also, in your tuning of PID, it looks like P is ok for now. So, start adding gain to the D, this should cause the actuator to slow down before it gets to the end point. Keep adding gain until you stop getting the overshoot. It will also help soften the vibration at the end of the stroke if you cannot secure your sensor better (assuming it is loose).
 

Thread Starter

rbpassos

Joined Mar 22, 2015
8
Thanks for your advices.

I fixed better sensor to actuator, that wasnt the problem.

I tried to give more gain to D, but did not solve iether.

But since I REDUCED the sample frequency from 100Hz to 40Hz my wave form became significatly better.

May that be a resonable solution to control?

reducedFS.jpg
 

Thread Starter

rbpassos

Joined Mar 22, 2015
8
Now I start thinking that the improvment in sine form is due to the reduction of noise, since I reduced sample frequency.
Until now I wasnt using an analogical filter, only the digital one inside the rotine.
I am thinking of build one.
 
Top