LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple control at higher frequency, and data writing at specific intervals?

Hello Labviewers!

 

I would like to write a VI that controls an electric actuator. I have an input from a load cell that I will be monitoring with my DAQ. I would like to control this value to provide force control to an external system which will be changing with time. To be clear, My output will need to continously adjust to stay at the desired setpoint of the input. The input is a voltage proportional to a force, and the output will be a voltage to an actuator. I would like to control the actuator at a reasonably high frequency, a few hundred hz and have the VI cycle between values.

 

A typical cycle would be square wave shape, and i would like to count the cycles in the VI. For example 200 cycles of +100 lb to -100lb.

 

So basically the Vi starts up, and starts cycling the actuator closed loop, controls at the desired +100lb setpoint for a preset time (2 seconds) then changes to control at -100 pounds for another 2 seconds and so on for 200 cycles and then stops.  

 

I am using Labview 2009 SP1. 

 

I have attached my crude attempt at a VI, but I was having a bit of trouble with counting the cycles and writing a generally good control VI. 

 

Any advice here? Thanks! 

 

 

0 Kudos
Message 1 of 2
(2,074 Views)

Hello Vr6Fidelity,

 

To make sure I understand your question, you would like to count the number of cycles for your actuator but the current implementation doesn't work. Is that correct?

 

Looking at your VI, you are adding one to the current iteration number if the % error is below the % error threshold. This sum is then being compared to the desired number of cycles for stopping the program. However, between iterations of your loop the values added by the "Boolean To (0, 1)" do not carry over to the next iteration. Under the current implementation: if the error threshold is met during loop cycle zero, then the index value of zero will increment by one and the completed number of cycles will display a one. However if the second loop cycle does not meet the error threshold, then the index value of one will not increment and the completed number of cycles will still be one. Is this the desired behavior?

 

Thanks for the clarification!  I'll be better able to assist you once I better understand the functionality you would like to implement.

 

0 Kudos
Message 2 of 2
(2,016 Views)