04-13-2011 04:05 PM
Hi all,
I have some code that I've attached that I'm trying to set up as a discrete state-space controller. The controller is not to be put on the realtime, but rather, send a setpoint to a shared variable. The input range is from 0.7-1.5 and the output range should be -100% to 100%.
I've made a great recursive model using the Identification Toolkit and as you can see, it has its' own loop that is constantly running and updating. The problem I'm running into is the controller code.
If I run my code for a while, the output goes well beyond the +/-100% range I've specified. I was hoping someone could look over my code and tell me how best to do this type control, as I'm new to this toolkit and don't know the tricks of the trade.
Any help is appreciated!
Thanks,
Matt
04-26-2011 09:11 AM
Hey,
The first VI in the first loop was missing, and there is a feedback node in the third loop... Why do you have that in your code? I suggest using shift registers if you want to pass data back between iterations...
Regards,
A. Zaatari