09-16-2009 08:05 AM
hello
Overview: We are building a current controlled servo tube capable of sinusoidal load control to 4htz. We have a load cell providing input to a crio 9014 (9237 module) which is running in scan mode (not fgpa). The digitized load cell value is then sent to a PID VI to allow a computation of the next current (I) value to send back to the servo tube which thus, close the loop on the load control. This computed current value is sent through crio analog output module to the servo amplifier. A copy of the main program (mouseloader.vi) and other pertinent files such as project files can be found here.
http://www.engr.uconn.edu/~jmacione/temp/labview43-Copy/
Problem. The program starts to fail when the sinusoid load needs to go above 1htz. The sinusoidal input to the PID control, called "basic function generator.vi", outputs 1000 points per sinusoid. We can chart sinusoid going into the PID control (pid vi) and it appears as a clean. Yet, the waveform leaving the PID control is suffering from distortions which appear as jaggies, as if there were not enough points to represent the sinusoid. This appears to limit how fast our loading device can function (max of 1htz) as well as distorts the waveform.
here is an example of the waveform.
it shows its not any type of tuning issue.
This is just 1htz, ie, one cycle a second
Thoughts. From basic research, the fpga mode (which we are not using) has an independent timing module which can multiply out with our timer. There is a good answer by dustin w here. http://forums.ni.com/ni/board/message?board.id=170&message.id=215968&query.id=757585#M215968 But Im not sure that this applies as we are using scan mode interface which i thought would execute on our computer. Im also thinking that the internal PID control timer (dt) is complicating the timing. We have at this point turned off all of our other timing devices but are unable to establish the waveform to correct.
Desires: I would like any suggestions to allow us to create a smooth sinusoidal 4htz waveform (4 times a second) using the PID control.
thanks
Jim
09-16-2009 08:25 AM
there is a fundamental flaw in your program. You have a selector controled by "signal" that outputs a scalar "Load (N)" or the waveform output of the function generator. Only a scalar is returned from the selector. you are not actually feading the sinusoid you think you are into the PID. You need to use the sine generator pt by pt. you are also computing the incoming frequency incorrectly. you should not be dividing by iterations per second.
What is the iterations per second that you are getting using the current loop? This will be the limiting factor on how well you can control force.
09-16-2009 08:55 AM - edited 09-16-2009 08:58 AM
The sinusoid from the function genetor is being created point by point.
That is the way this VI works.
I incorrected stated the problem.
There are really two sinusiods for the PID control.
One is from sinsoid waveform we are trying to create from the function generator (goes to set point on PID)
The other is the feedback from the load cell which should resemble a sinusiod (goes to process variable on PID)
The distorted waveform we are seeing coming from the load cell and going to the PID set point, not from the from the function generator.
Thus, the delay seems to be happening at the cRIO
We are getting around 10 cycles from the CRIO per second.
09-16-2009 09:19 AM
we removed the PID VI
we made our on pid control with no timer.
We still have the same problem
any help is apprecaited.
09-16-2009 09:31 AM
10 cycles per second will not produce the desired results for your application. your output result will change every 100 msec producing the kind of results you are showing (10 pts per wave). you should be looking for 200 to 8000 iterations per second depending on the responsiveness of your power converter and load disturbance.
09-16-2009 11:30 AM - edited 09-16-2009 11:31 AM
i talked to Ben, one of the ni cRIO support people
the solution that seems to be the most effective ..
in project explorer, to change the "network refresh time" of the crio from 100ms to 10ms.
then scan time under teh same setting was already 10ms.
there were other solutions, such as running the code on teh crio vs the computer.
but the crio just lacks the power needed to run the code in a timely manner.
this did also clean up the waveforms though.
09-16-2009 11:37 AM
sometimes knowing what to ask is part of the problem which is why the boards dont work well...
i sincerely appreciate your efforts to help
thanks stu