In most cases, the control system is often designed for linear
systems,namely,by using the transfer function as a block representing
the object to control. However, I have to build a control system to
simulate the control of nonlinear object without any linearization.
How can I achieve that? Can I use the Sfunction?
Thanks in advance!
On Wed, 28 Jan 2009 19:30:28 0800, workaholic wrote:
Your question is unclear.
Are you doing this work in some tool?
Why are you stopping at simulation?
If you mean "how do I design a controller for a nonlinear system", the
answer space is huge, and depends largely on the salient points of the
system (there are formal design methods for some simple nonlinear
systems, but few real world ones).
If you mean "how do I build the controller in a simulation tool", and if
you mean that an "sfunction" is a transfer function block, then yes, you
can use transfer function blocks for at least part of the work, possibly
wrapped with nonlinearities as appropriate to compensate your plant.
I am sorry,for I am so eagerly to know the answer...
What I really mean is, if I simulate a linear system's control, I only
need to build a transfer function and add the feedback to form a
classic control loop, as for the nonlinear case, can I simply replace
the transfer function block with the sfunction block which is define
by a mfile like a differential equation to describe the nonlinear
system?
say, if I have a system like below:
r ====> +/ ==================> controller==========>the object's
transfer function============>y




================================ feedback 
======================================
Can I change the transfer function into a block
r ====> +/ ==================> controller==========>the nonlinear
object's differential eqs============>y




================================ feedback 
=============================================
The differential equation may be put in a mfile ,and my equation is
how can I achieve that, can I use the sfunction block to model it?
But it seems that the sfunction is really complicated, I wish to know
if there is any other way?
Thanks for all!
On Thu, 29 Jan 2009 17:35:54 0800, workaholic wrote:
This is more properly a Matlab question, so it may be helpful to ask it
on the Matlab group.
Matlab has a rich set of nonlinear blocks; it may be far easier to build
the nonlinear system up from that.
Making sfunctions for blocks is documented in the Matlab help. It isn't
trivial, but it can be done.
I know you wanted to work in Matlab, but SimApp offers a very
convenient way to represent nonlinear systems with many nonlinearities
built in. It is also graphically oriented. Depending on your
situation, you can linearize effects like sqrt by providing an x^2
function. For hard nonlinearities like backlash, you will find that
the system easily goes into limit cycles. Sometimes you can bias the
system to operate in a more friendly region where the analysis can be
linearized. Finally, there are more advanced methods available. You
can make time responses of nonlinear systems with most nonlinearities,
but frequency responses require some form of linearization technique.
But first, try the program for free. www.simapp.com
Peter
I have no idea what a s function is. If you mean Laplace transforms
the answer is no.
I use a system of differential equations when I do serious simulation
and use RK4 to do the iterations. The differential equations can be
linear or nonlinear. The PID and feed forwards are part of the
forcing function for one of the differential equations. You mention
using a block and I assume you are talking about a graphical
simulation software package like SimApp, Scicos or Simulink. I have
no idea if these programs can do what you want to do graphically but
simulations using normal programming is easy enough. The hard part is
getting accurate parameters coefficients.
Peter Nachtwey
On Sun, 01 Feb 2009 10:58:15 0800, pnachtwey wrote:
 snip 
One of his other responses prodded me to remembering  an sfunction is
the Matlab/Simulink native way of building the innards of a block to be
simulated. There's a specific format that takes care of initialization,
running, and teardown, so you can write just about anything you want and
have it work right inside of a block.
So basically the OP was making the newbie mistake of equating control
theory with Matlab/Simulink (heaven knows if he's also making the mistake
of equating control _practice_ with control _theory_).
Let me first ask you a question: have you already launched Simulink and
spend one minute looking around? There are tons of blocks for modeling
nonolinear phenomena...

Z.H.
Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here.
All logos and trade names are the property of their respective owners.