06-04-2012 02:08 PM
hello,i have a code in labview which is generating a signal like this:
and i would like to stop the execution of the code when the execution time is equal to the settling time of the signal, is there a way to do this??
i need a command which calculate this settling time of the signal that i am generating
thanks
Solved! Go to Solution.
06-04-2012 02:18 PM
Based purely on your graph, I would do some sort of derivative. If the derivative is 0 and within your range of final value (peak is within the final range), call it done.
06-04-2012 02:28 PM
but i am generating that signal when the code is running, so i don´t know the exactly signal which i will have in each case.
the code is the next,and the signal generated is the input process variable of the regulator pid,so i need stop the code when the time is equal to the settling time
06-04-2012 02:35 PM
@mariomoskis wrote:
but i am generating that signal when the code is running, so i don´t know the exactly signal which i will have in each case.
the code is the next,and the signal generated is the input process variable of the regulator pid,so i need stop the code when the time is equal to the settling time
Crossrules gave you the answer i would have suggested.
What criteria do you want to use decide if the signal has settled?
rember to be able to stop when it seetles the decision has to be based on the reading prior to the "STOP" since you do not know what is comming after.
Ben
06-04-2012 02:41 PM
so,if i understand well
i must do the derivate of the pid´s output and if it is 0, and it is in the range that i want (+-1% of the setpoint),all is done?
06-04-2012 02:48 PM
but my output are numers,so i should generate a function first and later derivate it?
06-04-2012 02:52 PM - edited 06-04-2012 02:56 PM
@mariomoskis wrote:
so,if i understand well
i must do the derivate of the pid´s output and if it is 0, and it is in the range that i want (+-1% of the setpoint),all is done?
Exactly*!
Give Crossrules a Kudos and mark his reply as the answer.
Ben
Well not EXACTLY zero since in real world meassurements zero is rare. look for a small derivative. I can't recall ever reading a real zero ever (that did not invlove an error).
06-04-2012 02:59 PM
and how can i generate a function with the points that i will have at the output? because the if i try to derivate the output, the kind of terminals coneted are different
06-04-2012 03:05 PM
Personally, I would use a shift register to hold the previous value. You can then do a comparison between the current and previous values. If the slope goes to 0 or changes sign (will need another shift register to hold slope), then you hit your peak. I'll see if I can get together something really quick to show.
06-04-2012 03:12 PM
ok,it would be better to understand what u meant 🙂