LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simple pid is bogging down app

Hello:
I have an application that has:
* a queue driven state machine (main while loop)
* an event loop in a separate while loop to catch a user's menu selection, button down, etc. This will put states on the queue for the state machine.
One of my states measures voltage from RTDs. I used the SimplePID.vi to calculate the error and feed my duty cycle on my pulse generator to control the on/off power to the RTD.
Basically, in the idle state (most of the time) tempaerature must be regulated so the state that uses the PID is constantly running. The processor time gets eaten up, when the user does choose a menu selection there is a 3- 5 sec. delay before the new state becomes active.
I'm looking for suggestions on how else to implement th
e PID.
Thanks
0 Kudos
Message 1 of 3
(2,746 Views)
HTMike wrote:
> Hello:
> I have an application that has:
> * a queue driven state machine (main while loop)
> * an event loop in a separate while loop to catch a user's menu
> selection, button down, etc. This will put states on the queue for the
> state machine.
> One of my states measures voltage from RTDs. I used the SimplePID.vi
> to calculate the error and feed my duty cycle on my pulse generator to
> control the on/off power to the RTD.
> Basically, in the idle state (most of the time) tempaerature must be
> regulated so the state that uses the PID is constantly running. The
> processor time gets eaten up, when the user does choose a menu
> selection there is a 3- 5 sec. delay before the new state becomes
> active.
> I'm looking for suggestions on how else to
implement the PID.
> Thanks
Just a thought but what is limiting the speed that SimplePID is called?

Dave R.
0 Kudos
Message 2 of 3
(2,746 Views)
This looks like a pretty good programming design! My gut feeling about what is happening, is that your timer/timeout event is happening faster than what your PID state is running, therefore you are queueing up the "idle" events. When you cause a new event, all the previous events are executed first before the menu selection event (queue) is handled.
0 Kudos
Message 3 of 3
(2,746 Views)