LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID control for a sinusoid

Hello,

I have written a program that takes a reference signal, and then uses a proportional control to synthesize a similar signal in a wire coil. I modulate the duty cycle of the counters of a PCI 6224 card. One counter goes to  the positive side  of an H Bridge, and the other to the negative. I'm getting decent results for reference frequencies of about a hz, but if I go below that I start seeing more interesting wave forms (the funkiness appears when the waveform crosses zero). I am questioning whether adding integral or differential controls are liable to improve matters given the time dependence of the system, and how to best apply them if appropriate.

Attached are my program and the results it gives for several frequencies. Most of the missing VIs are those that record the data to file. The other is the proportional controller from the PWM Counter Output example, taking the reference signal as its setpoint. (It also adds .5 to the duty cycle from the P output. If at the setpoint, I want the current in the coil to remain constant)

Thanks,
Elliot


Download All
0 Kudos
Message 1 of 2
(2,583 Views)
 

Hey, are you using the PID toolkit in LabVIEW?  If so, this link: https://www.ni.com/docs/en-US/bundle/372192d/resource/372192d.pdf, discusses using interregnal and derivative terms.  It is possible that your system just can't do frequencies below that.  Personally, I have found the best way to figure this stuff out is to just try.  Also, consider using the PID gain scheduling VI.  This will let you have different P, I , & D terms based on an input.  I have found that a very useful tool.

Hope this helps!

Dan

Daniel Eaton
National Instruments
Systems Engineering
Embedded and Industrial Control
0 Kudos
Message 2 of 2
(2,558 Views)