LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed with PID control for RPM control application

Solved!
Go to solution

Hi guys,

 

I have been working on this project for a while since I started from scratch. Here is the idea: control the centrifuge from computer, use analog output to output voltage, counter input to get the frequency of the rotation. Optointerruptor is set the way that frequency measurement is exactly same as the RPM. I tried creating a test loop outputting voltage and inputting it in the DAQ to test everything and determine the PID gains. Since everything was working fine, I switched to counter input to test the model in reality. I faced following problem: task is not executed on the Counter Input Virtual channel. So I am not getting process variable in the PID loop and nothing is working the way it should. 

 

I attached a snippet of the code for counter input as well as one of the control loop that was working just fine. Maybe you can point me in the right direction. Thank you!

 

Best wishes,

Mariia

3-16-16 RPM PID control.jpg

 

 

0 Kudos
Message 1 of 5
(3,753 Views)

You really should learn to keep your block diagram clean.  It is impossible to read at the moment.  Try cleaning it up before asking someone to interpret it, especially if you only plan to provide an image of your code.

  • Overlapping wires
  • Wires behind VIs
  • Wires running right to left
  • Short wire segments
  • Lots of crossing wires
  • Very soon, it will look like this:

main-qimg-a2e1e13841b01982fcb2ddcda2f958e9.jpg

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 5
(3,713 Views)

In addition to what aputman has already said, it may be a good idea to see if you can reproduce your error with a smaller section of code. There's a lot going on and we don't know 100% what you're doing, but if you can create a small example that recreates your issue, we may be able to narrow it down from there. 

0 Kudos
Message 3 of 5
(3,699 Views)
Solution
Accepted by topic author mariia2406

Have you ever had the counter input working? Build a simple program that only reads from the counter input. Does it work? If not, do you get an error from the DAQmx VIs? If so, what error? If not, what is the output from the DAQmx Read? Can you connect your input to an oscilloscope to verify that your hardware is properly generating pulses?

0 Kudos
Message 4 of 5
(3,687 Views)

Thank you for all the comments. Went through everything step by step and VI works now. Thank you all!

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