07-30-2006 12:09 PM - edited 07-30-2006 12:09 PM
Message Edited by james p martin on 07-30-2006 12:18 PM
07-30-2006 12:27 PM
07-30-2006 01:23 PM
Don't forget the debugging tools. Your problem would become immediately obvious if you would run your VI using execution highlighting. Try it! 😄
07-31-2006 04:12 AM
Thanks for the replies,
I have put the whole code into a while loop, and I have put the write function also within the loop, but as I have to compare the current pressure values with the rate (the ramp line which is being drawn according to the rate).... at every instant , I am not able to do that because as my rate line starts drawing.....the pressure input is vary slowly varying so the error increases all the time.
Could you please tell me that how to draw a ramp line without using any loop, so that I can take the ramp value at an instant and simultaneously compare with actual pressure.
Regards
08-01-2006 11:10 AM
08-03-2006 03:43 AM - edited 08-03-2006 03:43 AM
Hi Charlie,
Thanks for your reply.....but I dont want the whole array to pass actually i want to compare the actual and current ramp input to calculate error.....can I do this with indexing enable coz what I think it will pass me whole array at the end of loop.......can I pass the current values from inside to outside the loop which I am not able to do coz I just get the last value after stopping the loop.
Thanks
Message Edited by james p martin on 08-03-2006 03:45 AM
08-04-2006 11:24 AM
08-08-2006 03:47 AM
Thanks charlie..and others,
I have made few changes also in my program and what I am doing in my code is that as I have to increase the pressure at a desired rate , which is "Rate(Kgf/Sec)" specified in the code which I am calculating at every 10msec. point by increasing a counter...and comparing it with current pressure value to calculate error for PID loop...but now I have some issues....
I got some response regarding to this problem but it could not solve the problem
Regards
08-09-2006 01:01 PM
Hi James,
I'll try to answer as many of your questions as I can, though, I am not an expert in PID control...
The value "dT" I m taking in PID loop is 10mSec. because I am calculating desired pressure at 10mSec....is this correct???or what should I take ???
If your loop rate is maintained a 10ms, then I would assume that dT=10ms should work fine.
As the user can change the Rate so my desired pressure slope changes according to that and the points which I will be getting corresponding to that wud change....e.g. if I my " Rate(Kgf/Sec)" becomes 1 so in 1 sec. the desired should reach at 1 and at t= 2sec it should become 2....and if if set Rate to 0.5 Kgf/Sec so at t=1sec. it should become 0.5..and so on.....but it is not happening..the rate does not have any relationship with timing which is missing in the code...so how can I get my timing right???
In order for your loop rate to reflect what the user inputs on the front panel, you will have to modify the value you pass to the ms timer in your loop. In other words, don't wire a constant value of 10 to it; rather, whatever you calculate based on user input. (same for the elapsed time)Is there anything to do with the samping rate at which I am acquiring the pressure.
The larger while loop will run as fast as it can with everything inside of it, since it has no explicit timing of its own. If the DAQ Asst takes longer to execute than the 10 ms in your inner while loop, that will control the timing. Since it is likely that the DAQ Asst does not take this long to execute in your app, it's safe to say it's not controlling the timing of your overall application.
Also How can I reset the counter value to 0 ....even when I make reinitialise to default it starts with previous value.
The value being displayed in your counter indicator is being fed by a feedback node -- this what's actually sotring the value (it's that orange arrow on your block diagram).
I hope this helps -- at least a little!
08-10-2006 04:15 AM
Thanks Charlie,
You wrote "In order for your loop rate to reflect what the user inputs on the front panel, you will have to modify the value you pass to the ms timer in your loop. In other words, don't wire a constant value of 10 to it; rather, whatever you calculate based on user input. (same for the elapsed time"
I have tried this but as I have given the values to the elapsed time as per the calculated value (i.e. Rate) my chart is updating after that much time interval....which is not right......what I want is that I should calculate the values per 10mSec. using a counter and then updating the chart as per the Rate(kgf/Sec) (which is slope).
Anyways.....now I have changed the controller card for Valves and the response is also linear so I am just using open loop and I am able to control as per the desired rate but the problem is that the desired pressure is not changing as per rate enterd by input......now the file which I am attaching is ..I have removed all the time delays .....and there is another thing that when I give time elapsed a value of 10/100msec. it always show time elapsed TRUE all the time.
............Now I am giving it a new start....my aim is to calculate the desired pressure points which I am doing with the concept that every 10msec. I am running a counter(C) then I multiply that with Rate and divide by 100.....which gives me desired point at 10msec point and so on....so what I am doing is right or not???or you could suggest me some other method to calculate my desired pressure points as per the rate defined by user so my main focus is this to update the chart as per the specified rate ....controlling thing is now I am able to control.
Regards