LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop and start counter set to frequency read

Original question posted in the counter forum but no response so hope its ok to try here?
 
I am using a 6024E interface to operate a PID loop that keeps the RPM stable of a servomotor but having problems when attempting to read frequency at the same time from a flow-meter.
 
Basically the operation of the system is as follows;-
 
User sets an RPM demand, say 5000RPM, an analog signal is sent out to the motor controller and motor runs up to this value after a brief delay. The feedback from the motor is from its shaft encoder which gives 1000 PPR, after signal conditioning in hardware this signal is applied to the gate of timer 0 and after scaling applied to a PID loop. The PID loop is quite stable and responds well to operator demands.
 
However the first problem was noticed when the RPM demand was taken to zero and an attempt to halt the program was made. There was a delay in shutting down that was roughly equiv to the time out value which was set on the DAQMX read Vi.
 
Things became much worse when a further loop was added to read a flowmeters frequency output (approx 50 to 300Hz max, counter 1) that varied with the servo motors RPM demand. This additional routine has almost stopped the whole program initially starting as it appears that counter channel 1 is waiting for an input before letting the rest of the program run.
 
I have attached the part of the program that I am using now to read the frequency of the flow meter, similar routine also being used to monitor the RPM of the servo motor.
 
Basically when the operator increases the RPM demand and reaches a demand of 10RPM a compare function places an output line, which is connected to the input OPR1/PFI7 (see attached vi ) to logic 1. This then triggers the counter to start reading the RPM of the motor. A similar method is used for the flowmeter but in this instance it does not try to read the flow until the motor has reached 3000RPM as the flow being measured is very low and below 3000RPM it is only about 2cc/min = 40Hz.
 
Problem occurs though when the RPM is reduced to zero and the flow/RPM stops. If the RPM demand is increased again the motor sometimes will not respond and suffers delay. Removing the loop for the flowmeter cures this problem. Seperate loops are used for the flowmeter, motor RPM and PID loop that controls the motor RPM. 
 
The problem, as I see it, is that I need to be able to stop the counter for the flowmeter aquiring data when it falls below a certain value but be able to restart it again when the the flow increases?
 
Also is there any way I could sync the analog output signal (motor RPM demand) to the counter freq read signal (motor encoder feedback)? I found examples in the help files for this but using 'count edges' not frequency or period mode.
 
Thanks John
Labview Version 8.5
Labview Version 8.6
Labview Version 2014
0 Kudos
Message 1 of 3
(2,873 Views)
Hello,
 
First of all thanks for posting on our forum.
I may be lazy but I think your question is very long and not very clear... Next time try to be more precise and to post shorter messages, this is just an advise, but short questions often get quick answers.

now let's talk about your problem, the first thin I'll say is why don't you use NI-Motion hardware, that would be really appropriate to you application, then if you can't (which I understand) you should really use Real-time programming, when you're using a PID, real time is really advised.

My only question will be : What is the problem?  can you be a little bit clearer? what can we do for you?

I'm sorry but I'll really be glad to help you but so far I did not understand.

Regards

Richard Keromen

0 Kudos
Message 2 of 3
(2,822 Views)
Hello Richard

Thanks for reply. Yes I guess you are right it is long winded. Problem was when using the counter vi in frequency mode it appeared to be waiting for a valid input before it would release the rest of the Labview program. My solution was probably not very elegant but managed to sort it all out and got 2 PID loops running together using PCI-6601E and PC1 6024E but take on board your recommendations for real time DAQ.

Regards

John
Labview Version 8.5
Labview Version 8.6
Labview Version 2014
0 Kudos
Message 3 of 3
(2,815 Views)