LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID controller with a dynamic setpoint

Hello!

 

I've attached a VI which is generating a chirp signal to a vibrating source. The vibrations is measured with an accelerometer and the response signal can be seen in the attached picture. As could be seen the source resonance causes the amplitude to soar. My aim is to regulatae this with a PID controller and make the response more linear. The problem is that the setpoint, the chirp, is dynamic, and the PID VI in labview doesn't seem to manage this. I want to compare datapoint in the chirp with the datapoint from the response to get my error. Any clues on how to fix this? 

 

Best regards, 

 

Oscar

Download All
0 Kudos
Message 1 of 5
(3,292 Views)

If I understand you correctly:

1... You are sending out a constant amplitude, variable frequency signal (top graph).

2... The response of the gizmo is particularly sensitive around 18000 on the bottom graph.

 

Thats how you want to find the response of the gizmo.

 

Then you want to account for that response on a later run to provide a non-constant amplitude drive, and obtain a constant response?  Is that your goal?

 

If so, I'm not sure a PID is the best solution.  If the response is fixed (not changing) then you have the curve right there.  Simply look at it as a response vs. frequency plot to get some data like

V in    Freq     V out

1.0      1.0       0.102

1.0      2.0       0.105

1.0      3.0       0.112

1.0      4.0       0.124

...

1.0      125      6.32

1.0       130     6.1

...

1.0       200     0.7

(just made-up numbers)

 

That defines the response vs. frequency of your gizmo.

 

Then take the reciprocal of that to get:

V in    Freq     V out

1.0      1.0       1.0 / 0.102

1.0      2.0       1.0 / 0.105

1.0      3.0       1.0 / 0.112

1.0      4.0       1.0 / 0.124

...

1.0      125      1.0 / 6.32

1.0       130     1.0 /  6.1

...

1.0       200     1.0 / 0.7

 

Then as you sweep your input frequency, look up the frequency in that table and use the result to set your amplitude.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 5
(3,194 Views)

Been home sick the last days and haven't been able to work on my program. But your idea sounds really great, probably a much better approach. Will get back to you as soon I've started working again. Thanks a lot!

 

Best regards,

 

Oscar

0 Kudos
Message 3 of 5
(3,164 Views)

You'll have to use the INTERPOLATE function to get the driving amplitude.

 

I think you'll have to do one of these ideas:

 

A... STEP the drive.  i.e. set frequency = F0, find amplitude A0 at F0, generate sine at A0, F0, measure, set Frequency = F1, find amplitude A1 at F1, generate sine at A1, F1, etc. 

 

B.. Generate the chirp using the builtin CHIRP function from F0 to Flast.  That's a constant amplitude.

Generate the curve using the reciprocal you measured, at the same frequency points as the chirp.

(i,e. if your chirp is 512 points, your recip curve should be 512 points).

Multiply the chirp by the recip curve, to get the amplitude-modulated drive signal.

 

C...Generate your own drive signal from scratch, using a phase-coherent sine wave from the basic sinusoidal equation: V = A * sin (2*pi*f*t + theta).

 

Use the snippet I posted to you a few weeks ago, except you need to now modulate the AMPLITUDE as well:

Sweep Snippet 2.png

 

That means to multiply the output of the SIN function by the recip curve at that frequency.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 4 of 5
(3,152 Views)

Hi again and thanks for the reply!

 

I think that I'm doing what you are suggesting in the VI that I've attached. Only that I'm using the envelope from my response and original chirp to modulate the amplitude on the output signal. But as you can see in the graphs(saved the values after 6 iterations) the program isn't able to regulate the output as desired. Will hopefully be able to work on it more tomorrow, but would be gratefull for any comment on the method or the code in general!

 

Best regards,

 

Oscar

0 Kudos
Message 5 of 5
(3,137 Views)